Logits are raw model scores before probabilities. Learn how logits work, how softmax and sigmoid transform them, and why neural networks use them.

Updated August 2026
Logits are the raw scores a machine learning model produces before those scores are converted into probabilities. In a classifier, a logit can be any real number. A transformation such as sigmoid or softmax turns the logits into values that can be interpreted as probabilities.
Google's Machine Learning Glossary uses the same distinction: logits are model outputs before normalization. This matters because a score of 2.0 is not a 200% probability.
This content was generated with the assistance of AI. Our AI prompt chain workflow is carefully grounded and preferences .gov and .edu citations when available. All content is reviewed by a Telnyx employee to ensure accuracy, relevance, and a high standard of quality.
Logits give a model an unconstrained output space during training. Probabilities must stay between 0 and 1 and, in a multi-class setting, must sum to 1. Models usually compute raw scores first, then apply the appropriate probability function when a probability is needed.
For binary classification, the sigmoid function maps one logit to a number from 0 to 1. For multi-class classification, softmax converts a vector of logits into a probability distribution across classes. PyTorch documents this binary-versus-multidimensional distinction in its logits-to-probabilities utility.
Consider three class logits: [2.0, 1.0, 0.1]. Those values are scores, not percentages. Applying softmax produces probabilities of roughly [0.66, 0.24, 0.10].
Adding the same constant to every logit does not change the softmax probabilities. What matters is the difference between the scores. A larger gap means the model assigns relatively more probability to the higher-scoring class.
| Property | Logits | Probabilities |
|---|---|---|
| Range | Any real number | 0 to 1 |
| Sum across classes | No fixed total | Softmax outputs sum to 1 |
| Typical use | Model output before activation | Prediction interpretation and thresholding |

In logistic regression, the logit is the linear score before sigmoid. The model combines weighted input features into that score, then uses sigmoid to calculate the probability of the positive class. The logit is also the log-odds of the probability when the assumptions of the model apply.
This is why a logit of zero maps to a probability of 0.5. Positive logits correspond to probabilities above 0.5, while negative logits correspond to probabilities below 0.5.
Language models produce a logit for every token in their vocabulary at each generation step. Softmax turns those logits into token probabilities. Decoding settings then choose or sample the next token from that distribution.
Temperature changes the distribution’s sharpness before sampling. It does not change what a logit is. Treat logit bias, temperature, top-p, and token selection as related controls with different effects.
For a multi-class model, the largest logit identifies the class that would win under an argmax decision. The other logits still matter because their gaps show how strongly the model prefers that class relative to alternatives. A top score of 3.0 has a different interpretation when the next score is 2.9 than when it is negative 4.0.
In a binary classifier, the sign of the logit determines which side of the 0.5 probability boundary the score falls on after sigmoid. But a production decision may use a different probability threshold. The raw logit and the decision threshold should therefore be kept separate in documentation and code.
This same distinction appears in AI classification: the model produces scores, while the application decides which error tradeoff is acceptable. If you are evaluating those choices, the F1 score formula is a useful companion metric.
Sigmoid transforms one score into one probability. It is common for binary classification or independent multi-label predictions. Softmax transforms a set of scores into a distribution whose probabilities add to 1. It is common when the classes are mutually exclusive.

The distinction changes the output meaning. A multi-label image tagger can assign high sigmoid probabilities to both "beach" and "sunset." A single-label animal classifier using softmax must divide its probability across options such as bird, cat, and dog.
Inspect logits during debugging when a probability looks surprising. Compare the top few scores, confirm the class-to-index mapping, and check whether the inference code applies the intended activation function once. Applying softmax twice or mixing up logits with probabilities is a common source of confusing results.
For language models, inspect the top candidate tokens at a generation step. This can reveal an unexpected tokenization issue, an overly broad prompt, or a decoding setting that is flattening or concentrating the distribution more than intended. The hard versus soft token guide gives useful context for how token-level representations differ from plain text.
The objective function guide explains why training code often accepts logits directly. For generative systems, read the LLM API guide alongside model-specific documentation before treating token controls as portable across providers.
Logits appear anywhere a model must rank or classify possible outcomes. An image classifier produces one logit per label before softmax identifies the most likely class. A binary risk model can produce one logit per item before sigmoid maps it to a probability used by an alert threshold.
Training code provides a concrete application. PyTorch's CrossEntropyLoss accepts one unnormalized logit per class and combines log-softmax with negative log-likelihood loss. Passing softmax probabilities into that loss changes the calculation. This API contract is why developers must label model outputs correctly and apply probability transforms only where the library expects them.
When a model's output looks wrong, check the output shape before changing the model. A binary classifier may return one logit per item, while a multi-class classifier returns one logit per class. Confirm that the label index, activation function, and loss function all match that shape.
Keep the preprocessing path identical between training and inference. A logit that appears unreasonable can come from a missing normalization step or a mismatched class order, not a failure in softmax. Log the model version and input features with a small, approved sample so the result can be reproduced.
In binary logistic regression, the logit is the log-odds of the positive probability. In broader neural-network usage, "logits" usually means the raw pre-activation scores, including vectors used for multi-class classification. The distinction matters when explaining a specific model.
Yes. A logit is not a probability and has no 0-to-1 limit. A model can output positive or negative values of any magnitude. The activation function is what maps the score into a probability or probability distribution.
Many libraries accept logits directly. PyTorch's CrossEntropyLoss, for example, expects unnormalized logits and combines LogSoftmax with negative log-likelihood loss. Passing an already transformed probability into that loss changes the calculation, so check the API expectation carefully.