Research Papers 论文研究 9h ago Updated 5h ago 更新于 5小时前 50

Are Arithmetic Heuristic Neurons Form-Invariant? A Mechanistic Analysis of Symbols, Text, and Code in LLMs 算术启发式神经元是否具有形式不变性?对LLM中符号、文本和代码的机制分析

Arithmetic heuristic neurons in Llama-3 models are form-invariant, meaning the same sparse set of MLP neurons handles arithmetic across symbolic math, natural language, and Python code. A two-stage pipeline using attribution and activation patching identified a compact, shared circuit that is both necessary and sufficient for late-layer arithmetic computation. Transferring activations from successful executions to failed ones recovered over 97% of incorrect predictions for addition and subtracti 研究揭示了大语言模型中算术计算依赖于“启发式神经元”这一稀疏集合,且该机制在符号、文本和代码三种不同输入格式下具有形式不变性。 通过归因补丁和激活补丁技术,识别出跨格式共享的紧凑神经元集,证明这些共享电路对于晚期层的算术计算既是必要的也是充分的。 跨格式失败主要源于激活状态而非独立电路,将成功执行的激活转移到失败执行中可恢复超过97%的加减法错误预测。 共享神经元在不同格式中始终属于相同的启发式家族,表明LLM内部的算术逻辑表示具有高度的结构稳定性。

65
Hot 热度
78
Quality 质量
72
Impact 影响力

Analysis 深度分析

TL;DR

  • Arithmetic heuristic neurons in Llama-3 models are form-invariant, meaning the same sparse set of MLP neurons handles arithmetic across symbolic math, natural language, and Python code.
  • A two-stage pipeline using attribution and activation patching identified a compact, shared circuit that is both necessary and sufficient for late-layer arithmetic computation.
  • Transferring activations from successful executions to failed ones recovered over 97% of incorrect predictions for addition and subtraction, proving failures stem from activation states rather than missing circuits.
  • Shared neurons consistently belong to the same heuristic families across different input formats, suggesting a unified internal representation for arithmetic strategies.

Why It Matters

This research provides critical evidence for the modularity and robustness of arithmetic reasoning in Large Language Models, challenging the notion that different problem formulations trigger entirely distinct internal mechanisms. For AI practitioners, it suggests that improving model performance on specific formats may not require retraining entire circuits but rather optimizing activation patterns within existing, shared neural pathways. This insight significantly advances mechanistic interpretability by offering a concrete method to debug and enhance arithmetic capabilities through targeted intervention.

Technical Details

  • Models Analyzed: The study investigates three variations of the Llama-3 model family to ensure generalizability across different scales or configurations.
  • Methodology: A two-stage identification pipeline combines attribution patching and activation patching to isolate specific arithmetic heuristic neurons within the Multi-Layer Perceptron (MLP) layers.
  • Formats Tested: The analysis covers three distinct input modalities: symbolic arithmetic expressions, natural language word problems, and Python code snippets performing calculations.
  • Intervention Results: Activation transfer experiments demonstrated that injecting correct activation states from one format into another could recover accuracy exceeding 97% for basic addition and subtraction tasks.
  • Neural Consistency: The study confirms that the identified heuristic neurons map to consistent functional families (e.g., carry propagation, digit alignment) regardless of the input syntax.

Industry Insight

  • Debugging Strategy: Developers should focus on activation state optimization and prompt engineering to guide neurons toward correct heuristic families, rather than assuming the model lacks the fundamental capability to solve a problem type.
  • Model Efficiency: Since a compact, shared circuit handles diverse formats, future model architectures could be optimized for sparsity and modularity in arithmetic layers, potentially reducing computational overhead without sacrificing multi-modal reasoning ability.
  • Interpretability as a Tool: Mechanistic interpretability techniques like activation patching can be directly applied to improve model reliability, offering a path to "fix" specific failure modes in deployed LLMs without full fine-tuning.

TL;DR

  • 研究揭示了大语言模型中算术计算依赖于“启发式神经元”这一稀疏集合,且该机制在符号、文本和代码三种不同输入格式下具有形式不变性。
  • 通过归因补丁和激活补丁技术,识别出跨格式共享的紧凑神经元集,证明这些共享电路对于晚期层的算术计算既是必要的也是充分的。
  • 跨格式失败主要源于激活状态而非独立电路,将成功执行的激活转移到失败执行中可恢复超过97%的加减法错误预测。
  • 共享神经元在不同格式中始终属于相同的启发式家族,表明LLM内部的算术逻辑表示具有高度的结构稳定性。

为什么值得看

这项研究为理解大语言模型的内部工作机制提供了关键的 mechanistic interpretability 证据,证明了模型并非针对每种输入格式构建独立的计算路径,而是复用同一套底层算术逻辑。这对于优化模型鲁棒性、调试特定任务失败以及设计更高效的指令微调策略具有重要的理论指导意义。

技术解析

  • 研究对象与方法:在三个 Llama-3 模型上,针对符号算术、自然语言应用题和 Python 代码三种格式,使用结合归因补丁(attribution patching)和激活补丁(activation patching)的两阶段流水线来识别算术启发式神经元。
  • 核心发现:发现了一个跨所有三种格式共享的紧凑神经元集合。定向干预实验证实,该共享电路对于晚期层的算术计算是必要且充分的。
  • 激活转移实验:将一种格式中成功执行的共享神经元激活转移到另一种格式中失败的执行过程,能够恢复大部分错误预测,其中加法和减法的恢复率超过97%。
  • 形式不变性验证:数据显示跨格式的计算失败主要源于神经元的激活状态差异,而非存在不同的内部电路;此外,共享神经元在不同格式间保持一致的启发式家族归属。

行业启示

  • 模型调试方向:当模型在特定格式(如代码)上表现不佳时,应优先检查其通用算术神经元的激活状态,而非假设需要重新训练特定的格式处理模块。
  • 数据增强策略:利用跨格式的形式不变性,可以通过混合不同格式的训练数据(如同时包含文本问题和代码片段)来强化共享启发式神经元的稳定性,提升模型泛化能力。
  • 可解释性应用:开发者可以利用这种“形式不变性”特性,通过监控少数关键神经元的激活情况来实时评估模型在复杂推理任务中的置信度和潜在失败风险。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Research 科学研究 Mechanistic Interpretability Mechanistic Interpretability