Lab

Logits

Logits: The raw numbers a language model outputs, one for every token in its vocabulary, before softmax turns them into probabilities.

At each step, a language model’s last layer produces one number for every token in its vocabulary. These raw outputs are called logits. A higher logit means the model leans more towards that token coming next.

On their own, logits are hard to read. They can be any size and either sign, and they do not add up to anything in particular. What matters is the gap between them: two tokens whose logits are close are close contenders, while a large gap means one is far more likely than the other.

To turn logits into probabilities, the model applies softmax. It exponentiates each logit and divides by the total, so every value becomes positive and they add up to 1. Because of the exponent, a fixed gap between two logits becomes a fixed ratio between their probabilities.

Most of the controls in a local AI app work on logits before softmax runs. Temperature divides every logit by the same number, which stretches or squashes the gaps. Repetition penalties push down the logits of tokens that have already appeared. Filters such as top-k, top-p and min-p then cut away the unlikely tail before one token is picked at random.

Logits are not why the same prompt can give different replies. On the same software and hardware, the same text gives the same logits every time. The variety comes from sampling, which picks one token at random from that spread; with temperature 0, most tools always take the top token, and the reply usually repeats. The explainer shows logits for a few example prompts and lets you watch each control reshape them.

See it working

Explore it in How a model picks the next token

See how temperature, top-k, top-p, min-p and penalties turn a model's logits into one token, and why their order matters.

Open the explainer