Meta-memorization and memorization scaling laws in transformers
Alex Nguyen, Kenneth A. Norman, Gautam Reddy
Abstract
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) 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.
Create a lesson
Related papers
Coarse Semantic Blocks for Efficient Training-Free Sparse Attention
Sosuke Kobayashi, Shoichiro Yamaguchi, Seiya Tokui
What Is the Influence of Task Order in Continual Learning? An Empirical Study and Order-Aware Evaluation for Motion Forecasting
Zirui Li, Yunlong Lin, Haohan Yang et al.
Reciprocity Can Erase Direction:tructural Boundaries and Controlled Utility of Magnetic Graph Networks
Dawei Han, Zicheng Wang, Yaoxing Ren et al.
Deep Learning Compilers: Architecture, Optimization, and Empirical Characterization
Jinghao Wen, Ruixuan Wang, Xun Jiao
OmniST: Topology-Invariant Spatiotemporal Forecasting with Guaranteed-Coverage Uncertainty at Unseen Sensor Locations
Praveg Vashishtha
LIRA: A More Interpretable Dynamic Loss-Informed Rank Allocation for Low-Rank Adaptation
Sihao Wang, Bozheng Li, Xuemiao Xu et al.