The Geometry of Inference in Transformer Residual Streams

Timur Mudarisov, Mikhail Burtsev, Radu State

University of Luxembourg · London Institute for Mathematical Sciences

Published September 29, 2026 · on the feed October 1, 2026 · ▲ 2 · arXiv 2609.37824

Other No code arXiv ↗Hugging Face ↗

The 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.

The Brief

2:30

A short podcast summary of the paper. Written and voiced by AI.

Transcript

The Geometry of Inference in Transformer Residual Streams. By Timur Mudarisov and two others, from the University of Luxembourg and the London Institute for Mathematical Sciences. Published on the twenty-ninth of September. No code repository is linked to it.

A transformer language model builds its prediction through a series of residual updates. How its representation becomes specific to one eventual outcome has remained unclear. The approach here compares each intermediate residual state with two things: its own final state, and an empirical bank of final states taken from other contexts. One asks whether the state is heading toward where it will actually end up. The other asks how many places it could still plausibly be heading instead. The central claim is that specificity grows in a way that a single distance cannot capture. Distance, the number of competing endpoints, and how concentrated the surviving endpoints are each give a distinct view of the process.

Across six pretrained language models, a state's own endpoint becomes preferable to the average alternative early on, while many individual alternative endpoints remain closer. Those competing sets generally shrink with depth. Their membership changes, though, and the endpoints that survive need not grow more similar to one another. So directional alignment and the rank of the true endpoint can improve while the Euclidean distance to the final state barely changes. The state can be pointing more clearly at its destination without getting much nearer to it.

Two formal pieces support this. A simple high-dimensional model separates the roles of norm, alignment and endpoint geometry, and shows how gradual changes in direction can produce sharp drops in competition. A proof shows that a straight path toward a state's own endpoint cannot introduce new competitors, under either Euclidean or cosine distance. When new competitors are observed entering, the path has therefore departed from straight-line convergence. Finally, endpoints tied to lower-ranked output tokens tend to lie farther away in cosine distance in every model studied, linking residual geometry to how outputs are organized.

The empirical results come from six pretrained models, and the comparison bank is built from final states of other contexts, so competition is measured against that bank. The high-dimensional model is described as simple, and the straight-path result is a statement about what a straight path cannot do, which is what makes observed new competitors informative.

Watching only the distance to the final answer would suggest little is happening across many layers. Counting competitors and checking direction tell a different story, one of sharpening specificity, and the authors give both the measurements and the geometry to explain why the views disagree.

Paper Quest · 7 chapters · about 39 min

Play this paper

Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.

Chapter 1 🧩 · The problem

A model's middle layers already hint at its answer. The question is how sharply they point.

You can already decode hints of a language model's final prediction from its middle layers. But a hint being there doesn't tell you how selectively a middle state points at where it will actually end up.

The road ahead

  1. 1 · The problem ~6 min Middle layers already hint at a model's final prediction, but prior work leaves open how selectively a middle state points at its own ending.
  2. 2 · What came before ~3 min
  3. 3 · The key idea ~8 min Judge a middle state against its own final state and a bank of other final states, and count how many alternatives sit closer.
  4. 4 · Choose your own research ~3 min
  5. 5 · Build the method ~8 min Build a bank of other contexts' final states, compare each middle state with its own final state, then count the alternatives that beat it.
  6. 6 · The experiment ~6 min You’ll guess: As a middle state's direction and endpoint rank improve with depth, what happens to its Euclidean distance to the final state?
  7. 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Join free to play the whole quest ›

Free, with Google or an email address. Your stars and progress are kept.

KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.