AnTKV: Anchor Token-Aware Sub-Bit Vector Quantization for KV Cache in Large Language Models

Zeyu Li, Chuanfu Xiao, Yang Wang, Xiang Liu, Zhenheng Tang, Baotong Lu, Mao Yang, Xinyu Chen, Xiaowen ChuarXiv 2025 · DOI

Abstract

As Large Language Models (LLMs) scale to handle massive context lengths, the Key-Value (KV) cache has become a critical memory bottleneck. Standard quantization methods struggle to maintain accuracy below 1-bit. We introduce AnTKV, a novel framework that achieves ultra-low "sub-bit" compression (down to 0.375 bits per element) with minimal performance loss. By identifying and preserving a tiny fraction (1%) of "anchor tokens" in full precision and employing token-aware vector quantization for the remainder, AnTKV enables scaling LLaMA-3-8B to 840K tokens on a single GPU and provides up to 3.5× higher decoding throughput.

Introduction

The memory required for the KV cache grows linearly with sequence length, often rivaling the model's parameters in long-context scenarios. While Scalar Quantization (SQ) is commonly used to compress these caches to 4-bit or 8-bit, it hits a hard floor at 1-bit. Vector Quantization (VQ) can reach sub-bit regimes by grouping numbers into vectors; however, at extreme compression levels, VQ typically suffers from catastrophic accuracy drops because it treats all tokens as equally important. AnTKV addresses this by recognizing that quantization error is highly non-uniform across tokens.

Methods

AnTKV utilizes a dual-stage framework designed to balance extreme compression with high fidelity:

  1. Offline Token-Aware Centroid Learning: Instead of standard k-means, AnTKV uses weighted clustering to create VQ codebooks. It uses gradients (derived from forward error analysis) as weights, ensuring the quantization process prioritizes accuracy for the most sensitive data regions.
  2. Online Anchor Token Selection: The authors developed a lightweight metric called the Anchor Score (AnS) to identify critical tokens on the fly. During inference, the top 1% of tokens with the highest scores are kept in full precision (FP16), while the remaining 99% are aggressively compressed using the learned VQ centroids.
  3. System Optimization: The framework is implemented with custom GPU kernels using Triton, extending FlashAttention to compute Anchor Scores with minimal overhead.
The AnTKV framework involves offline token-aware centroid learning and online selection of high-precision anchor tokens.

Key Insights

  • The 1% Rule: Preserving just a tiny subset of tokens in full precision is sufficient to stabilize the model under aggressive quantization. These "anchor tokens" are not random; they tend to cluster at the initial "sinks" and the most recent tokens of a sequence.
  • VQ vs. SQ: While scalar quantization fails at 1-bit, vector quantization exploits data correlations to reach sub-bit regimes (e.g., 0.375 bits) while maintaining usable performance.
  • Pre-RoPE Quantization: Applying quantization before Rotary Position Embeddings (RoPE) yields better results, as RoPE disrupts the data distribution, making it harder to cluster effectively.

Key Results

AnTKV was evaluated across a broad suite of benchmarks including WikiText-2, C4, and LongBench using models like LLaMA-3 and Mistral-7B.

  • Superior Accuracy: On Mistral-7B at 1-bit, AnTKV achieved a perplexity of 6.32, significantly outperforming prior state-of-the-art methods like CQ (7.25) and KVQuant (15.36).
  • Extreme Compression: AnTKV remains functional even at 0.375 bits, a regime where most other methods fail completely. This allows LLaMA-3-8B to scale to 840,000 tokens on a single 80GB A100 GPU.
  • Throughput Gains: By reducing memory I/O, the implementation delivers up to 3.5× higher decoding throughput compared to a standard FP16 baseline.
AnTKV maintains high performance across diverse long-context benchmarks (LongBench) even as bit-width drops below 1-bit.

Conclusion

AnTKV demonstrates that anchor-aware vector quantization can break the 1-bit barrier for LLM KV caches. By focusing precision on the most critical 1% of tokens, the framework enables massive context scaling and significant throughput improvements. Future work will focus on further refining the Anchor Score metrics and optimizing kernels for a wider variety of architectures, such as Mixture-of-Experts (MoE) models.

Summary updated

BibTeX
@misc{li2025antkv,
  author = {Zeyu Li and Chuanfu Xiao and Yang Wang and Xiang Liu and Zhenheng Tang and Baotong Lu and Mao Yang and Xinyu Chen and Xiaowen Chu},
  title = {{AnTKV: Anchor Token-Aware Sub-Bit Vector Quantization for KV Cache in Large Language Models}},
  year = {2025},
  eprint = {2506.19505},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.19505},
}
Figure