AI Dictionary › AI Fundamentals

Top-p (nucleus sampling)

Top-p, or nucleus sampling, is a sampling technique that limits the model's choices to the smallest group of tokens whose cumulative probability reaches a threshold p, for example 0.9. Picture candidates ranked from most to least likely: you keep them until their probabilities sum to 90% of the total, then discard the rest and draw only within this "nucleus". The count is not fixed: if the model is confident the nucleus is small, if uncertain it widens. It is like inviting to a meeting only the people who together hold 90% of the expertise.

Definition

Top-p matters because it cuts improbable tails that produce nonsense while keeping flexibility. It is often preferred over top-k because it adapts to the model's confidence step by step.

Related terms

More in AI Fundamentals

Put it into practice

From our network

AGORÀ Intelligence: Enterprise AI Governance Platform

Govern AI at scale: policies, adoption and measurable results on your data. Built for boards and C-suite.

Visit agora-intelligence.com →

From the Agora Intelligence blog

More on agora-intelligence.com →

Say what you mean. Get what you need.

Grace Certified, the AI coach that trains and certifies your prompt engineering, by Agora Intelligence.