AI Glossary / AI and machine learning / Intermediate
Logits
Definition
Logits are a classifier's raw output scores before they are converted into probabilities: the unbounded numbers the model actually computes, one per class, which the softmax step turns into the familiar percentages.
What it means
Between the model's arithmetic and the probabilities you see sits one quiet layer: the logits. Each class gets a raw score, any real number, positive or negative, and the scores' relative sizes encode everything the model believes.
The conversion to probabilities is the softmax: exponentiate each logit and divide by the total, so the biggest logit gets the biggest share and all shares sum to one. The probabilities are a view; the logits are the substance.
Training happens on the logits directly: the cross-entropy loss compares them with the true class, and working in this raw space keeps the arithmetic stable where tiny probabilities would underflow.
Logits also carry margin information: the gap between the top two logits is the model's raw margin of victory, a confidence signal that survives even after probabilities are squeezed toward zero and one.
For a business, logits matter when you need more than the headline probability: threshold tuning, margin analysis and debugging all work better on the raw scores than on the rounded percentages they become.
The word itself is a descendant of logit, the log-odds function, though in everyday model talk it has broadened to mean any raw pre-softmax score, whether or not the classes are two.
How it works
Read the model's final linear layer: its outputs, one number per class, are the logits.
Apply softmax to present probabilities: exponentiate each logit and normalize by the sum.
Train against the logits with cross-entropy, which expects raw scores, not pre-squashed probabilities.
Use the gap between top logits as a margin signal when grading confidence beyond the headline probability.
Keep raw logits in logs for consequential decisions, so calibration and audit work on unrounded numbers.
Inspect the distribution of logits across a validation set: a healthy model shows confident spreads on the cases it gets right and narrow, nervous gaps on the ones it gets wrong.
Three practical examples
- A three-class churn model whose logits of 2.1, 0.4 and minus 1.3 become probabilities of 82, 15 and 3 per cent after softmax.
- A threshold review working on the logit gap, finding that cases with a gap under 0.5 account for most errors.
- A debugging session where the log reveals two classes' logits nearly tied, explaining a run of flip-flopping predictions.
Think of it this way
Think of judges holding up scorecards at a competition: the raw points are the logits, and converting them into each contestant's share of the prize pool is the softmax. The shares are what the audience sees; the points are what the judges actually decided.
The limit: points without a common scale invite misreading. A logit of 3 means nothing alone; only the spread across classes carries meaning, and comparing raw scores across different models is comparing scorecards from different contests.
Worked example
tuning on the margin
Suppose a bank's three-way triage model routes applications by predicted class. The figures are illustrative.
Analysis of the logits shows errors concentrate where the top two scores sit within 0.4 of each other, regardless of the headline probability.
A review rule routes all narrow-margin cases to humans: 9 per cent of volume, catching 41 per cent of the errors.
The margin signal lived in the logits all along; the rounded probabilities had squeezed the information nearly flat.
Illustrative case study
A fictional support team set their routing thresholds on rounded two-decimal probabilities, and an entire band of borderline cases, probabilities displayed as identical, routed inconsistently at random.
Recovering the raw logits separated the band cleanly, and the routing became stable overnight.
The invented lesson: rounding is a decision. Work and threshold on the raw scores, and round only for the audience.
Common misconceptions and mistakes
- Logits are probabilities. They are the raw scores before conversion; only after softmax do they share the probability scale.
- The biggest logit always wins. In a single deterministic pass, yes, but sampling, ties and downstream thresholds all mean the win needs the margin read too.
- You never need to see them. Any work on confidence, thresholds or debugging is better done on logits than on rounded probabilities.
Business use
Log raw outputs for consequential decisions; keep rounding for the presentation layer only.
Build narrow-margin routing rules on the logit gap, which keeps information that probabilities compress.
Never compare raw scores across models: only within one model's classes do the numbers share a scale.
People also ask
What is softmax?
The conversion from raw scores to probabilities: exponentiate each logit and divide by their total, so shares are positive and sum to one.
Why train on logits rather than probabilities?
Numerical stability and cleaner gradients: the raw space avoids the underflow and saturation of tiny or near-one probabilities.
What is the margin?
The gap between the top two logits, a raw confidence measure that survives the squeeze of probability conversion.
Can logits be negative?
Yes; they live on the whole number line, and only their relative differences matter, since softmax is unchanged by adding a constant to all of them.
Check your understanding
Why do threshold and margin analyses work better on logits than on probabilities?
Answer: Because probability conversion compresses near the extremes, while logits preserve the raw gaps between classes, so borderline cases stay distinguishable on the raw scale.
Related terms
Learn next
AI for Business Owners covers how to ask for the raw numbers behind a reported confidence: https://aiforbusinessandlife.com/academy/ai-for-business-owners. [C2]
More in AI and machine learning
- Local case-control sampling - Local case-control sampling is a subsampling method for fitting logistic regression to large datasets.
- Local tangent space alignment - Local tangent space alignment, or LTSA, is a nonlinear dimensionality-reduction method that estimates local tangent spaces around data points and aligns...
- Logic learning machine - Logic Learning Machine is a rule-learning approach associated with Marco Muselli's switching neural network work and implemented in the Rulex software.
- Loss curve - A loss curve is the plot of a model's error score over the course of training: the falling, or sometimes worryingly not-falling, line that shows whether and...
- Loss surface - A loss surface is the landscape of a model's error over all possible parameter settings: the hills and valleys training must descend, whose shape decides...
- Lost-in-the-middle effect - The lost-in-the-middle effect is the tendency of language models to use information at the beginning and end of a long input well, but to miss or garble...
Sources
[S2] Google, Machine Learning Glossary. Full URLs are in the source ledger. Verified 11 October 2026.
Previous: Logit lens Next: Logrank test