arXiv:2610.23242cs.LGOct 2026

Manuscript Offprint

arXiv:2610.23242

Anisotropic Representation Dynamics in Transformers

Nguyen Do, My T. Thai

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Small differences between internal representations can shrink or grow as they pass through a Transformer layer, affecting how information is preserved and how sensitive the model is to perturbations. Yet it remains unclear when changes in attention weights can turn a representation difference that would otherwise shrink into one that grows. We develop a Mixture-Gated Theory of Anisotropic Representation Dynamics that separates self-attention into value transport, query gating, and key gating. Our analysis reveals how the geometry of attended representations constrains gating and how interactions between these mechanisms can reverse contraction induced by value transport. We formalize this phenomenon as gating-induced regime switching, where a representation difference contracts under fixed attention routing but expands under full attention. We derive a necessary and sufficient spectral criterion that certifies the existence or absence of switching and identifies switching directions without exhaustive search. Beyond existence, our theory characterizes maximum relative switching strength, certifies the severity of contraction that gating can overcome, and determines the largest dimension of a subspace in which every nonzero direction switches. Experiments across four Transformer architectures validate these predictions through analytical and finite-forward comparisons, revealing distinct and joint query-key gating mechanisms and nontrivial switching subspaces. Our results provide a mechanistic and spectral understanding of how attention routing can alter local representation dynamics.

1 Introduction

Many practical problems involving Transformers depend on how small changes to internal representations evolve during computation. Some changes gradually disappear, while others grow and affect the model's behavior. For example, in model editing, correcting a wrong fact should change the intended answer without affecting unrelated behaviors [9]. An overly strong edit may unintentionally change other answers, so we want useful and independent changes to be amplified while unwanted changes are suppressed. A similar challenge appears in adversarial attacks, where an attacker may need to query a target model many times to find a small perturbation that flips its prediction [4]. Understanding which perturbation directions are likely to be amplified could help identify promising attacks without relying entirely on repeated trial-and-error queries. This problem also appears in many other Transformer applications, including representation steering, model robustness, and long-context modeling, where preserving useful changes and suppressing unwanted ones is important [16, 8].

Previous studies have provided important insights into how Transformer representations evolve. Research on representation collapse and signal propagation explains how repeated attention can make token representations increasingly similar or reduce their diversity [3, 11, 6]. Other work studies when token representations converge or diverge across layers [13, 15]. Jacobian and spectral analyses further reveal how sensitive Transformer representations are to perturbations and how this sensitivity depends on attention computations [7, 2, 1, 14, 12]. However, knowing that a representation difference

Preprint.

grows does not necessarily explain what causes it to grow. In particular, we still need to distinguish changes caused by the information being passed through attention from those caused by attention selecting different information. This leads to our central question: Can attention routing turn a representation difference that would otherwise shrink into one that grows?

To answer this question, we develop a Mixture-Gated Theory of Anisotropic Representation Dynamics. Our starting point is that the same Transformer computation can shrink some representation differences while amplifying others. We refer to this direction-dependent behavior as anisotropic representation dynamics. To understand why this happens, we examine how self-attention changes its output. Attention combines information from different tokens, and a small perturbation can affect this process in two ways. First, it can change the information carried by the tokens themselves, which we call value transport. Second, it can change how much attention each token receives, which we call gating. We further distinguish query gating, which changes attention through the query, from key gating, which changes attention through the keys. This decomposition allows us to compare how representation differences evolve when only the transported information changes, and when changes in attention allocation also contribute to their evolution. A representation difference may therefore evolve very differently depending on whether attention routing responds to it (See Figure 1).

Nearby states at layer ℓ\ell

small local difference

Transport only

difference contracts

State-dependent routing

tiny shift re-routes attention

Full dynamics

difference is amplified

Figure

Figure 1: Conceptual illustration of gating-induced regime switching. Two nearby representations initially differ by a small perturbation δzℓ\delta z_{\ell}. Under fixed attention weights, value transport contracts this difference. However, a small change in the query can redistribute attention among token representations, introducing an additional gating contribution. When this contribution is sufficiently strong, the full attention computation amplifies the same representation difference rather than suppressing it. The illustration motivates our analysis of how attention routing can reverse transport contraction.

Our analysis shows that changing attention weights does not always produce a change in the output. If attended tokens have nearly identical representations, shifting attention between them has little effect. We characterize this limitation geometrically, showing that differences among attended representations restrict which perturbation directions can affect the output through query gating. Even when attended tokens differ, some perturbations produce no local query-gating response. More importantly, gating can either reinforce or counteract value transport. Consider a representation difference that becomes smaller under value transport alone. By changing which tokens receive attention, gating can oppose this contraction. If the gating response is sufficiently strong, the full attention computation makes the same difference grow instead of shrink. We call this reversal a gating-induced regime switch. Our theory establishes a spectral condition for when switching is possible, identifies directions that exhibit this reversal, and characterizes the largest subspace in which every nonzero direction switches.

Our theory also shows that not all regime switches are equally significant. In some directions, value transport only weakly suppresses a representation difference, making it relatively easy for gating to amplify it. In other directions, gating can still amplify a difference even when value transport strongly suppresses it. To distinguish these cases, we introduce two complementary measures: relative switching strength, which compares the gating effect against the suppression caused by value transport, and absolute reversal severity, which measures how strongly transport can suppress a difference that gating can still amplify. Our theory characterizes both measures, establishes conditions under which switching cannot occur, and examines the reliability of switching directions when the underlying operators are estimated with error. We validate these predictions on pretrained Transformer models by applying small perturbations to hidden representations and comparing the observed changes with our theoretical predictions. The experiments show that high relative switching strength does not necessarily indicate that gating overcomes strong suppression. Moreover, unguided random search often fails to identify directions that are strongly suppressed by transport but amplified by full attention, whereas spectral analysis identifies such directions directly and can be more efficient when many directions must be examined. Our contributions are summarized as follows:

• We explain why the same Transformer attention computation can amplify some representation differences while suppressing others. To understand this behavior, we decompose self-attention into three mechanisms: value transport, query gating, and key gating. We then show that query gating is constrained by the geometry of the attended representations: it can only produce changes through directions in which those representations differ.

• We develop a spectral theory to explain when attention gating can reverse the contraction caused by value transport. Our results provide a precise condition for this reversal, identify the directions where gating is strongest relative to transport contraction, and determine how severe a contraction can still be reversed. We also characterize the largest subspace in which every nonzero direction exhibits such a reversal.

• We validate our theoretical predictions across different Transformer models. Through finite-forward experiments, we verify the predicted geometric and gating mechanisms and examine how switching behavior varies across architectures and layers. We further show that spectral analysis can identify directions where gating reverses particularly severe contraction, even when these directions are difficult to discover through unguided perturbation search.