arXiv:2609.37824cs.CLSep 2026

Manuscript Offprint

arXiv:2609.37824

The Geometry of Inference in Transformer Residual Streams

Timur Mudarisov, Mikhail Burtsev, Radu State

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

Abstract

Transformer language models build predictions through successive residual updates, but how their representations become specific to an eventual outcome remains unclear. We study this process by comparing intermediate residual states with their own final states and an empirical bank of final states from other contexts. Across six pretrained language models, the own endpoint becomes preferable to the average alternative early, while many individual endpoints remain closer. These competing sets generally shrink with depth, but their membership changes and their surviving endpoints need not become more similar to one another. Directional alignment and endpoint rank can therefore improve while Euclidean distance to the final state changes little. We develop a simple high-dimensional model that separates the roles of norm, alignment, and endpoint geometry, showing how gradual directional changes can produce sharp reductions in competition. We also prove that a straight path toward the own endpoint cannot introduce new competitors under either Euclidean or cosine distance; observed entries thus establish departures from straight-line convergence. Finally, endpoints associated with lower-ranked output tokens tend to lie farther away in cosine distance across all studied models, connecting residual geometry to output organization. Together, these findings characterize increasing geometric specificity during transformer inference and explain why distance, competitor count, and concentration of the surviving endpoints provide distinct views of that process.

1 Introduction

Transformer language models build next-token predictions through successive residual updates. Prediction lenses show that information about eventual token predictions can often be decoded from intermediate states [Belrose et al., 2023, Ali et al., 2025], and studies of final representations identify output-related geometric structure [Park et al., 2025]. These findings leave open how selectively an intermediate state distinguishes the final representation reached by its context from alternatives, and how these distinctions evolve across depth.

We formulate the geometric inference hypothesis that intermediate residual states express partial distinctions among possible final states and that residual updates refine those distinctions through changes in relative geometry (Figure 1). We operationalize this hypothesis using a fixed bank of residual endpoints, the final measured residual states of sampled contexts. Each trajectory has an own endpoint, and an alternative endpoint is a competitor whenever it is closer to the current state than the own endpoint. The bank preserves contextual variation among final states, including states with the same top predicted token. Our contributions are as follows:

  1. Across six pretrained models, we relate cosine endpoint distance to output-token rank and show that early average preference for the own endpoint coexists with many closer alternatives. Cosine competitor sets exhibit entries as well as exits over depths where their mean size declines, indicating

Preprint.

(a) Geometry across depth

Figure

(b) Distances to every endpoint

(c) Geometric resolution

Figure 1: Geometry of inference in residual streams. (a) Three intermediate states along a residual trajectory and an anisotropic bank of endpoints from other contexts. At layer ℓ\ell, alternatives closer to xℓ,ix_{\ell,i} than the own endpoint yiy_i form the competitor set Cℓ,i\mathcal{C}_{\ell,i}. The competitor region is a ball under Euclidean distance and a spherical cap of directions under cosine distance. (b) Distance to the own endpoint (blue), individual alternatives (gray, with competitors at ℓ3\ell_3 highlighted in orange), and the mean alternative distance (dashed orange). The own endpoint is closer than the mean alternative from early depths ( Δℓ,i>0\Delta_{\ell,i} > 0), while individual competitors remain. (c) The competitor fraction Aℓ,iA_{\ell,i} remains significant after mean preference appears, then falls by orders of magnitude. Dotted lines in (b) and (c) mark the three states shown in (a). All panels use a synthetic three-dimensional model.

that refinement can revise earlier endpoint comparisons.

  1. We relate expected competitor counts to endpoint probability mass and show how gradual alignment can sharply reduce competition during a plateau in Euclidean distance. We also prove that monotone straight-line convergence yields nested competitor sets under Euclidean and cosine distance, so observed entries establish departures from this baseline.

  2. We show that structured endpoint distributions fitted only to final states can predict mean competition along held-out trajectories more accurately than a uniform-sphere baseline.