arXiv:2507.03038cs.CLcs.AI2025-07ACL被引 6

模型不确定时主动多试路径,选最可靠结果,提升生成质量。

Cautious Next Token Prediction

  • 根据预测熵动态调整采样试验次数,熵高则多试
  • 在多个试验中选困惑度最低路径,确保可靠性
  • 无需训练,适配大模型与多模态模型,可替代传统采样

自回归语言模型普遍采用下一词预测范式。当前主流解码策略为温度缩放结合核采样,以平衡多样性与连贯性。然而当模型对测试问题不确定时,该方法表现欠佳。为此,我们提出一种无需训练的解码策略——谨慎下一词预测(Cautious Next Token Prediction, CNTP)。在解码过程中,若某步预测熵较高,即模型不确定性大,则从该步独立启动多次试验,直至遇到标点符号停止;随后选取困惑度最低的试验路径作为最可能、最可靠的生成路径。试验次数与预测置信度负相关:越不自信,越应多试。这一机制模拟人类在不确定时更谨慎探索的心理行为。大量实验表明,CNTP在各类大语言模型与多模态大模型上均显著优于现有标准解码策略。此外,将CNTP与自洽性结合,可进一步超越原始自洽性方法。我们相信,CNTP有望成为未来大模型解码的标准选项之一。代码已公开于 https://github.com/wyzjack/CNTP。

原文摘要 · Abstract (English)

Next token prediction paradigm has been prevailing for autoregressive models in the era of LLMs. The current default sampling choice for popular LLMs is temperature scaling together with nucleus sampling to balance diversity and coherence. Nevertheless, such approach leads to inferior performance in various NLP tasks when the model is not certain about testing questions. To this end, we propose a brand new training-free decoding strategy, dubbed as Cautious Next Token Prediction (CNTP). In the decoding process, if the model has comparatively high prediction entropy at a certain step, we sample multiple trials starting from the step independently and stop when encountering any punctuation. Then we select the trial with the lowest perplexity score viewed as the most probable and reliable trial path given the model's capacity. The trial number is negatively correlated with the prediction confidence, i.e., the less confident the model is, the more trials it should sample. This is consistent with human beings' behaviour: when feeling uncertain or unconfident, one tends to think more creatively, exploring multiple thinking paths, to cautiously select the path one feels most confident about. Extensive experiments on both LLMs and MLLMs show that our proposed CNTP approach outperforms existing standard decoding strategies consistently by a clear margin. Moreover, the integration of CNTP with self consistency can further improve over vanilla self consistency. We believe our proposed CNTP has the potential to become one of the default choices for LLM decoding. Code is available at https://github.com/wyzjack/CNTP.

解码策略大模型自洽性生成质量

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。