PulseAugur
EN
LIVE 09:13:13

LLM temperature=0 inference not deterministic due to GPU batching

LLM inference at temperature=0, which typically selects the highest probability token, is not guaranteed to be deterministic due to the nature of floating-point arithmetic and batching on GPUs. Concurrent requests sharing GPU resources can alter the order of operations in calculations like matrix multiplication and attention, leading to tiny variations in output probabilities. When the probabilities of the top two tokens are very close, these minor variations can cause the model to select a different token, resulting in a completely different output sequence. To achieve true bit-identical reproducibility, specialized batch-invariant kernels are required, which can incur a performance cost. AI

IMPACT Highlights a subtle but important detail for developers using LLMs for evaluation and regression testing.

RANK_REASON Technical explanation of a nuance in LLM inference behavior. [lever_c_demoted from research: ic=1 ai=1.0]

Read on dev.to — LLM tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

LLM temperature=0 inference not deterministic due to GPU batching

COVERAGE [1]

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

    Temperature=0 Doesn't Mean Deterministic. Your Batch Size Does.

    <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…