Imagine you’re running a high-stakes math competition. You have a brilliant student (your LLM) who usually gets the right answers. To speed things up, you decide to let them use a calculator or organize their scratchpad differently. On paper, these changes shouldn't affect the final result. But suddenly, on one specific problem, the student who previously answered "26" now confidently says "13."
What happened? The student is still just as "accurate" on average, but for that one specific person asking that one specific question, the answer just flipped.
This is the "Butterfly Effect" of LLM serving, and it’s the core of Sharven Rane’s recent paper.
TL;DR
Even "exact" LLM optimizations—like speculative decoding or prefix caching—can change the specific answers a model gives, simply because floating-point math in a busy, batched environment is inherently chaotic. This paper shows that these "exact" features flip answers about as often as just reordering the requests in a queue, while "lossy" shortcuts like FP8 KV caching flip twice as many.
What Problem Does This Paper Address?
In production, we use "serving shortcuts" to make LLMs faster and cheaper. Features like speculative decoding (using a tiny model to guess what the big model will say) or prefix caching (remembering previous prompts) are documented as "exact." This means that, mathematically, the output distribution shouldn't change.
However, computers don't do math with infinite precision; they use floating-point numbers. In a batched engine like vLLM, a request’s calculations depend on how many other requests are in the batch and how the work is split across the GPU. Because floating-point addition isn't associative ($ (a+b)+c $ isn't always exactly $ a+(b+c) $), tiny errors in the very last bit of a calculation can cascade. One flipped bit changes one token; one changed token sends a math derivation down a completely different path.
The author tackles a practical engineering question: How do we tell if a new feature is "breaking" the model, or if we're just seeing the natural "noise" of a busy server?
Methods
The author served a Qwen3 4B Instruct model using vLLM and tested nine different single-feature configurations. To measure the "noise floor," they established two benchmarks:
- The Restart Floor: Running the exact same requests after a fresh process restart.
- The Scheduling Floor: Running the same requests but in a different order (shuffling the queue).
They then compared these "floors" against the "flip rates" of features like prefix caching, chunked prefill, and speculative decoding. Crucially, they also tested a "control arm" using batch invariant kernels—specialized code that ensures the math is done in the same order regardless of the batch composition, effectively killing the noise.
Datasets
The study used a battery of 3,380 items across five standard benchmarks:
- GSM8K & MATH500: For multi-step mathematical reasoning.
- MMLU: For general knowledge across various subjects.
- HumanEval & MBPP: For Python code generation and functional correctness.
Key Insights and Ideas
- The Scheduling Noise is Real: Just changing the order in which requests arrive at a server flips about 1.72% of graded outcomes. If you're testing a new feature and see a 1.5% change in answers, you haven't necessarily found a bug; you might just be seeing the "weather" of the GPU.
- "Exact" is a Relative Term: Features like speculative decoding and prefix caching are "exact" in that they don't exceed the noise generated by reordering requests. They stay within the "scheduling floor."
- The FP8 KV Cache Warning: Many teams treat FP8 KV caching (compressing the model's "memory") as a nearly free lunch. This paper shows it is decidedly not exact. It flips 3.36% of answers—double the noise floor—making it as impactful as changing the model's weights themselves.
- The Magic of Batch Invariance: When using batch invariant kernels, the "exact" features became truly, bit-for-bit identical to the reference. This proves that the flips we see in production are almost entirely due to the non-deterministic nature of batched floating-point math.
Key Results
- Flip Rates: Under default settings, "exact" features flipped between 1.47% and 1.78% of answers.
- The Floor: The scheduling floor was measured at 1.72%. Because the features didn't significantly exceed this floor, they can be considered "exact" for practical purposes.
- FP8 Impact: The FP8 KV cache flipped 3.36% of outcomes. Interestingly, while it flipped many individual answers, the aggregate accuracy barely moved (+0.13 points), illustrating why looking at accuracy alone is dangerous.
- Reproducibility: With batch invariant kernels, the flip rate for all seven "exact" features dropped to 0.00%.
Limitations and Future Work
- Model Scale: The study used a 4B parameter model. Larger models might have larger "margins" on easy items, potentially making them more or less sensitive to these flips.
- Hardware: Results were gathered on a single consumer GPU (RTX 5070 Ti). Multi-GPU setups or different architectures might exhibit different noise characteristics.
- Traffic Patterns: The "scheduling floor" was measured by shuffling a static list. In the real world, arrival times and request lengths vary constantly, which likely raises the noise floor even further.
The author's final recommendation for engineers? If you want to be sure a serving change is safe, don't just run one test. Use at least three replicas to measure your noise floor, or better yet, certify your changes using batch invariant kernels where the expected noise is zero.
Summary updated