Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Log probabilities (logprobs)

Topic: Training and modelsAlso called logprobs, token probabilities

Definition

The log of the probability a model gave each token it generated, returned by some APIs to show how confident the model was.

In more detail

In OpenAI's Chat Completions API you set logprobs to true, and top_logprobs to a number from 0 to 20 to also see the most likely alternatives at each position. A log probability close to 0 means the model was almost certain of that token; a large negative value means it was a long shot.

They are useful for classification, where the probability of yes against no gives a score instead of a bare label, and for flagging answers the model was unsure about. They measure confidence in the wording, not truth, so a model can be confidently wrong, and not every provider or model returns them.

  • LLM-as-a-judge

    Using a model to grade another model's outputs against written criteria, ideally checked against a sample of human-labelled cases.

  • Temperature

    A sampling setting that controls randomness: lower values favour the most likely tokens, higher values spread probability more evenly.

  • Token

    The unit of text a model reads and writes, often a word or part of a word; in English a token averages about four characters of text.

  • Top-p

    A sampling setting that restricts the model to the smallest set of likely tokens whose probabilities add up to p, then samples from that set.

  • LLM API parameters cheat sheet

    Temperature, top_p, max tokens, stop, seed, logprobs, JSON output and reasoning effort, with exact names for OpenAI, Claude and Gemini, checked on the API docs.

    Cheat sheetIntermediate

  • LLM evaluation

    Measuring AI system quality with datasets, code checks and model-graded tests.

    SkillIntermediate

  • Temperature

    A sampling setting that controls randomness: lower values favour the most likely tokens, higher values spread probability more evenly.

    Glossary

  • Token

    The unit of text a model reads and writes, often a word or part of a word; in English a token averages about four characters of text.

    Glossary