mlsanityData to 14 Oct 2026

Foundations of Top-k Decoding For Language Models

arXiv 2505.19371 ↗First posted 25 May 2025cs.AI cs.LG math.STcited by 10

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

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  3. 2019The Curious Case of Neural Text Degenerationcited by 2,916
  4. 2018Hierarchical Neural Story Generationcited by 1,193
  5. 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 341
  6. 2019Adaptively Sparse Transformerscited by 155
  7. 2024Turning Up the Heat: Min-p Sampling for Creative and Coherent LLM Outputscited by 150
  8. 2024From Decoding to Meta-Generation: Inference-time Algorithms for Large Language Modelscited by 137
  9. 2022Truncation Sampling as Language Model Desmoothingcited by 123
  10. 2019Learning with Fenchel-Young Lossescited by 119
  11. 2022Locally Typical Samplingcited by 111
  12. 2015Best Subset Selection via a Modern Optimization Lenscited by 100
16 more
  1. 2017Noisy Natural Gradient as Variational Inferencecited by 94
  2. 2018An elementary introduction to information geometrycited by 76
  3. 2013Projection onto the probability simplex: An efficient algorithm with a simple proof, and an applicationcited by 67
  4. 2019Explicit Sparse Transformer: Concentrated Attention Through Explicit Selectioncited by 62
  5. 2023Closing the Curious Case of Neural Text Degenerationcited by 32
  6. 2020Learning Sparse Classifiers: Continuous and Mixed Integer Optimization Perspectivescited by 26
  7. 2023Fast, Differentiable and Sparse Top-k: a Convex Analysis Perspectivecited by 26
  8. 2022Uncertainty Estimates of Predictions via a General Bias-Variance Decompositioncited by 20
  9. 2022L0Learn: A Scalable Package for Sparse Learning using L0 Regularizationcited by 12
  10. 2024Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategiescited by 7
  11. 2021Analysis of Generalized Bregman Surrogate Algorithms for Nonsmooth Nonconvex Statistical Learningcited by 5
  12. 2018Re-examination of Bregman functions and new properties of their divergencescited by 3
  13. 2023Best-Subset Selection in Generalized Linear Models: A Fast and Consistent Algorithm via Splicing Techniquecited by 3
  14. 2024Exact continuous relaxations of l0-regularized criteria with non-quadratic data termscited by 2
  15. 2019Learning Sparse Distributions using Iterative Hard Thresholdingcited by 1
  16. 2024Efficient sparse probability measures recovery via Bregman gradientcited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 4; 2026: 6.

10 papers.