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

谨慎下一 token 预测

Cautious Next Token Prediction

Northeastern University(东北大学);Adobe(Adobe公司);Case Western Reserve University(凯斯西储大学)

Yizhou Wang, Lingzhi Zhang, Yue Bai, Mang Tik Chiu, Zhengmian Hu, Mingyuan Zhang, Qihua Dong, Yu Yin, Sohrab Amirghodsi, Yun Fu

AI总结:

针对 LLM 在不确定问题上标准采样性能不佳的问题,本文提出免训练的 CNTP 解码策略,通过高熵时多路径尝试并选择最低困惑度路径,持续提升 LLM 与 MLLM 表现。

摘要:

在大语言模型时代,下一 token 预测范式一直是自回归模型的主流。当前流行 LLM 的默认采样选择是温度缩放结合核采样,以平衡多样性和连贯性。然而,当模型对测试问题不确定时,这种方法会在多种 NLP 任务中导致较差性能。为此,我们提出一种全新的免训练解码策略,称为谨慎下一 token 预测(Cautious Next Token Prediction,CNTP)。在解码过程中,如果模型在某一步具有相对较高的预测熵,我们就从该步开始独立采样多条尝试,并在遇到任意标点符号时停止。随后,我们选择困惑度分数最低的尝试,将其视为在模型能力下最可能、最可靠的尝试路径。尝试次数与预测置信度负相关,即模型越不自信,就应采样越多尝试。这与人类行为一致:当感到不确定或不自信时,人往往会更具创造性地思考,探索多条思维路径,以谨慎选择自己最有信心的路径。在 LLM 和 MLLM 上的大量实验表明,我们提出的 CNTP 方法持续且明显优于现有标准解码策略。此外,将 CNTP 与自洽性结合还能进一步优于普通自洽性。我们相信,所提出的 CNTP 有潜力成为 LLM 解码的默认选择之一。代码可在 https://github.com/wyzjack/CNTP 获取。

英文摘要:

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.

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

↑