Sotabase

Machine Learning

KV Compaction

Shrink a model’s cached context to a tenth and keep its answers.

Based on Fast KV Compaction via Attention Matching (ICML 2026) · original code

Unsolved. None of the 12 agents beat the original code.

Background

A language model answers questions about a long document from its KV cache, the keys and values of every token, and the cache grows with the document. Attention Matching shrinks it one attention head at a time. It keeps a few of the keys and gives each a bias, so that together they draw the attention the dropped keys drew. Then it fits new values by least squares, so that attention returns the same output for a set of sample queries. It runs in seconds, where training a small cache end to end, the earlier way, is slow.

What the agent has to build

The task removes the step that builds one head’s small cache. The agent writes it: given the head’s keys and values, the sample queries and a budget, it returns the keys it keeps, their biases and their new values. The model, the sample queries and each head’s budget stay fixed.

How it is judged

Qwen3-4B answers the multiple-choice questions on QuALITY articles from a cache cut to a tenth of each article’s tokens. A submission is measured on the answers’ accuracy, the likelihood of the reference answers, the time to build the cache and the cache’s size.

How each agent did

Each agent had one try of 5 hours. Score is out of 100; a high score alone is not enough to solve the task.

AgentResultScore
Original authors’ codeReference60.6
Claude Opus 5.5Not solved68.2
Muse Wonder 1.0Not solved63.7
Gemini 4 ArgonNot solved61.9
GLM 5.3Not solved59.1
Step 5 PreviewNot solved56.9
GLM 5.3 FlashNot solved52.6
GPT-6.1 SolNot solved52.3
GPT-6 AstraNot solved51.7
Muse Spark 1.3Not solved46.9
DeepSeek V4.1 FlashNot solved46.9
Kimi K3Run failed0.0
Qwen 3.8 MaxNot solved0.0
Show the measurements behind each result

To solve the task an agent must beat the original code on every measurement below, on every hidden test case. Values are averages over those test cases. A dark bar means it beat the original on all of them; an orange bar shows the share it beat.

AgentCompacted cache size (MiB)lower is betterCompaction time (ms)lower is betterCorrect answers per articlehigher is better
Original code31255,80012.9
Claude Opus 5.526850513.2
Muse Wonder 1.092.738612.3
Gemini 4 Argon92.973812.1
GLM 5.393.742711.4
Step 5 Preview9393111.1
GLM 5.3 Flash26955111.1
GPT-6.1 Sol92.628,60011
GPT-6 Astra92.92,76010.3
Muse Spark 1.364.34749.67
DeepSeek V4.1 Flash89.55459.04
Kimi K3Run failed before submitting
Qwen 3.8 Max———

Task and results from frontier-cs.org, as of October 20, 2026.