跳到主要内容Skip to main content

采样 / 采样参数Sampling

Sampling

  • 模型能力Model capabilities
  • 第二站 · 上手Station 2 · Hands On
解决什么问题What problem it solves

模型在多个候选词里怎么挑,决定输出的发散程度。How the model picks among candidate tokens — this determines how far the output diverges.

这是什么What it is

一组控制生成过程的参数统称:温度、Top-p、Top-k 等。

它们只影响「怎么挑词」,不影响模型本身的智商。

A collective term for parameters controlling generation: temperature, Top-p, Top-k and so on.

They affect only how a token is chosen, not the intelligence of the model itself.

为什么需要知道Why it matters

知道这组参数后,模型输出的不稳定就有了可解释的原因。而不是「它今天抽风」。Once you know these parameters, unstable output has an explainable cause instead of "it was feeling odd today".

出处Sources
  • Gemini 采样参数(topK/topP)Gemini sampling parameters (topK/topP) ↗
  • Anthropic Messages 采样参数Anthropic Messages API sampling parameters ↗