Engineering brief
Context compaction is a trap when caching is cheap
At a glance
- Relevance
- Practical value
- Warnings
- None
Most AI agents compact context to save tokens. But new experiments show full history beats compaction on cost, recall, and latency—thanks to 50x caching discounts.
Default compaction strategies can waste money and degrade quality; caching changes the economics.
Summary
Towards AI's experiments on their AI tutor reveal a counterintuitive finding: not compacting context often outperforms compaction. The team tested sliding windows, summarization, selective retention, and full history across Gemini and DeepSeek models. Full history consistently achieved higher recall (95% vs 32% for compacted) and lower cost per turn due to aggressive prompt caching.
Caching discounts of up to 50x mean that resending the same context is far cheaper than regenerating summaries. Compaction destroys cache locality, forcing the model to re-process new tokens at full price. The result is higher latency, more tool calls, and worse memory recall.
The tradeoff shifts when context exceeds local hardware limits. On a MacBook, the 32K window forced compaction, lowering recall to 33%. For documents, hybrid retrieval (dense + BM25) maintained 100% accuracy, outperforming pure semantic search at scale.
Teams should not default to compaction. Instead, measure cache hit rates, use cheaper models with generous caching, and only compact when context windows are genuinely constrained by hardware or API limits. The real bottleneck is workflow design, not model quality.
Watch the video
This video is blocked due to your privacy settings. To watch this video, please accept YouTube marketing cookies.
Related breakdowns
Computer-use agents beat benchmarks but fail the reliability test
Computer-use agents are hitting human-level benchmark scores, but fail the repeatability test. Here is why reliability, not capability, is the real adoption…
AI Futures Without Lock-In: Decouple Before You Consolidate
Remy Guercio makes a case for ROI maxing over token maxing: decouple your AI stack to control costs and avoid vendor lock-in. Tailscale's Aperture demo shows…
80% agent reliability means zero customer trust — here's proof
The eval flywheel from Amazon AGI Lab: why 80% reliability means zero customer trust, and how direct customer feedback beats static benchmarks.
Get TL;DW
Too Long; Didn't Watch.
A concise breakdowns of the AI and devtools videos that actually matter for engineering leaders.
Free. Weekly. No hype.
Video and thumbnails remain the property of their respective creators. tldw.news provides editorial analysis, commentary, and discovery links to original content.