Scaling Laws for Associative Memories
Vivien Cabannes, Elvis Dohmatob, Alberto Bietti
TL;DR
This work studies associative memory in a high-dimensional, transformer-like setting where memories are stored as outer products of input and output embeddings. It derives scaling laws for the generalization error as a function of model capacity $d$ and data size $T$ under Zipf-distributed data, compares memory-storage schemes, and analyzes optimization-driven memorization via SGD, Adam, and layer normalization. Key findings show explicit error bounds for random embeddings, the dramatic capacity gains achievable by learning embeddings, and practical guidance on step size, batch size, and normalization to optimize memory storage. The results offer theoretical and empirical insights into memorization in deep networks and suggest design principles for memory-augmented models and training strategies.
Abstract
Learning arguably involves the discovery and memorization of abstract rules. The aim of this paper is to study associative memory mechanisms. Our model is based on high-dimensional matrices consisting of outer products of embeddings, which relates to the inner layers of transformer language models. We derive precise scaling laws with respect to sample size and parameter size, and discuss the statistical efficiency of different estimators, including optimization-based algorithms. We provide extensive numerical experiments to validate and interpret theoretical results, including fine-grained visualizations of the stored memory associations.
