arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.15058cs.LG
收藏

最优解码器是倾斜温度

The Optimal Decoder is Tilted Temperature

Purdue University(普渡大学)

Nikolaos Papagiannis, Ananth Grama, Wojciech Szpankowski

AI总结:

该研究将解码建模为带约束的pass@k最大化问题,提出倾斜温度最优解码规则,设计J-EOS在线算法与CTD离线算法,在HumanEval等代码生成基准上取得优于基线的效果。

摘要:

更大的样本预算对大语言模型(LLMs)中更高的采样温度有好处,但温度调优优化的目标及其作用原理仍鲜为人知。我们试图回答这些问题:我们将解码建模为在两个约束条件下的pass@k最大化问题,这两个约束编码了关键的解码失败模式:防止多样性崩溃的熵下限,以及防止不合理性的交叉熵上限。我们证明,该最大化问题呈现为单一闭式条件采样规则,即倾斜温度q* ∝ (p e^(ηV))^(1/T)。此处的倾斜来自验证器势V,它量化了部分生成最终通过的可能性。普通温度采样、验证器贪心解码和奖励倾斜策略均为其特例。我们进一步表明,在将多样性预算随样本量k缩放的自然规则下,所得最优温度随k增大,将经验选择转化为定理。最优解仍需要未知的验证器势,我们用两种设计方法对其进行估计。在线设置中,我们的J-EOS算法联合跟踪两个约束乘数,并仅通过二元通过/失败反馈学习验证器势。离线设置中,我们证明当模型经过校准时,其对数概率可通过仿射映射跟踪正确性。在此条件下,倾斜项坍缩为指数项,最优解简化为普通温度采样。校准温度解码(CTD)随后在离线设置中拟合一个标量,且采样时相对于温度采样无额外推理时间开销。基于这些决策规则,我们设计了一种用于代码生成的实用解码算法,并在包括HumanEval和MBPP在内的基准上与CTD一起评估,结果显示其优于标准解码和自适应解码基线。

英文摘要:

Larger sample budgets benefit from higher sampling temperatures in LLMs, but what temperature tuning optimizes and why it works remain poorly understood. We seek to answer these questions: we pose decoding as pass@$k$ maximization subject to two constraints that encode critical decoding failure modes: an entropy floor preventing diversity collapse, and a cross-entropy ceiling preventing implausibility. We prove that this maximization takes the form of a single closed-form conditional sampling rule, the \emph{tilted temperature} $q^\star \propto \bigl(p e^{ηV}\bigr)^{1/T}$. Here, the tilt comes from a verifier potential $V$ that quantifies how likely a partial generation is to eventually pass. Ordinary temperature sampling, verifier-greedy decoding, and reward-tilted policies represent special cases. We further show that, under a natural rule for scaling the diversity budget with sample size $k$, the resulting optimal temperature increases with $k$, turning empirical choice into a theorem. The optimum still needs the unknown verifier potential, which we estimate using two design approaches. In the online setting, our J-EOS algorithm jointly tracks the two constraint multipliers and learns the verifier potential from binary pass/ fail feedback alone. In the offline setting, we show that when the model is calibrated, its log-probability tracks correctness up to an affine map. Under this condition, the tilt collapses into the exponent and the optimum reduces to ordinary temperature sampling. Calibrated Temperature Decoding (CTD) then fits one scalar offline and samples with zero additional inference-time overhead relative to temperature sampling. Building on these decision rules, we design a practical decoding algorithm for code generation and evaluate it alongside CTD on benchmarks including HumanEval and MBPP, showing improvements over standard and adaptive decoding baselines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑