PulseAugur
实时 09:21:43
English(EN) Temperature=0 Doesn't Mean Deterministic. Your Batch Size Does.

LLM temperature=0 推理因 GPU 批处理而非确定性

LLM 在 temperature=0(通常选择概率最高的 token)下的推理并不保证是确定性的,因为浮点运算和 GPU 上的批处理的性质。共享 GPU 资源的并发请求会改变矩阵乘法和注意力等计算中的操作顺序,导致输出概率出现微小差异。当两个最高概率 token 的概率非常接近时,这些微小的差异会导致模型选择不同的 token,从而产生完全不同的输出序列。为了实现真正的逐位可重现性,需要专门的批处理不变内核,这可能会带来性能成本。 AI

影响 为使用 LLM 进行评估和回归测试的开发人员强调了一个微妙但重要的细节。

排序理由 对 LLM 推理行为细微之处的技术解释。[lever_c_demoted from research: ic=1 ai=1.0]

在 dev.to — LLM tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

LLM temperature=0 推理因 GPU 批处理而非确定性

报道来源 [1]

  1. dev.to — LLM tag TIER_1 English(EN) · speed engineer ·

    Temperature=0 并不意味着确定性。您的批次大小才意味着确定性。

    <h2> The problem </h2> <p>A team I worked with had an eval suite that called their model at <code>temperature=0</code> and diffed the output against a golden completion, on the theory that greedy decoding meant identical input in, identical output out — perfect for catching regre…