A Model of Diverse Sampling from Language Models
Organizations: ETH Zürich · MPI-IS · ELLIS Institute Tübingen · Cornell University ·
Abstract
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- 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 -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 -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@.
Figures & tables
Appendix figures & tables25 assets
Supplementary material from the paper’s appendix.
Appendix
| Ambrosia , | GSM8K , | FineWeb , | ||||
| 1.50 | 0.367 | 3.47 | 941 | 95.8 | 0.0650 | |
| 2.50 | 1.37 | 4.47 | 942 | 96.8 | 1.06 | |
| leading term (exact) | 0.0661 | 0.0162 | 1.42 | 384 | 19.5 | 0.0132 |
| lower bound Eq. 34 | 0.0675 | 0.0165 | 3.47 | 941 | 23.9 | 0.0162 |
| : (MC) | 0.0672 | 0.0167 | 9.67 | (1500) | (295) | 0.0165 |
| for the lower bound | sufficient | |
| Ambrosia , | 129 | 142 |
| Ambrosia , | 31 | 43 |
| GSM8K , | 3300 | 3492 |
| GSM8K , | 895145 | 941451 |
| FineWeb , | 91087 | 95816 |
| FineWeb , | 62 | 149 |
| bound 45 in nats (GSM8K, ) | ||||
| 4.23 | 0.725 | 0.355 | 0.140 | |
| 53.9 | 37.4 | 30.5 | 21.5 |
| run pool size | larger pool | ||||
| ESS | ESS med. [IQR] | ESS med. [IQR] | |||
| GSM8K , , , , local sampling temperature , PoolDPP-Sampling | |||||
| 0.018 | 1.4 [1.0, 2.3] | 50 | 5.8 [2.9, 9.5] | 38 | |
| 0.078 | 6.7 [3.4, 9.8] | 38 | 99.4 [63.6, 203] | 0 | |
| 0.304 | 30.0 [21.5, 39.1] | 2 | 673 [494, 906] | 1 | |
| 0.113 | 1.4 [1.0, 11.9] | 36 | 1.0 [1.0, 1.0] | 50 | |
| Held-out | ||||||||
| Method | Setting | Quality | Kernel | log-det | cos. dist. | D-1 | D-2 | Jaccard |
| Ancestral | local | |||||||
| Ancestral | local | |||||||
| -means | local | |||||||
| -means | local | |||||||
| -means | local | |||||||
| Dual | Primal eig. | Primal MAP | Primal eig. / dual | ||
| Method | Per-chain acc. | Pass@ |
| Ancestral | 0.682 | 0.925 |
| -means | 0.560 | 0.905 |
| PoolDPP-Sampling ( ) | 0.565 | 0.915 |
| PoolDPP-MAP ( ) | 0.502 | 0.915 |
| Embedder | GSM8K answer flip | GSM8K operator flip | SQL semantic edit |
| MiniLM-L6 (Ambrosia kernel) | |||
| Qwen3-Emb.-0.6B (GSM8K kernel) | |||
| Qwen3-Emb.-0.6B, instructed |
| Method | pass@10 | per-chain acc. | Answers | log-det | pass@10 | |
| Ancestral | ||||||
| Plain kernel (Qwen3-Embedding-0.6B) | ||||||
| PoolDPP-Sampling , | 0.12 | |||||
| PoolDPP-Sampling , | 0.03 | |||||
| PoolDPP-MAP , | 0.028 | |||||
| PoolDPP-MAP , | ||||||
| Method | Different answer | Same answer, different derivation | Surface only | Pairs | Agreement |
| Ancestral | |||||
| -means | |||||
| PoolDPP-Sampling , | |||||
| PoolDPP-MAP , |
| Method | Quality | Sem. div. | Tok. div. Distinct-2 |
| DivBS ( ) | |||
| DetBS ( ) | |||
| Ancestral ( ) | |||
| PoolDPP-Sampling ( ) | |||
| PoolDPP-MAP ( ) |
| Method | Setting | ||||
| GSM8K | |||||
| pass@10 | per-chain acc. | answers/set | log-det | ||
| Ancestral | 0.925 | 0.682 | 1.54 | ||
| -means | 0.905 | 0.560 | 1.52 | ||
| MMR | 0.912 | 0.506 | 1.68 | ||
| MBR | – | 0.913 | 0.773 | 1.26 | |
| set metric | item metric | |||||
| Comparison | 95% CI | |||||
| GSM8K, plain Qwen3-Embedding-0.6B kernel | ||||||
| PoolDPP-Sampling vs. ancestral | 0.12 | |||||
| PoolDPP-Sampling vs. ancestral | 0.03 | 0.0025 | ||||
| PoolDPP-MAP vs. ancestral | 0.028 | |||||
| PoolDPP-MAP vs. -means | 0.22 | |||||
| Local temperature | None | All | |||
| Task, local temp. | Label | Quality by length quintile (Q1 Q5) | Chars Q1 / Q5 | AUC | ||
| GSM8K, | correct | / | ||||
| Ambrosia, | executes | / | ||||
| golden | ||||||
| Ambrosia, | executes | / | ||||
| golden |
| symbol | meaning | defined |
|---|---|---|
| Strings and language models | ||
| , , eos | alphabet, strings over it, end-of-string marker | § 2 |
| , , | string, its prefix before position , its length | § 2 |
| , | language model, prefix probability | § 2 |
| , | prompt, language model conditioned on it | § 2 |
| locally annealed language model at temperature | Eq. 2 | |
| term | meaning | defined |
|---|---|---|
| ancestral sampling | sampling one token at a time from the conditionals | § 2 |
| local, global annealing | tempering each conditional, or the whole string | 1 and 3 |
| local sampling temperature | , the temperature at which a pool is drawn | Eq. 1 |
| global temperature | in | § 3 |
| embedding, embedder | unit-norm vector of a string, the model that computes it | § 3 |
| quality-scaled embedding | , a column of | Eq. 4 |