ziz_i

Logits — raw scores

The raw scores a model produces before softmax turns them into probabilities. There is one per vocabulary entry. They can be any real number, negative or positive.

The last layer of a language model outputs a vector z\mathbf{z} with one entry per token in the vocabulary. A larger logit means that token is more likely to come next, but logits are not probabilities: they do not add to 1 and can be negative. Softmax converts them (section 4.3), and temperature divides them first to sharpen or flatten the result.

Example

z=[2.0,  1.0,  −1.0]  →softmax  [0.71,  0.26,  0.04]\mathbf{z} = [2.0,\; 1.0,\; -1.0] \;\xrightarrow{\text{softmax}}\; [0.71,\; 0.26,\; 0.04]

Order is kept; the scores become shares that add to 1 (0.705 + 0.259 + 0.035).

Where the course uses it

Related terms