← Latest papers
🤖 machine learning

OSCAR: Offline Spectral Covariance-Aware Rotation for 2-bit KV Cache Quantization

OSCAR is a deployable 2-bit KV cache quantization method that leverages offline spectral covariance estimation to derive attention-aligned rotations and clipping thresholds, enabling near-lossless accuracy on long-context reasoning tasks while significantly reducing memory usage and improving inference throughput in modern LLM serving frameworks.

Original authors: Zhongzhu Zhou, Donglin Zhuang, Jisen Li, Ziyan Chen, Shuaiwen Leon Song, Ben Athiwaratkun, Xiaoxia Wu

Published 2026-05-19
📖 5 min read🧠 Deep dive

Original authors: Zhongzhu Zhou, Donglin Zhuang, Jisen Li, Ziyan Chen, Shuaiwen Leon Song, Ben Athiwaratkun, Xiaoxia Wu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Problem: The "Memory Hoarder"

Imagine a large language model (LLM) as a brilliant but forgetful librarian. When you ask it a long question, it has to keep a running list of everything you've said so far (the "KV Cache") to understand the context.

As the conversation gets longer (up to 32,000 words or more), this list becomes massive. To store it, the librarian needs a huge amount of expensive memory (like a giant, high-speed warehouse). If the warehouse gets full, the librarian has to stop working or slow down drastically.

The goal of this paper is to shrink that warehouse by 8 times without the librarian forgetting anything important. They want to compress the notes from "high-definition" (BF16) down to "tiny sketch" (2-bit) size.

The Old Way: The "Hadamard Shuffle"

Previously, researchers tried to shrink these notes by simply shuffling the words around. They used a mathematical trick called a Hadamard rotation.

  • The Analogy: Imagine you have a messy room with a few giant, awkward sofas (outliers) and lots of tiny chairs. You can't fit them all in a small box. The old method was to take a giant mixer and spin the room around. This spreads the giant sofas out so they look like a few slightly larger chairs, making it easier to pack them.
  • The Flaw: This mixing is "blind." It doesn't know which parts of the room are actually important for the librarian's job. When you compress everything down to a tiny 2-bit sketch, this blind mixing accidentally blurs the most critical details, causing the librarian to start hallucinating or giving wrong answers. It's like trying to pack a delicate vase and a rock together; if you just shake the box, the vase breaks.

The New Solution: OSCAR (The "Smart Architect")

The authors propose OSCAR (Offline Spectral Covariance-Aware Rotation). Instead of blindly shaking the room, OSCAR acts like a smart architect who studies exactly how the librarian works before packing begins.

1. The "Offline Calibration" (The Study Phase)

Before the librarian starts serving customers, OSCAR takes a small sample of conversations and asks: "Which parts of the memory does the librarian actually use to make decisions?"

  • The Analogy: Imagine the librarian has to pick a book based on a specific question. OSCAR realizes that the librarian cares deeply about the color of the book cover (the "Query") but doesn't care much about the thickness of the pages (the "Value").
  • The Result: OSCAR creates a custom map (a rotation matrix) that aligns the memory storage with these specific needs. It ensures that the parts the librarian cares about most are preserved with high precision, while the less important parts get compressed more aggressively.

2. The "Smart Packing" (The Rotation)

OSCAR uses this map to rotate the data into a shape that is perfect for compression.

  • The Analogy: Instead of just spinning the room randomly, OSCAR rearranges the furniture so that all the fragile items are lined up in a way that fits perfectly into the small box. It separates the "important directions" from the "noise."
  • The Magic: By doing this, they can compress the data down to 2 bits (extremely small) and still keep the librarian's accuracy almost identical to the original high-definition version.

3. The "Hybrid Warehouse" (The System)

OSCAR doesn't compress everything at once. It uses a clever hybrid system:

  • The "Sink" and "Recent" Tokens: The very first few words (the start of the story) and the very last few words (what you just said) are kept in high-definition. These are the most critical anchors.
  • The "History" Tokens: The middle part of the conversation (the long history) is the part that gets compressed into the tiny 2-bit sketch using the smart OSCAR rotation.

Why This Matters (The Results)

The paper tested this on some of the smartest AI models available (like Qwen and GLM) with very long contexts.

  • Accuracy: When other methods tried to compress to 2 bits, the models basically forgot how to think (accuracy dropped to near zero). OSCAR kept the models nearly as smart as the original high-definition version.
  • Speed & Memory: Because the data is 8 times smaller, the warehouse fits 8 times more conversations. This means the system can handle 7 times more users at once without running out of memory.
  • Real-World Ready: The authors didn't just write a theory; they built a working system that fits into modern AI servers (SGLang and vLLM). It's like they didn't just design a better box; they built a new truck that uses that box and drives faster.

Summary

OSCAR is a method that stops AI models from "forgetting" when they try to save memory. Instead of blindly squishing data, it first studies what the AI actually cares about, rearranges the data to match those needs, and then compresses it. This allows AI to remember massive amounts of information (like a whole book) using a tiny fraction of the memory, without losing its intelligence.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →