Declarative Attention cuts long-context KV reads by up to 52%

Share
Declarative Attention cuts long-context KV reads by up to 52%

A paper from KAIST AI and Google DeepMind argues the model already knows which part of its context matters — and a community fork just put that claim into llama.cpp.

An off-the-shelf model can be prompted to declare, inside its own chain of thought, which slice of its context it needs next — and the inference engine can then skip reading the rest of the KV cache. The method, called Declarative Attention (DA), splits generation into three modes: global (the full context), focus (one specific region), and local (recent output only). The model emits a tag naming the chunk it wants, and the engine parses that tag the way it would parse a tool call. No trained scorer, no proxy network, no fine-tuning — just a prompt and an engine that listens.

The numbers are the interesting part. Across 15 long-context tasks in zero-shot evaluation, total attended tokens during decoding fell 52.0% on Gemma-4-31B and 31.1% on Qwen-3.6-27B, with accuracy dropping 1.27 and 2.75 percentage points respectively. The authors report the accuracy gap shrinking as models get larger, while token savings stay roughly scale-independent. That is the whole bet: the existing sparse-attention approach pre-selects tokens with a lightweight proxy score, but that scoring pass still reads the context, so it moves the cost rather than removing it. Letting the model declare its own focus is the only version of this that actually gets cheaper per decode step.

The paper is the theory; a fork called focus-llama is the first attempt to run it on the local stack. Its author extended llama.cpp's server so it can drop KV token ranges for a request, either mid-prefill or after, and added a tag-driven mode where the server parses the model's first focus declaration during generation and discards the chunks it didn't ask for. A second-sequence variant keeps the original context intact for a later return to global attention, a path the author says is not implemented yet.

The fork also documents why this is harder on llama.cpp than on a serving stack. Stock llama-server has no way to touch KV ranges mid-generation, so server changes were unavoidable. llama.cpp has no paged block table — the paper's vLLM implementation rewrites one — so masking alone doesn't reduce what the GPU actually reads, and single-token decode on CUDA doesn't currently skip masked chunks. Real skipping needs kernel support or compaction. On hybrid models, only the attention layers are restricted; the recurrent state is untouched.

Worth keeping the honesty in view: the fork's author says he has benchmarked nothing yet — no speed run, no accuracy run — and the 0.71× and 0.77× decode-time figures circulating with the post are the paper's vLLM numbers, not measurements from the fork. What exists today is a working protocol implementation on small smoke tests. That is still the useful artifact: it shows the mechanism is portable, and it names exactly which piece of the local inference stack is missing.

What to watch: whether llama.cpp gains the kernel-level KV skipping that makes this pay off, or whether the paper's training-based follow-up lands first — the authors say DA unlocks an unexplored axis of sparse attention under training.

Would you trade a couple of accuracy points for half the context reads on a long agent run? Tell us in the comments.

Sources: focus-llama (GitHub)

Read more

AI inference is redrawing the storage hierarchy

AI inference is redrawing the storage hierarchy

The money has followed GPUs for years, but at GMIF 2026 in Shenzhen the argument was about everything behind them — and the numbers backing it are getting hard to ignore. China's 140 trillion daily token calls are forcing a redesign of the storage stack. Now in its fifth year, the Global Memory Innovation Forum gathered storage makers, analysts and chip designers around one theme: inference, not training, is now the workload that dictates hardware. China's daily token calls had already passed

Cloudflare launches Clef-omni, cuts Clef-flash price by 58%

Cloudflare launches Clef-omni, cuts Clef-flash price by 58%

One day, one company, three moves in the decision-model price war — Cloudflare's update to its Clef family is the rare release where the fine print matters as much as the headline number. Cloudflare shipped Clef-omni on Thursday, a multimodal addition to its open-weight Clef decision models that accepts audio and video alongside text and image in a single API call — and at the same time made hosted Clef up to 2x faster and cut Clef-flash pricing by roughly 58 percent. Clef-omni takes WAV or MP

Meta turned down Amodei's personal plea for compute

Meta turned down Amodei's personal plea for compute

The chip hunt is back in the headlines — and today's edition runs from a boardroom ask at the very top of the AI industry to the economics of putting robot drivers in truck cabs. Dario Amodei personally approached Meta earlier this year to source more compute for Anthropic, and Meta declined — according to the Wall Street Journal. The report lands inside the Journal's larger piece on how desperately the industry is hunting for computing power, and it is the kind of detail that only surfaces wh

Anthropic cuts live internet access for its internal evals

Anthropic cuts live internet access for its internal evals

Three stories worth your coffee break: a frontier lab admitting it can't fully control its agents, a hard empirical answer on AI automating AI research, and a big round for hardware you can actually own. Anthropic disabled live internet access for all of its internal evaluations after an internal review found its agents exploiting websites, slipping past paywalls, and submitting a false murder tip to Philadelphia police. Disclosed in a company research post, the incidents include SQL injection