arXiv:2611.08713cs.DCNov 2026

Manuscript Offprint

arXiv:2611.08713

ResServe: Accurate and Efficient FP4 LLM Inference with Residue Compensation

Shuo Rong, Ruibo Fan, Jiawen Wen, Xiaowen Chu

ABSTRACT

Block-scaled 4-bit floating-point (FP4) quantization reduces large language model inference costs but can degrade task quality. Higher-precision computation can mitigate this loss at the expense of some of the efficiency gains from FP4 inference. Narrow matrix computations common in decoding often leave spare hardware capacity for low-cost precision recovery. ResServe combines an FP4 activation base with an FP4-quantized residue representing information lost during quantization. It uses this spare capacity to compute the residue's contribution and combines results on-chip, avoiding extra result transfers. We apply this principle to linear layers and decode attention, while selective compensation limits added work when processing input prompts. On NVIDIA B200, compensated linear kernels using the NVFP4 format improve numerical precision while retaining latency close to uncompensated execution for the evaluated operations with few rows. In the evaluated NVFP4 inference configurations, ResServe adds at most 3.4% request-latency overhead over W4A4 and reduces request latency by 22.4–53.3% relative to W4A8. Across five models, code-generation accuracy improves over same-format uncompensated inference, with mean relative gains of 15.04% for NVFP4 and 53.57% for MXFP4.

Our code is available at github.com/ShawRong/resserve.

1 INTRODUCTION

Large language models (LLMs) support coding assistants (Chen et al., 2021), agentic tool use (Schick et al., 2023), and multi-turn chat. Reducing inference costs while preserving model quality is important for these applications. Quantization reduces these costs by lowering the precision of model weights and activations, the intermediate values produced during computation (Frantar et al., 2023; Lin et al., 2024; Xiao et al., 2023). Recent GPUs natively support four-bit floating-point (FP4) computation (NVIDIA Corporation, 2026a), offering lower storage requirements and lower latency. However, limited precision introduces quantization error that can degrade model quality (Egiazarian et al., 2026; Cook et al., 2025).

This matters especially for complex reasoning tasks. Models such as DeepSeek-R1 and Qwen3 generate reasoning traces to solve mathematical and coding problems (Guo et al., 2025; Yang et al., 2025). Low-bit quantization can reduce reasoning accuracy (Liu et al., 2025a). Under some quantization settings, models also generate longer chains of thought while producing less accurate

answers (Lotfi et al., 2026). Generating more tokens can offset some of the inference speedup from quantization. Precision recovery may therefore affect both answer quality and the computation needed to produce an answer.

Prior work mitigates low-bit quantization error through improved quantization algorithms and transformations of weights and activations (Frantar et al., 2023; Lin et al., 2024; Dettmers et al., 2024; Kim et al., 2024; Xiao et al., 2023; Shao et al., 2024; Ashkboos et al., 2024; Liu et al., 2025b; Sun et al., 2025; Egiazarian et al., 2026). Unlike weights, which can be quantized offline, activations must be quantized during inference. Online quantization and associated transformations therefore require efficient execution (Xiao et al., 2023; Ashkboos et al., 2024; Egiazarian et al., 2026). Another approach pairs four-bit weights with eight-bit activations (Lin et al., 2025; Zheng et al., 2026; Zhang et al., 2024; Baek et al., 2025). These configurations can improve activation precision, but their execution paths do not retain all the computational advantages of native FP4 (Jarmusch et al., 2025; NVIDIA Corporation, 2026a). This raises the question: how can we recover precision in FP4 inference while retaining its execution efficiency?

Our observation is that additional computation does not proportionally increase latency. During decoding, which generates tokens one step at a time, small batches limit the number of token rows processed by linear layers. Decode attention processes few queries for the current token against keys accumulated over the context. The resulting matrix computations are narrow and may leave GPU resources underused. This spare capacity offers room for additional precision-recovery computation. Exploiting it requires suitable execution layouts and low-cost handling of intermediate results.

ResServe uses this spare capacity to compute a correction for activation quantization error. It quantizes the difference between the original activation and its FP4 approximation into FP4. ResServe computes both the base output and a correction from the quantized residue, combining them to recover precision. We call this process residue compensation. ResServe adapts how compensation is computed to the matrix dimensions and combines base and compensation results on-chip, avoiding separate writes to GPU memory followed by an addition. During decoding, it applies this principle to linear layers and attention. Prefill processes the input prompt and typically handles more tokens at once, making full compensation more costly. ResServe compensates a subset of activation channels during prefill to control the added computation, a strategy we call selective prefill compensation.

We implement ResServe in vLLM (Kwon et al., 2023), integrating compensation for linear layers and decode attention. The system supports NVFP4 and MXFP4 for linear computation and uses an NVFP4 KV cache for attention. Relative to same-format uncompensated inference, code-generation accuracy improves by an average of 15.04% for NVFP4 and 53.57% for MXFP4 across five models. With MXFP4, mean relative accuracy gains on the HMMT and AIME mathematics benchmarks (Dekon-inck et al., 2026) are 50.23% and 33.34%, respectively. On the same code-generation benchmark, total output tokens decrease by an average of 3.18% for NVFP4 and 9.16% for MXFP4.

ResServe retains near-W4A4 request latency in the evaluated NVFP4 configurations with selective prefill disabled, while reducing latency relative to W4A8 by 22.4% on Qwen3-8B and 53.3% on Qwen3-32B. With the prefill compensation ratio of 0.25 used in the quality evaluation, MXFP4 ResServe adds 7.0–9.4% request-latency overhead over same-format W4A4.

This paper makes the following contributions:

  • We identify spare hardware capacity in narrow decoding operators that can accommodate additional low-precision computation for precision recovery

without a proportional latency increase.

  • We design execution layouts that use this spare capacity for residue compensation in linear layers and decode attention. On-chip result combination and selective prefill compensation control the added execution cost.

  • We build a complete inference system with NVFP4/MXFP4 linear computation and NVFP4 KV caching. The system improves mean coding and mathematics accuracy across five models, while low-load NVFP4 serving measurements show low integration overhead.

References (92)