SecurityTechInsider AI security & governance
EN/ NL
Governance

Temperature alone does not provide proof

Four studies show that temperature and sampler are important factors in code-generation reproducibility. Record model version, sampler, random state and test

24 November 2026 3 min
Illustration for this article: Temperature alone does not provide proof. Oxidised copper and patinated brass sheet, corrosion blooming across the surface.
Organisations must now record the full sampling configuration and execution environment for code generation to prove reproducibility in audit or dispute. Image: SecurityTechInsider — original editorial illustration

You must now record the full sampling configuration and execution environment for every code generation workflow, not temperature alone. A single parameter does not prove reproducibility.

The prompt is an analysis of 24 November 2026 of temperature and sampler effects on code-generation reproducibility, which argues that temperature and sampler together determine the candidate space for long code generation, and that temperature alone cannot guarantee repeatability. The analysis draws on four academic studies testing this claim across open-weight models and code agent benchmarks. In our assessment, this means you cannot rely on a single API parameter to demonstrate reproducibility in code delivery or agent output, and must instead treat reproducibility as a property of the entire generation and execution chain.

Why does temperature alone not guarantee reproducible code?

Temperature controls how sharply or flatly a model chooses between possible next words. The sampler then determines which candidates may be chosen from at all. The combination of these two settings, not temperature in isolation, determines whether long code generation holds up or collapses. The research shows that at high temperature, configurations using top-p, top-k and pure sampling failed, whilst samplers that tightly constrain the candidate set remained more robust. The order matters too: whether temperature is applied before or after truncating the candidate list changes the outcome. This undermines the widespread assumption that one number in an API call is the determinism dial.

What else beyond temperature affects reproducibility?

Visible text is not the full input. Variation also arises through context assembly, model version, batching, numerical execution, orchestration and external tools. A fixed random seed only helps under strictly controlled conditions. As soon as the model version, the way the prompt is assembled, the retrieval, the batch size, the numerical kernels or a tool result changes, the same seed can still produce different code. This explains why two seemingly identical runs diverge in practice.

What are the failure modes you need to guard against?

  • Incomplete sampling documentation — reporting only temperature zero without recording sampler type, random state and execution environment.
  • Silent model or tokenizer drift — supplier updates to model version or tokenizer without controlled release or notification.
  • Unverified performance claims — benchmark results that do not state the exact sampling setting and number of repetitions used.
  • Unexecuted generated code — code delivered without running it in a fixed sandbox against versioned tests.
  • Audit and dispute risk — reproducibility claims that cannot be independently verified or recomputed by a third party.

Which concrete controls must you demonstrate in your code delivery workflow?

  1. Record model version and tokenizer version — pin both in the change management pipeline and change only through controlled release, not silently by the supplier.
  2. Document the complete sampling configuration — capture temperature, sampler type, random state and any truncation parameters for every generation run.
  3. Capture the execution environment — record software versions, numerical kernels, retrieval configuration and batch size used during code generation.
  4. Run generated code in a fixed sandbox — execute all code against versioned tests before it counts as delivered, to verify correctness and trigger conditional repairs.
  5. Require sampling details in supplier contracts — specify that benchmark results and performance claims must state the exact sampling setting and number of repetitions; otherwise the claim is not fully verifiable.

How should you approach code evaluation and benchmarking?

Code evaluations and agent benchmarks must now document the complete sampling configuration and execution environment, rather than only varying the temperature. Executable tests can be used to select candidates and trigger conditional repairs, shifting the gain from a specific algorithm to the verification itself. The most important shift is treating reproducibility as a property of the whole generation and execution chain, not of a single parameter. This aligns with broader audit methods that leave an evidence trail and with verification practices that allow an independent party to recompute a result or settle a dispute.

Tooling can capture and store the sampling configuration and execution environment automatically, but the decision to require this data, to pin model versions through controlled release, and to run generated code against tests before acceptance remains yours to make and to defend.

Sources: This article draws on reporting and guidance from arXiv and ACL Anthology (Industry Track).

Marit Halversen

Written by

Marit Halversen

Covers AI governance and regulatory design, with a focus on how compliance obligations land on architecture rather than on paperwork.