The Logit Lens is a mechanistic interpretability technique that applies a transformer's unembedding matrix directly to intermediate residual stream activations. By multiplying the hidden state at any layer by the output vocabulary projection, it converts internal representations into a probability distribution over the token vocabulary, revealing the model's implicit next-token predictions at that specific depth without requiring the computation to pass through subsequent layers or the final layer norm.
Glossary
Logit Lens

What is Logit Lens?
A direct probing method that decodes intermediate residual stream states into vocabulary distributions to reveal a transformer's evolving next-token predictions before the final layer norm is applied.
This method provides a window into the iterative refinement process of a transformer's predictions. Early layers often produce incoherent or low-confidence outputs, while middle and later layers progressively sharpen the distribution toward the final answer. Researchers use the Logit Lens to identify where specific capabilities—such as factual recall or syntactic agreement—emerge in the forward pass, complementing causal tracing and activation patching studies by visualizing the model's evolving beliefs.
Key Characteristics of the Logit Lens
The Logit Lens is a direct interpretability technique that applies the final unembedding matrix to intermediate residual stream states, revealing the model's evolving next-token predictions before the final layer norm is applied.
Direct Unembedding of Residual Stream
The core mechanism involves taking the residual stream activation at a specific layer and token position and multiplying it by the model's unembedding matrix (the linear map from the final hidden state to the vocabulary logits). This bypasses the final layer norm and all subsequent transformer blocks, producing a raw probability distribution over the vocabulary that represents the model's 'best guess' at that intermediate stage. The technique reveals how predictions crystallize layer by layer, often showing that the final token identity is determined surprisingly early in deep networks.
Layer-by-Layer Prediction Trajectory
By applying the Logit Lens at every transformer layer, researchers can trace the evolution of a prediction from input embedding to final output. This creates a trajectory showing how the model's confidence in the correct token increases and how competing hypotheses are pruned. Key observations include:
- Early layers often represent syntactic possibilities
- Middle layers resolve semantic ambiguity
- Final layers perform calibration and sharpening This trajectory provides a window into the model's progressive refinement process without requiring any auxiliary classifiers.
Zero-Training Interpretability
Unlike probing classifiers which require training a separate diagnostic model on extracted representations, the Logit Lens requires no additional training. It leverages the model's own pre-trained unembedding matrix, making it a lightweight and faithful tool. This eliminates the risk that a trained probe is memorizing task-specific patterns rather than reflecting the model's true internal state. The technique is immediately applicable to any pre-trained transformer with a language modeling head, including GPT, LLaMA, and Mistral architectures.
Early Convergence Phenomenon
A striking finding from Logit Lens analysis is that for many factual and straightforward prompts, the model's final prediction is locked in at 30-50% of the network's depth. The remaining layers often serve to increase confidence or refine the output distribution rather than change the top prediction. This has profound implications for early exiting and speculative decoding—if the prediction stabilizes early, computation in later layers could theoretically be skipped, reducing inference latency without sacrificing accuracy.
Contrast with the Tuned Lens
The standard Logit Lens suffers from a distributional mismatch: intermediate residual stream states are not optimized to be directly unembedded by the final matrix. The Tuned Lens addresses this by learning a separate affine transformation (a learned linear map and bias) for each layer to translate its residual stream into a form the unembedding matrix can interpret. This improves prediction accuracy at early layers but sacrifices the Logit Lens's key advantage of requiring no training. The choice between them depends on whether fidelity or zero-shot applicability is prioritized.
Circuit Validation and Ablation Studies
The Logit Lens is a critical tool in mechanistic interpretability workflows for validating hypothesized circuits. After identifying a circuit component (e.g., an attention head or MLP neuron) through causal tracing, researchers can ablate that component and use the Logit Lens to observe how the prediction trajectory changes across all layers. This reveals whether the component's contribution is direct (immediate effect on the logit lens output) or indirect (mediated through later layers). It helps distinguish necessary computational steps from redundant or backup pathways.
Frequently Asked Questions
Direct answers to the most common technical questions about applying the unembedding matrix to intermediate residual stream states for early next-token prediction.
A Logit Lens is a direct probing technique that applies the model's final unembedding matrix (the lm_head) to intermediate states in the residual stream to decode the model's current next-token prediction before the final layer norm and output projection are applied. Instead of waiting for the computation to flow through all remaining layers, you take the hidden state vector at a specific layer L and token position T, multiply it by the unembedding matrix W_U, and apply a softmax to obtain a probability distribution over the vocabulary. This reveals the model's 'best guess' at that intermediate stage. The technique works because the residual stream is a linear accumulation of all previous layer outputs, and the unembedding matrix acts as a linear map from representation space to vocabulary space. By probing at every layer, you can trace how the model's prediction evolves token-by-token through the depth of the network, often revealing that the final token identity is decided surprisingly early in the forward pass.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Logit Lens vs. Other Probing Techniques
A comparison of Logit Lens with alternative methods for extracting interpretable signals from transformer internal representations.
| Feature | Logit Lens | Linear Probing | Sparse Autoencoder (SAE) | Activation Patching |
|---|---|---|---|---|
Requires training a classifier | ||||
Directly decodes vocabulary tokens | ||||
Causal intervention method | ||||
Captures polysemantic features | ||||
Computational overhead | Minimal | Moderate | High | Moderate |
Granularity of interpretation | Layer-level token predictions | Task-specific feature presence | Monosemantic feature decomposition | Circuit component identification |
Typical use case | Tracking prediction evolution across layers | Detecting encoded linguistic properties | Decomposing activations into interpretable features | Isolating causal circuits for specific behaviors |
Related Terms
Core concepts for understanding how the Logit Lens decodes a transformer's evolving predictions by directly reading from the residual stream.
Residual Stream
The primary information highway that the Logit Lens reads from. Each transformer layer performs a read-modify-write operation on this accumulating state. The Logit Lens applies the unembedding matrix directly to this stream at any layer to project it into vocabulary space, revealing the model's intermediate predictions before the final layer norm is applied. This bypasses the final normalization step to show raw, evolving beliefs.
Unembedding Matrix
The linear transformation that maps the model's hidden dimension back to the vocabulary size. In a Logit Lens, this matrix is applied directly to intermediate residual stream states. It is the transpose of the embedding matrix in models with weight tying. This operation converts a high-dimensional vector into a probability distribution over tokens, showing what the model would predict if it stopped at that layer.
Circuit Analysis
The process of identifying the minimal subgraph of a network responsible for a behavior. The Logit Lens is a key diagnostic tool in this workflow. By tracking how predictions evolve layer-by-layer, researchers can isolate which attention heads and MLP layers contribute to a specific output. For example, a sudden jump in prediction accuracy at a specific layer indicates the circuit component that computes that feature has just written to the stream.
Layer Norm Bypass
A critical technical detail of the Logit Lens technique. The standard forward pass applies a final layer normalization before the unembedding matrix. The Logit Lens applies the unembedding directly to the pre-norm residual stream state. This is necessary because the final norm's scale and shift parameters are optimized for the last layer's distribution, and applying them to intermediate states would distort the signal, making early-layer logits uninterpretable.
Early Exit Inference
A related architectural concept where a model is trained with multiple output heads attached to intermediate layers. The Logit Lens provides a post-hoc analysis of this capability without any training. By examining the logits at each layer, one can determine the earliest point at which the model converges on the correct answer, revealing the computational depth required for different types of queries—from simple syntax to complex reasoning.
Activation Patching
A causal intervention technique often paired with Logit Lens analysis. After identifying a layer where a specific prediction crystallizes, researchers can replace that layer's activation with a cached version from a corrupted prompt. If the Logit Lens shows the prediction reverting, it confirms the causal role of that layer. This combination of probing and patching validates that the observed representations are actually used by the model.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us