将解码统一为概率单纯形上的优化问题,可系统设计新采样器。
Decoding as Optimisation on the Probability Simplex: From Top-K to Top-P (Nucleus) to Best-of-K Samplers
- 把解码看作在概率单纯形上优化,平衡模型得分与结构偏好。
- 提出Best-of-K采样,在高温度下使数学题准确率提升18.6%。
- 适合想定制采样策略或做自洽推理的研究者使用。
解码处于语言模型与下游应用之间,却仍被视为调参的启发式过程。我们主张解码应被理解为一种有原则的优化层:在每个词元处,我们在概率单纯形上求解一个正则化问题,权衡模型得分与结构偏好和约束。这一统一框架可还原贪婪解码、软最大采样、Top-K、Top-P(核)及Sparsemax风格稀疏性作为特例,并通过最优性条件解释其共性结构。更重要的是,该框架使无需依赖经验法则即可设计新解码器成为可能。我们通过设计Best-of-K(BoK)采样器加以验证,该采样器采用基于KL散度的覆盖率目标,专为多样本流水线(如自洽性、重排序、验证器选择)而设。BoK旨在固定样本数K内覆盖优质候选解,显著提升实际性能。例如,在高采样温度下,Qwen2.5-Math-7B在MATH500数据集上准确率提升18.6%。
原文摘要 · Abstract (English)
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 improves empirical performance. We show that such samples can improve accuracy by, for example, +18.6% for Qwen2.5-Math-7B on MATH500 at high sampling temperatures.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。