A decoder-only transformer produces its next-token distribution only after the final hidden state has passed through the model’s output normalization and vocabulary projection. Logit lens reuses that output path on states from earlier transformer blocks. The result is a sequence of vocabulary distributions that can expose how token preferences change with depth.
The method is attractive because it maps internal vectors into familiar token space without fitting a separate classifier. That convenience also creates a sharp interpretive boundary: an intermediate state was not necessarily optimized to be directly decoded by the final output map. A readable token distribution is a probe of that state, not a guarantee that the model has already settled on the same prediction.
The probe reuses the model’s vocabulary map
Let h_l denote the residual-stream state after transformer block l. For a model whose final output path applies normalization N followed by vocabulary matrix W_U and bias b, the ordinary final logits can be written as
z_final = W_U N(h_L) + bA basic logit-lens probe substitutes an earlier state:
z_l = W_U N(h_l) + bApplying softmax to z_l produces a vocabulary distribution for that layer. Comparing these distributions across depth can show a candidate token becoming prominent, disappearing, or being replaced as later blocks transform the residual stream.
The exact expression depends on model architecture. Some models have no output bias. Normalization placement and parameter sharing also vary. A probe should follow the actual model’s output path rather than assume a universal decoder formula.
Intermediate states can be poorly aligned with the final decoder
The vocabulary projection is trained to consume the representation presented at the model output. Earlier residual states participate in computation, but they need not occupy a representation basis that the final decoder interprets cleanly.
This creates a possible mismatch. An early state can contain information that later blocks can use even when direct projection assigns that information little probability in vocabulary space. Conversely, a token can receive a high probe score at one layer and then lose that position after subsequent attention and feed-forward transformations.
For this reason, layer-to-layer changes are often more informative than treating any single intermediate probability as a calibrated statement. The probe exposes compatibility between an internal state and the final vocabulary map at that point in the network.
Normalization is part of the measurement
Applying the output projection directly to an unnormalized residual state can mix two effects: representational direction and scale. In architectures with a final normalization layer, reproducing that normalization before projection gives the probe an output path closer to the one used for actual next-token prediction.
Even then, the operation remains counterfactual for intermediate layers. The final normalization parameters were optimized in the context of the complete network. Reusing them earlier does not turn an intermediate state into a genuine model output.
This distinction matters when comparing implementations. Two tools both described as logit lens can disagree because one applies the final normalization and another projects raw residual states. Their token rankings can therefore differ without either implementation containing an arithmetic error.
Token rankings carry less baggage than raw probabilities
Softmax converts probe logits into numbers that resemble ordinary next-token probabilities. The resemblance can invite stronger claims than the probe supports. Intermediate distributions are not necessarily calibrated, and probability magnitude can be affected by representation scale, normalization details, and alignment with the final decoder.
Token rank, logit differences, or changes in a selected token’s position across layers can provide a narrower measurement. These quantities still depend on the decoder projection, but they avoid treating an intermediate softmax value as if it had the same status as the model’s final predictive probability.
A useful comparison also fixes the token position being inspected. In an autoregressive transformer, each sequence position has its own residual state. Comparing different positions across layers confounds depth with different prediction contexts.
Residual-stream probes do not isolate a component’s contribution
A residual state contains accumulated contributions from earlier attention and feed-forward operations. Decoding h_l shows the vocabulary projection of the combined state at layer l; it does not attribute a token preference to the most recent block alone.
Subtracting adjacent states can expose the update added by a block, but projecting that difference is a different measurement from projecting the full residual stream. Because later normalization and nonlinear computation can change how updates interact, a decoded difference should not be equated with the block’s complete causal effect on the final prediction.
Component attribution requires a measurement designed for attribution, such as controlled activation replacement or ablation under a clearly specified intervention. Logit lens is better suited to observing how decodable token structure evolves through the network.
Stable early tokens do not imply computation has stopped
A token may remain at the top of the probe ranking for many layers while its margin over alternatives continues to change. Later blocks can also alter representations used for subsequent generated tokens, even when the currently inspected token ranking appears stable.
The converse also occurs at the level of interpretation: unstable early rankings do not establish that the network lacks relevant information. The information may be encoded in a form that the final vocabulary map cannot decode directly at that depth.
Logit lens is therefore most defensible when used as a view into decoder-aligned structure, with architecture details and layer position held explicit. It can reveal a useful trajectory through token space, but that trajectory remains a projection of internal computation rather than a transcript of the computation itself.