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

无算法的算术:语言模型用启发式方法集解决数学问题

Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics

Technion – Israel Institute of Technology(技术离子-以色列理工学院);Northeastern University(东北大学)

Yaniv Nikankin, Anja Reusch, Aaron Mueller, Yonatan Belinkov

AI总结:

该研究以算术推理为对象,通过因果分析发现大语言模型依靠稀疏启发式神经元的无序组合实现算术运算,而非鲁棒算法或记忆,且该机制在训练早期就已形成。

摘要:

大语言模型(LLM)究竟是通过学习鲁棒的可泛化算法来解决推理任务,还是靠记忆训练数据?为探究这一问题,我们以算术推理作为代表性任务展开研究。借助因果分析,我们识别出模型中的一个子集(即一条电路),它能够解释模型在基础算术逻辑上的大部分行为,并对其功能进行了检验。通过深入到电路单个神经元的层面,我们发现了一组稀疏的重要神经元,它们实现了简单的启发式规则。每条启发式规则识别一种数值输入模式并输出相应答案。我们假设这些启发式神经元的组合是模型生成正确算术答案的机制。为验证这一点,我们将每个神经元划分为若干启发式类型——例如当操作数落在特定范围内时会激活的神经元——并发现这些启发式类型的无序组合,正是能够解释模型在算术提示上大部分准确率的机制。最后,我们证明这一机制在训练早期就成为算术准确率的主要来源。总体而言,我们在多个LLM上得到的实验结果表明,LLM执行算术运算既不依赖鲁棒算法,也不依赖记忆,而是依靠“启发式方法集(bag of heuristics)”。

英文摘要:

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".

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

↑