AI
Quantization makes LLM serving less predictable, cache system hides divergence in responses
A new study reveals how weight quantization in language models amplifies inconsistencies when servers reuse cached computation, causing identical requests to produce different answers.
Researchers have uncovered a significant reproducibility problem in how modern language model serving systems handle weight quantization and cached computation. When servers reuse key-value tensor caches from earlier parts of a conversation, response variability surges—especially as model weights are compressed into lower-precision formats.
The Cache Reuse Problem#
Production serving stacks like vLLM and Ollama optimize performance by reusing key-value tensors from shared conversation prefixes, avoiding the need to recompute embeddings for repeated text. However, this optimization creates a blind spot: the cache state itself is not considered part of the request and is not reset between runs. This means identical prompts can take different computational paths depending on what's already in memory.
When the researchers disabled prefix reuse entirely, the same model with the same seed and request order reproduced every generated token perfectly across ten different configurations. Enable cache reuse, and divergence crept in—the model's responses diverged between cache-hit and cache-recompute paths.
Quantization Dramatically Amplifies Divergence#
The team's testing showed a steep relationship between weight precision and response inconsistency. Using Qwen2.5-7B across the tested serving engines:
- 16-bit weights: Divergence occurred in 37.4% of conversation episodes
- 4-bit weights: Divergence spiked to 82.5% of episodes
The effect was not subtle: as precision dropped from 16-bit to 3-bit, the margin shifts between the two top output choices grew 4.9-fold. Running quantized 4-bit models through 16-bit computational kernels (without quantized execution) eliminated most of the extra divergence, suggesting the amplification originates in the quantized inference code itself, not the quantization format alone.
Where the Divergence Happens#
Further investigation pinpointed Ollama's server-level prompt caching system as a major contributor. Under the original episode order, this caching mechanism alone accounted for a 37.5-point swing in divergence rates. Across five random episode orderings, the divergence span ranged from 20.0 to 28.7 percent. Once researchers manually restored the cache state before each run, both execution paths reproduced perfectly—they still disagreed with each other, but each was internally consistent.

