Logits
What Are Logits in Machine Learning?
Logits are raw model output scores that rank possible predictions before conversion into probabilities. Higher logits indicate a stronger relative preference, but are not percentages or confidence values. They can be positive or negative.
Logits vs. Probabilities vs. Log-Odds
These terms have different meanings. In neural-network documentation, logits usually refers to unconverted final-layer scores.
| Term | Range | Meaning and use |
|---|---|---|
| Logits | Any real number | Raw scores that rank classes or tokens before conversion. |
| Probabilities | 0 to 1 | Converted values used for decisions, thresholds, or sampling. |
| Log-odds | Any real number | The statistical logit of a binary probability: the logarithm of p divided by 1 minus p. |
How Logits Become Predictions
Conversion depends on whether a model chooses between two outcomes or many.
- The model produces one score or a set of scores, such as 2 for class A and 1 for class B.
- For a binary choice, sigmoid converts one score into a probability from 0 to 1.
- For multiple classes or next tokens, softmax converts scores into probabilities totaling 1. Here, A receives the larger probability.
- Software selects the highest-probability output or samples from the distribution.
Why Language Models Use Logits
A large language model produces one logit for every possible next token. Softmax and decoding settings determine the next token. Lower temperature favors leading tokens, while higher temperature spreads choices more widely. Changing logits can change wording, but not make a model more knowledgeable or reliable.
Practical Benefits of Working With Logits
Logits offer control during development and evaluation.
- Training libraries can combine logits with cross-entropy loss in a numerically stable operation.
- Teams can inspect close scores to understand a classifier or AI feature's choice.
- Applications can set probability thresholds for review queues or alerts.
- Developers can tune token selection in AI app design and development workflows.
Practical Limits and Common Mistakes
Raw scores need careful interpretation.
- Do not call a logit confidence. Its size matters only relative to other scores or a known conversion.
- Do not apply softmax twice. Many APIs and loss functions expect raw logits and convert them internally.
- Use sigmoid for one independent binary output and softmax for mutually exclusive choices.
- Do not assume high probabilities are well calibrated. Validate them on representative data against real outcomes.
Logits in AI Application Development
Teams use logits to evaluate model behavior, apply safety rules, and decide how AI output reaches users. A support tool, for example, may send uncertain classifications to human review. Understanding logits helps teams select tools, including AI agent builders, and test features before release. Emergent helps people build, test, and ship AI-enabled applications from natural-language requirements.
on Emergent today


