arXiv:2608.18419cs.LGcs.AI2026-08

揭示LLaMA 3.1如何通过内部机制理解数列结构。

Mechanistic Interpretability of Structure-Aware Numerical Reasoning in LLaMA 3.1 8B

论文配图:Mechanistic Interpretability of Structure-Aware Numerical Reasoning in LLaMA 3.1 8B
图 1 · 摘自论文原文
  • 通过反事实激活替换分析,发现模型自动计算并存储一阶差分。
  • 在数列预测任务中准确率超90%,表明其能捕捉结构规律。
  • 首次发现类似归纳电路的机制,适合关注模型可解释性的研究者。

近期研究表明大语言模型具备强大的数值序列建模能力,对时间序列预测有潜力。尽管模型具有上下文学习能力,但其完成时间序列预测的内在机制仍不明确,特别是是否真正理解底层结构——至少需对数列的一阶差分进行推理。为此,本文从机械可解释性角度研究Llama 3.1-8B。我们设计了一项必须依赖结构线索才能解决的序列建模任务:随机采样n个数并带偏移重复。结果表明,该模型在任务上表现优异,说明其能捕捉潜在结构。进一步通过探测实验与激活替换反事实分析发现,模型在内部表示中自发计算并存储一阶差分,且通过类似归纳电路的机制检索相关差分并加到当前值上。本工作是首个识别此类概念归纳机制的研究之一。

原文摘要 · Abstract (English)

Recent work has shown that large language models (LLMs) exhibit strong numerical sequence modeling capabilities and show promise in time-series prediction. While LLMs display in-context learning capabilities, the mechanisms with which they accomplish time-series prediction remain unclear. Specifically, whether they truly understand the underlying structure, which at a minimum requires reasoning over first differences in the sequence of numbers. To study this, we investigate Llama 3.1-8B from a mechanistic interpretability point of view. Mechanistic interpretability is an emerging field concerned with the reverse engineering of the algorithms learned by neural networks such as LLMs. To assess Llamas' numerical sequence modeling capabilities and to facilitate our mechanistic interpretability analysis, we create a sequence modeling task that cannot be solved without picking up structural cues. Specifically, we sample n random numbers and repeat them with an offset. We find that Llama displays strong performance on our tasks suggesting that it can pick up on the underlying structure. To understand the mechanisms that allow it to do so, we perform probing experiments and activation patching based counterfactual analysis. Probing reveals that the model computes and stores first differences in its internal representations without explicit supervision, indicating that it tracks structural information about the sequence. Activation patching reveals that Llama retrieves the relevant first-difference with a mechanism similar to an induction circuit and subsequently adds it to the current value. Notably, our work represents one of the first studies to identify this form of concept induction in LLMs.

可解释性数列推理机制分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。