FundamentalsUpdated 2026-10-24

Top-p Sampling

Sample only from the smallest set of tokens whose cumulative probability reaches p.

#参数#采样#生成

In plain language

Top-p, or nucleus sampling, controls randomness alongside temperature. Smaller p means fewer candidates and more conservative output; larger p allows richer expression. Usually adjust one, not both aggressively.

Example

Use p=0.9 for factual Q&A and 0.95-1.0 for creative writing.

Recommended tools

Related terms