Cheaper to summarize than to send everything
If a document is 50k tokens but the answer only needs the conclusion, you can summarize the document offline once, store the summary, and send the summary at query time. The user gets the same answer with 5% of the tokens. The expensive part — reading 50k tokens — happens once.
Two compression patterns
- Static compression — generate summaries at ingest time. Embed both the chunk and its summary; retrieve summaries first, drill into chunks only when needed.
- Dynamic compression — at query time, rewrite long chunks down with a cheap model before passing to the expensive model. Useful for chat history compaction.
The fidelity tradeoff
Compressed contexts lose information. Summaries are interpretations, not the original text. For tasks that require exact quotes (legal, audit, citations) summaries are insufficient — keep originals available, compress only the surrounding context. For tasks where the gist is enough (intent classification, routing) summaries are net win.