Open Models Almanac
Methodsinference & servingcontext management

specific method · filed under inference & serving

Context folding

Context folding is a context-management strategy for long search-agent contexts that keeps the conversation within a length limit.1 Once the cumulative tool-response length reaches a preset threshold, earlier tool responses are pruned from the history.2

Trade-off A comparison in the passage shows it scoring lower on BrowseComp than a discard-all strategy.3

How this definition was written

Summarised by glm-5.3-flash from 1 source; every sentence is checked against the quote it cites.

  1. most search agents built on our model adopt a simple context-folding strategy(256k — Qwen/Qwen3.5-397B-A17B · Hugging Face
  2. once the cumulative Tool Response length reaches a preset threshold, earlier Tool Responses are pruned from the history to keep the context within limits — Qwen/Qwen3.5-397B-A17B · Hugging Face
  3. simple context-folding achieved a score of 69.0, while using the same discard-all strategy as DeepSeek-V3.2 and Kimi K2.5 achieved 78.6 — Qwen/Qwen3.5-397B-A17B · Hugging Face

Also called context-folding strategy, simple context-folding strategy(256k).

sources
2
model
1
lab adopt it
1
strongest
used

Documented in

Alibaba (Qwen)

Evidence

2 quotes from 2 sources, one card per model, each opening with its strongest.

How sources treat it
evaluated 1used 1

Qwen3.5-397B-A17B

Alibaba (Qwen)adopted2 sources

most search agents built on our model adopt a simple context-folding strategy(256k): once the cumulative Tool Response length reaches a preset threshold, earlier Tool Responses are pruned from the history to keep the context within limits.

usedinference serving
1 more from this model

BrowseComp: we tested two strategies, simple context-folding achieved a score of 69.0

evaluatedinference servingin Qwen3.5-based search agentsQwen Team
↑