A Geometric Invariant of Attention Predicts Head Specialization from Weights Alone

Miguel P. Bento
11/9/2026
cs.LGcs.CL
transformer-attention

Official code: MPedraBento/rho-invariant (0 stars, Python, MIT, last commit 2026-11-09).

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.

Show full abstract

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 $-0.55$ and $-0.74$ across four bias-free RoPE models spanning $135$M to $7$B 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.

View on arXivView PDF

Code Implementations(1)

MIT
00Python, ShellNov 9, 20263 weeks agoMIT

Similar Papers

Cite this paper

@article{bento2026geometric,
  title  = {A Geometric Invariant of Attention Predicts Head Specialization from Weights Alone},
  author = {Miguel P. Bento},
  year   = {2026},
  eprint = {2611.12206},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.12206v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.12206.svg)](https://codeofpaper.com/paper/2611.12206)

Discussion