Homeglossary

Logits

Logits are machine-learning output scores that rank possible predictions before a model converts them into probabilities. They can be any positive or negative number, so they are not percentages or confidence values by themselves. In software, developers use logits to train, inspect, and control classifiers and language models.

Build more understandable AI apps with Emergent.

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.

TermRangeMeaning and use
LogitsAny real numberRaw scores that rank classes or tokens before conversion.
Probabilities0 to 1Converted values used for decisions, thresholds, or sampling.
Log-oddsAny real numberThe 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.

  1. The model produces one score or a set of scores, such as 2 for class A and 1 for class B.
  2. For a binary choice, sigmoid converts one score into a probability from 0 to 1.
  3. For multiple classes or next tokens, softmax converts scores into probabilities totaling 1. Here, A receives the larger probability.
  4. 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.

Start Building
on Emergent today
Start Building