compression with a quality contract

The Benchmark

Every compression method shrinks tokens. The only number that matters is how much it saves without changing what the agent decides — and what it truly costs once prompt caching is priced in. This is a head-to-head on exactly that axis, where every technique runs through the same decision-equivalence gate and the same cache-aware cost model. The winner is computed, not assumed.

The result, in one line. Across a 64-trajectory, 8-family corpus spanning the content agents actually traffic in, Distil leads on certified savings — 81.5% cheaper at 100% decision-equivalence under the deterministic (structural) runner. Every lossy technique posts a real raw cut but drops decisions and is disqualified by the gate. Even Distil's byte-exact lossless mode (58%) tops every competitor's certified number, because theirs is zero. Read this with the live-model caveat below: graded by the real model, the aggressive distil-causal lead does not hold — the robust point is distil-lossless.

The standings

Ranked by cache-aware dollar savings on the varied corpus (see methodology below). Certified means the method passed a statistical non-inferiority test and preserved 100% of decisions; anything less is disqualified, however much it saved. Want to test a specific tool? Register it through the reproducible --external seam and it's measured on the identical axes.

TechniqueFamilyTokens saved$ savedDecision equiv.VerdictFidelity
distil-causalcache-aware + causal pruning 80.5%81.5% 100%✔ certified · leaderlossy*
truncate-tailsliding-window / truncation 78.7%79.6% 14%✘ fails gatelossy
distil-streamlossless + cross-turn dedup (fully reversible) 61.0%61.7% 100%✔ certifiedreversible
distil-losslesscache-aware lossless + structured fold + template mining 57.4%58.1% 100%✔ certifiedbyte-exact
summarizeabstractive / rolling summary 56.5%57.2% 39%✘ fails gatelossy
extractive-pruneextractive importance (LLMLingua family) 18.2%18.4% 77%✘ fails gatelossy
minify-alllossless minification 0.1%0.1% 100%✔ certifiedbyte-exact

*distil-causal drops context that ablation proves never changed a decision — not byte-reversible, but certified decision-equivalent. The three Distil operating points are all certified at 100%: distil-lossless (byte-exact: structured fold + template mining), distil-stream (adds cross-turn dedup of recurring tool output the cache can't reach — fully recoverable), and distil-causal (adds causal pruning). The lossy families are faithful reference implementations; bring your own tool with --external to add it to the table. Numbers: claude-opus-4-8 pricing, deterministic runner. Reproduce below.

The corpus

To avoid any one tool's home-turf advantage, the comparison runs on 64 reproducible trajectories across 8 families deliberately spanning both regimes: structured/repetitive data (JSON record arrays, SQL rows, metrics, logs) where structural compaction pays off, and diagnostic/prose content (Kubernetes incidents, stack traces, RAG chunks, support transcripts) that conservative crushers protect and lossy methods mangle. Decisions are buried inside large tool outputs — as on real agents — so naive head/tail truncation drops them (14% equivalence). A large reference doc is re-read every turn (the recurring tool output prompt caching can't reach), which Distil's cross-turn dedup collapses and others re-bill in full.

Why this is the honest comparison

Same gate for everyone

No method is special-cased

Every technique — including Distil's own — is scored by the identical decision-equivalence + non-inferiority gate and the identical cache-aware cost model. The harness will happily rank a competitor above Distil if it earns it. It doesn't, because no other family combines lossless, cache-stability, causal pruning, and certification — but the door is open.

Faithful baselines

Best-form, not strawmen

The baselines are faithful reference implementations of the real technique families — sliding-window truncation, extractive importance pruning (the LLMLingua / Selective-Context lineage), abstractive summarization, naive minification — each in its best reasonable form. They genuinely remove tokens. They just can't prove they kept the decision.

Raw ≠ real

Two ways to "win" that don't count

A method can post a big raw token cut yet flip decisions — summarize cuts 56% but keeps only 39%; truncation cuts 79% but keeps 14%; extractive importance cuts 18% but keeps 77%. All disqualified. Or a method can shave tokens yet bust the prompt cache and cost more in real dollars. The benchmark prices both, so neither illusion survives.

Verify it yourself

Plug in a real tool

Don't trust our reference baselines? Register any installed compressor through the --external seam and it's measured on the identical axes. The claim "Distil leads on certified savings" is reproducible — and falsifiable. That's the point.

The equivalence dial

100% decision-equivalence is the default — but it's a setting, not a wall. Some teams will trade a little equivalence for deeper savings. Distil makes that trade explicit and bounded instead of hidden: you set a target, and the compressor spends a divergence budgetfloor((1−target) × turns) turns — on the highest-value turns first, falling back to byte-exact everywhere else. You always know exactly what you traded.

$ distil frontier --corpus benchmarks/corpus_xl
savings-vs-equivalence dial  (runner=deterministic)

   target   achieved equiv  token savings   curve
----------------------------------------------------------------------
     100%             100%          58.1%   ████████████████
      95%             100%          58.1%   ████████████████
      90%             100%          58.1%   ████████████████
      80%              82%          62.9%   ██████████████████
----------------------------------------------------------------------
At 100% you get the certified-safe result. Relax the target and the budget is
spent on the highest-value turns — deeper savings, a known equivalence cost.

Honest notes: the dial's resolution is bounded by session length — on 5-turn trajectories the budget steps in 20% increments, so 95% and 90% round to the certified-safe point; longer sessions dial finer. The extra savings are real but modest (a principled risk knob, not a magic unlock), and the trade is always reported, never silent. Grade the frontier against the live model with --runner anthropic.

Reproduce it

# the bundled 7-domain standings, offline, zero API key
distil benchmark

# the 64-trajectory varied corpus above (from a repo clone)
python benchmarks/gen_corpus.py
distil benchmark --corpus benchmarks/corpus_xl --html standings.html

# verify against a REAL external compressor (list[str] -> list[str] over block texts)
distil benchmark --external mypkg.compressor:compress:MyTool

# grade with the live model instead of the deterministic runner
distil benchmark --runner anthropic --tokenizer anthropic
Honest scope. Numbers use the deterministic (structural) decision-equivalence runner — reproducible by anyone, no key required — on the reproducible 64-trajectory corpus generated by benchmarks/gen_corpus.py. ~80% is near the certified ceiling for this corpus: beyond it you start dropping decisions, and no honest tool can exceed that without lying — which is exactly what every disqualified row tried to do. For task-accuracy on a public benchmark (τ-bench, SWE-bench, GSM8K), ingest its traces into a corpus and run with --runner anthropic: the same comparison, graded by the live model. The harness is the deliverable; the corpus is swappable.

Toward live-model validation

The deterministic runner certifies structurally — fast, free, reproducible by anyone. The same harness upgrades to live-model, task-accuracy grading with no new code: every technique's compressed context is judged by the real model, on real benchmark trajectories. The path is three commands:

# 1) record a public benchmark's agent trajectories as API requests (jsonl),
#    then convert them into a Distil corpus
distil ingest --input taubench_traces.jsonl --out corpus_taubench

# 2) run the SAME standings, but decisions graded by the live model
#    and tokens counted billing-grade
export ANTHROPIC_API_KEY=sk-ant-…
distil benchmark --corpus corpus_taubench --runner anthropic --tokenizer anthropic

# 3) the certified leaders now carry a live-model decision-equivalence verdict

What this buys: the equiv column becomes "did the live model make the same decision on the compressed context," graded on τ-bench / SWE-bench / GSM8K episodes instead of the synthetic corpus. The non-inferiority gate, the cost model, and the technique set are unchanged — only the judge and the data get more real.

What the live model actually said (and we won't hide it). We ran exactly this on the bundled corpus, opus-4-8, majority-vote-3, filtered to the turns where the model is self-consistent on identical context (about half of all turns — on the other half the model itself varies, so equivalence is undefined and it's nobody's compression that "failed"). On the unambiguous turns: distil-lossless and byte-exact lead at 86%; truncate/summarize 79%; aggressive distil-causal drops to 57%. Two honest consequences: (1) the deterministic gate is an optimistic proxy for aggressive pruning — the structural "distil-causal leads" result does not hold under the live model; (2) the robust operating point is the conservative, recoverable distil-lossless, and aggressive modes should be gated by the live runner or the equivalence dial. No method reaches 100% even on unambiguous turns — a ~14% residual is pure model variance, not compression. That is the real ceiling, reported, not spun.