Computer Science > Machine Learning
Title:Linear Attention Has Superlinear Capacity
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 $d$, we show that a Hebbian linear attention head has capacity $d$ for exact reconstruction, but superlinear capacity for approximate reconstruction and identification. Explicit constructions achieve $\Omega(d^{5/4})$ and $\Omega(d^{3/2})$ associations respectively, and random values improve the former to $\Omega(d^{4/3}/(\log d)^{1/3})$. We also establish an $O(d^2)$ 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.
| Comments: | 44 Pages |
|---|---|
| Subjects: | Machine Learning (cs.LG) ; Neural and Evolutionary Computing (cs.NE) |
| Cite as: | arXiv:2612.03155 [cs.LG] |
| (or arXiv:2612.03155v1 [cs.LG] for this version) | |
| https://doi.org/10.48550/arXiv.2612.03155 arXiv-issued DOI via DataCite (pending registration) |
Submission history
Access Paper:
- HTML (experimental)
Additional Features
- Audio Summary
Current browse context:
References & Citations
- Google Scholar
- Semantic Scholar
BibTeX formatted citation
Bookmark
Bibliographic and Citation Tools
Code, Data and Media Associated with this Article
Demos
Recommenders and Search Tools
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.