Context reduction is the practice of decreasing the amount of information sent to a Large Language Model (LLM) while preserving the information needed for the current task. It is a practical part of context engineering because large prompts increase cost, latency, and failure risk.
Common reduction techniques include:
- removing duplicated or stale conversation turns;
- replacing long tool outputs with summaries and artifact references;
- selecting fewer retrieval chunks before generation;
- compressing prior task state into structured notes;
- discarding irrelevant examples or tool definitions; and
- moving intermediate state to external storage through context offloading.
Context reduction is related to context compaction, but the terms are not identical. Compaction usually refers to summarizing or restructuring an existing history. Reduction is broader: it can happen before retrieval, after tool calls, during message assembly, or as a routing decision.
The main engineering tradeoff is recall versus focus. Aggressive reduction can remove facts the model later needs. Weak reduction leaves the model with bloated context, increasing the chance of lost-in-the-middle failures or context confusion.
Reduction should be measured by task success, not by token count alone. A smaller prompt that fails is more expensive than a larger prompt that reliably completes the task.
LangChain describes compression as one of the core context engineering operations in its context engineering for agents article.
The LLM Knowledge Base is a collection of bite-sized explanations for commonly used terms and abbreviations related to Large Language Models and Generative AI.
It's an educational resource that helps you stay up-to-date with the latest developments in AI research and its applications.