cd /news/ai-safety/your-model-passed-safety-evals-then-… · home › topics › ai-safety › article
[ARTICLE · art-163290] src=pub.towardsai.net ↗ pub= topic=ai-safety verified=true sentiment=↓ negative

Your Model Passed Safety Evals. Then You Quantized the KV Cache.

A paper presented at the ICML 2026 Mechanistic Interpretability Workshop found that quantizing a model's KV cache from float16 to int4 can cause an aligned language model to answer prompts it previously refused, even though the model's weights were never changed. The finding matters because KV cache quantization is now a production default in major serving frameworks such as vLLM, TensorRT-LLM and SGLang, where it cuts memory by 40% and lowers cost per token, yet safety benchmarks are typically not rerun after the optimization. The result challenges the assumption that quantization affects only speed, memory and perplexity rather than safety-relevant behaviour.

by read15 min views1 publishedNov 3, 2026

15 min read · LLM Infrastructure · AI Safety · Production ML

Here is a scenario that should make any ML engineer uncomfortable.

You spend months aligning a language model. You run it through safety benchmarks — refusal rates, harmful content evals, adversarial prompts. It passes. You’re confident. You deploy it.

Then your infrastructure team, doing exactly what infrastructure teams should do, optimises the serving stack. They quantize the KV cache from float16 to int4. Memory drops 40%. Latency improves. Cost per token falls. Everyone is happy.

Nobody reruns the safety benchmarks.

Three months later, a user discovers the model will now answer questions it refused before deployment. Not because anyone changed the weights. Not because of a new jailbreak. Because of a compression decision that touched nothing the safety team thought to monitor.

This isn’t hypothetical. It’s the finding that came out of the ICML 2026 Mechanistic Interpretability Workshop — and it’s one of those results that, once you understand it, fundamentally changes how you think about deploying aligned models.

I came across this paper while going deep into the mechanistic interpretability literature — a field I’ve been following closely since it started producing results specific enough to actually matter in production. Most interpretability work is fascinating but distant from deployment reality. This one isn’t. This one is about a decision that every team running a production LLM has already made or will make soon. That’s what makes it worth understanding carefully.

Before we get to the problem, it’s worth being precise about what we’re actually talking about — because “KV cache” gets mentioned constantly in production ML discussions and rarely explained properly.

When a language model generates text, it operates autoregressively: it produces one token at a time, and each new token requires attending to every token that came before it. The attention mechanism does this by computing three vectors for each token: a Query, a Key, and a Value. The query for the new token attends to the keys of all previous tokens, uses those similarities to weight the values, and produces the next representation.

The problem is that as sequences get longer, recomputing all those keys and values from scratch at every generation step is extraordinarily expensive. The KV cache solves this by simply storing the key and value vectors from previous tokens and reusing them. Instead of recomputing, you retrieve. For a long conversation, this is the difference between generating at a usable speed and waiting several seconds per token.

Without the KV cache, long-context generation at production scale would be computationally impossible. It is not an optional optimisation — it is a fundamental component of every LLM serving system in use today. vLLM, TensorRT-LLM, SGLang — they all depend on it.

The KV cache does have one serious problem, though: memory. For a model handling long conversations across many concurrent users, the stored keys and values can consume gigabytes of GPU memory. And GPU memory is expensive. Which is where quantization enters the picture.

Quantization, in this context, means reducing the numerical precision of the stored key and value vectors. Instead of storing each number as a 16-bit float (float16), you store it as an 8-bit integer (int8) or a 4-bit integer (int4). The mathematical operations become cheaper, the memory footprint shrinks dramatically, and the serving infrastructure becomes significantly more efficient.

This is not a fringe optimisation. KV cache quantization is now a production default in the major LLM serving frameworks. The implicit assumption — the one that nobody really articulated because it seemed obvious — was that quantization affects performance characteristics like speed, memory, and output quality as measured by perplexity. It does not affect behaviour in ways that matter for safety.

That assumption, it turns out, is wrong.

And the reason it’s wrong is geometrically precise, mechanistically traceable, and genuinely alarming.

The paper from Xu, Kumarappan, and Zhou — presented at both the ICML 2026 Mechanistic Interpretability Workshop and the AdaptFM Workshop — begins with a deceptively simple observation:

Standard quality metrics for KV cache quantization — perplexity, task accuracy, latency — have a blind spot. They cannot detect whether the model still refuses harmful requests after compression.

Perplexity measures how surprised the model is by text. It is an aggregate measure over the entire output distribution. Safety alignment, by contrast, lives in a specific, narrow part of that distribution — the part that governs refusal behaviour. A model can have near-identical perplexity scores at float16 and int4 while having completely different refusal rates. The aggregate metric obscures the specific failure.

What the researchers found when they looked inside the models — across eleven instruction-tuned models ranging from 3.8B to 72B parameters — is this: safety alignment occupies a low-dimensional subspace of the model’s activation space that is orders of magnitude more vulnerable to quantization noise than the full representation space.

Let me translate that from mathematics into something concrete. When a model is safety-aligned — through RLHF, DPO, RLVR, constitutional AI, or any other method — the training process doesn’t uniformly change all the model’s weights. It carves out specific geometric directions in the model’s activation space that correspond to safety-relevant concepts: “this request is harmful,” “I should refuse,” “this is the kind of output I should not produce.” These are what mechanistic interpretability researchers call features — linear directions in high-dimensional space that encode specific meanings.

Think of the model’s activation space as a very high-dimensional room. Most of that room is used for general-purpose representations — language understanding, factual knowledge, reasoning. Safety alignment carves out a small, specific corner of that room and says: this is where refusal lives. When you ask the model something harmful, it checks this corner, finds the refusal signal, and acts accordingly.

Now here is the critical insight from the 2026 paper. That corner of the room — the one where refusal lives — is geometrically small. The safety subspace is low-dimensional, occupying roughly 1⁰² to 1⁰³ times less volume than the full representation space that perplexity averages over. It is a tiny, specific region in a vast space.

Quantization introduces rounding noise across that space. When the noise is tiny relative to the full space, perplexity barely moves — the aggregate measure is unaffected. But that same noise, applied to the tiny safety subspace, can be catastrophic. A rounding error that is invisible at the scale of the full activation space is enormous at the scale of the refusal direction.

The result: the model’s refusal mechanism degrades silently. Perplexity barely moves. The model still generates fluent, helpful text. It just no longer reliably refuses the things it was trained to refuse. The safety team’s benchmarks looked at the wrong scale.

The numbers are not small. Mistral-7B loses 15.2% of its refusals at only 1.03× perplexity degradation — a perplexity change so small it would never trigger an alert in standard monitoring. In the strongest tested setting, safety refusal drops from 0.98 to 0.16. That is not a degradation. That is near-complete safety collapse.

And in production vLLM serving with FP8 KV cache — the standard fp8_e5m2 format used on NVIDIA GPUs — a 30.3% conditional flip rate was observed on Qwen-2.5–7B, roughly 150 times worse than simulated uniform 8-bit quantization.

One of the most practically useful contributions of this research is that it doesn’t just identify the problem — it classifies it. The researchers found three distinct failure modes, each with a different underlying cause and a different fix:

Failure Mode 1: Outlier-Crushes-Safety In most neural networks, a small number of activation channels have dramatically larger magnitudes than the rest — these are called outliers. Quantization schemes set their scaling factors based on these outliers. When they do, the smaller-magnitude channels — which include the channels carrying the refusal signal — get collaterally damaged by the coarse quantization grid forced on them by the outlier-driven scale factor. Think of it like setting the exposure on a photograph to capture a bright light source, which inevitably underexposes the darker parts of the scene that you actually cared about.

Failure Mode 2: Outlier-as-Safety In some models, the safety signal itself overlaps with the outlier channels. This sounds like it would protect safety — outlier channels survive quantization better, right? In fact, it makes things worse. When safety lives in outlier channels, even finer-grained quantization cannot rescue it, because the outlier channels require special treatment that standard quantization schemes don’t provide.

Failure Mode 3: Multi-Layer Dilution In a subset of models, the safety signal is distributed across many layers rather than concentrated in a few. Per-layer fixes work well when safety is concentrated — you can protect the specific layers that matter. When safety is diffuse, layer-by-layer interventions fail to recover it fully because no single layer fix addresses the whole picture.

The reason this taxonomy matters practically is that the right mitigation depends on which failure mode your model is in. Applying the wrong fix not only fails to recover alignment — it can actually make things worse.

Here is where the research becomes immediately actionable. The same team that identified the problem also proposed a solution: Per-Channel Reduction (PCR), a training-free diagnostic protocol that takes approximately 35 GPU-minutes to run and classifies your model into one of the three failure modes — then prescribes the corresponding mitigation.

The protocol works as follows:

Step 1 — Run a 20-prompt diagnostic. A small set of carefully chosen prompts probes the model’s refusal geometry under quantization. These prompts are designed to activate the safety-relevant channels specifically.

Step 2 — Classify the failure mode. Based on the pattern of refusal degradation across bit-widths, PCR classifies the model into one of the three modes described above.

Step 3 — Apply the corresponding mitigation. Each failure mode has a targeted fix — either protecting specific channels during quantization, adjusting the quantization scheme for outlier handling, or distributing protection across layers.

Step 4 — Verify recovery. Rerun the refusal benchmark. The protocol recovers up to 97% of lost alignment at 0–7% memory overhead — training-free, no weight updates required.

The full audit has been validated across six independent axes: held-out models, the KIVI quantizer, scheme transfer, layer-selection baselines, fresh prompts, and system-prompt interventions. It is not an academic exercise — it has been confirmed in production vLLM deployments on NVIDIA GPUs.

A practical checklist worth adding to any LLM deployment process:

I want to step back from the specifics for a moment, because this finding has implications that extend well beyond KV cache optimisation.

The underlying discovery is that safety alignment is geometrically fragile. It does not live uniformly across the model’s weights and activations. It occupies specific, low-dimensional subspaces. And those subspaces are vulnerable to perturbations that standard metrics never measure.

This matters far beyond quantization. Any operation that modifies a model’s internal representations without explicitly protecting the safety-relevant subspaces is a potential alignment failure vector. Fine-tuning on new domains. Model merging. Distillation. LoRA adaptation. Weight pruning. Speculative decoding. The list is long, and the research community has barely begun to systematically audit these operations for safety impact.

The ICML 2026 TrustNLP workshop made this explicit: the geometry of refusal is linearly manipulable — it serves as both a vulnerability and a defence primitive. A safety axis that can be crushed by quantization noise can, in principle, also be deliberately targeted by adversarial interventions. Understanding the geometry is both the path to making alignment more robust and a map of where it can be attacked.

This is also why the connection to mechanistic interpretability is not incidental — it is essential. The only reason this failure mode was found is that researchers were looking inside the model, tracking specific geometric directions, asking not just “what does the model output?” but “where in the model’s internal structure does safety live?” Without those tools, the alignment collapse would remain invisible, exactly as it has been in most production deployments until now.

Dario Amodei’s urgency of interpretability argument lands harder here than almost anywhere else. We cannot protect what we cannot see. The safety properties of a deployed model are not fully captured by its outputs — they are encoded in its geometry, and that geometry can be damaged by the same infrastructure decisions that look entirely routine from the outside.

The uncomfortable conclusion is that AI safety and AI infrastructure are not as separate as most organisations treat them. The safety team runs evals on the aligned model. The infrastructure team optimises the serving stack. The two functions rarely talk to each other about the safety implications of infrastructure decisions.

This paper is an argument for changing that. Specifically, it is an argument for:

Safety-aware quantization — choosing quantization schemes with explicit knowledge of where safety-relevant features live in the model, rather than optimising purely for memory and latency.

Continuous safety monitoring in production — not just at deployment time, but as infrastructure changes are made. Refusal rates, not just perplexity, as a production health metric.

Interpretability as a deployment tool — using mechanistic analysis to characterise a model’s safety geometry before deployment, so that infrastructure teams know which operations are safe and which require additional validation.

Cross-functional safety reviews — including safety evaluation as a gate on infrastructure changes, not just on model updates.

None of this is beyond current capability. The 35-minute audit exists. The tools exist. What hasn’t existed, until this paper, was the clear demonstration that the problem is real, measurable, and fixable.

There is also a broader organisational point worth making. In most companies building on top of LLMs, alignment and infrastructure are separate concerns maintained by separate teams using separate metrics. Safety teams track refusal rates, harmful content rates, and adversarial robustness. Infrastructure teams track latency, throughput, memory efficiency, and perplexity. There is no shared metric that sits at the intersection of those two concerns — and that gap is exactly where this failure lives.

Building that shared metric — a safety-aware inference quality score that infrastructure teams run alongside perplexity — is not a research problem. It is an organisational and tooling problem. The 35-minute PCR audit is a step toward making that concrete. But the deeper fix is recognising that infrastructure decisions are safety decisions, and treating them accordingly from the start.

One result buried in the paper deserves specific attention because it affects a combination of techniques that is increasingly common in production.

Speculative decoding — a technique we will cover in Part 4 of this series — uses a small, fast draft model to propose candidate token sequences, which the large target model then verifies in a single forward pass. It is one of the most effective ways to reduce latency for reasoning-heavy models, and its adoption in production serving has accelerated sharply in 2026.

The paper tested what happens when you combine speculative decoding with target-side KV cache quantization. The result is not a modest degradation — it is catastrophic refusal collapse at 4 to 3-bit KV quantization on the target model. Acceptance rate and throughput are unaffected. Only safety collapses.

This matters because both techniques are independently attractive. Speculative decoding cuts latency. KV quantization cuts memory. Combining them seems like an obvious production win. The safety implication is not obvious at all — which is precisely the problem.

If your serving stack uses speculative decoding and you are considering KV quantization, this combination requires explicit, targeted safety validation before deployment. The standard perplexity and throughput benchmarks will show no issues. The refusal rate benchmarks will show catastrophic ones. The 2026 TrustNLP workshop at ICML captured the shift in how the field is now thinking about alignment fragility. The dominant question has moved from “is the model aligned?” to “where does alignment live, and what can damage it?”

The geometry of refusal — the idea that safety is encoded as a specific linear direction in activation space — has become both a research target and a design primitive. Papers from the 2026 workshop explored using that safety axis as a defence: if you know where the refusal direction is, you can monitor it during inference, detect when it is being suppressed, and intervene. A steerable safety axis, rather than a hidden one, is a more robust foundation for alignment.

This connects directly to the mechanistic interpretability work we covered in Part 1 of this series. Sparse autoencoders, circuit tracing, and Neuronpedia are all tools for finding and characterising specific directions in a model’s activation space. The safety geometry that makes alignment collapse detectable is the same geometry that interpretability tools are designed to map. The fields are converging — and the convergence is producing results with immediate practical value, not just theoretical elegance.

The researchers behind this paper have made their diagnostic tool publicly available. The 35-minute audit protocol, the PCR failure mode classifier, and the mitigation prescriptions are documented in the arXiv paper and the ICML workshop materials. There is no technical barrier to running this before your next quantized deployment. There is only the organisational barrier of knowing it exists and building it into your workflow.

We spend enormous effort aligning models. Constitutional AI, RLHF, RLVR, red-teaming — the alignment research stack is deep and growing. Then we hand those models to infrastructure teams who do exactly what they should do: make them faster, cheaper, more efficient.

And somewhere in that handoff, in a quantization decision that touched nothing the safety team thought to monitor, the alignment silently collapsed.

The 2026 finding is not a criticism of infrastructure engineers — they were optimising the right things, with the right tools, against the right metrics. It is a criticism of a gap in how we think about the deployment pipeline. Safety is not a property that gets baked into a model and then preserved automatically through every subsequent transformation. It is geometrically encoded, geometrically fragile, and geometrically fixable — if you know where to look.

Now we know where to look. That’s the first step.

If this made you think differently about your deployment pipeline — or if you’ve already hit this problem in production and have a story to tell — I want to hear about it in the comments.

References:

Tags: LLM Infrastructure · AI Safety · KV Cache · Quantization · Mechanistic Interpretability · Production ML · Alignment

Your Model Passed Safety Evals. Then You Quantized the KV Cache. was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

── more in #ai-safety 4 stories · sorted by recency
── more on @icml 2026 mechanistic interpretability workshop 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/your-model-passed-sa…] indexed:0 read:15min 2026-11-03 · —