Foundations of Top-k Decoding For Language Models
Not on the map. Why?
Abstract (arXiv)
Top-k decoding is a widely used method for sampling from LLMs: at each token, only the largest k next-token-probabilities are kept, and the next token is sampled after re-normalizing them to sum to unity. Top-k and other sampling methods are motivated by the intuition that true next-token distributions are sparse, and the noisy LLM probabilities need to be truncated. However, to our knowledge, a precise theoretical motivation for the use of top-k decoding is missing. In this work, we develop a theoretical framework that both explains and generalizes top-k decoding. We view decoding at a fixed token as the recovery of a sparse probability distribution. We consider Bregman decoders obtained by minimizing a separable Bregman divergence (for both the primal and dual cases) with a sparsity-inducing ℓ0 regularization. Despite the combinatorial nature of the objective, we show how to optimize it efficiently for a large class of divergences. We show that the optimal decoding strategies are greedy, and further that the loss function is discretely convex in k, so that binary search provably and efficiently finds the optimal k. We show that top-k decoding arises as a special case for the KL divergence, and identify new decoding strategies that have distinct behaviors (e.g., non-linearly up-weighting larger probabilities after re-normalization).
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 28 of its 65 references that are in the map. First posted on arXiv 25 May 2025.
Builds on
28 of 65 references.
References · 28
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2018Hierarchical Neural Story Generationcited by 1,193
- 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 341
- 2019Adaptively Sparse Transformerscited by 155
- 2024Turning Up the Heat: Min-p Sampling for Creative and Coherent LLM Outputscited by 150
- 2024From Decoding to Meta-Generation: Inference-time Algorithms for Large Language Modelscited by 137
- 2022Truncation Sampling as Language Model Desmoothingcited by 123
- 2019Learning with Fenchel-Young Lossescited by 119
- 2022Locally Typical Samplingcited by 111
- 2015Best Subset Selection via a Modern Optimization Lenscited by 100
16 more
- 2017Noisy Natural Gradient as Variational Inferencecited by 94
- 2018An elementary introduction to information geometrycited by 76
- 2013Projection onto the probability simplex: An efficient algorithm with a simple proof, and an applicationcited by 67
- 2019Explicit Sparse Transformer: Concentrated Attention Through Explicit Selectioncited by 62
- 2023Closing the Curious Case of Neural Text Degenerationcited by 32
- 2020Learning Sparse Classifiers: Continuous and Mixed Integer Optimization Perspectivescited by 26
- 2023Fast, Differentiable and Sparse Top-k: a Convex Analysis Perspectivecited by 26
- 2022Uncertainty Estimates of Predictions via a General Bias-Variance Decompositioncited by 20
- 2022L0Learn: A Scalable Package for Sparse Learning using L0 Regularizationcited by 12
- 2024Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategiescited by 7
- 2021Analysis of Generalized Bregman Surrogate Algorithms for Nonsmooth Nonconvex Statistical Learningcited by 5
- 2018Re-examination of Bregman functions and new properties of their divergencescited by 3
- 2023Best-Subset Selection in Generalized Linear Models: A Fast and Consistent Algorithm via Splicing Techniquecited by 3
- 2024Exact continuous relaxations of l0-regularized criteria with non-quadratic data termscited by 2
- 2019Learning Sparse Distributions using Iterative Hard Thresholdingcited by 1
- 2024Efficient sparse probability measures recovery via Bregman gradientcited by 1
Built on by
Citing papers per year: 2025: 4; 2026: 6.
10 papers.
- 2025Statistical Methods in Generative AIcited by 4
- 2026A Practical Investigation of Training-free Relaxed Speculative Decodingcited by 3
- 2026Decoding as Optimisation on the Probability Simplex: From Top-K to Top-P (Nucleus) to Best-of-K Samplerscited by 2
- 2025Conformal Sparsification for Bandwidth-Efficient Edge-Cloud Speculative Decodingcited by 1
- 2025Relative-Based Scaling Law for Neural Language Modelscited by 1
- 2025Towards Reproducibility in Predictive Process Mining: SPICE -- A Deep Learning Librarycited by 0
- 2026On Temperature-Constrained Non-Deterministic Machine Translation: Potential and Evaluationcited by 0
- 2026Entropy-Guided k-Guard Sampling for Long-Horizon Autoregressive Video Generationcited by 0
- 2026Entropy-informed Decoding: Adaptive Information-Driven Branchingcited by 0
- 2026Composable Decoding on the Probability Simplex: Theory and Implementationcited by 0
- 2026Composable Decoding on the Probability Simplex: Theory and Implementation28 Sep 2026
- 2026A Practical Investigation of Training-free Relaxed Speculative Decoding9 Jul 2026
- 2026Entropy-informed Decoding: Adaptive Information-Driven Branching10 May 2026
- 2026Decoding as Optimisation on the Probability Simplex: From Top-K to Top-P (Nucleus) to Best-of-K Samplers20 Feb 2026
- 2026Entropy-Guided k-Guard Sampling for Long-Horizon Autoregressive Video Generation27 Jan 2026
- 2026On Temperature-Constrained Non-Deterministic Machine Translation: Potential and Evaluation20 Jan 2026
- 2025Towards Reproducibility in Predictive Process Mining: SPICE -- A Deep Learning Library18 Dec 2025
- 2025Relative-Based Scaling Law for Neural Language Models23 Oct 2025
- 2025Conformal Sparsification for Bandwidth-Efficient Edge-Cloud Speculative Decoding11 Oct 2025
- 2025Statistical Methods in Generative AI8 Sep 2025