/p/2026-08-24 · explainer
Paper explainer · 2608.19993 · Chen, Chen, Wang, Li & Huang

Your skill router is packing the wrong set.

Loading reusable documents into the context window is now the main way an agent picks up a capability it did not have. Nearly every router scores each document on its own for relevance and packs the top few until the budget runs out — which cannot see that two documents overlap, or that a third is a plausible near-miss. On a code benchmark built so that no task is solvable without the right documents, two complementary ones reach 93% success, a redundant third buys one point for 225 tokens, and one that is semantically related but irrelevant costs 23 points. Scoring whole sets instead reaches 0.73 task success against 0.20 to 0.52 for released routers and retrievers, on 28% fewer tokens.

01 · The failure

A near-miss document costs more than a missing one

The benchmark is built to make this measurable. Real coding tasks are forked so their standard libraries are replaced by sixteen private modules across five capability families, with call surfaces nobody could guess; a task is only admitted if the private-module solution passes, the standard-library solution fails, and every single-capability hybrid fails too. About a third of forked tasks clear that gate. So a task's success depends entirely on which documents are in the window. Build a set below.

Interactive · switch documents in and out of the windowmeasured success rates on a two-capability task · token costs as reported

      
measured task success with this set
tokens of context consumed
0%50%100%

The asymmetry is the whole paper in one line. Covering a second capability is worth 93 points. Adding a redundant document is worth one, for 225 tokens. Adding a semantically related but task-irrelevant one is worth minus twenty-three. A scorer that ranks documents independently has no way to tell the second from the third — they look equally relevant on their own.

02 · The model

Coverage saturates. Tokens charge in a straight line

To choose a set you need a number for a set, so the paper writes one down. Each document supplies some amount of each capability; each query demands some amount of each; the value of a set is the demanded capabilities it covers, run through a saturating curve so that the second document covering the same capability is worth much less than the first — and then a flat charge per token is subtracted. Maximise that under a hard budget. Drag the slider and watch the two halves pull against each other.

Interactive · add documents covering the same capabilitymeasured anchors at one and two documents · the saturating shape is the paper's fixed model form illustrative beyond the anchors
value of the set → (axis shown from 75 to 100)
2 documentsextra documents on the same capability8 documents
gross capability benefit — before the token charge
net objective — benefit minus the per-token charge
050100

Fitting this needs no access to the hidden capability vectors — only the products of demand and supply, which come out of pass/fail execution records through two small encoders. The fit is 281 parameters, and its recovered document-capability matrix ranks true pairs above uncovered ones 99.6% of the time, at an area under the curve of 0.996 over 155 pairs. A model with sixty times the parameters buys nothing.

03 · The algorithm

Keep every prefix, not just the end of the chain

Once the objective can go down as well as up, ordinary greedy packing breaks: it fills the budget, and the best set was three documents back. The algorithm here enumerates every seed of at most two documents, grows each into a chain by repeatedly taking the document with the highest benefit-per-token, and — the actual trick — records every partial set along the way, returning whichever recorded set scores best. Step the chain and watch the two curves separate.

Interactive · step along one density chainthe algorithm's own steps · benefit and net values illustrative, the behaviour is the paper's

      
050100

Chart · how often each selector finds the true optimum80 selection instances · held-out tasks, varied budget and varied penalty coefficient
0%50%100%

Set-scoring methods land on the optimum roughly half the time by luck. Document-scoring methods — top-k, maximal marginal relevance, determinantal point processes — clear it under 10% of the time, with a mean shortfall around a hundred times larger.

The guarantee attached is a bicriteria one, and it is worth reading plainly: the returned set captures at least 63.2% of the capability benefit of any feasible set, while paying that set's full token cost. That benefit coefficient cannot be improved by any polynomial-time algorithm. The cost is a run time that grows with the fourth power of the library size, which is why the library here is a retrieval shortlist rather than a whole registry.

04 · The measurement

0.73 against 0.20 to 0.52, on fewer tokens

All of the above would be arithmetic if the executor did not agree. It is a frozen open-weight coding model, run on 80 held-out selection instances against every released alternative the authors could get: two skill routers, a graph-based selector, lexical and dense retrievers, and the executor choosing its own documents. Pick a selector.

Interactive · pick a selector80 held-out instances · one frozen executor · success measured by running the code
measured task success
tokens of documents injected
00.400.80

Two things to take from the ordering. The executor picking its own documents at 0.51 beats every released router and retriever in the table — if you are considering a routing layer, that is the baseline to beat, not a naive top-k. And the token column runs the other way to intuition: the best result uses the fewest tokens, because the documents it leaves out were actively costing accuracy.

05 · Your context budget

What near-misses are costing your own injections illustrative

The production shape is any place you inject retrieved text by relevance rank: skill documents, tool definitions, few-shot examples, retrieved runbook pages. Set your own budget and library below. The per-document effects applied are the paper's measured ones — one point for a redundant document, minus twenty-three for a plausible near-miss.

Interactive · scale it to your injection budgetper-document effects measured · budget, library size and near-miss rate illustrative
documents the budget admits
accuracy given away to near-misses

The experiment this suggests costs an afternoon and needs no selector at all: take your current injection, delete everything below the top two or three, and measure. If accuracy goes up, your ranker is buying you near-misses and you have found the paper's largest single effect in your own product.

The numbers

What the paper actually reports

What this does not show

In practice