TL;DR
Large language model (LLM) agents struggle with long conversations due to context length limits. U-Fold tackles this by dynamically summarizing and filtering past interactions, creating a concise yet informative "working context" that preserves crucial details and tracks evolving user intent. This leads to significantly improved performance in complex, multi-turn user-centric tasks compared to existing methods.
What Problem Does This Paper Address?
LLM-based agents are increasingly used in tool-augmented applications, but their ability to handle long, complex interactions is hampered by the limited context window of LLMs. Traditional "context folding" methods, which summarize past conversations to save tokens, often fail in realistic user-centric scenarios. These methods tend to either discard important fine-grained details (like user constraints) or lose track of the user's changing intent over multiple turns. This can lead to agents making incorrect decisions, missing crucial information, or performing redundant actions. The paper aims to solve this by developing a context folding method specifically designed for the dynamic and evolving nature of user-centric dialogues.
Methods
U-Fold introduces a dynamic, two-component approach to context folding:
- Conversation Summarization Module: This LLM-based module continuously summarizes the dialogue history. Crucially, it goes beyond simple summarization by explicitly tracking the evolution of user goals, constraints, and preferences. It also generates an explicit "to-do list" of pending objectives, providing a structured interface for downstream planning.
- Dynamic Data Extraction Module: This LLM-based module acts as a filter. It reviews the full logs of past tool calls and dynamically extracts only the information that is relevant to the current user query and the to-do list. This prevents the context from being bloated with irrelevant or noisy data from tool outputs.
Together, these modules create a compact, "user-centric working context" that is updated at each turn, ensuring the agent always has access to the most relevant information and understands the current user intent.
Datasets
The paper evaluates U-Fold on several existing user-centric benchmarks:
- τ-bench (Yao et al., 2024): Simulates multi-turn dialogues with an agent and a user simulator, incorporating API tools.
- τ²-Bench (Barres et al., 2025): Extends τ-bench to dual-control environments.
- VitaBench (He et al., 2025): A more complex life-service simulation environment.
The authors also created a "harder version" of VitaBench for evaluating performance under severe context inflation, where tool outputs are intentionally noisy.
Key Insights and Ideas
- User-centricity is key: Standard context folding methods, designed for simpler tasks, break down in realistic user-centric scenarios where intent shifts and fine-grained constraints are critical.
- Dynamic is better than static: Simply summarizing past interactions isn't enough. U-Fold's dynamic approach, which continuously updates the context based on the latest turn, is crucial for tracking evolving user needs.
- Preserving constraints matters: Discarding intermediate facts and user constraints is a major failure mode. U-Fold's ability to retain these details is a primary driver of its success.
- Information extraction is more than summarization: The dynamic data extraction module is vital for filtering out noise from tool outputs, making the compressed context truly useful.
- Capability transfer: A stronger LLM can act as an effective "folder" for a weaker agent, suggesting a cost-effective way to improve agent performance on long-horizon tasks.
Key Results
U-Fold consistently outperformed the strong ReAct baseline and prior context-folding methods (ReSum, IterResearch) across all tested benchmarks.
- Win Rate: U-Fold achieved a 71.4% win rate against ReAct in long-context settings.
- Improvements: U-Fold showed improvements of up to 27.0% over prior folding baselines.
- Error Reduction: U-Fold substantially reduced all error types, particularly omissions of critical user information, which is a key failure mode addressed by its design.
- Tool Call Efficiency: U-Fold required significantly fewer redundant tool invocations compared to static folding methods, as it could access necessary information directly from the retained history.
- Context Length: U-Fold significantly slowed context length growth over interaction rounds, demonstrating its efficiency.
Limitations and Future Work
The authors acknowledge a couple of limitations and suggest future directions:
- Triggering Folding: U-Fold currently triggers folding at every user turn. Future work could involve learning a policy to detect when user intent has actually changed, potentially reducing overhead.
- Benchmark Complexity: Existing benchmarks, while improved, still don't fully capture the complexity of real-world multi-session, multi-user systems. Developing more challenging benchmarks with richer tool ecosystems and longer, interdependent tasks is an important future direction.
Summary updated