lm-head -- hidden state → vocab logits

When the model has finished thinking about your prompt it holds one long list of numbers, and it still has to turn that into an actual word. This is the step that does it: the model compares its final state against every word it knows — a fixed list of perhaps 50,000 to 250,000 entries — and gives each one a score, and the highest scorer is usually what you see appear. It is also one of the largest single parts of a model, because it needs a row of numbers for every word in the language. That is why many models reuse the very same table they used to read your prompt. A few also squash the scores into a fixed range before choosing, so that no single one can run away from the rest.

Interactive page: the output projection that turns a hidden state into a logit per vocabulary token, plus the three tricks around it — tied weights, logit soft-capping, and decode-time logit slicing. Anchor: A9 lm_head structure / A10 vocab (Family C6).

What it shows

The last hidden state h (a D-vector) is projected against every row of the unembedding matrix W_lm ([V × D]): logit[v] = h · W_lm[v]. Scrub the transport across the vocabulary to fill the logit per token (each = a dot product with that token's row). The argmax is the predicted next token.

Toggles:

The hidden states H [N×D] are shown with the sliced row highlighted.

Render tier

T2 (WebGL2 heatmaps for H and W_lm; Canvas2D for the logit bars + cap lines).

Wiring

layout.mount + controls (seed, tie, soft-cap, cap, slice) + a per-vocab Transport (auto-plays + loops), drawn with render.heatmap/cell ctx and tensor.seededRandn. Interactive (2026-06-13 contract): drag any h cell ↕ to steer the hidden state and watch every logit + the argmax recompute live; hover a logit bar for its full derivation (h · W_lm[v] = Σ_d h[d]·W[v,d]), an h or W_lm cell for its value. ?step/?tie/?cap0/?slice0/?play headless hooks, plus ?hover=x,y (fake cursor) and ?drag=d,val (set h[d], e.g. ?drag=2,2.5). Source: page.js.