aiaimodel.cards
Inference33

Log probabilities

The model's confidence in each token it produced

Log probabilities

The logarithm of the probability the model gave each output token, and optionally the most likely alternatives at each position, returned by some APIs on request.

Why it matters. They let you measure confidence, score options and build classifiers without parsing free text.

How it works

Log probabilities (logprobs) are natural logarithms of token probabilities, so they are 0 or negative: 0 means certain, and more negative means less likely. Many APIs can return the chosen token's logprob plus the top few alternatives at each position; adding up token logprobs gives the log probability of a whole sequence.

Availability varies: some providers return them only for some models, some not at all, and reasoning models often don't expose them. Self-hosted engines such as vLLM and llama.cpp generally can. Implementations differ on whether values are taken before or after sampling adjustments such as temperature.

Typical uses are confidence thresholds on classification labels, ranking candidate answers and flagging uncertain spans for review. They are not calibrated chances of being correct: a model can be confidently wrong.

Worked example

Illustrative: a classifier returns "yes" with logprob -0.105 and "no" with -2.303. Since e^-0.105 = about 0.90 and e^-2.303 = about 0.10, the model put about 90% on "yes". A routing rule could send anything below 0.80 to a human.

Common mistakes

  • Treating token probability as the chance the answer is right; it measures confidence, not accuracy.
  • Reading only the first token's logprob when the label spans several tokens.
  • Designing around logprobs before checking that the model and API return them, especially for reasoning models.

See it on a real card: Build with it on Llama 4 Maverick.

Related terms