Manuscript Offprint
arXiv:2611.12206A Geometric Invariant of Attention Predicts Head Specialization from Weights Alone
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Transformers are built with continuous symmetries in the attention mechanism. We derive , a scalar invariant that measures each head's capacity to couple to rotary positional encodings. This framework allows us to analyze heads without forward passes, opening a new research direction into data-independent analysis of modern LLMs. Empirically, we find that predicts induction heads, the most-studied circuit type in mechanistic interpretability, with Spearman correlation between and across four bias-free RoPE models spanning 135M to 7B parameters. As a preliminary proof of concept, we use to apply YaRN to only the top-50% positional heads, which degrades perplexity less than uniform application. Code is available at https://github.com/MPedraBento/rho-invariant.
Keywords: invariants, symmetry, attention heads, mechanistic interpretability, rotary position encoding
1. Introduction
Mechanistic interpretability is grounded in the meaning behind transformer head activations. Some approaches are activation patching (Conmy et al., 2023), probing classifiers, or behavioral diagnostics on crafted inputs (Olsson et al., 2022). Recent work connecting RoPE to heads relies heavily on data (Barbero et al., 2024). In this paper we ask: how much can we learn from the weights alone? Analogously to physics, where theories often have fewer observables than parameters, the attention mechanism admits basis-invariant quantities. These, in turn, characterize heads independently of the choice of basis.
The attention mechanism works by using quadratic forms in the query-key space and the value-output space . The static composite is invariant under the full head-space reparameterization for any . In RoPE-based models the rotation is block-diagonal with one rotation per frequency plane, and requiring invariance of the whole family breaks down to the group , such that within each plane a rotation and a positive rescaling act as , leaving unchanged. The form is thus invariant under this residual symmetry, making it a basis-independent observable of the head's structure (Elhage et al., 2021).
- Accepted as an extended abstract at the Symmetry and Geometry in Neural Representations Workshop (NeurReps), NeurIPS 2026. This work was conducted independently of the author's role at Feedzai.
© 2026 Bento.
BENTO

Figure 1: The invariant measures the relative magnitude of the positional perturbation to the content term. Content heads (left) are dominated by ; positional heads (right) have a large position-dependent component.
where is the static term and is the positional perturbation induced by the RoPE rotation at relative position , with inputs and matrices , so that .
We define a positional capacity invariant as a measure of the capacity a head has to couple to positional encodings. We can define a simple basis-invariant scalar that quantifies how much the bilinear form varies with position,
where is the context length. The sampling set is logarithmically spaced because the RoPE frequencies are geometrically spaced, so uniform sampling in probes all frequency bands up to the context horizon . Thus, measures positional capacity over the sampled range, not at arbitrarily long range.
The invariant is non-negative , with equality iff for all . Being a function of , is additionally scale-invariant, unchanged under or . It is, however, sensitive to the softmax shift , which leaves attention patterns unchanged; in practice weight decay penalizes and , discouraging large components in that do not affect the output, thus mitigating this issue.
Proposition 1 ( gives position-independent logits on ) Fix a head with static term and assume . Let be any (nonempty) set of relative positions. Then if and only if for every , in which case the attention logit
is independent of the relative position for all and all residual-stream inputs .
Proof By (2), is a sum of terms , each a squared Frobenius norm over the common denominator (positive by the assumption ),
Geometric Invariant of Attention
Table 1: vs. induction score across four bias-free RoPE models. Spearman (all ) and the smallest -percentile band containing the top-10 induction heads.
| Model | Params | Spearman | top-10 within |
|---|---|---|---|
| SmolLM2-135M | 135M | -0.74 | bottom 14% |
| TinyLlama-1.1B | 1.1B | -0.71 | bottom 7% |
| SmolLM2-1.7B | 1.7B | -0.55 | bottom 17% |
| Mistral-7B | 7B | -0.59 | bottom 30% |
hence each . A sum of non-negative terms vanishes iff every term vanishes, so iff for every . Substituting into (1) gives , which contains no dependence on .
Crucially, measures capacity, not usage, as a high- head may still ignore position on a given input, but a head with produces logits with no positional dependence across , for any input (Proposition 1).
3. Results
3.1. predicts induction heads without data
Induction heads (Olsson et al., 2022) implement the “A B … A → B” copying pattern, which is the most-studied circuit in mechanistic interpretability. We measure induction scores via repeated random sequences and correlate with .
We find that induction heads have extremely low , consistently across four bias-free RoPE models spanning 135M to 7B parameters (Table 1). The Spearman correlation between and the induction score is negative and highly significant in every model ( from to , all ), and the ten strongest induction heads always lie in the low- tail (bottom 7–30% of the distribution).
This result supports our hypothesis of capacity interpretation. Induction heads perform content matching, a position-invariant operation. The low reflects minimal coupling to RoPE, thus ensuring activation-independent decoupling. The correlation is imperfect because induction is a multi-head circuit. Thus, low is necessary but not sufficient for induction, precisely the capacity interpretation.
3.2. Application: capacity-gated context extension
Uniform RoPE scaling methods (Chen et al., 2023) degrade short-context performance because they modify all heads. We apply YaRN (Peng et al., 2024) to the top-50% heads by , leaving the remaining heads at the original positions.
The targeted variant degrades perplexity less than uniform YaRN at both the short and the long context, as seen in Table 2. The evaluation stays within the model’s native context. The inflated long context values are due to the evaluation near the context limit.
BENTO

Figure 2: vs. induction score for all heads in TinyLlama-1.1B. Induction heads cluster in the low- regime.
Table 2: Context extension at (Mistral-7B). Targeted applies YaRN only to the top-50% heads.
| Method | Short PPL (512) | Long PPL (4096) |
|---|---|---|
| Baseline () | 7.63 | 5.44 |
| YaRN (all heads) | 19.37 | 162.96 |
| YaRN + Targeted (ours) | 12.92 | 130.34 |
4. Discussion and limitations
We have shown that a single basis-invariant scalar, computable from weights alone, predicts induction heads. The key contribution is the capacity interpretation. measures what a head's geometry allows it to couple to, not what it does on any given input.
This framework generalizes beyond the invariant. The full set of invariant quantities ( eigenspectrum, singular values, the commutator ) defines an invariant signature per head. Future work entails a more comprehensive study of the weight invariants of transformers.
Finally, we validate on four bias-free RoPE models up to 7B parameters. The YaRN+Targeted application is a preliminary proof of concept on Mistral-7B, demonstrated within the native context window. Further evaluation is left to future work. The framework applies specifically to RoPE-based architectures, and to the QK sector.
GEOMETRIC INVARIANT OF ATTENTION
References
Federico Barbero, Alex Vitvitskyi, Christos Perivolaropoulos, Razvan Pascanu, and Petar Velivckovič. Round and round we go! what makes rotary positional encodings useful? ArXiv, abs/2410.06205, 2024. URL https://api.semanticscholar.org/CorpusID:273229201.
Shouyuan Chen, Sherman Wong, Liangjian Chen, and Yuandong Tian. Extending context window of large language models via positional interpolation. ArXiv, abs/2306.15595, 2023. URL https://api.semanticscholar.org/CorpusID:259262376.
Arthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga-Alonso. Towards automated circuit discovery for mechanistic interpretability. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=89ia77nZ8u.
Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html.
Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. In-context learning and induction heads. Transformer Circuits Thread, 2022. https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html.
Bowen Peng, Jeffrey Quesnelle, Honglu Fan, and Enrico Shippole. YaRN: Efficient context window extension of large language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=wHBfxhZu1u.
Jianlin Su, Murtadha Ahmed, Yu Lu, Shengfeng Pan, Wen Bo, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063, 2024. ISSN 0925-2312. doi: https://doi.org/10.1016/j.neucom.2023.127063. URL https://www.sciencedirect.com/science/article/pii/S0925231223011864.