Your bookmarks

Loading your bookmarks

Latest updates

New courses, skills, book chapters, and site improvements will appear here.

Create free accountSign upDashboardDashboard

Logit lens

  • Control
  • Research term
3 steps

The logit lens is a research technique that reads a model's partway-through internal state as if it were the final layer, showing which next token, or word piece, each layer points toward.

A language model passes one working state through dozens of layers, each adding to it, and only after the last does it score every possible next token. Each score is called a “logit.” Because the state has the same size at every layer, that scoring step can be run on it at any depth.

Where you’ll meet it

You read a thread about a downloadable model getting a trivia question wrong. A chart shows the right answer on top at a middle layer and a wrong one winning by the last, and the post says a late layer "overrode" what the model knew.

What to do

Read the chart as a pointer to where researchers might look. Before believing a layer overrode anything, look for an experiment in which someone changed that layer's state and the answer changed with it, on more questions than this one.

Easy to mix up

A probe has to be trained first, learning one property, such as sentiment, from labeled examples. The logit lens needs no training, because it reuses the final layer the model already has.

Check yourself

You run the logit lens on a model, and its first few layers decode into tokens that look random. What does that tell you about those layers?

Go deeperA trained correction extends the lens to models where it fails

The idea was posted on LessWrong in 2020 by the writer nostalgebraist, using GPT-2, whose middle and late layers decoded into sensible guesses. On several other model families, the plain lens stays unreadable for many more layers.

Belrose and colleagues introduced the tuned lens in 2023. It trains a small adjustment for each layer, so the decoded guesses track the final output more closely. Both versions can miss information a layer holds for later in the text, such as a rhyme word planned several words ahead.

Practice Modern AI

Or take the learning quiz on a mix of every set