aiqbench analysis
This research exposes a critical reproducibility risk in LLM serving where enabling prefix caching causes significant trajectory divergence in agentic workloads, particularly under weight quantization. The study demonstrates that while cached paths are deterministic given their state, the absence of persistent cache state between requests introduces non-determinism that scales from 36% to 75% of episodes when moving from 16-bit to 4-bit precision. This finding is vital for engineers deploying reliable AI agents, as it highlights a hidden instability in standard serving optimizations that can alter task outcomes without affecting aggregate accuracy metrics.
Same Request, Different Answer: Quantization Amplifies Cache-Induced Divergence in LLM Serving
From arXiv
Full textPrefix caching, in which a serving engine reuses the key and value tensors of a shared prompt prefix across requests, is enabled by default in the major open-source stacks and treated as a transparent optimization. We measure what it costs in reproducibility, and find that the cost rises sharply with weight quantization. Holding the model, decoding parameters, seed, and request order fixed, and issuing every request serially at batch size one, we ran an eighty-episode multi-turn agentic tool-use workload with caching enabled and disabled across two engines and four weight formats.
Enabling the cache changed the agent's trajectory on 36.2 percent of episodes at 16-bit precision and on 75.0 percent at four-bit, a gradient that survives re-measurement under a controlled cache configuration. With caching disabled, repeated execution was bit-identical in every configuration, 0 of 800 episodes, which bounds other sources of nondeterminism at 0.5 percent. Repeated cache-enabled runs did diverge, and three experiments locate the cause: a single server-level prompt-cache setting moves run-to-run divergence by 37.5 percentage points, execution order acts only while that setting is active, and restoring cache state makes the cached and recompute paths each reproduce on 40 of 40 items while still differing from each other on 14.
Cached serving is deterministic given cache state, and irreproducible in practice because that state is absent from the request and never reset by default. A single-turn bridge shows the divergence reaching task outcomes without shifting aggregate accuracy. We release the harness, logs, and analysis pipeline.
Full text under the publisher's open licence · 247 words