← Latest papers
🤖 machine learning

Hurwitz Quaternion Multiplicative Quantization for KV Cache Compression

The paper introduces Hurwitz Quaternion Multiplicative Quantization (HQMQ), a calibration-free method that compresses KV caches by representing 4-element chunks as quaternions quantized via a product of a fixed Hurwitz group and random secondary codebooks, achieving near-fp16 accuracy with up to 5.05× compression across diverse modern LLMs while eliminating the need for calibration.

Original authors: Kabir Swain, Sijie Han, Daniel Karl I. Weidele, Mauro Martino, David Cox, Antonio Torralba

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

Original authors: Kabir Swain, Sijie Han, Daniel Karl I. Weidele, Mauro Martino, David Cox, Antonio Torralba

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) like a brilliant but forgetful librarian. When you ask it a long question, it has to remember every word you've said so far to answer correctly. In computer terms, this memory is called the KV Cache.

For very long conversations, this memory cache gets huge. If the librarian tries to remember every detail in high-definition (like a 4K movie), it fills up the computer's RAM instantly. This forces the computer to use slower storage or crash, making the conversation stop.

To fix this, engineers try to "compress" the memory, like turning a 4K movie into a smaller MP4 file. However, previous methods of compression were like using a blunt knife: if you cut the file size too much (below 4 bits), the movie becomes unwatchable (the AI starts making nonsense). If the AI model has "outliers" (weird, extreme numbers in its data), standard compression breaks completely, causing the AI to hallucinate wildly.

The Solution: HQMQ (The "Smart Compass" System)

The authors propose a new method called HQMQ. Instead of just shrinking the numbers, they treat groups of data as quaternions (a type of 4D mathematical compass).

Here is how it works, broken down into three simple steps:

1. The "24-Point Star" (The Primary Codebook)

Imagine the direction a piece of data is pointing is like a compass needle. Instead of trying to store the exact angle (which takes too much space), the authors use a special, pre-made "star" with 24 points (called the Hurwitz group).

  • The Analogy: Think of this as a standard set of 24 fixed directions (North, Northeast, etc., but in 4D). No matter where the data points, you just snap it to the nearest of these 24 "perfect" directions.
  • The Magic: Because these 24 points are mathematically perfect and evenly spaced, you don't need to train the AI to learn them. They are just "hard-coded" rules, like the letters on a keyboard.

2. The "Random Spin" (The Secondary Codebook)

The 24 points aren't enough to cover every possible nuance. So, the authors add a second layer: a small, random "spin" for each specific part of the AI.

  • The Analogy: Imagine you have a globe with the 24 points painted on it. Now, imagine you can spin the globe randomly for every single sentence the AI processes.
  • The Result: When you combine the fixed 24 points with a random spin, you get thousands of unique directions (24×random spins24 \times \text{random spins}).
  • Why it's cool: The paper claims you don't need to train this random spin. Because of the math behind it, any random spin works almost as well as a trained one. It's like saying, "You don't need to practice throwing darts; just throw them randomly, and the math guarantees you'll hit the board." This saves time and data.

3. The "Outlier Safety Net" (Med3×)

Some AI models (like Qwen) have "outliers"—data points that are 100x or 200x larger than normal. Standard compression tries to squash these huge numbers down to fit, which destroys the data.

  • The Analogy: Imagine you are packing a suitcase. Most clothes are normal size, but you have one giant, awkwardly shaped teddy bear. If you try to force the bear into a small box, it rips the box.
  • The Fix: HQMQ has a rule: "If a number is too big (more than 3 times the average), don't squeeze it. Just keep it in its original, high-quality form (fp16) and mark it with a tiny flag."
  • The Result: Only about 1–3% of the data gets this special treatment, so the memory savings are still massive, but the "giant teddy bears" don't break the system.

What Did They Prove?

The authors tested this on five different modern AI models (Mistral, Llama, Qwen, etc.). Here are their main findings:

  • It Works Without Training: Unlike other methods that need a "calibration" phase (where the AI studies data to learn how to compress), HQMQ works immediately with random settings.
  • It Saves Massive Space: They managed to shrink the memory cache by 5 times. For example, a 128k-context cache for a 70-billion-parameter model (which usually takes 43 GB) was shrunk to 8.5 GB. This means you could run a massive AI on a single consumer graphics card instead of a supercomputer.
  • It Handles "Bad" Data: On models with extreme outliers (like Qwen), standard compression failed completely (the AI's error rate exploded). HQMQ + the "Safety Net" fixed this, bringing the AI's performance back to near-perfect levels.
  • Speed: They built a special "fused" engine that reads the compressed data and decodes it instantly while the AI is thinking. This means the AI doesn't slow down; it just uses less memory.

The Bottom Line

HQMQ is like a universal, pre-made compression kit for AI memory. It uses a clever mathematical trick (multiplying a fixed 24-point star by a random spin) to store directions efficiently without needing to learn anything first. It also has a safety switch for weird data spikes.

The result? You can run much longer, smarter conversations on much smaller computers without the AI losing its mind.

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 →