AIFeed

Gemma-4 strongly privileges the coordinate basis

Summary

TL;DR: Gemma-4-31B has a strongly privileged basis, and it is conveniently the coordinate basis. I believe many researchers already understand that the residual stream is highly structured, though I haven't seen illustrations showing significant preference for coordinates across the whole residual stream [1] . This is a very brief post that shows illustrates that a counterexample to the residual stream being largely rotation invariant. I briefly sketch an argument for why this privileged basis might emerge in Gemma. It is commonly suggested that the residual stream's basis is arbitrary. A simplification of the argument makes roughly these moves: Every block reads from the stream through a matrix and writes back through a matrix . We could rotate the stream by an arbitrary orthogonal matrix and rotate each read matrix by and write matrix by . This results in an exact functional copy of the original model but with the residual stream rotated As a result, the model could have chosen any r…

Original text(via LessWrong)
TL;DR: Gemma-4-31B has a strongly privileged basis, and it is conveniently the coordinate basis. I believe many researchers already understand that the residual stream is highly structured, though I haven't seen illustrations showing significant preference for coordinates across the whole residual stream[1]. This is a very brief post that shows illustrates that a counterexample to the residual stream being largely rotation invariant. I briefly sketch an argument for why this privileged basis might emerge in Gemma.

It is commonly suggested that the residual stream's basis is arbitrary. A simplification of the argument makes roughly these moves:

  • Every block reads from the stream through a matrix and writes back through a matrix .
  • We could rotate the stream by an arbitrary orthogonal matrix and rotate each read matrix by and write matrix by . This results in an exact functional copy of the original model but with the residual stream rotated
  • As a result, the model could have chosen any rotated version of its basis. Each would result in the same model, so none is privileged over others.

You may already see the clear issue with this argument: functional equivalence is not the same as training equivalence. A simple case of this is that composition of linear operations is another linear operation. Thus deep linear nets are functionally equivalent to a single linear operation, but nonetheless they have different training dynamics.

First, let us check whether Gemma uses coordinates as a privileged basis. (Aside: for the work below, I've removed the ~50 outlier coordinates so that we can focus on the ways the coordinates are preferred beyond the small set of outlier coordinates).

How do we know if coordinates are privileged?

If coordinates are not privileged, then basis vectors are as good a basis as a random one. This implies that coordinate of the residual stream acts like a stream projected onto a random unit vector . I'll call a random probe.

Random probes in high dimensions are all alike. A random unit vector in 5,000 dimensional space has a small piece of every direction in it, so a probe is an average over everything the stream is doing. Any statistic of a probe (how large it is, how long it keeps its value across layers, how heavy its tails are) comes out nearly the same for every probe.

For the size of a probe we can say exactly how alike. If the stream has covariance with eigenvalues , then

where is the squared component of along the -th principal direction. The are all close to , so every probe has close to the average variance. The relative spread is roughly , where counts how many directions the variance is spread over.

This gives us a concrete way to test whether a rotated basis is preferred-- we measure whether acts like a random probe with the predicted variance statistics (or, equivalently, whether acts like a random probe after rotating by some matrix .)

To check that this actually makes sense, let's see how closely our predictions apply to a randomly rotated basis. I take the residual stream at the input of a block over ~250,000 token positions of web text, rotate it by one fixed random rotation, and measure the standard deviation of each of the coordinates. Predictions in black, with the empirically measured values in orange.

Orange: the standard deviation of each direction of a randomly rotated basis, at the input of four blocks. Black: the random-probe prediction, computed from the eigenvalues of the covariance alone. The x-axis is in multiples of the SD that all probes would share if they were identical. Note how narrow the axis is.

The black curve is not fitted to the orange histogram. It only knows the eigenvalues, and it still gets the centre, the width and even the slightly lopsided shape. So for a basis that really is arbitrary, the test passes: 99% of the rotated directions land in the range predicted to hold 99% of them.

Coordinate basis is far from random

Now the same plot for Gemma's actual coordinates, at the same four blocks.

Blue: the standard deviation of each of Gemma's coordinates. Orange and black: a rotated basis and the prediction, as in the previous figure. They are now a thin spike at 1, cut off where it is much taller than the blue. As before, sizes are in multiples of the size all random probes would share (the root-mean-square SD over the coordinates). The "predicted range" is the range that should hold 99% of random probes. Top: all coordinates. Bottom: the same test after throwing away the largest 10% and the smallest 10% of coordinates, with sizes measured relative to what is left.

If the coordinates were arbitrary, essentially all of them would sit inside the spike at 1. In these four blocks, only between 5% and 17% of them are. In a rotated basis the 95th percentile direction is at most 1.3x as large as the 5th percentile one, whereas for Gemma's coordinates that ratio is anywhere from 5x to 200x.

Notably, the overall shape is very different from a Gaussian shape we would expect from random probes. In the middle blocks, it is bi-modal, heavy tailed, and very far from uniform.

A sketch of how this might happen

Here I give a hypotheses/sketch for why Gemma might end up with the coordinate basis as privileged.

Recall the hole in the rotation argument: functional equivalence is not training equivalence. The block that reads the residual stream applies first, and then a matrix and . One striking observation we can empirically find is that nearly all scale difference in the residual stream is absorbed by . Scale is arbitrary here-- we could always scale up by and then scale down by . Nonetheless, all scale seems to live in . is shown in blue and the norm of (or on the write side) is shown in grey. If the dense matricies or had taken on account for scale, they would have a negative slope that adjusts for the input coordinates size. Instead, their value sits near while varies over multiple OOMs.

image.png
image.png

One dot per coordinate, at four blocks. Across: how large the coordinate is in the stream. Top: the MLP's input gain on that coordinate (blue), and the length of its column of the dense matrix . Bottom: the MLP's output gain (orange), and the length of its row of . Each is divided by its median. Dashed: a gain proportional to 1/size (top) or to size (bottom).

The input gain equalizes the scale, and then the dense matrix is nearly perfectly flat in its scale. This is unlikely to be accidental-- there must be some feature that encourages scale to live in the gain rather than in the dense matrices. I do not have a full account here, though I do have some hypotheses, which I sketch below.

Why would training prefer the gain? Considering the gradient

The right-hand side is the part of the matrix's gradient that asks for column to be rescaled, and the equation says that the gain receives exactly that. So both hear the same request. The difference is how clearly they hear it. Each of the tens of thousands of weights in the column gets one small piece of it, buried under the gradient for everything else that weight does, which is noisy and complex. The gain gets all of the pieces added together.

We can check that this is enough in a toy model. The inputs have sizes from 0.001 to 1, the model is , and the task can be fit equally well with any split of the scale between and column .

image.png
image.png

With exact gradients the scale is shared between the gain and the matrix. But with noisy gradients most of it goes to the gain, and more of it the more weights a column has. An alternative or additional feature may be weight decay, which is often applied to the dense coordinates but not to the learned gain. In either case, noise gradients + weight decay + Adam is enough to produce most of this behaviors.

This suggests the following story:

  • The models want the data coming into MLP blocks to be isotropic. This probably works best with superposition and other noise constraints the model works with (or perhaps something like weight decay?)
  • Models have reason to keep objects in the residual stream a at different size. This creates anisotropy in the residual stream that must be adjusted for somewhere.
  • Gradients are encouraged to place scale adjustment information in the diagonal scale. This seems to be because noisy gradients mean LayerNorm matrices receive gradient updates more directly about scale adjustments. Because scale adjustments live in the diagonal, information becomes coordinate aligned.
  • ^A small number of very large coordinates are well known in many models (Kovaleva et al. 2021, BERT Busters: Outlier Dimensions that Disrupt Transformers; Timkey & van Schijndel 2021, All Bark and No Bite: Rogue Dimensions in Transformer Language Models Obscure Representational Quality; Sun et al. 2024, Massive Activations in Large Language Models). Elhage, Lasenby & Olah 2023, Privileged Bases in the Transformer Residual Stream, show that such outlier values make the residual stream basis-aligned in models they trained. I don't count these outlier coordinates as a 'significant preference' for coordinates, since it involves only a small number of them. Gemma has its own (~50), and they are removed from everything here.

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by LessWrong
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗