# Podgląd przewidywań warstw pośrednich (logit lens, tuned lens)

EN: **Logit lens and tuned lens** · id `logitlens` · aliases: logit lens, tuned lens, early decoding, soczewka logitowa

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Ewaluacja i interpretowalność](https://aiatlasgraph.com/t/evaluation.md) › [Interpretowalność](https://aiatlasgraph.com/t/explainability.md) › [Interpretowalność mechanistyczna](https://aiatlasgraph.com/t/mechinterp.md) › Podgląd przewidywań warstw pośrednich (logit lens, tuned lens)

## Description

- PL: Dekodowanie ukrytych stanów warstw pośrednich transformera na rozkład słownika, bezpośrednio (logit lens) lub przez wyuczony translator na warstwę (tuned lens).
- EN: Decoding a transformer's intermediate hidden states into vocabulary distributions, directly (logit lens) or via a learned per-layer translator (tuned lens).

## In one sentence

- PL: Zaglądanie, jakie słowo model „miał na myśli” w połowie obliczeń, zanim doszedł do ostatecznej odpowiedzi.
- EN: Peeking at which word a model “had in mind” halfway through its computation, before reaching its final answer.

## Problem it solves

- PL: Widzimy tylko ostatnie słowo modelu, więc nie wiemy, kiedy w trakcie obliczeń zdecydował albo zmienił zdanie.
- EN: We only see the model's final word, so we cannot tell when during its computation it decided or changed its mind.

## What it does

- PL: Jak klatki z filmu o rzeźbiarzu: oglądasz rzeźbę na kolejnych etapach, a nie tylko gotowe dzieło.
- EN: Like stills from a film about a sculptor: you see the statue at successive stages, not only the finished work.

## Everyday example

- PL: Badaczka sprawdza pytanie o stolicę kraju i widzi, że poprawna nazwa pojawia się już w połowie modelu, a później tylko się umacnia.
- EN: A researcher tests a capital-city question and sees the correct name appear halfway through the model, then just grow stronger.

## This concerns you if you…

- PL: chcesz zobaczyć, jak odpowiedź modelu kształtuje się krok po kroku
- PL: uruchamiasz otwarte modele i masz dostęp do ich wnętrza
- EN: want to see how a model's answer forms step by step
- EN: run open models and can access their internals

## Keywords

logit lens · tuned lens · residual stream · unembedding matrix · early exit · iterative inference · TransformerLens · nnsight

## How it works

- PL: Logit lens przepuszcza stan strumienia rezydualnego z danej warstwy przez końcową normalizację i macierz unembeddingu, bez treningu. Tuned lens uczy dla każdej warstwy małe przekształcenie afiniczne destylowane do wyjścia ostatniej warstwy, co zmniejsza obciążenie predykcji. Trajektorie predykcji przez warstwy analizuje się jako „iteracyjne wnioskowanie”.
- EN: The logit lens passes a layer's residual-stream state through the final norm and unembedding matrix, with no training. The tuned lens learns a small affine map per layer, distilled to match the final-layer output, reducing prediction bias. Prediction trajectories across layers are analysed as iterative inference.

## Limits

- PL: Logit lens bywa zawodny we wczesnych warstwach i w niektórych rodzinach modeli, bo reprezentacje nie są jeszcze w przestrzeni wyjścia. Tuned lens wymaga treningu translatorów i pokazuje, co da się odczytać, a nie co model faktycznie wykorzystuje.
- EN: The logit lens is unreliable in early layers and some model families because representations are not yet in output space. The tuned lens needs trained translators and shows what is decodable, not what the model actually uses.

## Key terms

- PL: **strumień rezydualny**: Wektor przekazywany między warstwami transformera, do którego każda warstwa coś dopisuje.
- PL: **unembedding**: Końcowa macierz zamieniająca stan modelu na wyniki dla słów.
- EN: **residual stream**: The vector passed between transformer layers, which each layer adds to.
- EN: **unembedding**: Final matrix turning a model state into word scores.

## Know first

- [Transformery i attention (Transformers and attention)](https://aiatlasgraph.com/t/transformers.md)
- [Sondy klasyfikacyjne (probing) (Probing classifiers)](https://aiatlasgraph.com/t/probing.md)

## Sources

- [Eliciting Latent Predictions from Transformers with the Tuned Lens](<https://arxiv.org/abs/2303.08112>) `tuned-lens-2023` · by Nora Belrose, Igor Ostrovsky, Lev McKinney, Zach Furman, Logan Smith, Danny Halawi, Stella Biderman, Jacob Steinhardt

---

AI Atlas revision 130 (2026-11-06) · HTML: https://aiatlasgraph.com/t/logitlens · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-11-06
