NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Alignment Collapse Under KV Cache Quantization: Diagnosis and Mitigation

Bruce Changlong Xu, Adarsh Kumarappan, Mu ZhouNeurIPS 2026

TL;DR

Compressing a Large Language Model's working memory (KV cache quantization) saves massive amounts of GPU memory, and according to standard metrics like perplexity, the models seem totally fine. However, this paper reveals a silent danger: low-bit compression can secretly lobotomize a model's safety guardrails, causing it to comply with harmful requests it would normally refuse. Fortunately, by mapping out the hidden geometry of where safety lives inside the model, the authors built a fast, training-free diagnostic tool that predicts how a model will break and prescribes an exact fix to recover up to 97% of lost alignment.

Figure 1: KV cache quantization silently destroys safety alignment, and the failure is geometric. Left: Perplexity monitoring misses safety collapse entirely; collapse onsets span four bits across eleven models (3.8B–72B) and five benchmarks (1,894 prompts). Center: The root cause is geometric: safety–outlier channel overlap at the critical layer determines whether per-channel quantization can rescue alignment. Right: PCR diagnoses each model’s failure mode from 20 calibration prompts (∼35 GPU-min) and prescribes model-specific mitigations, recovering up to 97% of lost alignment at minimal memory overhead.

What Problem Does This Paper Address?

When an LLM generates text, it keeps a running scratchpad of past tokens—the Key-Value (KV) cache—so it doesn't have to recompute the entire conversation at every step. For long contexts, this scratchpad hogs GPU memory. The standard engineering fix is quantization: shrinking those stored numbers from 16-bit precision down to 8, 4, or even 2 bits.

Historically, if engineers shrank the KV cache and saw that perplexity (how "surprised" or confused a model is by normal text) and task accuracy stayed flat, they shipped it. What nobody checked was safety. LLMs are carefully post-trained to refuse harmful requests, and refusal is a specific behavior, not a general language fluency score. Can a model pass every standard health check while silently losing its moral compass? Yes—and worse, every model breaks at a completely different compression threshold, leaving engineers flying blind.

Methods

To diagnose and cure this without retraining the model, the authors introduce a metric called ConditionalFlip (the percentage of safe refusals in 16-bit that flip to harmful compliance when quantized) and a novel diagnostic framework called Per-Channel Reduction (PCR).

In standard coarse quantization, a single scaling grid is stretched across an entire layer. Because a few "outlier" channels have massive number ranges, they stretch the grid so wide that quieter channels get squished into a single rounding bin and destroyed. Finer per-channel quantization gives every channel its own custom-fitted grid.

High PCR occurs when outlier channels crush quiet safety channels under a shared grid.

The authors' 4-step, training-free protocol (~35 GPU-minutes) maps this interaction:

  1. Layer Scan: Quantize one layer at a time (using $\ge 50$ prompts) to find the critical layer where the most refusals flip.
  2. Layer-Spread Assessment: Count how many individual layers exceed 10% and 20% flip rates to see if safety is concentrated or spread thin.
  3. Compute PCR: Using just 20 calibration prompts at the critical layer, compare coarse (per-tensor) vs. fine (per-channel) flip rates. High PCR means fine-grained scaling rescues safety; low PCR means it doesn't.
  4. Mitigation Selection: Based on PCR and layer spread, apply a targeted fix—either Group-64 quantization (a memory-cheap approximation of per-channel scaling), keeping specific critical layers in full FP16 precision, or a combination of both.

Datasets

Because the protocol is entirely inference-time and training-free, no training datasets are used. Instead, the authors evaluate 11 instruction-tuned models (3.8B to 72B parameters) across five evaluation benchmarks totaling 1,894 prompts:

  • AdvBench (520 prompts) & HarmBench (320 prompts): Standard adversarial safety suites testing harmful compliance.
  • Custom Alignment Suite (63 prompts): A small set introduced by the authors, used alongside small subsets for fast calibration.
  • XSTest (450 prompts): Tests for exaggerated over-refusal on safe prompts that merely sound edgy.
  • IFEval (541 prompts): Measures general instruction-following degradation outside of safety.

Key Insights and Ideas

  • Why perplexity is blind to safety collapse: Perplexity averages error across the entire representation space (thousands of dimensions). Refusal behavior, however, lives in a tiny, low-energy subspace—making it $10^2$ to $10^3\times$ more vulnerable to rounding noise than general text generation.
  • No universal safe bit-width: Qwen-2.5-7B collapses at 6-bit, Mistral-7B at 4-bit, and Gemma-2-9B survives all the way down to 3-bit before collapsing at 2-bit.
  • Three geometric failure modes:
  • Outlier-crushes-safety (High PCR): Safety lives in quiet channels and gets crushed by outliers; finer quantization (Group-64) easily saves it.
  • Outlier-as-safety (Low PCR): Safety channels are the outliers. They already span the grid, so finer grouping won't help—you must keep those critical layers in FP16.
  • Multi-layer dilution: Safety is spread across dozens of layers, so rounding errors snowball and single-layer fixes fail.
  • Loss of discrimination, not "turning evil": On XSTest at 2-bit, Yi-9B flips 54.9% of unsafe refusals into compliance while simultaneously spiking false refusals on safe prompts from 2.0% to 85.2%. Quantization blurs the decision boundary rather than pushing the model in one direction.

Key Results

  • Silent failures caught: At 4-bit, Mistral-7B's perplexity barely twitches ($1.03\times$ baseline), yet it loses 15.2% of its safety refusals. Even in production vLLM serving on NVIDIA GPUs using standard fp8_e5m2 KV cache, Qwen silently flips 30.3% of its refusals.
  • Accurate predictions & massive recovery: Using just 20 calibration prompts, PCR predicts the right mitigation direction with 100% accuracy across all nine primary models, a 72B model, and an unseen held-out family (OLMo-2, achieving 97.2% recovery).
  • Cheap fixes: The prescribed mitigations recover 52.0% to 97.8% of lost alignment on vulnerable primary models (e.g., dropping Qwen's 4-bit flip rate from 90.3% down to 1.9%, and Gemma's 2-bit flip rate from 91.8% to 2.7%) with under 1% serving latency overhead and minimal memory cost (typically 0–7%).
  • Generalization: PCR accurately predicts safety outcomes on production quantizers like KIVI and rotation-based methods like QuaRot—even catching an edge case where rotation actively worsens safety.

Limitations and Future Work

  • Low-signal models need more prompts: For models where individual layers have very low flip rates (like Mixtral-8x7B and Yi-1.5-34B), 20 calibration prompts aren't enough to get a clean statistical signal; the calibration set has to be bumped up to 50 prompts.
  • Higher memory cost for diluted, moderate-PCR models: While most fixes cost 3–7% extra cache memory, Phi-3.5-mini requires protecting 15 layers in FP16 (47% relative cache overhead, though its small 3.8B size keeps absolute cost low, and a cheaper 5-layer alternative still gets 60.9% recovery).
  • Beyond quantization: Because PCR measures an intrinsic geometric property of the model's architecture, the authors note that the natural next step is extending this diagnostic to other KV compression techniques, such as token eviction, pruning, and low-rank approximations.

Summary updated

BibTeX
@inproceedings{xu2026alignment,
  author = {Bruce Changlong Xu and Adarsh Kumarappan and Mu Zhou},
  title = {{Alignment Collapse Under KV Cache Quantization: Diagnosis and Mitigation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=iyno3PkrLm},
}
Figure