arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2402.16726cs.LGcs.AI
收藏

面向模多项式上已 grok 的 Transformer 内部电路与性质的实证解释

Towards Empirical Interpretation of Internal Circuits and Properties in Grokked Transformers on Modular Polynomials

The University of Tokyo(东京大学)

Hiroki Furuta, Gouki Minegishi, Yusuke Iwasawa, Yutaka Matsuo

AI总结:

本文通过傅里叶分析和新的进展度量,系统研究模多项式等复杂模算术任务上 grokked Transformer 的内部表示、任务间可迁移性及多任务混合对 grokking 的影响,为内部电路可解释性提供实证依据。

摘要:

Grokking 已被积极研究以揭示延迟泛化之谜,而在已 grok 的模型内部识别可解释表示和算法,是理解其机制的一个有启发性的线索。已知模加法上的 grokking 会在 Transformer 中实现傅里叶表示及其基于三角恒等式的计算电路。考虑到模运算中的周期性,一个自然的问题是:这些解释和解读在多大程度上适用于加法之外的其他模运算上的 grokking。为了更仔细地考察,我们首先提出假设:任意模运算都可以用独特的傅里叶表示或内部电路来刻画;已 grok 的模型能够获得在相似运算之间可迁移的公共特征;并且混合相似运算的数据集能够促进 grokking。随后,我们通过在包括多项式在内的复杂模算术任务上训练 Transformer,对这些假设进行了广泛检验。我们的傅里叶分析以及针对模算术提出的新进展度量——傅里叶频率密度和傅里叶系数比——刻画了已 grok 模型在每种模运算下独特的内部表示;例如,多项式通常会导致在初等算术中观察到的傅里叶分量的叠加,但在困难的不可分解多项式上并不会出现清晰的模式。相比之下,我们对 pre-grokked 模型的消融研究表明,针对每种运算分别 grok 得到的模型之间的可迁移性仅限于特定组合,例如从初等算术到线性表达式。此外,一些多任务混合可能导致 co-grokking——即所有任务同时发生 grokking——并加速泛化,而另一些混合则可能无法找到最优解。我们为内部电路的可解释性提供了实证步骤。

英文摘要:

Grokking has been actively explored to reveal the mystery of delayed generalization and identifying interpretable representations and algorithms inside the grokked models is a suggestive hint to understanding its mechanism. Grokking on modular addition has been known to implement Fourier representation and its calculation circuits with trigonometric identities in Transformers. Considering the periodicity in modular arithmetic, the natural question is to what extent these explanations and interpretations hold for the grokking on other modular operations beyond addition. For a closer look, we first hypothesize that any modular operations can be characterized with distinctive Fourier representation or internal circuits, grokked models obtain common features transferable among similar operations, and mixing datasets with similar operations promotes grokking. Then, we extensively examine them by learning Transformers on complex modular arithmetic tasks, including polynomials. Our Fourier analysis and novel progress measure for modular arithmetic, Fourier Frequency Density and Fourier Coefficient Ratio, characterize distinctive internal representations of grokked models per modular operation; for instance, polynomials often result in the superposition of the Fourier components seen in elementary arithmetic, but clear patterns do not emerge in challenging non-factorizable polynomials. In contrast, our ablation study on the pre-grokked models reveals that the transferability among the models grokked with each operation can be only limited to specific combinations, such as from elementary arithmetic to linear expressions. Moreover, some multi-task mixtures may lead to co-grokking -- where grokking simultaneously happens for all the tasks -- and accelerate generalization, while others may not find optimal solutions. We provide empirical steps towards the interpretability of internal circuits.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑