Pick a concrete input and say what the equation should give before you read the math.
Foundation reference
Logit Lens: Probing Intermediate Representations
The logit lens applies a transformer’s output layer to its intermediate hidden states. It shows the token predictions those states produce at each layer, without additional training.
Study guide
Where to start
Why can the unembedding matrix serve as a probe that needs no training, and what does that assume about how intermediate layers represent information?
How to study this pagePredict · Check · Generalize · Continue
Work through the math, then read the cited papers for the original argument.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
Use the prerequisites and related concepts at the end of the page to fill the next gap.
Why It Matters for Modern Models
- The logit lens applies a transformer’s output layer to its intermediate hidden states. It shows the token predictions those states produce at each layer, without additional training.
- In GPT-2 it showed predictions forming gradually, with intermediate layers often already close to the final answer (nostalgebraist, 2020).
- It is the starting point for trained decoders such as the tuned lens, which Belrose et al. (2023) report to be more predictive and reliable than the raw logit lens.
Questions to Think About
- Why do some layers, and some models, give meaningless tokens under the logit lens even though they carry useful information?
- What does a learned affine map per layer (the tuned lens) correct for, and why does it work better than the raw logit lens?
Core Math
The logit lens decodes an intermediate residual-stream state with the model's own output layer, as if the network ended at that layer:
where is the residual stream after layer , is the final layer normalization and is the unembedding matrix. The corresponding next-token distribution is
Following shows how the prediction forms across layers. In GPT-2, nostalgebraist (2020) found that predictions move gradually toward the final output.
Tuned lens. Belrose et al. (2023) train a separate affine map for each layer before decoding,
which corrects for intermediate layers not representing information in exactly the same basis as the final layer.