AnchorKV: Safety-Aware KV Cache Compression via Soft Penalty with a Refusal Anchor
On the map: Efficient LLM inference and serving → KV cache optimization
also in 1 more
Abstract (arXiv)
Large language models (LLMs) outperform earlier architectures on generative inference and long-context tasks, but their large size introduces significant challenges in memory usage, energy cost, and on-device deployment. Since scaling pre-trained language models improves downstream capability citezhao2023survey, the key-value (KV) cache becomes a dominant inference bottleneck. Recent KV cache compression methods citejo2025fastkv,li2024snapkv,zhou2024dynamickv reduce this cost by retaining only a subset of attention-relevant tokens. However, while these approaches preserve accuracy on benign workloads, their compression policies either fail to defend against jailbreak attacks citejiang2024robustkv or degrade safety alignment under aggressive eviction. We propose AnchorKV, a drop-in modification to KV cache compression that biases token retention scores away from directions in key space associated with harmful prompts. AnchorKV constructs an offline safety anchor by adapting a difference-of-means representation engineering approach citearditi2024refusal,zou2023representation to the layer-specific key projection space used in KV caching. Based on this anchor, a soft penalty token selection rule trades a small amount of utility for substantially improved safety alignment, while reducing to the original compressor when the penalty is zero.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 18 of its 21 references that are in the map. First posted on arXiv 16 Jun 2026.
Builds on
18 of 21 references.
Closest ancestors · 4
Same direction, newest first
- 2024DynamicKV: Task-Aware Adaptive KV Cache Compression for Long Context LLMs19 Dec
- 2024SnapKV: LLM Knows What You are Looking for Before Generation22 Apr
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun
- 2023Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression at Test Time26 May
Other references · 14
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023A Survey of Large Language Modelscited by 2,537
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
- 2024Refusal in Language Models Is Mediated by a Single Directioncited by 960
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
- 2023SmoothLLM: Defending Large Language Models Against Jailbreaking Attackscited by 434
- 2023Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritizationcited by 156
- 2024AdvPrompter: Fast Adaptive Adversarial Prompting for LLMscited by 146
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026AnchorKV: Anchor-Residual KV Cache Compression
- 2026Behavior-Preserving KV Cache Compression
- 2024No Token Left Behind: Reliable KV Cache Compression via Importance-Aware Mixed Precision Quantization
- 2025TailorKV: A Hybrid Framework for Long-Context Inference via Tailored KV Cache Optimization
- 2026GRKV: Global Regression for Training-Free KV Cache Compression in Long-Context LLMs
- 2025ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference
- 2025KVCompose: Efficient Structured KV Cache Compression with Composite Tokens
- 2024SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal Budget