Context Compression
A lossy compression mechanism automatically triggered by large language model tools when a conversation exceeds the context window limit. Earlier dialogue history is condensed into a brief summary to free up token space, a process that may cause loss of granular details such as debugging decisions.
Core Facts
Common context pruning strategies include sliding window (retaining the most recent N messages), summary compression (summarizing old messages into a summary), and importance filtering (prioritizing the retention of tool call results).
Context compression refers to summarizing or trimming historical conversations and tool outputs in long multi-turn tasks to fit within the model's context window limit
Compaction refers to the framework automatically condensing earlier conversations into summaries or removing redundant content to free up space when session messages exceed the model's context window limit.
Timeline (last 90 days)
Existing context compression schemes typically retain condensed conclusions and discard early observations, but the discarded evidence may become critical again in later steps.
In long-horizon agent tasks, interaction trajectories often far exceed the model's context window, making context compression a hard problem.
Commonly used context management methods in the industry include context compression, on-demand retrieval and session isolation.
In practice, micro-sessions can be used as execution units, combined with a state graph engine to manage state between sessions and supplemented by context compression to reduce pressure within a single session; these approaches are not mutually exclusive.
The essential difference between micro-sessions and context compression is that compression performs lossy summarization of history within the same session, whereas micro-sessions actively end the session and hand over via structured state.
Context compression solves the "doesn't fit" problem rather than the "cheaper" problem: most of the history being replaced was originally in a cache-hit state with a very low unit price, whereas after compression the summary itself is newly added output, and the entire prefix after the rewritten position is invalidated and must be recomputed at the original price.
Common approaches to context compaction include sliding-window truncation of old messages, summarizing history with an LLM, and discarding segments by importance, and these methods introduce irreversible information loss.
The goal of agent context compression is to distill history into a structured summary, emphasizing task continuity and often adopting a structured format with fixed slots.
This weakening effect persists across different model families and compression architectures and is not a problem of individual implementations.
Encoder-based context compression systematically weakens refusal behavior in instruction-tuned language models, despite high reconstruction fidelity.
40 more timeline events
All Facts (20)
Common context pruning strategies include sliding window (retaining the most recent N messages), summary compression (summarizing old messages into a summary), and importance filtering (prioritizing the retention of tool call results).
90%VerifiedContext compression refers to summarizing or trimming historical conversations and tool outputs in long multi-turn tasks to fit within the model's context window limit
75%VerifiedCompaction refers to the framework automatically condensing earlier conversations into summaries or removing redundant content to free up space when session messages exceed the model's context window limit.
75%VerifiedContext compaction is a class of techniques that distill existing conversation history into a more concise representation, typically by having the model generate a summary of earlier content to replace the original message list.
75%VerifiedWhen conversation history exceeds the context window limit, platforms use engineering methods such as truncation and summary compression to trim the context, a process that inevitably loses detail information.
75%VerifiedIn multi-step tasks, an Agent loses context, which is fundamentally a state management problem, because information relies on the context window's memory, and key information is easily buried or truncated as the number of conversation turns increases.
65%VerifiedContext compaction is a technical mechanism designed to retain key information within a limited context window.
65%UnverifiedContext window compression is the process by which a summarizer compresses older content into a summary and stuffs it back into the window, which is essentially lossy compression where details may be lost in the process.
60%UnverifiedCommon strategies for handling context overflow include rolling truncation (discarding the earliest conversation records) and summary compression (replacing full history with a brief summary).
60%UnverifiedWhen the context window is nearly full, context compression is performed by discarding irrelevant information or generating summaries, in order to control token costs and keep the model's attention focused.
60%UnverifiedExisting context compression schemes typically retain condensed conclusions and discard early observations, but the discarded evidence may become critical again in later steps.
50%UnverifiedIn long-horizon agent tasks, interaction trajectories often far exceed the model's context window, making context compression a hard problem.
50%UnverifiedCommonly used context management methods in the industry include context compression, on-demand retrieval and session isolation.
50%UnverifiedThe essential difference between micro-sessions and context compression is that compression performs lossy summarization of history within the same session, whereas micro-sessions actively end the session and hand over via structured state.
50%UnverifiedIn practice, micro-sessions can be used as execution units, combined with a state graph engine to manage state between sessions and supplemented by context compression to reduce pressure within a single session; these approaches are not mutually exclusive.
50%UnverifiedContext compression solves the "doesn't fit" problem rather than the "cheaper" problem: most of the history being replaced was originally in a cache-hit state with a very low unit price, whereas after compression the summary itself is newly added output, and the entire prefix after the rewritten position is invalidated and must be recomputed at the original price.
50%UnverifiedCommon approaches to context compaction include sliding-window truncation of old messages, summarizing history with an LLM, and discarding segments by importance, and these methods introduce irreversible information loss.
50%UnverifiedThe goal of agent context compression is to distill history into a structured summary, emphasizing task continuity and often adopting a structured format with fixed slots.
50%UnverifiedEncoder-based context compression systematically weakens refusal behavior in instruction-tuned language models, despite high reconstruction fidelity.
50%UnverifiedThis weakening effect persists across different model families and compression architectures and is not a problem of individual implementations.
50%