TL;DR
When you train two neural networks on the same task, their internal weights end up looking like completely different tangles of spaghetti. Yet beneath this messy surface, transformers actually converge on identical, compact mathematical structures—"algorithmic cores"—that mirror the true physics of the task itself. By extracting these shared invariants rather than mapping individual neurons, we can cleanly read out and steer how models up to 32 billion parameters process language.
What Problem Does This Paper Address?
Imagine reverse-engineering a clock, only to realize the next clockmaker used completely different gears to tell the exact same time. Neural networks suffer from this exact underdetermination: training selects for external behavior, not internal circuitry. Many different weight configurations can compute the exact same function.
For researchers in mechanistic interpretability—the quest to open the black box of AI—this is a headache. If you painstakingly map out a circuit of attention heads in one model, are you discovering a fundamental truth about intelligence, or just cataloging the quirky accidents of one random seed? Instead of looking at implementation (specific neurons and weights), this paper shifts the focus to invariants: what mathematical structures must exist across any model that solves the task?
Methods
Inspired by control theory—specifically Kalman's minimal realization, which strips a dynamical system down to only the parts you can both steer and observe—the author introduces Algorithmic Core Extraction (ACE).
ACE unfolds in three intuitive steps at a given transformer layer:
- Extract: To find internal directions that are both active (vary across inputs) and relevant (actually affect the output), ACE multiplies the matrix of centered hidden activations ($\mathbf{H}$) with the stacked Jacobians ($\mathbf{J}$, which measure how sensitive the task output is to nudges in those activations). Taking the Singular Value Decomposition (SVD) of $\mathbf{HJ}^\top$ isolates a low-dimensional subspace: the algorithmic core.
- Validate: Correlation isn't causation, so ACE tests the core via surgical ablations. A core is sufficient if throwing away everything else leaves performance intact, and necessary if deleting just the core drops accuracy to random chance.
- Identify: Once isolated, the author fits simple linear operators (via least squares) inside the core's coordinates and inspects their eigenvalues to see what algorithm is ticking inside.
Datasets
Rather than introducing massive new static benchmarks, the study evaluates ACE across four controlled tasks of escalating complexity:
- Synthetic Markov Chains: Next-token prediction generated by a 4-state Markov process.
- Modular Addition: Predicting $a + b \equiv c \pmod{53}$ (and sweeping primes $p$ from 11 to 101 to test grokking dynamics).
- Subject–Verb Number Agreement: Controlled linguistic prompts testing singular vs. plural verb preferences (e.g., is/was vs. are/were), alongside open-ended generation prompts.
- Indirect Object Identification (IOI): Role-swap sentence pairs (e.g., "When Mary and John went to the store, John gave a drink to..."), evaluated on novel templates and names, as well as the standard benchmark prompts from Wang et al.
The linguistic tasks were evaluated across six pretrained LLMs: GPT-2 (Small, Medium, Large), LLaMA-3.1 (8B), Gemma-2 (9B), and Qwen2.5 (32B).
Key Insights and Ideas
- Orthogonal geometry, identical computation: Models trained with different seeds embed their cores in nearly perpendicular directions ($75^\circ\text{--}90^\circ$ apart)—explaining why naively averaging weights ("model merging") often breaks models. Yet statistically and dynamically, these cores execute the exact same state machine.
- Weight decay causes "core inflation": You'd expect regularization (weight decay) to make internal representations simpler and smaller. Paradoxically, after a modular addition model suddenly generalizes ("groks"), continued weight decay bloats the core from ~15 to ~50 dimensions. Why? Because spreading small weights across all mathematically valid Fourier frequencies minimizes the total squared weight norm ($L_2$) better than putting one large weight on a single frequency.
- Redundancy speeds up grokking: That same drive to spread weights across equivalent solutions pushes the model from memorization to generalization faster. More redundant valid solutions ($p$) mean faster grokking, yielding a neat inverse scaling law: $\tau_{\text{grok}} \propto \frac{1}{\omega p}$ (where $\omega$ is weight decay).
- Universal grammar axes exist across architectures: From a 124M GPT-2 to a 32B Qwen2.5—despite different tokenizers, architectures, and training data—every model converges on a single 1D axis in its late layers to govern subject–verb number agreement.
Key Results
- Markov Recovery: In 64D single-layer transformers, ACE isolates a 3D core that is strictly necessary and sufficient. Despite near-zero weight cosine similarity (0.03–0.05), cross-model Canonical Correlation Analysis (CCA) hits ~0.99, and linear operators fit inside the core cleanly recover the true Markov transition eigenvalues ($R^2_{\text{core}} / R^2_{\text{oracle}} > 0.98$).
- Crystallizing Clocks: In modular addition, eigenvalues of the core's linear operator snap directly onto the complex unit circle right as test accuracy jumps to 1.00 around epoch 800, blindly recovering the famous "Fourier clock" mechanism without guessing its form beforehand.
- Steering LLMs: Keeping only the 1D agreement core preserves grammar performance ($\text{AUC} \ge 0.91$), deleting it ruins it ($\text{AUC} \le 0.25$), and reflecting activations across it flips model grammar ($\text{AUC} \le 0.10$)—turning "all men are created equal" into "all men is created equal" during open-ended generation. Cross-family coordinate correlations reach $r = 0.62\text{--}0.94$.
- Multi-step Routing: For IOI, extracting cores at two token positions isolates compact subspaces (1.6–4.8% of hidden dimension) that preserve accuracy ($\text{AUC} > 0.99$) and invert the predicted name when flipped ($\text{AUC} < 0.07$). Remarkably, a linear transition operator mapping between the two cores transfers across different LLM families, explaining 60% of a target model's causal response on average.
Limitations and Future Work
- Hypothesis-driven: ACE isn't an automatic scanner for everything a model knows; you still have to bring a clear, falsifiable task and output metric to the table. Scaling this to open-ended reasoning remains an open frontier.
- Linearity assumptions: ACE relies on linear subspaces and linear operator fits. Extending the framework with nonlinear dimensionality reduction, learned probes, or Koopman operators will likely be needed to capture curved, nonlinear dynamics.
- Dual-use control: Because isolating causal cores makes surgical steering remarkably easy, the same tools useful for auditing and debugging could potentially be misused to bypass safety behaviors or induce targeted errors.
Summary updated