TGViewer
Data eXplore : Data Science, ML, Big Data, LLMs and AI Security Data eXplore : Data Science, ML, Big Data, LLMs and AI Security @dataxplore · 583 subscribers
Post #1989 152
KVzap: Nvidia learned to use memory 3–4 times more efficiently in inference

The KV-cache is today the main Achilles' heel of transformers when scaling the context. It grows linearly with the length of the sequence and is stored for each layer and each head.

For example, for a LLaMA-like model with 65B parameters, the KV-cache at 128k tokens occupies ~335 GB of memory. And it's also a pain in terms of time.

🟢 How NVIDIA solved Pain?

However, most optimizations reduce the KV-cache by layers or by heads. Although the main potential is precisely along the token axis: not all of them are really needed by the model.

The first working method of reducing KV by tokens was invented by the authors of KVzip: up to 4× compression with zero quality loss. But in practice, the method turned out to be too slow.

Nvidia took this idea, modified it a bit, and got almost the same result, but practically for free.

They simply train a small model that predicts, based on the hidden state of a token, how important its KV is. It's different for each layer, but it's either a linear model or a two-layer MLP - a maximum of 1–2 matrix multiplications.

And that's it, no expensive operations and recalculations (for comparison: in KVzip, the prompt essentially had to be run twice). Next, the KV pairs with a significance below a specified threshold are simply discarded.

The compute overhead is about 0.02% FLOPs for linear models. On a long context, this is noise against the quadratic attention.

The degradation on benchmarks is about zero, the compression is 3–4×. It's just a fairy tale (though, of course, much still depends on the engine).


Hats off to Nvidia for their excellent work. Everything is in the open source on GitHub | Paper

••••••••••••••••••••••••••••••••••••••
🤖 Data Science, ML & Big Data with @DataXplore
More from @dataxplore
  1. Oct 1, 2026Monitoring and debugging "silent" token drift in LLM pipelines: frequency analysis of embe…
  2. Sep 30, 2026Online detection of feature collisions in TDA transformation When using Topological Data A…
  3. Sep 18, 2026Am going to announce something big (for me, it's really big) on October 11, 2026.
  4. Sep 14, 2026Post #2188
  5. Aug 31, 2026I joined a Russian community on Telegram. They share some Russian startup and technology u…
  6. Aug 22, 2026Post #2185
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →