Issue 13 · Nov 2–8, 2026Editions · Glossary · Archive · Method · RSS · HU / ENG

News of the AI era, curated weekly

Glossary › Language models

top-p

advancedwidespread

The top-p setting determines from how large a pool of the most likely candidates the language model can sample the next word.

In plain terms

The language model writes text word by word (more precisely, token by token), and at each step draws one from many possible continuations. Top-p regulates how large a set of candidates can be included in this draw.

Imagine a waiter in a restaurant recommending something to you. If they only choose from the most popular dishes, and only enough of them to account for 90 percent of all orders, then rarely requested, unusual dishes will never come up. Top-p likewise cuts off the long tail of unlikely words.

The method is flexible: if the model is very confident in the continuation, the circle narrows to one or two words; if there are many good continuations, it can expand to several hundred. At low values, the text is more predictable; at high values, it is more varied but more prone to slipping in inappropriate words.

How it works

  1. The model calculates a probability for every possible next token, for example: 'coffee' 40%, 'tea' 25%, 'water' 15%, and so on.
  2. It ranks candidates from most likely to least likely.
  3. It sums probabilities from the top down until the total reaches the specified p value (for example, 0.9, or 90%). The candidates that have appeared up to that point, including the one that caused the sum to reach the threshold, form the 'nucleus'.
  4. It discards candidates outside the nucleus and proportionally scales up the probability of those remaining so they sum to 100% again.
  5. From this restricted set, the next token is sampled, then the entire process restarts for the next token.

An everyday example

In the advanced settings of an AI tool, you will find a 'Top P' slider between 0 and 1. If you set it to 0.3, your product descriptions will become more uniform and dry. Around 0.95, you get more varied phrasing, sometimes with surprising word choices.

Who is affected

developerIf you build an application or agent on a language model via API, this parameter adjusts how predictable the output should be. → Code
marketerIn text-writing tools, this determines whether you receive template-based or creative variations for the same request. → Marketing
everyoneThis is partly why a chatbot gives you two different answers to the same question.

A common misconception

MythA top-p of 0.9 means the model picks from 90 percent of the words, or that it is 90 percent accurate.
In realityThe 0.9 refers to the sum of probabilities, not the number of words: it might be covered by a single word, or sometimes by several hundred. It says nothing about the correctness of the answer.

Limits and risks

Similar, but not the same

Related concepts

Broader

sampling, text generation, large language model

Narrower

–

On the edge

temperature, top-k, token, hallucination, prompt

A brief history

The method was described by Ari Holtzman and co-authors in the paper "The Curious Case of Neural Text Degeneration," published on arXiv in 2019 and presented at the ICLR conference in 2020. They showed that generation always choosing the most probable word yields boring, self-repetitive text, while completely free sampling produces nonsense.

Where things stand

At the end of 2026, top-p is an adjustable parameter in the API of most language models. However, providers increasingly restrict it or fix its value themselves, especially for reasoning models, so users touch it less often.

Status: 2026 November

In the news

Appears in 3 Agent Age stories; the curve shows weekly occurrence in the news magazine.

Also known as

top-p · top_p · Top P · top-p sampling · nucleus sampling · top-p sampling · nucleus sampling · core sampling (model-weight sampling)

Sources

This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.