Logits
In One Sentence
Raw, unnormalized scores output by a neural network before Softmax converts them into probabilities.
ELI5 (Intuition)
The messy raw 'points' a model gives each possible next word or class (like
4.2 vs -1.7) before turning them into neat percentages that add up to 100%.ELI18 (Technical)
Real-valued vector \(\mathbf{z} \in \mathbb{R}^K\) produced by the final linear layer (
lm_head). Mapped onto the probability simplex via \(\operatorname{softmax}(\mathbf{z} / T)\). Temperature scaling, top-k, and logit bias all operate directly on logits.In Practice
Inspecting token
logprobs from an LLM API lets you build calibrated classifiers, detect hallucinations, or enforce JSON grammars by masking invalid token logits to \(-\infty\).