Everything *[NYC] 2026: see what we announced. →
Skip to content

Log probabilities (logprobs) definition

A log probability (logprob) is the natural logarithm of the probability a language model assigns to a token. At each position in its output, the model produces a probability distribution over its vocabulary, and many model APIs can return the logprob of the token the model picked plus the logprobs of a set number of the highest-ranked alternatives it considered at that position.


A diagram explaining Log probabilities (logprobs) in terms of related concepts.

What are log probabilities (logprobs) in LLMs?

Why do language models use logs instead of plain probabilities?

How do you get logprobs back from a model API?

What do developers actually use logprobs for?

Are logprobs the same as a confidence score?

How do logprobs relate to decision models?

Unlock New Possibilities with Sanity

With log probabilities (logprobs) under your belt, it's time to see what Sanity can do for you. Explore our features and tools to take your content to the next level.

Last updated: