Token Sample Complexity of Attention
Abstract
Lay Summary
Large language models can now process very long inputs, but it is not always clear how much useful information is gained by adding more and more tokens. This paper studies that question for attention, the mechanism that lets a Transformer decide which parts of an input to focus on. We introduce token sample complexity: a way to measure how quickly attention stabilizes as the number of input tokens grows. Our theory shows that this stabilization can be much slower than the standard statistical intuition would suggest. The rate depends not only on the model’s attention weights, but also on the geometry of the token representations, through a quantity we call the attention horizon. When this horizon is large, attention becomes more selective and more tokens may be needed before the model behaves like it would with the full context. We support these predictions with experiments on synthetic data, real text representations from Transformer models, and an end-to-end classification task. The results show that the same slowdown can be observed in logits, predictions, and accuracy. Overall, the paper gives a quantitative way to understand when longer contexts are likely to improve model behavior, and when the gains may become slow or limited.