The tuned lens is an interpretability technique for transformer language models that reads out the prediction a model would make at each intermediate layer by passing the hidden state through a small learned affine translator and then through the model’s own final normalization and unembedding. In Explainable AI, it is used to observe how a prediction forms and sharpens layer by layer, turning the residual stream of a network into a sequence of inspectable probability distributions over the vocabulary.
The method was introduced in 2023 as a refinement of the logit lens, which decodes intermediate states directly without any training. By learning one translator per layer, the tuned lens corrects for the fact that hidden representations drift in basis as they move through the network, which makes early-layer readouts far more reliable.
How the tuned lens decodes hidden states
A decoder-only transformer maintains a residual stream: each layer adds its output to a running hidden vector, and only the final vector is normally converted into logits. The tuned lens takes the hidden state h at layer l and computes `A_l h + b_l`, where A_l is a square matrix and b_l a bias vector. The result is fed through the final layer norm and unembedding matrix, which remain frozen, to produce a distribution over tokens.
Each translator is trained to minimize the KL divergence between the lens distribution at layer l and the model’s actual final output distribution on the same input. The translators are typically initialized to the identity, so training begins from the logit lens and learns only the correction needed. The underlying model weights are never modified.
The table below lists the main elements of the method and their role.
| Element | Role | Trained |
|---|---|---|
| Hidden state | Residual stream vector at a given layer | No |
| Affine translator | Maps the hidden state into the final-layer basis | Yes, one per layer |
| Final layer norm | Normalizes the translated vector | No, reused from the model |
| Unembedding matrix | Projects the vector onto vocabulary logits | No, reused from the model |
| Distillation loss | KL divergence to the final output distribution | Defines the training target |
Tuned lens versus logit lens and probing
The tuned lens sits between the training-free logit lens and general probing classifiers. It is more accurate than the logit lens but far more constrained than an arbitrary probe, because it must map into the model’s own output space and predict the model’s own behavior rather than an external label.
| Method | Training required | Main strength | Main weakness |
|---|---|---|---|
| Logit lens | None | Simple and fully faithful to model weights | Unreliable in early layers and some model families |
| Tuned lens | One affine map per layer | Lower perplexity and less bias across layers | Translator may add its own structure |
| Probing classifier | Separate classifier per property | Tests for any chosen concept | Can learn the task itself, not the model |
| Activation patching | None, but many forward passes | Establishes causal effects | Costly and narrower in scope |
The original study reported that the logit lens performs poorly on several model families, such as BLOOM and GPT-Neo, where early-layer readouts are nearly meaningless, while the tuned lens produces coherent predictions at every depth. The learned translators were also found to depend causally on similar features to those the model itself uses, which supports their use as a faithful view rather than a separate model.
What the tuned lens reveals about a model
The core output is a trajectory of predictions across layers for every token position. Researchers read these trajectories to measure prediction depth, the earliest layer at which the lens agrees with the final answer, and to locate where facts, syntax or task instructions start to influence the output.
The following table summarizes typical analyses and what each shows.
| Analysis | What is measured | Typical insight |
|---|---|---|
| Prediction depth | First layer matching the final top token | Easy tokens resolve early, hard ones late |
| Per-layer perplexity | Cross-entropy of lens outputs on text | How quickly the model converges |
| Trajectory anomaly detection | Unusual paths of predictions | Flags some prompt injection attempts |
| Feature importance per layer | Effect of removing directions on lens output | Which subspaces carry the prediction |
| Cross-model comparison | Lens behavior across sizes or checkpoints | How depth usage changes with scale |
Because the computation is cheap after training, the tuned lens is well suited to large-scale screening of many prompts, after which more expensive methods such as circuit analysis can focus on the interesting cases.
Training and applying a tuned lens in practice
Practitioners train a tuned lens on a general text corpus similar to the model’s pretraining distribution while keeping the model frozen. The number of added parameters per layer equals roughly the square of the hidden dimension, which is small compared with the model but not negligible for very wide networks. An open-source library maintained by the original research group provides pretrained lenses for several public models.
| Situation | Recommended choice | Reason |
|---|---|---|
| Pretrained lens exists for the model | Reuse it directly | Avoids training cost and variance |
| Fine-tuned derivative of a base model | Start from the base lens, then retrain briefly | Representations shift after fine-tuning |
| Quick qualitative inspection | Compare with the logit lens | Disagreement highlights basis drift |
| Claims about causal mechanisms | Confirm with activation patching | The lens alone shows correlation |
Limitations of the tuned lens
The central caveat is that a learned translator can introduce information that is not explicitly used by the model at that layer, so a readout is an estimate of latent prediction, not proof of it. The method is also linear by design, which can miss nonlinearly encoded information, and it explains predictions in vocabulary space only.
- Readouts are approximations: good agreement with final outputs does not guarantee faithful intermediate content.
- Lenses are model-specific: a lens trained on one checkpoint degrades on another.
- Interpretation requires care: early-layer predictions often reflect frequency priors rather than reasoning.
- No direct causal claims: interventions are needed to establish how a layer influences the output.
Stripped to the essentials
A language model thinks in many steps, called layers. Normally, people only see the answer after the last step. The tuned lens lets them peek at the guess after every step.
Each layer speaks a slightly different internal dialect. The tuned lens learns a small translator for each layer. The translator turns that dialect into the language of the final answer. This shows when the model became confident and when it changed its mind.
Where it is applied
A safety team evaluates an open-weight model with 32 layers before deploying it in a customer-support assistant. The team loads a pretrained tuned lens and runs 5,000 normal support prompts plus a set of known prompt injection attacks. For each prompt, it records the trajectory of top predictions across all layers.
On normal prompts, the predicted answer usually settles between layers 18 and 24. Many injection prompts show a different pattern: the trajectory jumps abruptly in the last few layers toward instruction-following tokens. The team trains a simple anomaly detector on these trajectories and uses it as an additional screening signal, while confirming suspicious cases with activation patching before drawing conclusions about the mechanism.