← Latest papers
🤖 machine learning

Quantamination: Dynamic Quantization Leaks Your Data Across the Batch

This paper introduces "Quantamination," a critical vulnerability in dynamic quantization where improper implementation in popular ML frameworks creates side channels that allow adversaries to steal sensitive user data from other inputs within the same processing batch.

Original authors: Hanna Foerster, Ilia Shumailov, Cheng Zhang, Yiren Zhao, Jamie Hayes, Robert Mullins

Published 2026-04-30
📖 5 min read🧠 Deep dive

Original authors: Hanna Foerster, Ilia Shumailov, Cheng Zhang, Yiren Zhao, Jamie Hayes, Robert Mullins

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

Imagine you are at a busy coffee shop where the barista (the AI server) has to make drinks for two customers at the same time to save time. To make things faster, the barista uses a special "quick-measure" cup instead of a precise scale. This is called dynamic quantization.

Here is the problem the paper found: The barista doesn't measure each cup individually. Instead, they look at both customers' drinks together to decide how big the "quick-measure" cup should be for that specific moment.

The "Shared Cup" Problem

In the world of AI, when two people ask a computer to process their data at the exact same time (a "batch"), the computer often calculates a single setting for both of them based on the largest numbers it sees in the combined pile.

  • The Victim: A regular user sending a secret message.
  • The Attacker: A sneaky user sending a fake message right next to the victim's.

Because the computer calculates the "cup size" based on the combined data, the victim's secret numbers actually change the size of the cup used for the attacker's data. It's like if the barista had to hold a giant bucket for the victim's huge order, and that bucket was so big it made the attacker's tiny espresso taste slightly different than it usually would.

The "Leak" (Quantamination)

The paper calls this "Quantamination" (a mix of "quantization" and "contamination").

The attacker knows exactly what their own drink should taste like. But because the "cup size" was changed by the victim's secret data, the attacker's drink tastes a tiny bit weird. By tasting that weirdness, the attacker can work backward to guess what the victim's secret data was.

What the Attackers Can Do

The researchers tested this in two main scenarios:

  1. Reading Secret Messages (LLMs):
    Imagine the victim is typing a secret sentence, one word at a time. The attacker sends their own words alongside the victim's.

    • The Result: The attacker was able to guess the victim's secret words with 99.6% to 100% accuracy. It was like the attacker could hear the victim whispering their password through the wall, just by listening to how their own voice echoed back.
    • How fast? It took a few hundred tries for the first word, but once they knew the first word, the next words became much easier to guess, like solving a crossword puzzle where you already have the first few letters.
  2. Identifying Images (Classification):
    Imagine the victim uploads a secret photo of a cat, and the attacker uploads a photo of a dog.

    • The Result: If the attacker had a library of 10,000 photos to choose from, they could almost always pick out the exact photo the victim uploaded.
    • The Catch: If the attacker didn't have the exact photo in their library, they could only guess the category (e.g., "It's probably a cat") with low accuracy. The "noise" from the computer was too strong to pinpoint the exact image without a direct match.

Why This Happens (The "Why" of the Coffee Shop)

Most modern AI systems are designed to be super efficient. They often use a method called "Per-Tensor" quantization for speed. This means they look at the whole batch of data to set the rules.

The paper found that popular tools like vLLM, SGLang, ONNX Runtime, and PyTorch often use this "look at the whole batch" method by default or as an easy option. This creates a hidden channel where one person's data leaks into another person's results.

The Good News

The paper also points out a simple fix. If the system uses "Per-Token" quantization (measuring each word or item individually before mixing them), the leak disappears. It's like giving every customer their own precise scale, so the giant bucket for the other customer doesn't affect them.

Many modern systems already use this safer method for standard text models, but the dangerous "whole batch" method is still the default for some specific high-speed settings (like FP8) and general-purpose tools.

The Real-World Hurdle

The paper admits that in the real world, this attack is a bit harder to pull off than in their lab.

  • The "Static" Noise: Real servers aren't perfectly quiet. Sometimes the computer's hardware or the software's random choices make the "taste" of the drink vary slightly even without a leak.
  • The "Temperature" Issue: Even if a user asks for a "perfectly deterministic" (no randomness) result, the server provider might add their own secret sauce or sampling methods that mess up the perfect pattern the attacker needs to see.

Summary

Dynamic quantization is a speed trick that saves money and time for AI companies. However, when it mixes two people's data together to set its rules, it accidentally creates a side channel. A sneaky user can listen to how their own data changes because of a stranger's secret data, allowing them to steal that secret. The fix is to stop mixing the measurements and measure each person's data individually.

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 →