The logit lens is an interpretability method that projects an intermediate transformer representation through the model’s final normalization and unembedding to ask what vocabulary prediction that hidden state already supports. It turns a residual-stream vector into a familiar language: token logits.
In large language models, the logit lens is used to inspect how predictions evolve across layers, where candidate answers become readable, how residual updates change token preferences, and whether intermediate states already align with the final output vocabulary. It is a readout technique, not proof that the model explicitly performs an intermediate softmax at every layer.
This Cognitive Art owner explains residual streams, unembedding matrices, normalization, layerwise logits, rank trajectories, answer emergence, direct logit effects, calibration mismatch, tuned-lens motivation, causal limits and token-position choice.
1. The basic operation
Take intermediate residual state h, apply the appropriate final normalization, then multiply by the unembedding matrix to obtain vocabulary logits.
2. Why vocabulary space helps
Vocabulary logits give humans a familiar semantic coordinate system instead of thousands of hidden dimensions.
3. Residual streams accumulate computation
Attention and MLP blocks add updates into the residual stream, so layerwise lens trajectories show how output alignment evolves.
4. Readable is not explicitly predicted
An intermediate vector can align with the unembedding even if later layers will transform it substantially. The lens reveals output-aligned information, not necessarily a native intermediate prediction.
5. Normalization matters
Using the wrong normalization can distort logits. Reproduce the architecture’s actual final normalization convention.
6. Token position matters
Final prompt token, subject token and earlier positions answer different representational questions.
7. Rank trajectories
Track target-token logit or rank across layers to identify candidate stages where an answer becomes output-aligned.
8. Direct logit attribution
Individual residual updates can be projected through the unembedding to estimate direct alignment with output tokens, but indirect downstream effects remain separate.
9. Calibration mismatch
Earlier layers were not necessarily optimized to inhabit the exact coordinate distribution expected by the final unembedding. Poor early decoding can reflect basis mismatch.
10. Tuned-lens boundary
A learned translator can correct layer-specific mismatch. The separate Tuned Lens owner handles that calibrated method.
11. Linear-probe boundary
A linear probe learns a new task readout. The logit lens uses the model’s own fixed vocabulary readout, which is more constrained but tests a narrower form of information.
12. Causal boundary
Use Activation Patching when the claim changes from readable intermediate prediction to causal contribution.
13. Failure signatures
Intermediate-softmax mythology, normalization errors, layer cherry-picking, readability-use confusion and treating poor early decoding as absence of information are the main failures.
14. Evaluation blueprint
Declare layer and position, reproduce normalization, compute full vocabulary logits, track predeclared targets and competitors, compare with calibrated readouts, then validate candidate stages with interventions.
World Return
The logit lens is strongest as a microscope for output alignment: it shows when a hidden state begins to speak the model’s vocabulary while keeping separate the harder question of how that state was computed and used.
