发现思维链令牌像程序变量,仅保留中间结果即可保持性能
Chain-of-Thought Tokens are Computer Program Variables
- 只保留思维链中存储中间结果的令牌,性能相近
- 用替代隐状态存储中间结果,模型表现不受影响
- 随机干扰中间值会引发后续推理和答案变化,适合推理研究者
思维链(CoT)要求大语言模型在得出最终答案前生成中间步骤,已被证明能有效提升复杂推理任务的表现。然而,其内在机制仍不清晰。本文通过实证研究了两种组合性任务:多位数乘法与动态规划。尽管思维链对解决问题至关重要,我们发现仅保留存储中间结果的令牌即可达到相近性能。此外,将中间结果以替代隐状态形式存储也不会影响模型表现。随机干预思维链中的某些数值后,后续令牌及最终答案随之改变。这些发现表明,思维链令牌可能发挥类似计算机程序中变量的作用,但存在意外捷径和令牌间计算复杂度限制等潜在缺陷。代码与数据已公开于 https://github.com/solitaryzero/CoTs_are_Variables。
原文摘要 · Abstract (English)
Chain-of-thoughts (CoT) requires large language models (LLMs) to generate intermediate steps before reaching the final answer, and has been proven effective to help LLMs solve complex reasoning tasks. However, the inner mechanism of CoT still remains largely unclear. In this paper, we empirically study the role of CoT tokens in LLMs on two compositional tasks: multi-digit multiplication and dynamic programming. While CoT is essential for solving these problems, we find that preserving only tokens that store intermediate results would achieve comparable performance. Furthermore, we observe that storing intermediate results in an alternative latent form will not affect model performance. We also randomly intervene some values in CoT, and notice that subsequent CoT tokens and the final answer would change correspondingly. These findings suggest that CoT tokens may function like variables in computer programs but with potential drawbacks like unintended shortcuts and computational complexity limits between tokens. The code and data are available at https://github.com/solitaryzero/CoTs_are_Variables.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。