Logits Versus Probabilities

Models often output raw scores called logits.

Logits are not probabilities.

logits = [2, 1, 0]

These numbers can be negative, positive, small, large, and they do not need to sum to one.

Probabilities must be nonnegative and sum to one.

probabilities = [0.66, 0.24, 0.10]

The usual path for multiclass classification is:

logits -> softmax -> probabilities -> cross-entropy

The raw logits are useful because they let the model express relative preference before normalization.

Exercise: Is this a probability vector

The vector [2, 1, 0] sums to 3. Enter 1 if it is already a probability vector, or 0 if it is not.

Compute it first, then check your number.

HintCheck the sum

A probability vector must sum to one.

SolutionWork it out

[2, 1, 0] sums to 3, not 1, so it is not a probability vector.

Exercise: Can logits be negative

Enter 1 if logits can be negative, or 0 if logits must always be between 0 and 1.

Compute it first, then check your number.

HintRaw scores

The probability constraints apply after normalization.

SolutionWork it out

Logits are raw scores. They can be negative, positive, or zero.