Skip to content
BENIBIX Learn

Log Probabilities (Logprobs)

AI💬 LLMsText Generation

Also known as Logprobs, Token Log Probabilities, Top Logprobs

The model's score for each word it could pick next. Near zero means sure.

Think of it like

It is like a quiz show board. It shows how many people picked each answer.

Example

Lucy asks for logprobs. The first word comes back as Hello at -0.32, about a 73 percent chance, with Hi next at -1.32, about 27 percent.

Why it matters

They show how sure the model was, so you can flag shaky answers or rank choices.

Definition

Logprobs are the scores a language model gives each token it could write next. Each one is the log of a chance, so it is zero or below. A score near zero means the model was very sure. A large negative score means it thought that token was unlikely. Many APIs can send back the logprob of each chosen token, and of the next few it almost picked.

Example code

json
{ "logprobs": true, "top_logprobs": 2 }
Ask for logprobs, and each word comes back with its score and the next best guess.
Each word it could pick gets a logprob, and closer to zero means more sure.

Common mistake

Reading a high score as proof the answer is true. The model can be very sure and still wrong.

Key takeaways

  1. 1
    A score per token. For the chosen one and the runners-up.
  2. 2
    Near zero is sure. Bigger negatives are less likely.
  3. 3
    Sure is not true. Confidence is not a fact check.

Learn it properly