Skip to the content.

Awesome Token Efficiency

A single index of the methods that make an LLM workload cost fewer tokens — billed input/output tokens and the resource “tokens” of KV-cache memory and recompute. This is a reference catalog (an “awesome list”), not a roadmap: it lists methods even if fak does not and will not implement them, so an operator or contributor can see the whole field on one page and know where fak sits on each.

How to read this

Every entry carries up to four tags:

fak status legend: ✅ shipped · 🟡 partial / seam present · 🔭 plan or design doc only · ❌ not in fak (and maybe never) · ➖ out of fak’s layer (client/provider/author side) · ⭐ a place fak does something the standard stacks do not.

The load-bearing axis is lossy vs lossless. The biggest mechanical, lossless wins — prefix caching, paged/radix KV reuse, batch tiers, lazy tool loading, tokenizer choice — change cost without changing what the model sees, so they are the ones that can be default-on. Lossy methods (compression, eviction, summarization, quantization) trade fidelity for size and belong behind a flag with a witness.


fak at a glance — what is on by default

fak is an agent kernel: a gateway you put in front of the model that keeps the provider’s prompt-cache prefix byte-identical while shedding old turns, and (in the fused path) runs the model with an addressable, bit-exact KV cache. Its token-saving defaults are audited by fak token-defaults-scorecard (scorecard doc). The budget-size policy for those bounded defaults lives in the long-context defaults doctrine: the advertised context window is a hard cap, not a resident-context target. On by default today:

Saver Loss What it does Lever
Provider prompt-cache passthrough lossless ships a byte-identical cache prefix so the provider discount survives structural
Tool-floor pruning lossless drops provably-unreachable tool definitions from the request structural
vDSO dedup lossless collapses identical repeated calls --vdso
Compact-history bounded sheds the un-cacheable middle past a 48k-token budget by splicing original bytes --compact-history-budget
Oversized-result elision bounded shrinks a scrolled-past tool_result to head+tail at 16 KB --elide-result-bytes
Structured-output passthrough lossless forwards response_format / json_schema / logit_bias to the ride engine structural (#907)
ctxplan O(1) view bounded re-materializes history under a budget --ctx-view-budget (default-on at 8000)

The rest of this page is the wider field. Where a method could be a safe fak default and isn’t yet, it links to a tracking issue (see default-on candidates).


Part A — Prompt & API-level (request-side)

Methods that shape the request before/around the model. fak owns the gateway here, so many of these are fak levers; others are the prompt author’s or the provider’s.

A1. Prompt caching (lossless, mechanical)

A2. Prompt compression (lossy, semantic)

A3. Context pruning / selection (mostly lossy, semantic)

A4. Output-side control (caps lossless; concision lossy)

A5. Batching / request shaping (lossless, mechanical)

A6. Tool / function-definition efficiency

The tool schemas are a per-turn input tax paid whether or not a tool is called.

A7. Tokenizer-level (lossless, mechanical)


Part B — KV-cache & inference-serving (resource-side)

These reduce the resource tokens — KV-cache memory, attention compute, recompute. fak owns the governance band on top of an engine and, in the fused path, runs its own reference engine with an addressable, bit-exact KV cache — so some of these are shipped in-kernel, many are the engine’s job that fak fronts, and a few are uniquely fak’s.

B1. KV-cache quantization (lossy; int8 ≈ neutral)

B2. KV-cache eviction / sparsity (lossy)

B3. Attention architecture for KV reduction (native — lossy vs MHA, no fidelity loss vs own weights)

B3b. Low-rank KV compression (post-hoc SVD, lossy)

B4. Prefix / cache sharing (lossless, exact reuse)

B5. KV offloading / transport / disaggregation (lossless movement)

B6. Recompute vs storage tradeoffs (lossless)

B7. Decoding-side compute savers (speculative family — mostly lossless)

B8. Context-length extension (KV-relevant)


Part C — Agent / context-engineering (loop-level)

How agent harnesses keep multi-turn token usage down. “Context engineering” (the term Cognition and Anthropic popularized) is the discipline of curating the optimal set of tokens in the model’s limited attention budget at each step. fak shares prefill across agents and sheds old turns cache-safely; most of the rest is the harness’s job, though fak’s gateway position lets it do several mechanically. A useful field taxonomy is Drew Breunig’s “How to Fix Your Context” (RAG · Tool Loadout · Context Quarantine · Pruning · Summarization · Offloading).

C1. Context compaction / summarization (lossy, semantic)

C2. Tool-result management

C3. Sub-agent / context isolation

C4. Retrieval over full-context / external memory

C5. History pruning / dedup

C6. Planning / scratchpad externalization (lossless)

C7. Prompt / system-prompt hygiene

C8. Caching at the agent layer


Default-on candidates (tracked as issues)

The honest rule (from the token-defaults scorecard): default-on a saver only when it is demonstrably safe — lossless or in-code-guarded bounded loss, with a committed witness. The methods below are mechanical and lossless-or-bounded, sit at fak’s gateway layer, and aren’t on yet:

Candidate Why it qualifies Issue
Inbound content exact-dedup (same file/tool output sent twice in one request) lossless, mechanical, extends vDSO from calls to message content #1101

Note: Tool Search / lazy MCP tool-schema loading shipped as fak_tools_search in 2026-06 and is no longer a candidate — see A6. Tool / function-definition efficiency.

Lossy methods (LLMLingua compression, summarization, rerank, KV eviction/quant) are deliberately not default-on candidates — they change what the model sees and stay behind a flag with a witness.

Maintenance

This list is meant to be refreshed. To update it:

  1. Re-run the field survey (the three research clusters: prompt/API, KV/serving, agent/context-engineering) and add new methods with a verified primary reference.
  2. Re-derive fak’s status from source, not from this page — the fak token-defaults-scorecard is the on/off authority for the defaults; internal/ packages are the authority for the in-kernel methods.
  3. For any newly-safe default-on candidate, file a tracking issue and link it here.

See also: SOTA optimizations fak sits on top of, fak vs vLLM / SGLang / provider KV caching, the frozen-trajectory cache cliff, and the broader Agent optimization methods survey (370 methods, 16 families) — this page is the token-efficiency-focused, fak-status-annotated slice of that field map.