Linear Attention Has Superlinear Capacity
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…
- arXiv
- 2612.03155
- Authors
- Hao Guo, Sudhaunshu Hardikar, Simon Dennis, Rivaan Patil, Kevin Shabahang
- Categories
- cs.LG · cs.NE