Fast KV Compaction via Attention Matching

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Zweiger, Adam, Fu, Xinghong, Guo, Han, Kim, Yoon
Format: Preprint
Publié: 2026
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917537180024832
author Zweiger, Adam
Fu, Xinghong
Guo, Han
Kim, Yoon
author_facet Zweiger, Adam
Fu, Xinghong
Guo, Han
Kim, Yoon
contents Scaling language models to long contexts is often bottlenecked by the size of the key-value (KV) cache. In deployed settings, long contexts are typically managed through compaction in token space via summarization. However, summarization can be highly lossy, substantially harming downstream performance. Recent work on Cartridges has shown that it is possible to train highly compact KV caches in latent space that closely match full-context performance, but at the cost of slow and expensive end-to-end optimization. This work describes an approach for fast context compaction in latent space through Attention Matching, which constructs compact keys and values to reproduce attention outputs and preserve attention mass at a per-KV-head level. We show that this formulation naturally decomposes into simple subproblems, some of which admit efficient closed-form solutions. Within this framework, we develop a family of methods that significantly push the Pareto frontier of compaction time versus quality, achieving up to 50x compaction in seconds on some datasets with little quality loss.
format Preprint
id arxiv_https___arxiv_org_abs_2602_16284
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Fast KV Compaction via Attention Matching
Zweiger, Adam
Fu, Xinghong
Guo, Han
Kim, Yoon
Machine Learning
Scaling language models to long contexts is often bottlenecked by the size of the key-value (KV) cache. In deployed settings, long contexts are typically managed through compaction in token space via summarization. However, summarization can be highly lossy, substantially harming downstream performance. Recent work on Cartridges has shown that it is possible to train highly compact KV caches in latent space that closely match full-context performance, but at the cost of slow and expensive end-to-end optimization. This work describes an approach for fast context compaction in latent space through Attention Matching, which constructs compact keys and values to reproduce attention outputs and preserve attention mass at a per-KV-head level. We show that this formulation naturally decomposes into simple subproblems, some of which admit efficient closed-form solutions. Within this framework, we develop a family of methods that significantly push the Pareto frontier of compaction time versus quality, achieving up to 50x compaction in seconds on some datasets with little quality loss.
title Fast KV Compaction via Attention Matching
topic Machine Learning
url https://arxiv.org/abs/2602.16284