Interpretability

logit lens

The logit lens is a cheap trick for peeking at the model's mind mid-computation. Normally only the final layer's hidden vector gets multiplied by the unembedding matrix to produce next-token predictions. The logit lens applies that same final projection to the hidden vector at every earlier layer too, decoding each one as if the model had to answer right now. You get a layer-by-layer trace of what the model is leaning toward as it thinks.

What this reveals is the gradual sharpening of a prediction. At early layers the decoded distribution is often vague or generic; by middle layers a confident guess frequently emerges and then just gets refined. It is a quick way to localize roughly where in the stack a fact or decision gets resolved, and to watch a wrong early guess get corrected — or a right one drift away.

It is a lens, with the distortions the name admits. Early layers were not trained to be read by the final unembedding, so their decoded logits can be misleading, especially before normalization. The tuned lens fixes part of this by learning a small per-layer adapter; either way, treat logit-lens readings as a useful sketch, not ground truth.

Also called
early decodingtuned lens (variant)