Research
Disentangling Direction and Magnitude in Transformer Representations: A Double Dissociation Through L2-Matched Perturbation Analysis
Disentangling Direction and Magnitude in Transformer Representations Authors: Mangadoddi Srikar Vardhan, Lekkala Sai Teja (NIT Silchar, India) · arXiv: 2602.11169v1 [cs.CL], 19 Jan 2026 · License: CC
- arXiv
- 2602.11169
- Published
- 2026-01-19
- Authors
- Mangadoddi Srikar Vardhan, Lekkala Sai Teja
AI summary
Disentangling Direction and Magnitude in Transformer RepresentationsAuthors: Mangadoddi Srikar Vardhan, Lekkala Sai Teja (NIT Silchar, India) · arXiv: 2602.11169v1 [cs.CL], 19 Jan 2026 · License: CC BY 4.0
Overview
- Research area: Mechanistic interpretability and representation geometry in transformer language models, with an emphasis on causal intervention methods (activation patching, linear probing, attention and LayerNorm analysis).
- Technical level: Intermediate. The paper is readable without deep mathematics, but assumes familiarity with concepts such as hidden states, L2 norms, LayerNorm, attention, and the linear representation hypothesis.
- Scope in one sentence: The paper introduces an L2-matched perturbation method to fairly compare how much a transformer's direction (vector orientation) versus its magnitude (vector length) matters for language modeling versus syntax, then traces the two effects to different internal pathways.
What This Paper Is About
Every hidden-state vector in a transformer can be split into a direction (a unit vector pointing somewhere in representational space) and a magnitude (the L2 norm, or length). The influential "linear representation hypothesis" says concepts are encoded as directions, but it is essentially silent on whether magnitude carries any function of its own. The paper's goal is to answer that question causally: by perturbing direction and magnitude in a carefully size-matched way, and by then repairing internal components, the authors ask whether these two geometric properties play distinct computational roles — or whether one is simply a byproduct of the other.
Key Contributions
- Empirical — a cross-over dissociation: Discovery that in Pythia-family models, angular (direction) perturbations are far more damaging to language modeling loss, while magnitude perturbations are far more damaging to subject-verb agreement accuracy, with each perturbation type preferentially impairing a different function.
- Methodological — L2-matched perturbation analysis: A framework that forces angular rotations and magnitude scalings to produce identical Euclidean displacement δ from the original vector, removing the perturbation-size confound that would otherwise make any comparison between the two meaningless.
- Mechanistic — causal pathway evidence: Attention repair recovers 28.4% of angular-induced loss damage versus 15.2% for magnitude damage in Pythia-410M; LayerNorm repair recovers 29.9% of magnitude damage versus 13.7% of angular damage — an inverse pattern. The authors explicitly caveat that these pathways explain only roughly 30% of each effect.
- Theoretical — refinement of the linear representation hypothesis: A proposal that direction and magnitude serve partially distinct roles in LayerNorm-based architectures, and that this specialization does not hold in RMSNorm-based architectures (TinyLlama-1.1B reverses the pattern entirely).
Main Findings
-
Angular perturbations dominate loss damage. At the smallest displacement tested (δ = 1.0), angular perturbations raised loss by 0.368 versus 0.009 for magnitude perturbations — a 42.9× ratio. The ratio shrinks as δ grows: 23.2× at δ = 2.0, 5.4× at δ = 5.0, 2.2× at δ = 10.0, 1.7× at δ = 15.0, and 1.4× at δ = 20.0. Baseline loss was 4.107.
-
Two regimes in the loss effect. For δ ≤ 5 the mean angular/magnitude ratio is 6.80×; for δ ≥ 10 it falls to 1.69×, a 75% reduction. The authors interpret this as angular damage saturating, since the model cannot predict worse than random.
-
The pattern reverses for syntax. On BLiMP subject-verb agreement (baseline accuracy 89.5%), magnitude perturbations dropped accuracy by 20.4% at δ = 5 while angular perturbations dropped it by only 1.6% — a 12.8× difference in the opposite direction. At δ = 10 the drops were 33.5% versus 12.4%; at δ = 15, 36.0% versus 22.1%. The abstract summarizes this as a drop difference of up to 21.1 percentage points at δ = 10.
-
Differential propagation through layers. Although both perturbations start at the same L2 displacement (5.00 at layer 8), by layer 15 angular displacement reached 35.9 versus 12.7 for magnitude (2.82×), and by layer 23 it reached 123.8 versus 38.9 (3.18×). Angular perturbations amplify 24.8× from intervention to final layer; magnitude perturbations amplify 7.8×. The authors acknowledge this means perturbations are no longer L2-matched downstream, but treat the differential propagation itself as informative.
-
The effect amplifies with scale. On Pythia-1.4B (24 layers, 2048 dimensions), the angular/magnitude loss ratio was 56.8× at δ = 2, 24.4× at δ = 5, and 6.0× at δ = 10 — 2 to 4× higher than Pythia-410M. The authors caution this rests on only two model scales within one architecture family.
-
Attention carries angular damage. Causal attention repair recovered 28.4% of angular-induced loss damage versus 15.2% of magnitude damage in Pythia-410M (t = 4.93, p = 0.004). The pattern replicated qualitatively in Pythia-1.4B: 23.8% versus 2.0%. Repairing later layers (12–15) recovered 25.0% of damage, while early layers (8–11) accounted for only 6.4% (t = 40.5, p < 0.0001).
-
LayerNorm carries magnitude damage. LayerNorm repair recovered 29.9% of magnitude-induced damage versus 13.7% of angular-induced damage (t = 6.4, p = 0.002) — the inverse of the attention result, completing a mechanistic double dissociation.
-
Magnitude tracks parse depth. Baseline vector magnitude correlated with dependency parse tree depth at r = 0.142 (p < 10⁻⁴⁵). Magnitude perturbation slashed this correlation by 75% (to r = 0.036), while angular perturbation reduced it by only 11% — an explanation for why magnitude damage hits syntax specifically.
-
Encoding is not the same as computation. Linear probing showed direction alone reaches 81.6% POS accuracy versus 29.7% for magnitude alone (chance is 16.7%), yet magnitude perturbations damage syntax more. The direction probe survived angular perturbation at 79.9% accuracy (a 1.7% drop), so the syntactic encoding was not destroyed — the model's use of it was disrupted.
-
Attention entropy is suggestive but unreliable. Angular perturbations raised attention entropy by 0.129 versus 0.025 for magnitude at δ = 5 (5.2×, t = 25.4, p < 0.001), but the pattern did not replicate at 1.4B scale, where angular perturbations slightly decreased entropy. The authors therefore prioritize the causal repair evidence.
-
Generalization is architecture-dependent, and this is itself a finding. Direction carried more syntactic information than magnitude across all tested layers (0, 4, 8, 12, 16, 20, 23), at 75–83% versus 19–40% POS accuracy. But in OPT-1.3B (LayerNorm) the attention mediation pattern reversed (34.4% magnitude recovery versus 27.0% angular), and in TinyLlama-1.1B (RMSNorm) the loss dissociation reversed entirely — magnitude caused roughly 5× more damage than angular at low δ.
Methodology in Plain English
The central difficulty the authors had to solve is a fairness problem. If you rotate a vector slightly and scale a vector slightly, the two changes are not the same size in space — so if the rotation hurts the model more, you cannot tell whether direction matters more or whether you simply pushed harder. Their fix is L2-matched perturbation analysis: they set a target displacement δ and then solve for the rotation angle and scaling factor that each produce exactly that Euclidean distance from the original vector. Angular perturbations rotate the unit direction toward a randomly sampled orthogonal direction; magnitude perturbations scale the norm up or down by a factor of 1 ± δ/‖h‖, with the branch chosen randomly. They verify every perturbation hits the target δ within a tolerance of 0.01.
The setting is Pythia-410M (24 layers, 1024-dimensional hidden states, 16 attention heads, run in float32) and Pythia-1.4B. Perturbations are injected at middle layers 8 through 15, where prior work places the most syntactic and semantic activity, applied to all token positions at once. Displacement values tested are δ ∈ {1.0, 2.0, 5.0, 10.0, 15.0, 20.0}; since hidden-state norms typically run 15–25, δ = 5 is roughly a 20–30% displacement. Downstream effects are measured on next-token cross-entropy over 281 WikiText-103 sentences (10–64 tokens, mean 42.6; baseline perplexity 60.7) and on 200 BLiMP subject-verb agreement minimal pairs. All experiments use 5 random seeds with independently sampled orthogonal directions; the authors note n = 5 limits statistical power even though effect sizes are large.
Beyond measuring damage, they run two causal repair experiments. In attention repair, they cache attention outputs from a clean forward pass and inject them during a perturbed pass. In LayerNorm repair, they cache clean input-LayerNorm and post-attention-LayerNorm outputs for layers 8–15 and inject those instead. Finally, they test whether vector magnitude correlates with dependency parse depth, and use linear probing to compare how much syntactic information direction versus magnitude carries.
Why This Matters
Impact on research. The paper pushes on a real gap in the linear representation hypothesis: that it says nothing about magnitude, even though LayerNorm explicitly manipulates norms and norms vary substantially across tokens, layers, and contexts. Its methodological contribution — L2 matching — is arguably as important as its findings, because it gives interpretability researchers a controlled way to compare perturbation types that previously could not be compared fairly. The negative results matter too: the fact that the dissociation reverses in TinyLlama-1.1B (RMSNorm) suggests normalization choice may fundamentally shape how transformers use representation geometry, which reframes the finding as a property of LayerNorm-based GPT-NeoX-family models rather than a universal law.
The paper also makes a conceptual distinction that generalizes beyond this specific experiment: a representation can encode information that matters less for behavior, and behave as if it matters more, because encoding and computation are different things. Probing accuracy may not predict behavioral importance.
Real-world applications:
- Model editing and knowledge injection. Methods that modify activation vectors without distinguishing direction from magnitude could be made more surgical — preserve direction when preserving language modeling quality and factual knowledge, preserve magnitude when preserving syntactic coherence, or edit the two separately when targeting a specific capability.
- Fine-tuning and quantization safety. Understanding which geometric component carries which capability could inform how aggressively norms can be altered (as happens in quantization and low-precision inference) without degrading syntactic behavior.
- Evaluation design. The demonstration that a single metric (loss) can point the opposite way from another (syntactic accuracy) is a caution for benchmark-driven development — a model that looks fine on perplexity may still have corrupted structural processing.
- Interpretability tooling. Separately probing direction and magnitude components could expose distinct information streams that current full-vector probing averages together.
Industry relevance. For teams doing activation steering, representation engineering, or knowledge editing in production LLMs, the paper's practical claim is that "edit the activation" is an under-specified instruction. It also raises a concrete engineering consideration: if magnitude carries structural position information through LayerNorm-mediated paths, then normalization-layer choices in model architecture are not just numerical-stability decisions — they may determine which geometric properties the model is even able to exploit.
Future Directions
- Explain the missing ~70%. Attention and LayerNorm repair together account for only roughly 30% of each perturbation type's damage. The authors state that the remainder likely flows through MLP layers and residual connections, which they did not repair, and that fully characterizing these pathways remains important future work.
- Resolve the entropy anomaly. Attention entropy increased 5.2× more under angular perturbation at 410M but did not replicate at 1.4B (where angular perturbation slightly decreased entropy). What the entropy metric is actually tracking across scales is unresolved.
- Test more architectures and normalization schemes. The dissociation reversed in RMSNorm-based TinyLlama-1.1B and the mediation pattern reversed in OPT-1.3B, suggesting normalization type is a key variable. The paper's own results argue for a broader sweep.
- Untangle propagation from initial perturbation. Because angular displacements amplify 3.18× more than magnitude displacements by the final layer, the perturbations are no longer L2-matched downstream. The paper acknowledges this partially contributes to the loss dissociation; separating the initial effect from the propagated one is an open problem. The paper also defers a discussion of representation-space anisotropy to Section 9, which is not included in the available content.
Target Audience
Researchers and graduate students in mechanistic interpretability, representation learning, and NLP who want a causal toolkit for asking which geometric property of a hidden state does what. It is most valuable to readers already comfortable with activation patching, linear probing, and transformer internals; practitioners working on model editing, activation steering, or representation engineering will find the practical implications directly actionable; and architecture-focused engineers should note the RMSNorm caveat before generalizing the findings. Readers looking for a definitive universal account of direction versus magnitude will not find one here — the paper is explicit that its conclusions are scoped to LayerNorm-based models in the Pythia family, that the mechanistic pathways are only partly explained, and that its statistical power is limited by 5 seeds.
Authors’ abstract
Transformer hidden states encode information as high-dimensional vectors, yet whether direction (orientation in representational space) and magnitude (vector norm) serve distinct functional roles remains unclear. Studying Pythia-family models, we discover a striking cross-over dissociation: angular perturbations cause up to 42.9 more damage to language modeling loss, while magnitude perturbations cause disproportionately more damage to syntactic processing (20.4% vs.1.6% accuracy drop on subject-verb agreement).This finding is enabled by L2-matched perturbation analysis, a methodology ensuring that an gular and magnitude perturbations achieve identical Euclidean displacements. Causal intervention reveals that angular damage flows substantially through the attention pathways (28.4% loss recovery via attention repair), while magnitude damage flows partly through the LayerNorm pathways(29.9% recovery via LayerNorm repair). These patterns replicate across scales within the Pythia architecture family. These findings provide evidence that direction and magnitude support partially distinct computational roles in LayerNorm based architectures. The direction preferentially affects attentional routing, while magnitude modulates processing intensity for fine-grained syntactic judgments. We find different patterns in RMSNorm-based architectures, suggesting that the dissociation depends on architectural choices. Our results refine the linear representation hypothesis and have implications for model editing and interpretability research