# Log Probabilities (Logprobs)

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

**Field:** Artificial Intelligence  
**Category:** LLMs  
**Also known as:** Logprobs, Token Log Probabilities, Top Logprobs

## Think of it like

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

## 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

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.

## Example code

```json
{ "logprobs": true, "top_logprobs": 2 }
```

Ask for logprobs, and each word comes back with its score and the next best guess.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Token (AI)](https://learn.benibix.com/term/ai/token)
- [LLM Sampling](https://learn.benibix.com/term/ai/sampling)
- [Next-Token Prediction](https://learn.benibix.com/term/ai/next-token-prediction)
- [LLM Temperature](https://learn.benibix.com/term/ai/temperature)
- [Top-k Sampling](https://learn.benibix.com/term/ai/top-k-sampling)
- [Hallucination (AI)](https://learn.benibix.com/term/ai/hallucination)

## Taught in

- [Temperature and Sampling](https://learn.benibix.com/learn/ai-llms/temperature-and-sampling): LLMs, 3/15

![A bar chart of the words a model could write first. Hello has the longest, highlighted bar, a logprob of -0.32, about 73 percent. Hi has a shorter bar, -1.32, about 27 percent. All other words have a tiny bar, far below. A note says closer to zero means more sure, and the model picked Hello.](https://learn.benibix.com/diagrams/ai2-logprobs.svg)

---

Source: https://learn.benibix.com/term/ai/logprobs
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
