Manuscript Offprint

arXiv:2608.30720

Tracing distinguishability through transformer processing with stochastic LayerNorm

Kieran Murphy

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

ABSTRACT

Representational similarity is foundational to analyses of deep networks, yet distances between point-valued representations are not intrinsically tied to downstream function: nearby states may produce different behaviors, while distant states may behave similarly. We instead give representations volume, turning similarity into statistical distinguishability. Overlapping stochastic representations necessarily induce overlapping downstream distributions, grounding latent comparison in model function and bringing it under information-theoretic tools such as the data-processing inequality. We realize this idea in pretrained transformers through a light-touch modification to LayerNorm: at each residual-stream read, we normalize the state, add isotropic Gaussian noise, and renormalize. During distillation fine-tuning, one learned allocation parameter per residual-stream read distributes a fixed global rate budget across the processing stack. The resulting model can be viewed as transformer blocks reading the residual stream with learned finite precision under a shared global rate budget. Using the Bhattacharyya coefficient, we trace which counterfactual distinctions are preserved through MLP blocks or selectively exposed to the query, key, and value computations of individual attention heads. Experiments on ViT-S and GPT-2 small reveal the depth-wise propagation of continuous visual perturbations and head-specific sensitivity to token distinctions aligned with known attention motifs. These results establish distinguishability as a functionally grounded lens on transformer computation that complements existing interpretability approaches.

1 INTRODUCTION

Deep networks are ordinarily trained on point-valued representations: each example constrains the computation at a measure-zero set of internal states, while behavior in the surrounding representational volume is left implicit. Many interpretability methods impose geometric notions of similarity on point-valued representations – for example, through pairwise similarity measures (Kornblith et al., 2019) or the reconstruction distortion used to fit sparse surrogate models (Huben et al., 2024; Bricken et al., 2023) – even though this geometry is not directly grounded by the model's functional objective. The disconnect between geometry and functionality when assessing point-based representations has been increasingly recognized in recent years (Ding et al., 2021; Cui et al., 2022; Davari et al., 2023).

When point-valued representations are replaced by stochastic ones, they acquire volume: behavior over neighborhoods of internal states becomes part of the training objective, coupling representational geometry to model functionality. The resulting stochastic representations define explicit channels through which quantities such as information transmission and pairwise distinguishability can be measured. Without a constraint on representation scale, however, a model can trivially overcome stochasticity by increasing the separation of its representations, recovering an effectively deterministic channel. Prior approaches therefore impose explicit capacity constraints, often through learned encoder-decoder bottlenecks (Kingma & Welling, 2014; Alemi et al., 2017; Murphy, 2026). Doing so at many internal locations requires substantial architectural modification.

a

Figure

b

Total rate B (nats)

Total rate B (nats)

Perplexity

Block depth

Figure 1: Injecting stochasticity into residual stream reads. (a) We add noise to every location in the network where the residual stream is read. The noise is injected inside the LayerNorm operation, which maps representations to the surface of a hypersphere. (b) For fine-tuned ViT-S (top) and GPT-2 small (bottom), the imposed read rate B sets the distillation loss relative to the base (deterministic) model, DKL(teacher∣∣student)D_{\mathrm{KL}}(\text{teacher}||\text{student}), as well as the modality-specific validation performance. (c) Per-tap rates provide a macroscopic view of prioritized information protection. For each attention block and MLP block, and for the final read before the unembed operation, a single σ\sigma is learned during optimization while fine-tuning all model weights.

Here, we propose a light-touch modification to transformer architectures that exploits the intrinsic scale constraint imposed by LayerNorm (Ba et al., 2016). Additive noise is applied to every LayerNorm in a transformer, before the learned affine scale and shift, with one optimized magnitude per location such that only ∼2L\sim 2L additional scalar parameters are introduced. In pre-norm transformers, each modification can be interpreted as a noisy read of the residual stream (Elhage et al., 2021): every attention and MLP block pays for measurement precision when accessing the representation carried by the residual stream.

Prior bottleneck approaches interpret useful computation upward from a low-information limit (Murphy, 2026). Here, we begin from a pretrained deterministic solution and move toward lower-fidelity internal channels, jointly adapting the model so that stochastic neighborhoods become part of the learned computation. Because the model weights are optimized jointly with the stochastic channels, the resulting neighborhoods are not merely tolerated by the pretrained computation; they are incorporated into the computation itself.

In experiments on ViT-S and GPT2-small, we use the fine-tuned models as approximations to the pre-trained base that allow information-theoretic tools to be applied natively. In the vision modality, we measure the models' ability to resolve different types of image augmentation, of varying magnitudes, across depths and bitrates. In natural language, we design minimal perturbations and measure the propagation of distinguishability in subsequent residual streams. We measure the degree of perturbation distinguishability accessed by each attention head's query, key, and value projections. Interestingly, the heads with the most sensitive key projections include several with high induction scores, as well as heads whose selectivity is weak or absent in canonical attention-pattern statistics. Monitoring perturbation distinguishability at every residual stream read thus grants a foothold into information processing by transformers that is grounded in downstream functionality, complementing existing methodology founded upon the geometry of point-based representations in ambient space.

References (32)

  • Deep variational information bottleneck
  • A general class of coefficients of divergence of one distribution from another
  • Layer Normalization
  • Towards monosemanticity: Decomposing language models with dictionary learning
  • Elements of information theory, volume 1
  • Deconfounded representation similarity for comparison of neural networks
  • Reliability of CKA as a similarity measure in deep learning
  • Hyperspherical variational auto-encoders (opens arXiv in a new tab)
  • Imagenet: A large-scale hierarchical image database
  • Grounding representation similarity through statistical testing
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • A mathematical framework for transformer circuits
  • Some guidelines and guarantees for common random numbers
  • Openwebtext corpus
  • Sparse autoencoders find highly interpretable features in language models
  • Auto-encoding variational Bayes
  • Similarity of neural network representations revisited
  • Directional statistics
  • Kieran A Murphy. From independent patches to coordinated attention: Controlling information flow in vision transformers. arXiv preprint arXiv:2602.04784, 2026. URL https://arxiv.org/abs/2602.04784. (opens arXiv in a new tab)
  • In-context learning and induction heads
  • Language models are unsupervised multitask learners
  • The information bottleneck method (opens arXiv in a new tab)
  • Interpretability in the wild: a circuit for indirect object identification in GPT-2 small
  • Because a LayerNorm output has zero mean and unit RMS, each read lives on the sphere $\mathcal{S}^{D-2}$ inside the mean-zero hyperplane of $\mathbb{R}^D$
  • This matching is what makes the channel reparameterisation-clean: gradients flow to both the weights and the rate allocation with no rejection sampler in the loop
  • This is converted to $\kappa_g$, then to a per-tap rate, and the total budget is fixed at $B = n \cdot \text{rate}(\kappa_g)$ over the $n$ taps; the network learns only how to spend it, via unconstrained logits $a$ passed through a softmax
  • the distillation KL alone drives a water-filling allocation
  • Choose an orthonormal basis $E \in \mathbb{R}^{d \times p}$ for $\mathcal{H}$
  • The resulting matrix has full row rank; we continue to denote it by $B_A$ and let $m$ denote its output dimension
  • Writing $W_A = P_A X$, we have $Y_A - b_A = S_A W_A$
  • Their projected BC is
  • Importance sampling then gives