compression with a quality contract
Token Economics · Module 3 of 3 ~5 min read

Distil & Proof

In this module
  • Why "it still looks fine" is not proof — and what is.
  • Non-inferiority testing, borrowed from clinical trials.
  • How Distil applies every technique in certified, risk-graded tiers.
  • A practical playbook, and where the field is heading.

Proving it didn't hurt

Every technique in Module 2 can quietly degrade quality, and the failure is often invisible — the output still looks reasonable. So the load-bearing question isn't "how much did you save?" It's "how do you know the model still makes the same decision?" Three things to internalize:

How Distil applies it — in tiers

Distil's design choice is to apply the safe techniques aggressively, the risky ones only under proof, and to refuse anything it can't certify. That's the tier ladder. Each rung saves more and risks more — and a rung is only allowed to ship if it clears the gate above it.

⛓ Quality contract — non-inferiority (TOST) gate No tier ships unless the agent's decisions are certified statistically not-worse. Fails → fall back a rung. must pass ↓ 0 Tier 0 — Lossless JSON minify · whitespace · de-dup · run-length collapse. Byte-recoverable. Always on. risk: none applied to every request 1 Tier 1 — Reversible digest Verbose tool output replaced by a compact digest + handle the agent can expand on demand. Reconstructable. risk: bounded reversible by construction Certified — Causal / counterfactual pruning Ablation finds context the decision doesn't depend on; cache-aware & keep-model guided. Kept only if it passes the gate. risk: gated to zero certified per run

The pieces that make the ladder work — each documented in depth on Techniques (which also carries the full tier reference table):

# See the certified frontier and what's safe to take on your own corpus
distil eval
distil bench            # lossless + causal savings, with the non-inferiority verdict
distil proxy --port 8788 # drop-in; records genuine savings as real traffic flows
distil leaderboard      # your real cumulative savings (local, private)

A practical playbook

Independent of any tool, this is the order of operations that saves the most for the least risk:

Do first — free wins

  • Stabilize your prefix. Put the system prompt and tool schemas first and keep them byte-identical; move anything volatile (timestamps, IDs) after the last cache breakpoint. This alone can 10× the discount on repeated tokens.
  • Turn on prompt caching and verify hits via the cache-token counts.
  • Minify structured payloads losslessly before they enter context.
  • Prune dead tool definitions — every unused schema is paid on every turn.

Then — measured wins

  • Digest verbose tool output reversibly; let the agent expand on demand instead of carrying full dumps forever.
  • Compact or summarize stale history — but treat summaries as lossy and keep recent turns verbatim.
  • Prune causally, not by surprisal — remove what the decision doesn't depend on.
  • Certify every aggressive step with a non-inferiority test; if it can't pass, don't ship it.
  • Measure genuine savings on real traffic, not a synthetic corpus.

Where the field is heading

You've finished the course. The throughline of every advance in this field is one move: find the tokens the outcome doesn't depend on, and stop paying for them — without changing the outcome. Distil makes that last clause a proof, applied in tiers, measured on your real traffic. Next: Install & Quickstart, then go deeper in Concepts and Techniques.

Further reading

Primary sources behind this course — verified, for the curious: