跳到正文
菜单
简体中文

Top-p Sampling vs Beam Search

Sampling only from the smallest set of tokens whose probabilities reach p.

功能对比

这两项技术尚未记录可对比的属性。

该选哪个?

由上述差异按固定规则生成,不是模型生成的。

Choose Top-p Sampling if…

已记录的属性中,没有任何一项显示它更有优势。

Choose Beam Search if…

已记录的属性中,没有任何一项显示它更有优势。

关于本页

页面保持可访问,但在积累足够的带来源细节之前不纳入搜索索引(PRD SEO-08)。

Top-p Sampling

technique · Techniques

Top-p, or nucleus sampling, keeps the most likely tokens until their cumulative probability reaches a threshold, then samples from that set. It solves the problem that a fixed top-k includes nonsense when the distribution is peaked and excludes reasonable options when it is flat. It exists because the set of plausible continuations should be sized by the model's own confidence.

Beam Search

technique · Techniques

Beam search expands several partial sequences at once and keeps the highest-scoring ones, rather than committing to the token chosen at each step. It solves the problem that greedy decoding can be locally optimal and globally poor. It exists as the default for translation and summarisation, and it tends to produce bland text for open-ended generation.