ResCom: Activation Residual Compensation for Large Language Model Quantization

ResCom adds a low‑rank correction based on activation rounding residuals to improve quantized LLM accuracy without extra training.

ResCom: Activation Residual Compensation for Large Language Model Quantization

Introduction

Quantizing large language models (LLMs) to low‑bit weights and activations is essential for reducing memory footprint and inference cost, but the rounding of activations often introduces a hidden source of error that degrades downstream performance. The paper ResCom: Activation Residual Compensation for Large Language Model Quantization proposes a simple, training‑free technique that leverages the residual left over after activation rounding to correct layer outputs. By constructing a low‑rank compensation matrix during calibration, ResCom restores much of the lost accuracy while preserving the speed and memory benefits of quantization.

How ResCom Works

Activation residuals as a signal

When an activation tensor is quantized, each value is snapped to the nearest representable level. The difference between the original floating‑point value and its quantized counterpart—the residual—contains information about the quantization error that is otherwise discarded. ResCom treats these residuals as a directional signal that can be used to adjust the subsequent layer’s output.

Low‑rank correction

Rather than storing a full‑size correction for every activation, ResCom computes a rank‑`r` matrix that captures the most influential directions of the residuals. The rank is chosen to balance expressiveness and storage; the authors demonstrate that a rank‑32 correction for the attention sub‑layers of Llama‑3‑8B yields substantial gains.

Output‑aware calibration

During a brief calibration phase (no gradient updates), the method evaluates how each residual direction contributes to the reconstruction error of the model’s final output. The most impactful directions are selected, and the corresponding low‑rank correction is solved in closed form. This procedure requires only a forward pass over a calibration dataset and does not modify the already‑quantized weights.

Reported Benefits

  • Perplexity: On Llama‑3‑8B with 4‑bit weights and activations, applying a rank‑32 attention correction reduces WikiText‑2 perplexity from 7.708 to 7.147.
  • MMLU: The same setting improves the Massive Multitask Language Understanding (MMLU) score by 2.89 percentage points.
  • GSM8K: Five‑shot accuracy on the GSM8K math benchmark jumps from 23.96 % to 36.16 %.
  • Scalability: Experiments span models from 1 B to 70 B parameters and include held‑out C4 evaluations, indicating that the approach generalizes across model sizes and data distributions.
  • Efficiency: The FP32 implementation adds only 2.25 % to a 4K token prefill latency, while a compact‑storage variant retains a 27.7 % peak‑memory reduction compared with FP16.

Practical Takeaways

  1. Minimal overhead – ResCom requires only a short calibration run and no additional training, making it attractive for production pipelines that already quantize models.
  2. Low‑rank design – By limiting the correction to a modest rank, the method keeps extra memory and compute costs low, which is crucial for edge or inference‑only environments.
  3. Compatibility – The technique works alongside existing quantization schemes (e.g., 4‑bit weight/activation quantization) and can be applied to any transformer‑style LLM without architectural changes.
  4. Open‑ended calibration data – Since the calibration step is output‑aware, practitioners can use a small, representative text corpus rather than the full training set, simplifying deployment.

Conclusion

ResCom demonstrates that the often‑ignored activation rounding residuals can be turned into a powerful corrective signal. By extracting the most influential residual directions and applying a low‑rank compensation during calibration, the method restores a large portion of the accuracy lost to aggressive quantization, all while keeping computational and memory overhead modest. For teams looking to deploy quantized LLMs at scale, ResCom offers a pragmatic, training‑free boost that bridges the gap between efficiency and performance.

Source

Read original source

Why we picked this

Introduces a novel method for LLM quantization, directly relevant to AI model deployment.

← Back to all articles