解析GPT类模型如何通过注意力机制实现递推预测。
Interpreting Affine Recurrence Learning in GPT-style Transformers
- 用三层Transformer学习仿射递推,揭示零层复制初始序列、二层负相似度头优化预测的机制。
- 模型在递推任务中能准确预测序列,关键依赖于注意力头的分工协作。
- 适合关注大模型可解释性与对齐研究的研究者阅读。
理解GPT类Transformer的内部机制,特别是其在上下文学习(ICL)中的能力,对推动人工智能对齐与可解释性至关重要。上下文学习使Transformer能在推理时泛化而无需修改权重,但其具体运作机制仍不清晰。本文研究了这类模型在执行仿射递推预测这一ICL任务时的可解释性,训练了一个定制的三层数组变压器,并结合实证与理论方法分析其内部行为。结果表明,模型在第一层通过复制机制生成目标序列的初始估计,随后在第二层利用负相似度注意力头进行修正优化。这些发现深化了对Transformer在递归任务中行为的理解,并为通过机制可解释性提升AI对齐提供了新思路。最后,我们讨论了未来工作方向,包括高维递推和多项式序列的扩展研究。
原文摘要 · Abstract (English)
Understanding the internal mechanisms of GPT-style transformers, particularly their capacity to perform in-context learning (ICL), is critical for advancing AI alignment and interpretability. In-context learning allows transformers to generalize during inference without modifying their weights, yet the precise operations driving this capability remain largely opaque. This paper presents an investigation into the mechanistic interpretability of these transformers, focusing specifically on their ability to learn and predict affine recurrences as an ICL task. To address this, we trained a custom three-layer transformer to predict affine recurrences and analyzed the model's internal operations using both empirical and theoretical approaches. Our findings reveal that the model forms an initial estimate of the target sequence using a copying mechanism in the zeroth layer, which is subsequently refined through negative similarity heads in the second layer. These insights contribute to a deeper understanding of transformer behaviors in recursive tasks and offer potential avenues for improving AI alignment through mechanistic interpretability. Finally, we discuss the implications of our results for future work, including extensions to higher-dimensional recurrences and the exploration of polynomial sequences.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。