← All papers
First page of A Model of Diverse Sampling from Language Models

A Model of Diverse Sampling from Language Models

Manuel Prada-Corral, Yahya Emara, Timothy J. O'Donnell, Ryan Cotterell, Tim Vieira

cs.LG Nov 18, 2026 · v1 cs.AI cs.CL cs.FL stat.ML
The KL finite-sample bounds (Theorems 5.1, 5.2, A.4 and Proposition A.2) are formalized in Lean 4 with Mathlib and released in the code repository.
Language models often produce high-quality individual samples but poor sets, with repeated samples clustering around the same semantic modes. We formalize diverse generation as sampling a size-$K$ subset of complete strings from a determinantal point process (DPP), where the likelihood encodes item quality, and the embedding geometry encodes repulsion between similar outputs. Exact inference over all strings is intractable, so we propose PoolDPP: draw a finite candidate pool from a tractable proposal, importance-weight the candidates toward the target quality, and run a $K$-DPP sampler on the induced pool kernel; a greedy MAP variant provides deterministic selection. We prove a finite-sample bound with an explicit constant: the KL divergence between the sampler's output and the target $K$-DPP decays as O(1/N) in the pool size. Empirically, PoolDPP extends the quality–diversity frontier on open-ended generation and the precision–recall frontier on ambiguous text-to-SQL (Ambrosia), and on mathematical reasoning (GSM8K), it raises diversity at about the same pass@$K$.

Language models produce good individual samples but poor sets, because repeated samples cluster around the same semantic modes. The goal is to sample sets of complete strings that are both high-quality and diverse.

Diverse generation is cast as sampling a size-K subset from a determinantal point process over all strings, with quality given by an annealed likelihood and repulsion given by embedding geometry. Because exact inference is intractable, PoolDPP draws a finite candidate pool from a proposal, importance-weights the candidates, and runs a K-DPP sampler (or a greedy MAP variant) on the induced pool kernel. A finite-sample bound is derived through a 'sketched distribution' framework, and the main theorems are machine-checked in Lean 4 with Mathlib.

The KL divergence between the sampler's output and the target K-DPP decays as O(1/N) in the pool size, with an explicit constant. Empirically, PoolDPP extends the quality–diversity frontier on FineWeb and the precision–recall frontier on Ambrosia text-to-SQL. On GSM8K it raises diversity at roughly the same pass@K.