Encyclopedia · 311 concepts
Learn this concept as a feed

NLP & Language · beginner · concept 117 of 311 · Updated Nov 4, 2026

Prompt and Context Compression

Shortening what goes into a model's context window without losing what the task needs, because every token costs money and time. Methods range from dropping low-information tokens with a small model (Microsoft's LLMLingua reports up to 20x compression with little loss) to packing an instruction into a few learned gist tokens, to agent habits such as summarizing a long transcript into notes. Claude Code's compaction is an everyday example.

Top AI contributors on this

Key terms

Token budgetLLMLinguaGist tokensCompactionContext rotSummarization memory

Where you meet it in the real world

Cutting API bills on long RAG prompts, keeping coding agents running across long sessions, fitting chat history into small on-device models, log and document triage