Decoding as Optimisation on the Probability Simplex: From Top-K to Top-P (Nucleus) to Best-of-K Samplers
Xiaotong Ji, Rasul Tutunov, Matthieu Zimmer, Haitham Bou-Ammar

TL;DR
This paper presents a unified optimization framework for decoding in language models, enabling the design of new decoding algorithms like Best-of-K that improve accuracy by covering diverse good solutions within a fixed sample budget.
Contribution
It introduces a principled optimization perspective on decoding, unifying existing methods and enabling the creation of novel decoders such as Best-of-K with empirical performance gains.
Findings
Best-of-K improves accuracy by +18.6% on MATH500 at high temperatures.
Unified framework explains and generalizes existing decoding methods.
New decoders can be designed easily within this optimization perspective.
Abstract
Decoding sits between a language model and everything we do with it, yet it is still treated as a heuristic knob-tuning exercise. We argue decoding should be understood as a principled optimisation layer: at each token, we solve a regularised problem over the probability simplex that trades off model score against structural preferences and constraints. This single template recovers greedy decoding, Softmax sampling, Top-K, Top-P, and Sparsemax-style sparsity as special cases, and explains their common structure through optimality conditions. More importantly, the framework makes it easy to invent new decoders without folklore. We demonstrate this by designing Best-of-K (BoK), a KL-anchored coverage objective aimed at multi-sample pipelines (self-consistency, reranking, verifier selection). BoK targets the probability of covering good alternatives within a fixed K-sample budget and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Speech Recognition and Synthesis
