TL;DR
OSCAR introduces an attention-aware, ultra-low-bit quantization method that successfully compresses the Key-Value (KV) cache of Large Language Models down to 2 bits (INT2) with minimal accuracy loss. By calculating downstream attention covariance structures offline, OSCAR derives optimal fixed rotations and clipping thresholds, reducing KV-cache memory by 8× and boosting serving throughput by up to 7×.
What Problem Does This Paper Address?
As Large Language Models (LLMs) handle increasingly long contexts, the Key-Value (KV) cache becomes a massive memory bottleneck during inference. Every generated token requires reading the entire historical KV cache from GPU memory, severely limiting batch sizes and increasing serving costs.
Quantizing the KV cache to ultra-low precision (like 2-bit) is a natural solution, but it is notoriously difficult. LLM activations contain severe channel-wise outliers—a few channels have massive values that dominate the quantization scale, crushing the precision of all other channels. Prior approaches used mathematical rotations (like the Hadamard transform) to spread out these outliers uniformly. However, these methods are "data-oblivious": they treat all dimensions equally, ignoring the fact that downstream attention mechanisms care far more about certain feature directions than others. At 2-bit precision, this misalignment causes model accuracy to collapse entirely.
Methods
OSCAR (Offline Spectral Covariance-Aware Rotation) solves this by aligning the quantization process with the actual covariance structures consumed by the attention mechanism.
The method operates in two phases:
-
Offline Calibration: Using a small calibration dataset, OSCAR computes the attention-aware target covariance matrices for both keys ($C_Q$, based on query energy) and values ($C_S$, based on score-weighted value interactions). It then performs an eigendecomposition to find the principal components ($U_Q$ and $U_S$). The final fixed rotation matrix ($R$) is a composition of three orthogonal factors: $$R = U \cdot H_{Had} \cdot P_{br}$$ Where $U$ is the attention-aware eigenbasis, $H_{Had}$ is a standard Hadamard transform to flatten remaining outliers, and $P_{br}$ is a permuted bit-reversal matrix that structurally balances high- and low-importance channels across quantization groups.
-
Online Serving Pipeline: Integrated into the SGLang serving framework, OSCAR employs a mixed-precision strategy. It keeps a small window of "sink" tokens and the most recent tokens in full precision (BF16), while the vast middle history is rotated, clipped, and stored as packed INT2 values. Custom fused Triton kernels handle the rapid quantization on the write path and dequantization on the read path without adding extra memory traffic.
Datasets
The authors evaluated OSCAR across five prominent reasoning and coding benchmarks:
- AIME25 (Mathematics)
- GPQA-Diamond (Graduate-level Q&A)
- HumanEval (Python coding)
- LiveCodeBench v6 (Holistic coding)
- MATH500 (Mathematics)
For long-context stress testing, they utilized RULER-NIAH (Needle-in-a-Haystack) with context lengths scaling up to 128K tokens. Calibration was performed using small, standard subsets of MMLU prompts, WikiText, and GPQA-Diamond.
Key Insights and Ideas
- Attention Doesn't Care About Euclidean Distance: Standard quantization techniques try to minimize the raw reconstruction error ($\|K - \hat{K}\|_F^2$). OSCAR recognizes that keys and values are only consumed through attention matrices. Therefore, the quantization error should be pushed into directions that the model reads less strongly, minimizing downstream logit distortion rather than raw tensor differences.
- The Three-Factor Synergy: The rotation matrix works because its components complement each other perfectly. $U$ aligns the channels with downstream importance; $H_{Had}$ equalizes the importance metric and suppresses outliers; $P_{br}$ ensures that when channels are grouped together for block-wise quantization, no single group gets stuck with all the high-importance data.
Key Results
OSCAR was tested on state-of-the-art models including Qwen3-4B-Thinking, Qwen3-8B, Qwen3-32B, and the 358-billion-parameter GLM-4.7.
- Accuracy Preservation: On Qwen3-8B, OSCAR achieved an effective 2.28 bits per element while trailing the unquantized BF16 baseline by a mere 1.42 points on average. In contrast, naive 2-bit quantization and standard rotation methods collapsed to near-zero accuracy.
- Long-Context Robustness: On the 128K RULER-NIAH task, OSCAR maintained high retrieval accuracy, whereas data-oblivious 2-bit baselines failed completely as context scaled past 16K tokens.
- System Speedups: OSCAR reduced the overall KV-cache memory footprint by ~8×. This allowed the system to achieve up to a 7× throughput improvement under large batch sizes and accelerated batch-size-1 decoding speed by up to 3× due to reduced memory bandwidth overhead.
Limitations and Future Work
- Surrogate Optimality: The mathematical proof of OSCAR's optimality relies on a "frozen-error surrogate" assumption rather than a full end-to-end proof of the autoregressive decoding process.
- Format Constraints: The study focuses strictly on the INT2 format. It does not explore alternative low-bit representations like NVFP4 or mixed-precision weight/KV combinations.
- Static Bit Allocation: OSCAR applies a uniform bit-width to all history tokens, leaving out potential gains from dynamic, token-adaptive bit allocation strategies.
Summary updated