ModelRefs / Log Probabilities — AI Glossary

Log Probabilities — AI Glossary

The log-likelihood scores assigned by a model to each generated token, useful for confidence estimation and alternative selection.

Overview

When logprobs are enabled (OpenAI `logprobs=true`, Anthropic `top_k_logprobs`), the API returns log p(token) at each position along with top alternative tokens. Used for uncertainty quantification, re-ranking, calibration testing, and interpretability. Important for structured generation where you need the token with highest probability among a constrained set.

Reference details

Topicinference
Also known aslog probs, token probabilities
Last reviewed2026-06-24

Example: Turn one back into a probability

A logprob of −0.05 is e^−0.05 ≈ 0.95, so the model put about 95% of its mass on that token. A logprob of −2.3 is e^−2.3 ≈ 0.10, or roughly 10%. Summing the logprobs of a completion gives the sequence log-likelihood, and dividing by token count normalises it so long answers are not penalised for length. The trap is what this confidence is about: it measures how sure the model is of the next *token*, not whether the claim is *true*. A fluent, confidently-worded fabrication has high logprobs throughout.

Commonly confused with

Logprobs are not a calibrated probability of correctness. They are the model's own distribution over its vocabulary, and post-training tends to sharpen that distribution regardless of accuracy. Calibration is the separate question of whether stated confidence matches observed accuracy, and it has to be measured against outcomes.

When to use it

Reach for it when:

  • Routing: send low-confidence generations to a larger model or to human review
  • Picking among a constrained set of options, where you want the highest-probability valid token
  • Measuring calibration, by bucketing predictions by confidence and checking observed accuracy

Reach for something else when:

  • As a truth score — high confidence and fabrication co-occur routinely
  • Comparing across models: the scales are not commensurable
  • Where the provider does not expose them, or exposes only the top few alternatives

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Log Probabilities — AI Glossary.

Frequently asked questions

What is Log Probabilities?

The log-likelihood scores assigned by a model to each generated token, useful for confidence estimation and alternative selection.

Is Log Probabilities the same as log probs?

Yes — log probs, token probabilities are common aliases for Log Probabilities.

What concepts are related to Log Probabilities?

Closely related concepts include sampling, calibration, beam search.