The Illusion of Equivalence: Systematic FP16 Divergence in KV-Cached Autoregressive Inference
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
KV caching is a ubiquitous optimization in autoregressive transformer inference, long presumed to be numerically equivalent to cache-free computation. This assumption fails under standard FP16 precision: cache-ON and cache-OFF execution paths employ different floating-point accumulation orderings which, due to FP16 non-associativity, produce a deterministic divergence in decoded token sequences. Across three open-weight models (LLaMA-2-7B, Mistral-7B-v0.3, Gemma-2-2B) evaluated on GSM8K, we observe a 100% token divergence rate across all sampling strategies, including greedy decoding, which rules out sampling randomness as a cause, and also with cache-ON yielding higher accuracy in 8 of 9 conditions, where the accuracy difference serves as an indicator that the divergence direction is systematic rather than random. Controlled FP32 falsification reduces divergence by eight orders of magnitude, eliminates token flips, and drops the flip rate to exactly 0.0%, confirming FP16 non-associativity as the sole causal driver. Layer-wise drift profiling reveals architecturally predictable propagation patterns: models using Grouped-Query Attention exhibit sharp divergence at the first layer, while Gemma's larger head dimension and sliding window attention produce uniform accumulation across all layers. Finally, activation patching of the entire residual stream fails to recover the cache-free trajectory, localizing the causal variable to the stateful KV cache. These findings establish that FP16 KV cache inference is fundamentally non-equivalent to recomputation and provide a mechanistic framework for understanding numerical instability in modern LLM inference systems.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 21 of its 26 references that are in the map. First posted on arXiv 16 Apr 2026.
Builds on
21 of 26 references.
Closest ancestors · 1
Same direction, newest first
Other references · 20
- 2023GPT-4 Technical Reportcited by 18,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,928
- 2022GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformerscited by 1,838
- 2022SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Modelscited by 1,338
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
8 more
- 2023AWQ: Activation-aware Weight Quantization for LLM Compression and Accelerationcited by 1,234
- 2017Mixed Precision Trainingcited by 1,135
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
- 2023Siren's Song in the AI Ocean: A Survey on Hallucination in Large Language Modelscited by 695
- 2015Deep Learning with Limited Numerical Precisioncited by 368
- 2023How is ChatGPT's behavior changing over time?cited by 265
- 2025Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inferencecited by 47
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026Stage-Replay Divergence Follows the KV Cache: Fixed-Prefix Precision Controls and Bidirectional Cache Transplantationcited by 1
- 2026From Expert Reduction to Behavioral Divergence: Tracing Numerical State through Sparse MoE Inferencecited by 0
- 2026Same Request, Different Answer: Quantization Amplifies Cache-Induced Divergence in LLM Servingcited by 0
- 2026Greedy Decoding Is Not Precision-Invariant: Cross-Precision Output Divergence in LLM Inferencecited by 0
- 2026Greedy Decoding Is Not Precision-Invariant: Cross-Precision Output Divergence in LLM Inference22 Sep 2026
- 2026Same Request, Different Answer: Quantization Amplifies Cache-Induced Divergence in LLM Serving4 Sep 2026
- 2026Stage-Replay Divergence Follows the KV Cache: Fixed-Prefix Precision Controls and Bidirectional Cache Transplantation30 Jul 2026
- 2026From Expert Reduction to Behavioral Divergence: Tracing Numerical State through Sparse MoE Inference30 Jul 2026
Similar, not cited
Close in wording, no citation either way
- 2026The Residual Stream Is All You Need: On the Redundancy of the KV Cache in Transformer Inference
- 2026Divergence Timing and Cumulative Disagreement under KV-Cache Eviction
- 2026The risk of KV cache compression
- 2026MomentKV: Closing the Directional Gap in KV Cache Eviction for Long-Context Inference
- 2025From TLinFormer to TConstFormer: The Leap to Constant-Time Transformer Attention: Achieving O(1) Computation and O(1) KV Cache during Autoregressive Inference
- 2026Pipeline-Native Transformers: Co-Designing Model Architecture and CPU Inference for Bandwidth-Efficient Autoregressive Decode
- 2026OCTOPUS: Optimized KV Cache for Transformers via Octahedral Parametrization Under optimal Squared error quantization
- 2025Visual Autoregressive Transformers Must Use Omega(n2 d) Memory