TL;DR
This paper investigates how Transformer models refine their internal representations layer-by-layer to arrive at a final prediction. By comparing intermediate states to a "bank" of possible final outcomes, the authors show that models develop an early preference for their eventual answer, but this preference is initially buried under many "competitor" alternatives that only get filtered out in the final layers through a complex, non-linear geometric process.
What Problem Does This Paper Address?
We know that Transformer language models build predictions through successive residual updates across many layers. Tools like the "Logit Lens" have shown that we can often decode the final prediction from intermediate layers. However, we still don't fully understand the mechanics of this refinement.
Specifically, the authors want to know: how selectively does an intermediate state distinguish its final representation from all other possible representations the model could have reached? Does the model move in a straight line toward the answer, or is the path more convoluted? Understanding this "geometry of inference" helps reveal how these models actually "think" through a problem across their depth.
Methods
The researchers operationalize their study using an Endpoint-Based Probe:
- Endpoint Bank: They collected a fixed set of "final" residual states (endpoints) from 1,024 different contexts.
- Competitor Sets: For any given layer, an alternative endpoint is a "competitor" if it is closer to the current state than the model's actual final state (the "own endpoint").
- Metrics: They measured both Euclidean distance (straight-line distance) and cosine distance (directional alignment).
- Geometric Modeling: They developed a high-dimensional synthetic model to disentangle the roles of vector norm (length), alignment (angle), and the overall distribution of endpoints.
- Distribution Fitting: They tested whether fitting statistical distributions (like von Mises-Fisher or Projected-Normal) to final states could predict the competition levels observed in new, unseen trajectories.
Datasets
The study evaluated six pretrained language models:
- Gemma-2B & Gemma-7B
- Qwen2.5-1.5B & Qwen2.5-7B
- Mistral-7B
- Llama-3-8B
The data consisted of 1,024 non-overlapping 256-token contexts per model sampled from the FineWeb sample-10BT dataset.
Key Insights and Ideas
- Early Preference vs. High Competition: Across all models, the "own endpoint" becomes closer than the average alternative very early in the network. However, hundreds of individual competitors remain even closer until much later. This suggests the model identifies the "neighborhood" of the answer quickly but takes many more layers to pick the specific house.
- Departures from Straight-Line Convergence: The authors proved that if a model moved in a perfectly straight line toward its answer, the set of competitors would only ever shrink. In reality, they observed new competitors entering the set at intermediate layers, proving that residual trajectories are curved and dynamic.
- The Euclidean Plateau: In models like Mistral and Llama, Euclidean distance to the answer can stay flat for many layers. During this "plateau," the model is actually making progress through directional alignment (improving cosine distance) while simultaneously changing the "scale" (norm) of the representation.
- Semantic Mapping: There is a clear link between geometry and probability. Endpoints associated with lower-ranked (less likely) tokens are physically further away in cosine distance than those associated with the top-predicted tokens.
Key Results
- Competitor Contraction: The "competitor fraction" often stays high (near 0.5) for a significant portion of the model's depth before falling by orders of magnitude in the final layers.
- Directional Specificity: Cosine competition (alignment) often resolves earlier than Euclidean competition.
- Predictive Geometry: The Projected-Normal distribution was the most accurate at predicting how many alternatives would remain competitive along a trajectory, suggesting that the "anisotropy" (uneven spread) of final states is a key feature of how Transformers organize information.
Limitations and Future Work
- Origin of Updates: While the paper describes how the geometry changes, it doesn't explain the specific mechanism or "logic" within the attention heads and MLP layers that drives these updates.
- Internal Search: The authors note that while they observe "turnover" in competitors, this doesn't necessarily prove the model is performing an explicit "internal search" or "pruning" process.
- Future Directions: The authors suggest that following these geometric populations across training checkpoints could reveal how this organization develops. They also propose that interventions (like steering the representation) near "competitor-margin crossings" could test if these geometric shifts directly cause changes in token predictions.
Summary updated