Telnyx - Global Communications Platform ProviderHome
AICommunicationsNetwork & WirelessVoice AI AgentsDeepfake DetectionstatefulactorInference200+ open-source buildsagent-signup.mdx402View all primitivesHealthcareFinanceTravel and HospitalityLogistics and TransportationContact CenterInsuranceRetail and E-CommerceSales and MarketingServices and DiningView all solutionsVoice AIVoice APIInferenceMobile VoiceSpeech-to-TextText-to-SpeechSIP TrunkingSMS APIWhatsApp Business APIGlobal NumbersIoT SIM CardView all pricingOur NetworkMission Control PortalCustomer storiesGlobal communicationsPartnersCareersEventsResource centerSupport centerAI TemplatesSETIDev DocsIntegrations
Contact usLog in
Contact usLog inSign up

Social

Company

  • Our Network
  • Global Coverage
  • Release Notes
  • Careers
  • Voice AI
  • AI Glossary
  • Shop

Legal

  • Data and Privacy
  • Report Abuse
  • Privacy Policy
  • Cookie Policy
  • Law Enforcement
  • Acceptable Use
  • Trust Center
  • Country Specific Requirements
  • Website Terms and Conditions
  • Terms and Conditions of Service

Compare

  • ElevenLabs
  • Vapi
  • Baseten
  • Together.ai
  • Twilio
  • Bandwidth
  • Vonage
  • Amazon Connect
© Telnyx LLC 2026
ISO • PCI • HIPAA • GDPR • SOC2 Type II

Ask AI

  • GPT
  • Claude
  • Perplexity
  • Gemini
  • Grok
Back to Glossary

What Are Logits in AI? A Plain-English Explanation

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

Emily Bowen
Editor: Emily Bowen

Updated August 2026

What are logits in AI?

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.

Why do models use logits instead of probabilities directly?

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.

Sign up and start building.

Sign UpContact Us

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.

How do logits become probabilities?

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.

Logits versus probabilities

PropertyLogitsProbabilities
RangeAny real number0 to 1
Sum across classesNo fixed totalSoftmax outputs sum to 1
Typical useModel output before activationPrediction interpretation and thresholding

A three-bar logit chart passing through softmax to produce a probability distribution that sums to one.

What is a logit in logistic regression?

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.

How are logits used in language models?

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.

How do logits affect a model's prediction?

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.

What is the difference between softmax and sigmoid?

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.

Comparison of sigmoid and softmax: sigmoid maps one logit to one probability for independent classes, while softmax maps a vector of logits to a distribution over mutually exclusive classes.

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.

How should developers inspect logits?

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.

Related concepts

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.

Practical applications of logits

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.

A practical logits checklist

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.

Frequently asked questions

Are logits the same as log odds?

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.

Can a logit be greater than 1?

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.

Why do loss functions often take logits as input?

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.

Sources

  1. Google ML Glossary
  2. PyTorch logits-to-probabilities
  3. PyTorch CrossEntropyLoss
Share on Social

Jump to:

What are logits in AI?Why do models use logits instead of probabilities directly?How do logits become probabilities?What is a logit in logistic regression?How are logits used in language models?How do logits affect a model's prediction?What is the difference between softmax and sigmoid?How should developers inspect logits?Related conceptsPractical applications of logitsA practical logits checklistFrequently asked questionsSources

Sign up for emails of our latest articles and news