解读GPT风格Transformer中的仿射递推学习
Interpreting Affine Recurrence Learning in GPT-style Transformers
AI总结:
本文通过训练三层Transformer预测仿射递推,揭示其先在第零层复制形成初始估计、再在第二层用负相似性头细化,从而推进对GPT风格Transformer上下文学习机制的理解。
摘要:
理解GPT风格Transformer的内部机制,尤其是它们执行上下文学习(in-context learning, ICL)的能力,对于推进AI对齐和可解释性至关重要。上下文学习使Transformer能够在推理过程中进行泛化而无需修改权重,但驱动这一能力的具体操作在很大程度上仍然不透明。本文对这类Transformer的机制可解释性进行了研究,重点考察其作为ICL任务学习和预测仿射递推的能力。为此,我们训练了一个定制的三层Transformer来预测仿射递推,并结合经验方法和理论方法分析了该模型的内部操作。我们的发现表明,模型在第零层利用复制机制形成目标序列的初始估计,随后在第二层通过负相似性头对该估计进行细化。这些见解有助于更深入地理解Transformer在递归任务中的行为,并为通过机制可解释性改进AI对齐提供了潜在途径。最后,我们讨论了这些结果对未来工作的启示,包括扩展到更高维递推以及探索多项式序列。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。