Gluing Local Contexts into Global Meaning: A Sheaf-Theoretic Decomposition of Transformer Representations
Bryce Grant, Peng Wang
NeurIPS page · Open on the map
Category: Interpretability & Model Adaptation › Transformer Algorithmic Decomposition · Type: new method · Keywords: sheaf theory, transformer representations, Hodge decomposition, representational consistency, mechanistic interpretability
Areas: Interpretability › Mechanistic Interpretability › Mechanistic Interpretability
Summary
The sheaf-theoretic decomposition of transformer representations provides a mechanistic analysis of how local paraphrase contexts glue into global meaning, yielding a new metric of harmonic mass and a principled way to detect representational collapse.
Explained to a 5-year-old
We look at how a computer brain (a transformer) pieces together tiny clues that two words mean the same thing. By drawing lines between these clues, we can see where the brain agrees and where it disagrees. The deeper the brain gets, the more it can spot hidden patterns of agreement and disagreement. This helps us understand why the brain sometimes forgets things and sometimes gets confused. It also shows us a new way to make the brain more reliable.
Explained to a 5-year-old, longer
Imagine a big puzzle where each piece is a tiny piece of information from a computer model that reads words. Sometimes two pieces tell us the same thing, like two different words that mean the same. We draw lines connecting those matching pieces to see if they fit together nicely. If they do, the model is consistent; if not, there is a problem. By stacking many layers of these pieces, we create a grid that lets us count how many little loops of matching there are. The amount of "harmony" in these loops tells us how stable the model is and how likely it is to break when we change something. This new way of looking at the model helps us find hidden mistakes, improve its memory, and make it work better for real tasks like understanding language and answering questions.
For a technical reader
We model paraphrase relationships as a cellular sheaf, compute its coboundary and Laplacian, and analyze the harmonic components to measure representational consistency. The Hodge decomposition yields a metric of harmonic mass that predicts steering fragility and outperforms variance-matched and probe baselines. Empirical results across multiple transformer architectures demonstrate superior performance on CounterFact and style-transfer tasks, and the operators recover known invariance-variance-covariance objectives while preserving encoder rank.
Problem
Understanding how transformer representations integrate local contextual evidence into coherent global meaning and quantifying the extent to which activations remain consistent across paraphrase relationships is a core challenge in interpreting these models.
Method
The approach builds a cellular sheaf over a paraphrase graph, computes its Laplacian spectrum, and uses Hodge decomposition to measure harmonic mass and identify cycles across transformer layers, offering a mechanistic tool to analyze consistency and collapse.
Results
The approach shows that the spectral complement carries 5.6-26.5× more causal influence than variance-matched controls (p < 10⁻¹⁵), outperforms LEACE on CounterFact (85.6% vs 42.7% on GPT-2, 87.1% vs 77.7% on Mistral-7B, mean gap +17.9 pp), preserves 31.0% vs 4.2% facts under style transfer (7.4× more, p < 10⁻⁵⁰), and recovers VICReg’s invariance-variance-covariance while keeping encoder rank 57-60/64 versus collapse to 14-42/64.
Contributions
The paper introduces a sheaf-theoretic decomposition that provides a mechanistic, cohomology-based analysis of transformer representations, yielding a new harmonic-mass metric and a principled way to detect collapse, and demonstrates that this metric predicts steering fragility and consistently outperforms existing probing baselines across models and tasks.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction