The Tuned Lens is a mechanistic interpretability technique that refines the logit lens by learning a distinct affine transformation (a linear map plus bias) for each transformer layer's residual stream. Instead of directly applying the final unembedding matrix to intermediate states, it trains these transformations to minimize prediction error, producing more faithful decoded next-token distributions.
Glossary
Tuned Lens

What is Tuned Lens?
An improvement on the logit lens that learns an affine transformation for each layer's residual stream to produce more accurate decoded next-token predictions.
By correcting for the systematic distortion introduced when early-layer representations are forced through the final unembedding matrix, the Tuned Lens provides a clearer window into a model's evolving beliefs. This enables researchers to trace how predictions sharpen across layers with greater fidelity than the logit lens, aiding circuit analysis and causal tracing.
Key Features of the Tuned Lens
The Tuned Lens refines the Logit Lens technique by learning an optimal affine transformation for each layer's residual stream, producing significantly more accurate decoded next-token predictions for reverse-engineering transformer computations.
Affine Transformation
Unlike the Logit Lens which applies the unembedding matrix directly, the Tuned Lens learns a distinct linear map (a weight matrix) and a bias vector for each layer. This affine transformation corrects for the systematic distortion introduced by interpreting intermediate residual stream states through the final unembedding matrix, which was optimized only for the final layer. The result is a layer-specific decoder that produces sharply more accurate probability distributions over the vocabulary.
Distillation-Based Training
The Tuned Lens is trained via a distillation procedure that requires no labeled data. For each layer, a decoder is optimized to minimize the KL divergence between its output distribution and the model's final softmax distribution on a corpus of text. This forces the learned transformation to extract the maximum predictive signal from the intermediate representation, effectively distilling the final layer's knowledge backward through the network.
Causal Fidelity
A core advantage of the Tuned Lens is its causal interpretability. Because it reads from the residual stream without modifying it, the technique does not interfere with the model's forward pass. This allows researchers to trace how a prediction evolves layer by layer without altering the computation itself, unlike activation patching or ablation methods that are inherently interventional.
Logit Lens Comparison
The original Logit Lens suffers from representation drift: early layers encode information in directions misaligned with the unembedding matrix, yielding noisy or uniform token predictions. The Tuned Lens corrects this by learning a rotation and scaling of the residual stream at each layer. Empirically, the Tuned Lens achieves dramatically lower perplexity on decoded predictions, especially in early and middle layers, revealing that the model converges on its final answer much earlier than the Logit Lens suggests.
Layer Prediction Trajectory
By applying the Tuned Lens at every transformer layer, researchers obtain a prediction trajectory showing how the model's top-1 token prediction evolves from input to output. Key observations include:
- Early convergence: Correct answers often dominate by 30-50% of network depth
- Sudden shifts: Abrupt changes in predicted tokens reveal specific layers where critical computation occurs
- Confidence calibration: The trajectory shows how probability mass concentrates on the final answer
Limitations and Bias
The Tuned Lens has notable constraints. It only decodes the linear extractable information from the residual stream; non-linear transformations or information distributed across multiple layers may be invisible. Additionally, the distillation objective biases the decoder toward the final output, potentially overstating early-layer certainty by learning to ignore genuinely ambiguous intermediate states. Researchers must cross-validate findings with causal methods like path patching.
Tuned Lens vs. Logit Lens vs. Probing Classifiers
A comparison of three methods for extracting interpretable predictions from the intermediate representations of transformer language models.
| Feature | Tuned Lens | Logit Lens | Probing Classifier |
|---|---|---|---|
Core Mechanism | Learned affine transformation per layer | Direct application of final unembedding matrix | Supervised classifier trained on frozen activations |
Requires Training | |||
Output Type | Next-token probability distribution | Next-token probability distribution | Linguistic or world property label |
Causal Intervention | |||
Captures Non-Linear Encoding | |||
Decoder Fidelity (vs. Final Output) | High (corrects systematic drift) | Moderate (distorted by representational drift) | N/A (measures property presence, not token identity) |
Primary Use Case | Tracing iterative refinement of predictions across layers | Quick, zero-shot inspection of residual stream beliefs | Testing if specific information is linearly extractable |
Typical Accuracy Metric | Top-1 token match with final output | Top-1 token match with final output | Classification F1 or accuracy on held-out data |
Frequently Asked Questions
Explore the mechanics, advantages, and implementation details of the Tuned Lens technique for decoding transformer representations.
The Tuned Lens is a mechanistic interpretability technique that decodes a transformer's intermediate residual stream activations into next-token probability distributions. It directly improves upon the Logit Lens by learning a distinct, layer-specific affine transformation—a linear map plus a bias term—for each layer's residual stream before applying the final unembedding matrix. The standard Logit Lens naively applies the final-layer unembedding matrix directly to intermediate layers, assuming the representation space is uniform throughout the network. This assumption fails because the residual stream undergoes a progressive refinement of representations. The Tuned Lens corrects for this distributional mismatch by training a weight and bias for each layer, producing significantly more accurate and coherent decoded predictions, especially in early layers where the Logit Lens often yields nonsensical outputs.
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.
Related Terms
Core techniques and concepts for reverse-engineering the internal computations of neural networks, forming the toolkit for advanced model transparency.
Logit Lens
The foundational decoding technique that applies the unembedding matrix directly to intermediate residual stream activations. This reveals the model's next-token predictions at each layer without any learned transformations. While computationally cheap, the logit lens often produces noisy or incoherent outputs in early layers because representations are not optimized to be directly decoded by the final unembedding matrix. The Tuned Lens directly addresses this limitation by learning an affine transformation for each layer.
Residual Stream
The central information highway in a transformer architecture where each sublayer reads from and writes its output back to a shared, accumulating state vector. The residual stream acts as a communication channel, allowing attention heads and MLP layers to pass information forward. The Tuned Lens operates by applying a learned transformation to this stream at each layer, decoding the model's evolving internal belief state into interpretable token predictions.
Direct Logit Attribution
A linear decomposition technique that attributes the final logit output for a token directly to the individual contributions of each attention head and MLP layer. By analyzing the direct path from each component's output through the residual stream to the final logits, researchers can quantify which parts of the network are most responsible for a prediction. This method is closely related to the Tuned Lens, which provides a more accurate per-layer decoding for such attribution analysis.
Probing Classifier
A simple supervised model, often a linear classifier, trained on a network's internal activations to predict a specific linguistic or world property. This tests whether information is linearly encoded in the representation space. The Tuned Lens can be viewed as a specialized probing classifier that is trained to decode the next token from each layer's residual stream, providing a window into the model's predictive state at every depth.
Activation Patching
A causal intervention technique that replaces a model's internal activation at a specific layer and position with a value from a corrupted or alternative forward pass. This isolates the function of a specific component. When combined with the Tuned Lens, researchers can observe how patching an activation changes the decoded predictions at subsequent layers, providing causal evidence for how information flows and transforms through the network.
Sparse Autoencoder
An unsupervised architecture trained to decompose a model's dense, polysemantic activations into a sparse set of interpretable, monosemantic features. While the Tuned Lens decodes the residual stream into token predictions, sparse autoencoders decompose the same activations into a dictionary of human-understandable concepts. Both techniques aim to make the internal state of the model transparent, but at different levels of abstraction.

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