TL;DR
OCTOPUS is a novel, data-oblivious KV cache compression codec that introduces joint quantization of rotated coordinate triplets using an equal-area octahedral mapping. By optimizing a non-uniform bit allocation between vector direction and magnitude, it sets a new state-of-the-art for extreme KV cache compression (down to 2 bits per coordinate) across text, video, and audio transformers without adding decode-time latency.
What Problem Does This Paper Address?
As transformer models scale to massive context windows for long-form text generation, video synthesis, and high-fidelity audio, they hit a severe hardware bottleneck: the Key-Value (KV) cache. During autoregressive decoding, the KV cache must be loaded from high-bandwidth memory at every single step, making inference heavily memory-bandwidth bound.
Recent state-of-the-art approaches use "rotation-preconditioned" quantization (like TurboQuant and PolarQuant). These methods apply a random orthogonal rotation to the keys, which spreads out outliers and forces the data into a mathematically predictable distribution. However, these prior codecs quantize only one coordinate or angle at a time. This independent processing misses a major optimization opportunity: exploiting the joint geometric structure of the coordinates to pack more information into fewer bits.
Methods
OCTOPUS advances the rotation-preconditioned paradigm by quantizing blocks of three coordinates (triplets) jointly. The compression pipeline consists of several key stages:
- Magnitude-Direction Split: The raw key vector is split into a global magnitude and a unit direction vector.
- Rotation Preconditioning: A fast, sign-flipped Walsh-Hadamard Transform (WHT) is applied to make the coordinate marginals isotropic and analytically tractable.
- Triplet Decomposition: The rotated coordinates are grouped into contiguous triplets. Each triplet is further decomposed into its local norm (radius) and a 3D unit direction vector lying on a 2-sphere ($S^2$).
- Octahedral Mapping: Borrowing a technique from real-time computer graphics, OCTOPUS maps the 3D unit direction vector onto a 2D square using an equal-area octahedral projection. This mapping features a near-uniform Jacobian, meaning standard 1D quantization on the square closely approximates true spherical distortion.
- MSE-Optimal Non-Uniform Bit Split: Using a Lagrangian optimization framework, the authors prove that a uniform bit split is sub-optimal. Instead, they implement an asymmetric $(b+1, b-1)$ split—allocating more bits to the direction coordinates and fewer to the triplet norm.
- Joint Rounding: To combat the non-linearity of the octahedral decoding step, the encoder performs a fast, local $3 \times 3$ grid search to find the optimal combination of direction and norm centroids.
To ensure this doesn't slow down inference, the authors implemented the decoder as a fused Triton kernel. It reconstructs keys on the fly in GPU registers during the attention loop, completely avoiding the need to materialize the uncompressed key tensor in memory.
Datasets
The authors evaluated OCTOPUS across four distinct modalities:
- Synthetic Probe: Isotropic Gaussian keys and queries used to verify theoretical mean squared error (MSE) bounds.
- Language Modeling: The Qwen2.5-7B-Instruct-1M model evaluated on long-context subsets of WikiText-2 and C4, alongside a multi-key needle-in-a-haystack retrieval sweep (up to 128k context).
- Video Generation: Two Wan-1.3B autoregressive Diffusion Transformers (DiTs) evaluated on chunk-wise video generation (CausVid) and frame-wise causal video forcing (Causal Forcing).
- Audio Generation: A 16-block next-scale autoregressive audio model (AAR) evaluated on AudioSet-20k clips.
Key Insights and Ideas
- The Asymptotic Behavior of Sub-Block Norms: The core mathematical insight is that rotation preconditioning spreads entropy so evenly that the norm of a small sub-block carries asymptotically less entropy as the total channel count rises. This justifies stealing bits away from the norm to give to the direction coordinates.
- Graphics Meets Quantization: Utilizing the octahedral map provides a piecewise-linear, bijection-based alternative to transcendental polar coordinates. This keeps arithmetic overhead low while maintaining an equal-area representation that prevents distortion at the poles.
- Decoupled Optimization: The authors discovered that during joint rounding, direction selection mathematically decouples from norm selection. This allows a tiny $3 \times 3$ local candidate search to perform identically to an expensive full-grid search, making online encoding computationally viable.
Key Results
OCTOPUS consistently matches or outperforms prior rotation codecs across all tested bit-widths, with its performance gap widening dramatically under extreme compression (2 bits per coordinate):
- Language Modeling Stability: At 2-bit compression, competing codecs like TurboQuant and PolarQuant suffer from catastrophic perplexity explosions (PPL >28). OCTOPUS maintains a stable WikiText-2 perplexity of 13.51, closely tracking the uncompressed fp16 baseline (10.03).
- Long-Context Retrieval: In 2-bit needle-in-a-haystack tests at 128k context, competing methods collapse to near-zero recall. OCTOPUS retains a robust retrieval recall of 0.70 to 0.75.
- Perceptual Quality in Video/Audio: In autoregressive video generation, competing codecs degrade into random noise at 2 bits. OCTOPUS remains visually faithful, preventing the error propagation that causes long-context rollouts to collapse.
Limitations and Future Work
While OCTOPUS achieves excellent rate-quality trade-offs, it is not entirely "free":
- Compute Overhead: The fused Triton decode kernels introduce a 5–11× computational overhead compared to highly optimized, unquantized cuDNN paths. This means OCTOPUS is highly advantageous when memory bandwidth or capacity is the primary bottleneck (e.g., ultra-long contexts or large batch sizes), but may slow down execution in compute-bound, short-context scenarios.
- Dimensionality Constraints: The reliance on the Walsh-Hadamard Transform requires the head dimension ($d$) to be a power of two, requiring padding for models that do not conform to this architecture standard.
Summary updated