FlagRot: Selective Rotation for Low-Bit KV Caches

Kunming Shao, Xijie Huang, Jierun Chen, Jiaqi Shao, Yanli Wang +5 more
11/2/2026
cs.CLcs.AIcs.LG

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{shao2026flagrot,
  title  = {FlagRot: Selective Rotation for Low-Bit KV Caches},
  author = {Kunming Shao and Xijie Huang and Jierun Chen and Jiaqi Shao and Yanli Wang and Jiangnan Yu and Qiwei Li and Wei Zhang and Kwang-Ting Cheng and Chi Ying Tsui},
  year   = {2026},
  eprint = {2611.03992},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.03992v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.03992.svg)](https://codeofpaper.com/paper/2611.03992)

Discussion