解构大语言模型中的数学推理:对内部机制的调查
Disentangling Mathematical Reasoning in LLMs: A Methodological Investigation of Internal Mechanisms
AI总结:
研究通过分析LLM执行算术任务时的内部机制,揭示模型在早期层识别算术任务,但正确结果生成仅在最终层完成,并发现擅长算术的模型在注意力与MLP模块间有明确分工。
摘要:
大型语言模型(LLMs)已展示了出色的能力,但其处理推理密集型任务的内部机制仍处于探索阶段。为了推进对模型内部处理机制的理解,我们通过分析任务执行期间的内部机制,探讨了LLMs如何执行算术运算。通过早期解码,我们追踪了跨层的下一个令牌预测是如何构建的。我们的实验发现,尽管模型在早期层识别算术任务,但正确结果的生成仅在最终层完成。值得注意的是,擅长算术的模型在注意力与MLP模块之间表现出明确的分工,其中注意力传播输入信息,而MLP模块聚合信息。这种分工在不那么熟练的模型中不存在。此外,成功的模型似乎在处理更具挑战性的算术任务时表现出功能性处理,这表明推理能力超越了事实记忆。
英文摘要:
Large language models (LLMs) have demonstrated impressive capabilities, yet their internal mechanisms for handling reasoning-intensive tasks remain underexplored. To advance the understanding of model-internal processing mechanisms, we present an investigation of how LLMs perform arithmetic operations by examining internal mechanisms during task execution. Using early decoding, we trace how next-token predictions are constructed across layers. Our experiments reveal that while the models recognize arithmetic tasks early, correct result generation occurs only in the final layers. Notably, models proficient in arithmetic exhibit a clear division of labor between attention and MLP modules, where attention propagates input information and MLP modules aggregate it. This division is absent in less proficient models. Furthermore, successful models appear to process more challenging arithmetic tasks functionally, suggesting reasoning capabilities beyond factual recall.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。