The Geometry of Position in a Transformer
RoPE gives transformers an explicit geometric representation of relative position inside attention. Each two-dimensional query/key plane rotates with a fixed frequency ,
But RoPE is applied to queries and keys, not written directly into the residual stream. After attention, value mixing, residual additions, and MLPs, what notion of position remains, and how does it evolve as it passes through the layers of the transformer?
We studied exactly this in Qwen2.5-3B. The code is on GitHub.
For a given phrase , layer , base position , and displacement , define
and average over a set of phrases,
We use 20 short matched phrases and move them over
To avoid confounds from the additional context, filler tokens between the two locations are masked from the moved phrase's attention. The phrase nevertheless remains at its true later token index, so RoPE is still evaluated at . The resulting map
gives an empirical geometry of implicit position inside the residual stream.
Displacing Tokens by Δ
For fixed , positional displacement is highly consistent across phrase content through much of the model. Under the matched-context intervention, pairwise cosine similarity between displacement vectors from different phrases is often above . Thus, to first order,
From this, we vary to see what structure, if any, emerges. We chose an arbitrary middle layer, layer 15, and computed the cosine Gram matrix
which shows repeated blocks and cross-like patterns across multiple positional scales.

The layer-15 cosine Gram matrix over displacements: clearly non-random, with repeated blocks and cross-like structure across multiple positional scales.
This geometry is clearly not random and very visibly multiscale.
Qwen's Inherent Frequencies
Qwen2.5-3B uses 64 RoPE frequencies,
Therefore a natural coordinate system for describing a displacement by is
We ask whether the residual position vector is approximately a linear image of this known architectural trajectory:
Over a ~500 token window, the 128 RoPE features are not all distinguishable. For small ,
so many low-frequency coordinates become numerically redundant. The singular spectrum of the RoPE design matrix has a sharp cutoff at approximately .

Singular spectrum of the RoPE design matrix over the finite window. It falls off a cliff after roughly 42 directions: low frequencies collapse into numerical redundancy, leaving usable coordinates.
Using only these 42 numerically supported directions, fitting on 80% of the sampled displacements and evaluating on held-out gives
The corresponding relative errors are for the vectors and for the Gram matrix. Therefore the model captures the geometry much better than the exact amplitudes.

Held-out displacements: the empirical Gram matrix (left) versus its reconstruction from a linear image of Qwen's RoPE coordinates (right). The geometry is recovered well even where the exact amplitudes are not.
This is stronger than simply observing similar Fourier peaks: much of the held-out residual positional trajectory can be reconstructed from a linear mixture of Qwen's actual RoPE coordinates.
The frequency specificity is real but modest. Across 20 controls formed by perturbing each Qwen frequency multiplicatively in log-space, the mean held-out vector cosine was , with a maximum of , compared with for the exact Qwen ladder. Thus the result is best stated as:
Residual position is strongly Fourier/RoPE-like, with additional specificity to Qwen's exact frequencies.
A nearby Fourier basis can explain much of the same finite-window trajectory.
What About Depth?
For each layer, collect all positional vectors into
The cosine geometry of changes sharply in the first few layers, then becomes remarkably stable through most of the network.

Centered geometry correlation between layers. After the first few layers the intrinsic positional geometry is remarkably stable (the large bright block).
At the same time, the vectors themselves do not remain fixed in residual coordinates. Their orientation steadily changes with depth, while their norms grow substantially toward the final layers.

Same- residual-space cosine between layers. The bright diagonal band shows the manifold's orientation drifting steadily with depth rather than staying fixed.
This suggests that the positional manifold is being transported through residual space. A first model is scaled orthogonal transport,
This works surprisingly well for most adjacent layers, but it is not sufficient. A general linear map performs substantially better:
To test this without interpolating the sampled positions, we construct a rank-42 shared basis using only training values of , fit on 80% of displacements, and evaluate on the remaining 20%. For most middle layers, held-out error inside this subspace is only 0.4% to 1.5%. When mapped back into the full 2048-dimensional residual space, errors are about 3% to 4%.
Most of this full-space error is simply the rank-42 projection floor. For example,
and likewise
The linear map accounts for almost all predictable evolution of the resolved positional manifold. There are, however, several genuine reorganization points. The strongest is , where full-space prediction error rises to approximately despite a projection error of only .

Held-out transport error per layer: a general linear map (orange) tracks the manifold's evolution far better than scaled-orthogonal transport (blue), and the 3→4 spike marks a genuine reorganization.
The dominant depth dynamics are therefore not only rotation and uniform scaling. Writing the polar decomposition
the orthogonal factor changes orientation, while the positive-semidefinite factor selectively stretches and contracts positional directions. The implicit representation of position is approximately linearly transported, but anisotropically.
Conclusion
Across token displacement,
the residual stream contains a multiscale positional manifold strongly related to the model's RoPE coordinates:
Across network depth,
that manifold is transformed approximately linearly:
So an implicit position vector is neither a fixed vector added to the residual stream nor simply the original RoPE rotation copied downstream. Instead, position appears as a structured low-dimensional manifold whose oscillatory geometry is inherited from RoPE and whose embedding is progressively rotated, stretched, and occasionally reorganized as computation moves through the transformer. The object is naturally
RoPE determines much of its geometry along ; the transformer supplies an approximately linear evolution along .