arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.01564cs.LGcs.AI
收藏

Transformer中的元记忆与记忆缩放定律

Meta-memorization and memorization scaling laws in transformers

Princeton University(普林斯顿大学);Princeton Neuroscience Institute(普林斯顿神经科学研究所)

Alex Nguyen, Kenneth A. Norman, Gautam Reddy

AI总结:

该研究发现Transformer存在元记忆与记忆缩放定律,更大模型记忆更多且更快,元记忆使模型可高效存储检索记忆,单层Transformer也能少样本记忆100比特序列。

摘要:

更大的Transformer能够记忆更多数据,其容量(以比特为单位)大致与参数数量呈线性缩放。违反直觉的是,更大的模型记忆速度也更快,在训练过程中记住一个序列所需的重复次数更少。我们在基于随机二进制序列训练的Transformer中重现了这两种记忆缩放定律,表明即使数据不包含语义或组合结构,也会出现快速记忆现象。快速记忆源于元记忆效应,即经过大量随机序列训练的模型学会了更快地记忆新序列。模型的记忆速率r(t)随训练时间t呈幂律增长,形式为r(t) ~ t^β,其中指数β固定,但上限随模型规模增大而提高。元记忆使单层Transformer也能少样本记忆100比特的序列。这种效应部分可通过结构化注意力头的形成来解释,这些注意力头将位置不变的序列信息传递给存储记忆序列的多层感知机(MLP)。元记忆在简化的密集关联记忆模型中也得到了体现,该模型的检索受注意力瓶颈约束。我们的结果表明,Transformer通过预训练获得了可复用的机制,能够实现高效的记忆存储与检索。

英文摘要:

Larger transformers can memorize more data, with a capacity (in bits) that scales roughly linearly with the number of parameters. Counterintuitively, larger models also memorize faster, requiring fewer repetitions of a sequence during training before it is memorized. We reproduce both memorization scaling laws in transformers trained on random binary sequences, showing that rapid memorization can arise even when data contain no semantic or compositional structure. Rapid memorization is due to a meta-memorization effect, where models trained to memorize a large set of random sequences learn to memorize novel sequences more quickly. The rate $r(t)$ at which models memorize grows with training time $t$ as a power-law $r(t) \sim t^β$ with a fixed exponent $β$ but an increasing upper cutoff across model scales. Meta-memorization enables even one-layer transformers to few-shot memorize a 100-bit sequence. This effect is partly explained by the formation of structured attention heads that convey position-invariant sequence information to MLPs where memorized sequences are stored. Meta-memorization is recapitulated in a simplified model of a dense associative memory where retrieval is constrained by an attentional bottleneck. Our results suggest transformers, through pre-training, acquire reusable mechanisms that enable highly efficient storage and retrieval of memories.

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

↑