Linear Attention Has Superlinear Capacity
Hao Guo, Sudhaunshu Hardikar, Simon Dennis, Rivaan Patil, Kevin Shabahang
Abstract
An attention head can be viewed as an associative memory in which queries retrieve stored key-value associations. How many associations can it reliably store and retrieve? Capacity is often studied with random keys and values, which models typical-case retrieval but not what the memory mechanism itself can support with well-chosen representations. We instead let the key and value representations be chosen freely, but require one fixed choice to support retrieval under every assignment of values to keys. We call this permutation-independent capacity, and study it for Hebbian linear attention, the simplest form of linear attention, whose state is a plain sum of outer products of keys and values. We consider two retrieval criteria: reconstruction, where the retrieved vector must equal the correct value, or lie within a prescribed tolerance excluding all other candidates; and identification, where it must be closer to the correct value than to any other candidate. When the key and value dimensions are both , we show that a Hebbian linear attention head has capacity for exact reconstruction, but superlinear capacity for approximate reconstruction and identification. Explicit constructions achieve and associations respectively, and random values improve the former to . We also establish an upper bound under either criterion, for more general linear reads. Taken together, our results show that the capacity of linear attention is substantially greater than previously suggested by analyses with randomly sampled representations. Viewed as an associative memory, even under the requirement of permutation independence, linear attention can reliably retrieve superlinearly many associations in the key and value dimensions, while remaining subject to a quadratic upper bound.
Create a lesson
Metadata
- Categories
- cs.LG, cs.NE
- Comments
- 44 Pages
Related papers
Grokking Is a High-Overlap, High-Capacity Regime of Ordinary Training
Shared title terminologycs.LGMian Wang
Interpretable generative graph attention for representation learning and reconstruction of multimodal neuroimaging data
Shared title terminologycs.LGMeenu Ajith, Ishaan Batta, Vince Calhoun
Efficient Algorithms for Lifelong Representation Learning in Linear Bandits Beyond Task Diversity
Shared title terminologycs.LGThang Duong, Zhi Wang, Chicheng Zhang
Tabular Selective Attention
Shared title terminologycs.LGRohith Saai Pemmasani Prabakaran, Daniel De Dios Allegue, Nour Shaheen et al.
PickPack: Scaling Context Extension To Millions Of Tokens With Sparse Attention
Shared title terminologycs.LGKumar Krishna Agrawal, Vihaan Thaker, Keshaw Ranjan et al.
Dual-Band Attention: Efficient LLM Inference With Lightweight Block Sparsity Estimation
Shared title terminologycs.LGZheng Liu, Kaixin Huang, Jiaxi Li et al.