Rotate, Then Round: The Geometry of KV-Cache Compression

· Source: LLM on Medium · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cloud Computing & IT Infrastructure, Software Development & Engineering · Depth: Expert, extended

Summary

KV-cache compression is critical for long-context Large Language Models, directly impacting memory costs and hardware requirements. This article details the evolution of compression techniques, from basic block quantization to advanced geometric methods like RotateKV and TurboQuant, highlighting the often-overlooked metadata overhead that can add 1-2 bits per value. It explains how KIVI's asymmetric quantization (per-channel keys, per-token values) and KVQuant's pre-RoPE approach address data distribution challenges. Crucially, the piece reveals that TurboQuant's theoretically unbiased 1-bit QJL residual was removed in production implementations (e.g., vLLM) because its high variance, when passed through the softmax function, systematically distorted attention weights. Production evaluations (vLLM/Red Hat AI, May 2026) recommend FP8 as the default for 2x KV capacity with minimal accuracy loss, suggesting `4bit_nc` TurboQuant as a secondary option under severe memory pressure, emphasizing `k8v4` configurations and avoiding quantization of boundary layers.

Key takeaway

For Machine Learning Engineers optimizing LLM inference memory, prioritize FP8 KV-cache quantization first, as it offers 2x capacity with negligible accuracy impact and strong performance. If further compression is needed, consider `turboquant_4bit_nc` with `k8v4` settings, but benchmark carefully on your specific workload, especially for reasoning and long-context tasks, and avoid quantizing boundary layers to preserve accuracy.

Key insights

KV-cache compression evolved from simple rounding to geometric transformations, but production revealed that unbiasedness isn't enough when softmax amplifies variance.

Principles

Method

Rotate vectors with an orthogonal matrix to spread outlier energy, then quantize using optimal scalar quantizers (e.g., Lloyd-Max codebooks) to achieve higher compression efficiency.

In practice

Topics

Best for: MLOps Engineer, AI Engineer, NLP Engineer, Machine Learning Engineer, AI Scientist, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by LLM on Medium.