arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.12426cs.CL
收藏

变换器中的几何事实回忆

Geometric Factual Recall in Transformers

New York University(纽约大学);Flatiron Institute(Flatiron研究所)

Shauli Ravfogel, Gilad Yehudai, Joan Bruna, Alberto Bietti

AI总结:

研究探讨了变换器模型如何通过几何方式记忆事实关联,证明嵌入维度与事实数量呈对数关系,并展示了多跳查询中的容量-深度权衡。

摘要:

变换器语言模型如何记忆事实关联?一种常见观点认为内部权重矩阵是嵌入对的关联记忆,需要与事实数量线性增长的参数。我们提出了一种理论和实证的替代观点,即几何形式的记忆,其中学习的嵌入直接编码关系结构,MLP扮演不同角色。在受控设置中,单层变换器必须记忆随机双射,证明对数嵌入维度足够:主体嵌入编码其关联属性向量的线性叠加,小MLP作为关系条件选择器,通过ReLU门控提取相关属性,而非关联键值映射。我们扩展这些结果到多跳设置——如'谁是x的妻子的母亲'——提供有无链式思维的构造,展示可证明的容量-深度权衡,辅以信息论下界。实证上,梯度下降发现精确结构。训练后,MLP在适当重新初始化时零样本转移至新双射,表明其学习了通用选择机制而非记忆特定事实。

英文摘要:

How do transformer language models memorize factual associations? A common account views internal weight matrices as an associative memory. That account requires parameter counts that scale linearly with the number of facts. We develop a theoretical and empirical account of an alternative, \emph{geometric} form of memorization in which learned embeddings encode relational structure directly, and the MLP plays a qualitatively different role. In a controlled setting where a single-layer transformer memorizes random bijections from subjects to a shared attribute set, we prove that a logarithmic embedding dimension is sufficient. Subject embeddings encode \emph{linear superpositions} of their associated attribute vectors, and a small MLP acts as a relation-conditioned selector that extracts the relevant attribute from the embedding. We extend these results to the multi-hop setting---chains of relational queries such as ``Who is the mother of the wife of $x$?''---and provide constructions with and without chain-of-thought that exhibit a provable capacity--depth tradeoff, complemented by a matching information-theoretic lower bound. Empirically, gradient descent discovers solutions with the predicted structure. Causal experiments support the proposed mechanism: when subject embeddings are appropriately re-initialized, the frozen MLP transfers zero-shot to entirely new bijections, showing it has learned a generic selection mechanism rather than functioning as a key-value memory.

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

↑