大模型算术推理靠的是启发式规则,而非算法或记忆。
Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics
- 通过分析神经电路发现关键启发式神经元。
- 少量启发式规则组合即可解释多数算术正确率。
- 早期训练即出现此机制,适合研究模型内部逻辑者。
大型语言模型(LLMs)在解决推理任务时是学习了可泛化的稳健算法,还是仅记忆训练数据?为探究此问题,我们以算术推理为例。通过因果分析,识别出解释模型基本算术行为的神经电路,并深入分析其单个神经元功能。发现少数重要神经元实现简单启发式规则:每个规则对应特定数值输入模式并输出相应答案。我们假设这些启发式神经元的无序组合构成了产生正确算术结果的机制。通过将神经元分类为若干启发式类型(如当操作数落入某范围时激活),发现这类组合能解释模型在算术提示下的大部分准确率。最终,我们在多个LLM中验证:该机制在训练初期即成为算术准确性的主要来源。结果表明,大模型进行算术推理并非依赖稳健算法或记忆,而是基于‘启发式规则包’。
原文摘要 · Abstract (English)
Do large language models (LLMs) solve reasoning tasks by learning robust generalizable algorithms, or do they memorize training data? To investigate this question, we use arithmetic reasoning as a representative task. Using causal analysis, we identify a subset of the model (a circuit) that explains most of the model's behavior for basic arithmetic logic and examine its functionality. By zooming in on the level of individual circuit neurons, we discover a sparse set of important neurons that implement simple heuristics. Each heuristic identifies a numerical input pattern and outputs corresponding answers. We hypothesize that the combination of these heuristic neurons is the mechanism used to produce correct arithmetic answers. To test this, we categorize each neuron into several heuristic types-such as neurons that activate when an operand falls within a certain range-and find that the unordered combination of these heuristic types is the mechanism that explains most of the model's accuracy on arithmetic prompts. Finally, we demonstrate that this mechanism appears as the main source of arithmetic accuracy early in training. Overall, our experimental results across several LLMs show that LLMs perform arithmetic using neither robust algorithms nor memorization; rather, they rely on a "bag of heuristics".
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。