FlagRot: Selective Rotation for Low-Bit KV Caches
Kunming Shao, Xijie Huang, Jierun Chen, Jiaqi Shao, Yanli Wang, Jiangnan Yu, Qiwei Li, Wei Zhang,
Key points
From the paper's conclusion- We therefore propose FlagRot, which stores each 32-channel piece rotated or as is, whichever has the smaller calibrated attention error, and rotates the query instead when reading.
Abstract
Long-context inference is bound by the KV cache, which 2-bit codes could shrink about sixfold if their error stays in check. The usual remedy rotates keys before quantizing, assuming rotation always helps. However, we observe that it does not: rotation flattens a spiky piece of a key but can give a flat one a new peak, and both coexist within one key. We therefore propose FlagRot, which stores each 32-channel piece rotated or as is, whichever has the smaller calibrated attention error, and rotates the query instead when reading. We further show that how often to decide follows the quantization axis: per-channel caches such as KIVI need one decision per head, at no write cost, while per-token caches decide per key, with the choice stored in existing sign bits. At 2.5 bits per value, FlagRot lowers the twelve-model KL divergence of KIVI from 18.7 to 12.4 x 10^-3, below RotateKV on 9 of 12 models. Served as a vLLM plugin, it raises RULER at 128k tokens by +2.9 points and the LongBench v1 mean by +0.4 to +1.9 points on the three of four models where 2-bit KIVI loses accuracy. It also lowers the error of 4-bit integer and FP4 caches.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Dual-QK: Sharp Queries and Flat Keys for Prunable 2-bit KV CachesarXiv · 2026
- Interface-Aware KV Cache Quantization for Dense On-Chip NVM in Long-Context LLM DecodingarXiv · 2026
- RoLaQ: Joint Rotation and Range Calibration for 2-Bit KV Caches in Multi-Head Latent AttentionarXiv · 2026
- WUSH-KV: KV Cache Quantization with Data-Adaptive TransformsarXiv · 2026
- LowRAM: Low-Rank Keys and Amortised Values for Composable KV Cache Compression at Test-TimearXiv · 2026
- KV-Kaizen: Learning Context-Adaptive Cache Compression ChoicesarXiv · 2026