Up nextNext guide
Logit Lens and Intermediate Layer Decoding
Language AI
Technical GUIDE
The logit lens and tuned lens are interpretability techniques that peek at a transformer's hidden states layer by layer to see what the model is 'thinking' before it produces a final answer.
Listen to this guideAI-narrated · ~2 min
They reveal how a prediction gradually forms as information flows up through the network.
A transformer builds its answer incrementally: each layer adds to a running 'residual stream' that is only turned into word probabilities at the very end. The logit lens, introduced by nostalgebraist in 2020, shortcuts this by applying the model's final unembedding (and layer norm) directly to intermediate layers, so you can read out the network's best guess at every depth. This often shows the answer crystallizing in middle-to-late layers. The tuned lens (Belrose and colleagues, 2023) improves on it by training a small affine probe per layer to translate hidden states into the final basis, fixing the bias and inaccuracy the raw logit lens suffers, especially in early layers and across different model families.
Using the logit lens to watch a factual answer like a capital city emerge in a model's middle layers
Applying the tuned lens to compare how different model families converge on a prediction across depth
Detecting that a model has internally 'decided' an answer several layers before the output
Diagnosing layers where harmful or biased token predictions first become dominant in the residual stream
Lens techniques are becoming standard for tracing how facts, refusals, or biases emerge across depth, and for spotting when a model 'knows' an answer early. Expect them combined with sparse autoencoders and causal patching to move from describing predictions to explaining mechanisms. Research is also probing whether intermediate readouts reveal latent knowledge or deception a model conceals in its final output, making lenses a candidate building block for safety audits and early-warning monitoring.
Free newsletter
One short email each weekday with the three AI stories that actually matter. Free forever, no ads.
One email each weekday. Unsubscribe in one click. We never sell or share your address.
Test yourself
Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.
Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation
The logit lens and tuned lens are interpretability techniques that peek at a transformer's hidden states layer by layer to see what the model is 'thinking' before it produces a final answer. They reveal how a prediction gradually forms as information flows up through the network.
The logit lens projects intermediate residual-stream states through the existing unembedding to see the model's predicted tokens at each depth.
The tuned lens learns a per-layer linear translator, correcting biases and giving more faithful, lower-perplexity readouts than the raw logit lens.
Each layer writes additive updates to a shared residual stream, so projecting that stream early approximates an intermediate prediction.
The logit lens was introduced by nostalgebraist in a 2020 blog post analyzing GPT-2's intermediate predictions.
Readouts typically show the correct token gaining probability across middle-to-late layers as computation accumulates.
Keep learning
More guides picked for this topic
Up nextNext guide
Logit Lens and Intermediate Layer Decoding
Language AI