arXiv paper· machine learning theory — transformer interpretability / linear algebra· theory paper with empirical survey

On attention heads and bilinear forms

Andrew O'Desky

cs.LG · math.SP · stat.ML

Quick verdict

Proves attention-head QK symmetric parts are balanced (n,n,N−2n) via a new profile map; theorems sound, but learned spectral patterns stay unexplained.

Summary

This paper by Andrew O'Desky studies the bilinear forms encoded in attention heads — the Gram-type matrices KᵀQ of query and key projections — across fourteen public decoder-only language models (GPT-2 family, OPT, BLOOM, Pythia, Mistral-Small-24B), totalling 9,512 heads. The central result (Theorem 3) is structural: whenever the stacked query-key map is surjective — a Zariski-dense condition — the symmetric part of the head's bilinear form has signature (n, n, N−2n), so equal counts of positive and negative eigenvalues are forced by low-rank QK architecture rather than learned from data. The paper introduces an orthogonally invariant profile map sending each bilinear form to a point of a 3-simplex (Theorem 4 classifies its fibers) and reports that profiles of trained forms accumulate near the rank-one family Θ in 13 of 14 models (all but opt-350m); Theorem 5 partially explains this via random matrices with proportional spectral lobes. Eigenvalue distributions of the symmetric parts are bimodal and fitted by sums of gamma-like distributions, though lognormal and Weibull families fit nearly equally well. Main limitations: the learned phenomena (Observations 2, 3, 6–9) lack mechanistic explanation, statistics are descriptive with no confidence intervals, and proofs were partly LLM-generated but Lean-formalized; experimental code is public.

Review complete

Assessment at a glance

machine learning theory — transformer interpretability / linear algebra

4

risk flags identified

● high 0

● medium 3

● low 1

Reproducibility readinesshigh
Code & data availableyes
Review confidencehigh
AI text signal1/20 passages flagged
Deep research viableCode-reproducible

5 strengths · 5 weaknesses · 5 author questions

AI text signal = Binoculars zero-shot detector score over 20 sampled passages (Fast-DetectGPT co-reported) — absence does not prove human authorship, and a flag does not imply misconduct.

Levels reflect verification complexity — not a quality score. Evolve never rates your paper.

Key claims under review

  • For a Zariski-dense set of query-key matrices (those whose stacked map C → H⊕H is surjective), the symmetric part of an attention head's bilinear form has signature (n, n, N−2n), so eigenvalue balance is structural, not learned (Theorem 3).
  • Empirically, all 9,512 attention heads across fourteen public decoder-only models exhibit this balanced signature (Observation 1).
  • Profiles of trained bilinear forms accumulate near the rank-one profile family Θ = {a = b, cd = 0} in 13 of 14 models (all but opt-350m), only partially explained by Theorem 5's large-dimension random-matrix limit.
  • Eigenvalue distributions of the symmetric parts are bimodal and well-modelled by sums of two gamma-like distributions, with tight cross-relations between the fitted parameters of the symmetric and antisymmetric spectra (Observations 3, 7–9).

Strengths

  • Clean structural theorem with real explanatory power

    Theorem 3 (§4) proves the symmetric part of a QK bilinear form has signature (n, n, N−2n) whenever the stacked (Q,K) map is surjective, converting Migliarini's puzzling '33 of 64' eigenvalue count in gpt2 into a mathematical inevitability and reconciling it explicitly (§4.0.1).

  • Novel, fully characterized diagnostic tool

    The profile map π: M_N(R)∖{0} → Δ3 (Definition 6) is orthogonally invariant, and Theorem 4 + Appendix B classify the fiber over every face of the simplex, including the empty-fiber edge — reusable geometry for head analysis beyond this paper.

  • Broad, multi-architecture empirical survey

  • Unusual epistemic honesty

  • Verifiability

Weaknesses

  • The learned phenomena are catalogued, not explained

  • Distribution-family claim underdetermined

  • No statistical inference anywhere

  • Key qualitative claim lacks a formal statistic

  • Scope gaps in the survey

Full Review Report

$1.99 · one-time

Unlock the complete preliminary analysis Evolve produced for this paper.

Report preview

Scope & Claims

This is a mathematics paper aimed at the ML interpretability community. Its three deliverables: (1) Theorem 3, a structural result proving that for any attention head whose stacked query-key map (Q,K): C → H⊕H is surjective — a Zariski-dense condition when N ≥ 2n — the symmetric part of the head's bilinear form KᵀQ has signature (n, n, N−2n); (2) a new orthogonally invariant “profile” map π: M_N(R)∖{0} → Δ3 (Definition 6), whose fibers over every face of the simplex are classified in Theorem 4 (Appendix B); (3) an empirical survey of fourteen public decoder-only checkpoints (distilgpt2, GPT-2 family, OPT-125m→13b, BLOOM-3b/7b1, pythia-70m-deduped, Mistral-Small-24B-Base) covering 9,512 heads. Section 2 adds a self-contained reformulation of transformers — attention functions, biaffine/bilinear attention, Proposition 3's homogenization of QKV attention in projective coordinates, Proposition 1's classification of RoPE-like scoring, and Proposition 2's unipotency bound — pitched as a bridge for mathematicians.

The remaining sections cover Methodology Assessment, Statistical Evidence, Results & Reproducibility, Limitations & Risks, and Verdict & Recommendations.

  • All 5 strengths & 5 weaknesses, analyzed in detail
  • 4 risk flags with severity, section & reviewer questions
  • Methods & statistical evidence assessment
  • 5 questions a peer reviewer would ask
  • Full six-dimension evaluation report & recommendations

One-time purchase · this paper only

One-time purchase, this paper only. AI-generated preliminary analysis — not peer review.

Frequently asked questions

Why do attention heads have exactly as many positive as negative eigenvalues?

Because of the architecture, not training. The attention score uses a bilinear form KᵀQ whose rank is at most the head dimension n. The paper proves (Theorem 3) that whenever the query and key maps together are surjective — generically true when the embedding dimension is at least twice the head dimension — the symmetric part of this form has exactly n positive and n negative eigenvalues plus N−2n zeros. This was verified on all 9,512 heads of fourteen public models.

What is the 'profile' of a bilinear form in this paper?

A four-number summary (a, b, c, d) summing to 1, plotted in a 3-simplex: a is the antisymmetric energy, b the balanced (indefinite) energy of the symmetric part, and c and d measure how far the spectrum leans toward positive or negative semidefinite. It is invariant under scaling and orthogonal coordinate changes; the profiles of all rank-one forms lie on a specific one-dimensional family Θ inside the simplex.

Is code or data available for this paper?

Yes. The author states that all experimental code, Lean formalizations, and additional visualizations are publicly available at https://aodesky.github.io/attention-bilinear-forms/. All fourteen analysed models (GPT-2 family, OPT, BLOOM, Pythia, Mistral-Small-24B) are public checkpoints, and every reported quantity is computable from their weight matrices.

Does the analysis cover modern architectures like RoPE and grouped-query attention?

Partially. The theory explicitly covers QKV, RoPE and ALiBi attention, and the empirical survey includes RoPE models (pythia-70m-deduped with partial RoPE, and Mistral-Small-24B-Base, which uses grouped-query attention with 32 query heads sharing 8 key-value heads per layer). RoPE forms are compared at relative position zero, and no encoder models or training-dynamics analyses are included.

About this review

This is an AI-generated preliminary review by Evolve.Pub, produced from the openly available text of the paper. It is not peer review and does not represent the authors' views. The canonical record of the paper is at the publisher link above.

  • Figures (simplex scatter plots, layer heatmaps, histograms) cannot be numerically verified from the text extraction; figure-based claims rest on captions and the numerical values stated in the text.
  • Mathematical notation is locally garbled by extraction (e.g., the stacked-map matrices in Theorems 1 and 3); the proofs nevertheless read as coherent.
  • The public code and Lean repository (aodesky.github.io) was not inspected; availability and Lean coverage are taken from the paper's own statements.
  • Review based on arXiv v1 text only; no peer-review status available.

Go deeper on this paper

Wrote a paper? Stress-test it before reviewers do.

Upload your manuscript for the same structured scrutiny — reasoning, statistics, evidence, figures, and reproducibility.

Scan your paper
On attention heads and bilinear forms | Evolve.Pub