How it works · 20 of 27 Advanced

How do you reproduce an AI bug when the same question gets different answers?

Same question, different answer

Reproducing an AI bug: An AI bug often will not come back on demand, because each answer depends on things that change between runs (the model version, the pages retrieved, sampling, even how busy the server is); to fix it, the team replays the trace and pins each of those until the bad answer appears every time, then keeps it as a test.

Loading the animation…

Say it like this To fix an AI bug, first make it happen every time: replay the trace and pin the model, the retrieved pages, sampling and, if needed, the server batch, then keep the case as a test.

Under the hood — for builders
Worked example: the card's reels
Nothing pinned: the bad refund answer came once in 20 pulls. Pin model and pages from the trace (D1): 5. Temperature 0: 18. Server batch: 20 in 20.
Terms: reproduce, replay, temperature
Reproduce: make a bug happen on demand. Replay: run a recorded request again with its recorded settings. Temperature: randomness in picking the next word; 0 means always the likeliest.
Terms: batch and batch-invariant
Batch: requests the server runs together. Batch-invariant: an answer that does not depend on what else is in the batch.
Measured: temperature 0 is not enough
Horace He and Thinking Machines Lab sent Qwen3-235B one prompt 1,000 times at temperature 0 and got "80 unique completions, with the most common of these occuring 78 times".
Where the answers split
All matched for 102 tokens; then "992 of the completions go on to generate 'Queens, New York' whereas 8 of the completions generate 'New York City'".
Why: the batch
The server's "forward pass lacks 'batch invariance'": an answer depends on how many requests share the batch. With batch-invariant kernels, "all of our 1000 completions are identical".
Our run: order changes the sum
Computers round as they add. Eight numbers that sum to exactly 0, added in 10,000 shuffled orders: 102 different totals; only 1,369 orders gave exactly 0.
What it costs
Thinking Machines timed 1,000 sequences on Qwen-3-8B, one GPU: vLLM default 26 s, deterministic 55 s, 42 s with an improved attention kernel.
In our papers
flide-forking-engine-for-agent-decisions notes Flide's option: "Add --batch-invariant if an answer must never change with load", "at most 10 percent slower".
What the trace must hold
Model id with its date · prompt version · ids of the exact pages or rows retrieved · tool results · temperature and seed · time (finds the index).
Measure it
Share of reported bugs reproduced · time from report to reproduction · reproduced bugs turned into tests · answers that change on replay.
Watch out
Replaying the query instead of the retrieved pages · trusting temperature 0 · a "latest" model alias · closing a bug that could not be reproduced.
Sources
He & Thinking Machines Lab, Defeating Nondeterminism in LLM Inference (Sep 2025) · our paper flide-forking-engine-for-agent-decisions · our run and read, 22 Nov 2026. Slot machine rates: our example.

What happens in the reproducing an AI bug animation, step by step?

  1. A customer was told “refund processed”. It wasn't. You ask the bot the same question: this time the answer is right.
  2. Your turn: each pull is the same question asked again. How many pulls before the wrong answer comes back? Tap a guess.
  3. It lands on pull 14 (our example). Four things changed between pulls; a bug that comes once in a while can't be fixed or tested.
  4. Lock what the trace recorded: the model version and the exact pages found. Now 5 pulls in 20 go wrong. Closer.
  5. Lock temperature at 0. 18 in 20 now, still not every pull: Thinking Machines asked one question 1,000 times at temperature 0 and got 80 different answers.
  6. Lock the server batch, so sums run in the same order however busy it is: 20 in 20. Now it can be fixed, and kept as a test. Next: which answers should a person check?

What everyday example explains reproducing an AI bug?

A slot machine whose reels you lock one by one. The pull is asking again, each reel is one thing that changes between runs, the jackpot is the bad answer, and a locked reel is a setting pinned from the trace.

Why should a team care about reproducing an AI bug?

The team decides what each trace must record so a bad answer can be replayed (D1), whether answers that drive actions need batch-invariant serving at its cost, and that every reproduced bug joins the regression suite (B4).