The Illusion of Equivalence: Systematic FP16 Divergence in KV-Cached Autoregressive Inference
- URL: http://arxiv.org/abs/2604.15409v1
- Date: Thu, 16 Apr 2026 15:59:40 GMT
- Title: The Illusion of Equivalence: Systematic FP16 Divergence in KV-Cached Autoregressive Inference
- Abstract summary: KV caching is a ubiquitous optimization in autoregressive transformer inference.<n>We show that FP16 KV cache inference is fundamentally non-equivalent to recomputation.
- Score: 2.954681536906518
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: 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.
Related papers
- Accuracy is Not Enough: A Divergence-Based Approach to Evaluate Fidelity Loss in Quantized LLMs [13.897073114465094]
Deployment of Large Language Models (LLMs) on memory-constrained edge devices relies heavily on aggressive post-training quantization.<n>We introduce a distribution-sensitive evaluation framework quantifying information loss in quantized LLMs.<n>We quantify probability mass displacement and distributional drift relative to the BF16 reference, capturing predictive distribution changes not reflected in top-1 accuracy.
arXiv Detail & Related papers (2026-09-07T15:49:52Z) - SemKV: Semantic Mixed-Precision KV Cache Quantization Guided by the Quality Cliff for Long-Context LLM Inference [3.2938220347051175]
We show that uniform KV quantization on a fractional-bit grid does not degrade gracefully.<n>We show that replacing the affine base with a distortion-optimized quantizer (TurboQuant-MSE) prunes the cliff in every protocol tested.
arXiv Detail & Related papers (2026-08-28T22:19:47Z) - Closing the Null Space: Guidance-Aware Quantization for Classifier-Free Diffusion [0.0]
Two-pass CFG execution pattern imposes a latency overhead that parameter-count and bit-operation metrics conceal entirely.<n>Guidance-Aware Mixed Precision (GAMP) is proposed, which calibrates directly on the guided prediction.
arXiv Detail & Related papers (2026-07-09T08:42:07Z) - Modeling Normal Is All You Need: Joint Latent Clustering for Anomaly Detection in Multimodal Cyber-Physical Systems [47.027290803102666]
Normal behaviour is the union of many imbalanced, curved, thin-fringed operating regimes.<n>We model the normal law with a jointly learned latent representation plus explicit Gaussian-mixture mode clustering.<n>We evaluate under a deliberately fair protocol: raw point-wise metrics with no point adjustment, a trivial-detector difficulty split, prevalence-matched F1, and train-normal-only calibration.
arXiv Detail & Related papers (2026-07-07T10:10:00Z) - Demystifying Numerical Instability in LLM Inference: Achieving Reproducible Inference for Mission-Critical Tasks with HEAL [18.134050827462005]
Large Language Models (LLMs) deploy into mission-critical domains (e.g. finance, medicine, law)<n>Experiments with 16-bit precisions still exhibit catastrophic output divergence across heterogeneous GPUs.<n>We propose Hybrid Error ALleviation (HEAL), a targeted intervention that approximates FP32 accelerators while resolving hardware constraints.
arXiv Detail & Related papers (2026-06-19T01:21:10Z) - LimiX-2M: Mitigating Low-Rank Collapse and Attention Bottlenecks in Tabular Foundation Models [56.999481798138625]
LimiX-2M is a 2M- parameter model that outperforms larger TabPFN-v2 and TabICL baselines on widely used benchmarks.<n>We present a unified tokenize-and-route framework for strong Tabular foundation models (TFMs)<n>Results highlight value-aware tokenization and readout-aligned routing as key levers for improving the accuracy--efficiency trade-off in TFMs.
arXiv Detail & Related papers (2026-06-03T06:07:33Z) - Alignment Collapse Under KV Cache Quantization: Diagnosis and Mitigation [6.129872931808218]
Key-value ( KV) cache quantization is widely used to reduce Large Language Model (LLM) inference memory.<n>In this study, we explore alignment preservation under KV cache quantization.<n>We find that low-bit quantization can silently destroy safety alignment.
arXiv Detail & Related papers (2026-06-01T02:02:20Z) - OmniISR: A Unified Framework for Centralized and Federated Learning via Intermediate Supervision and Regularization [58.03221830946145]
We propose OmniISR, a unified framework that fuses pure CL, pure FL, and hybrid CL-FL training modes.<n>We show that OmniISR consistently improves model performance in both centralized and federated paradigms.
arXiv Detail & Related papers (2026-05-19T04:13:27Z) - UTOPYA: A Multimodal Deep Learning Framework for Physics-Informed Anomaly Detection and Time-Series Prediction [42.532335022354545]
Anomaly detection in batch processes is hindered by transient dynamics, scarce fault labels, and reliance on singlemodality sensor data.<n>This work introduces UTOPYA, a multimodal framework that jointly addresses anomaly detection, time-series prediction, and phase classification in batch distillation.<n>A physics-informed regularisation scheme introduced in this work enforces temporal smoothness and thermodynamic monotonicity.
arXiv Detail & Related papers (2026-05-18T10:28:15Z) - Universally Empowering Zeroth-Order Optimization via Adaptive Layer-wise Sampling [43.822941944402544]
Zeroth-Order optimization presents a promising memory-efficient paradigm for fine-tuning Large Language Models.<n>However, its practical adoption is severely constrained by slow wall-clock convergence and high estimation variance.<n>We propose AdaLeZO, an Adaptive Layer-wise ZO optimization framework.
arXiv Detail & Related papers (2026-04-20T13:37:31Z) - Learning from Emptiness: De-biasing Listwise Rerankers with Content-Agnostic Probability Calibration [76.08899010904652]
CapCal is a training-free framework that mechanically decouples positional bias from ranking decisions.<n>It achieves superior performance among training-free methods while preserving single-pass efficiency.
arXiv Detail & Related papers (2026-04-11T10:47:22Z) - Variational Routing: A Scalable Bayesian Framework for Calibrated Mixture-of-Experts Transformers [5.534626267734823]
We introduce Variational Mixture-of-Experts Routing (VMoER), a structured Bayesian approach for modelling uncertainty in MoE layers.<n>VMoER confines inference to the expert-selection stage which is typically done by a deterministic routing network.<n>Across tested foundation models, VMoER improves routing under noise by 38%, and increases out-of-distribution AUROC by 12%.
arXiv Detail & Related papers (2026-03-10T10:07:53Z) - Silent Inconsistency in Data-Parallel Full Fine-Tuning: Diagnosing Worker-Level Optimization Misalignment [27.352639822596146]
Cross-worker divergence in losses and gradients can remain invisible under conventional monitoring signals.<n>We propose a model-agnostic diagnostic framework that quantifies worker-level consistency using training signals readily available in standard pipelines.
arXiv Detail & Related papers (2026-02-16T04:42:30Z) - Generalizing GNNs with Tokenized Mixture of Experts [75.8310720413187]
We show that improving stability requires reducing reliance on shift-sensitive features, leaving an irreducible worst-case generalization floor.<n>We propose STEM-GNN, a pretrain-then-finetune framework with a mixture-of-experts encoder for diverse computation paths.<n>Across nine node, link, and graph benchmarks, STEM-GNN achieves a stronger three-way balance, improving robustness to degree/homophily shifts and to feature/edge corruptions while remaining competitive on clean graphs.
arXiv Detail & Related papers (2026-02-09T22:48:30Z) - Environment-Aware Indoor LoRaWAN Path Loss: Parametric Regression Comparisons, Shadow Fading, and Calibrated Fade Margins [3.776919981139063]
Indoor LoRaWAN propagation is shaped by structural and time-varying context factors.<n>We present an environment-aware, statistically disciplined path loss framework evaluated using leakage-safe cross-validation.
arXiv Detail & Related papers (2025-10-05T20:14:48Z) - Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inference [31.2331188304598]
Changing system configuration, such as evaluation batch size, GPU count, and GPU version, can introduce significant differences in the generated responses.<n>We trace the root cause of this variability to the non-associative nature of floating-point arithmetic under limited numerical precision.<n>Inspired by this, we develop a lightweight inference pipeline, dubbed LayerCast, that stores weights in 16-bit precision but performs all computations in FP32.
arXiv Detail & Related papers (2025-06-11T08:23:53Z) - vCache: Verified Semantic Prompt Caching [95.16654660556975]
This paper proposes vCache, the first verified semantic cache with user-defined error rate guarantees.<n>It employs an online learning algorithm to estimate an optimal threshold for each cached prompt, enabling reliable cache responses without additional training.<n>Our experiments show that vCache consistently meets the specified error bounds while outperforming state-of-the-art static-threshold and fine-tuned embedding baselines.
arXiv Detail & Related papers (2025-02-06T04:16:20Z) - Consistency Trajectory Models: Learning Probability Flow ODE Trajectory of Diffusion [56.38386580040991]
Consistency Trajectory Model (CTM) is a generalization of Consistency Models (CM)
CTM enables the efficient combination of adversarial training and denoising score matching loss to enhance performance.
Unlike CM, CTM's access to the score function can streamline the adoption of established controllable/conditional generation methods.
arXiv Detail & Related papers (2023-10-01T05:07:17Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.