GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
RecentarXiv preprint

U-Fold: Dynamic Intent-Aware Context Folding for User-Centric Agents

Keep the full history, and on every user message rebuild a small working context: a summary with a to-do list plus verbatim lines from past tool output. Small gains over ReAct, big ones under noise.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2026
AUTHORS
Su, Fang, Li, Wang, Cai, Xie, Zhang, Yuan
FROM
Zhejiang University, Tongyi Lab (Alibaba Group), Westlake University
PUBLISHED
Jan 2026 · arXiv preprint
CITED BY
8Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 21% of this breakdown.

01

The paper in one minute

Most context-folding methods were designed for one long task with one goal: research a question, fix a bug. They summarize old steps and throw the originals away. Jin Su, Runnan Fang, Fajie Yuan and colleagues at Zhejiang University, Alibaba's Tongyi Lab and Westlake University looked at a different setting: an agent talking with a user over many turns, calling tools, while the user adds requests and changes their mind. There, they found two failures. Summaries drop fine-grained constraints that matter later, and they fail to track the user's current intent.

Their opening example: a user picks an aromatherapy store whose tool record says it opens at 12:00, then asks to book "Saturday 11 AM, or 2 PM if that's not possible." A vanilla folding summary kept the store name and packages but lost the hours, so the agent booked 11 AM.

U-Fold never discards. It stores the full dialogue and every tool call and result. On each new user message, it rebuilds the agent's working context with two extra model calls. The Conversation Summarization module rewrites a chronological summary that tracks goals, constraints and changes of mind, and ends with a to-do list of what is still pending. The Dynamic Data Extraction module reads that summary plus the entire tool history and selects the observation lines that matter, by line range, along with verbatim facts, constraints and a hint for the agent. The main agent then runs its usual ReAct loop on summary, extracted data and the new message.

On τ-bench, τ²-bench and VitaBench with five backbones, U-Fold beat ReAct in most cells by a few points and beat the summarize-and-discard baselines by much more, especially when tool outputs were long and noisy.

THE IDEA, VISUALLY
FOLD ON EVERY NEW USER MESSAGE Full history, kept dialogue + tool log Summarizer summary + to-do list Extractor reads all tool output Folded context summary + to-do line ranges of tool output, verbatim facts, constraints, a hint + the new message Main agent ReAct loop THE PAPER'S EXAMPLE (FIGURE 1) Store tags: open 12:00 to 22:00. User: “Saturday 11 AM, or 2 PM if that's not possible.” Vanilla folding: summary lost the hours → books 11 AM U-Fold: constraint kept from the tool log → books 2 PM MEAN GAIN OVER 9 DOMAINS, POINTS (TABLE 1) vs ReAct vs IterResearch Qwen3-4B +1.1 +3.7 Qwen3-30B-A3B +1.5 +11.3 DeepSeek-V3.2 +3.4 +27.0 GPT-4.1 +2.5 +13.9 Claude-4.5-Sonnet +2.8 +9.5 Qwen3-4B vs IterResearch recomputes to +3.1, not +3.7 HARD VITABENCH, NOISY TOOLS (TABLE 2) In-store ReAct 11.0 U-Fold 27.0 Cross-Scenarios ReAct 4.0 U-Fold 12.0 TOOL CALLS PER TASK (FIGURE 4) ReAct 15.21 U-Fold 18.27 ReSum 29.95 IterResearch 30.95 50-task error analysis (Figure 5): U-Fold 34 successes, ReAct 31; zero omissions for both
U-Fold keeps everything and refolds on every user message: a summarizer writes a summary and to-do list, an extractor picks relevant tool-output lines verbatim, and the agent acts on that small context. Against ReAct the mean gains were 1 to 3 points; against summarize-and-discard baselines and under noisy tools they were far larger.
Research notes: the problem, approach and results
+1.1 to +3.4

mean gain over ReAct across nine domains, by backbone (Table 1, in points)

11.0 → 27.0

In-store score with noisy, redundant tool output, ReAct against U-Fold, Qwen3-Thinking-30B-A3B

≈22K vs 32K

main agent context after 23 interaction rounds, U-Fold against ReAct (Figure 3a)

THE PROBLEM

Context folding methods summarize and discard history to fit a budget. They were built for single-goal tasks. In multi-turn customer dialogues, summaries drop fine-grained constraints (opening hours, quantities, IDs) and lag behind a user who changes their mind, so the agent acts on stale or incomplete facts.

THE IDEA

Never discard. Store the full dialogue and tool log, and on each new user message rebuild the agent's working context with two LLM calls: a summarizer that writes a chronological summary plus a to-do list, and an extractor that selects relevant tool-output lines by line range and states facts and constraints verbatim.

THE RESULT

Across τ-bench, τ²-bench and VitaBench with five backbones, U-Fold beat ReAct in 37 of 45 cells, by 1.1 to 3.4 points on average per backbone, and beat ReSum and IterResearch by 3.1 to 27.0. With noisy tool output on VitaBench, it scored 27.0 against 11.0 (In-store) and 12.0 against 4.0 (Cross-Scenarios).

02

Why it matters to an FDE

Customer-facing agents are multi-turn by nature: booking, ordering, support, account changes. These are the deployments where a dropped constraint becomes a wrong order and a refund.

Don't let a summary be the only copy. U-Fold's core move is to keep the raw history and treat every summary as a disposable view. Any deployment can adopt this. Store the full log, and rebuild the working context rather than replacing it.

Track intent explicitly. A running to-do list of pending user requests, rewritten every turn, is a cheap structure that makes "the user changed their mind" visible to the agent.

Quote, don't paraphrase, tool output. The extractor refers to tool output by line range and copies facts verbatim, so IDs, hours and prices are never reworded.

Count the cost yourself. Every user message triggers two extra model calls, and the extractor reads the entire tool history each time. The paper reports the main agent's context length, not total tokens or latency. With prompt caching, that difference can reverse the cost picture.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 99 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦1 results table
  • ?5 interview questions with answers
  1. 03Key takeaways

    The two modules, the results in points, the noisy-tool result and misreadings to avoid

    Free account
  2. 04How it works

    The data flow per user turn, the two prompts, and the evaluation setup

    Premium
  3. 05The numbers that matter

    Cell-level wins and losses, the noisy-tool setting, error analysis, ablation and folder transfer

    Premium
  4. 06Try it yourself

    Recompute Table 1's improvement column, test the error-analysis gap, and count folding's tokens

    Premium
  5. 07Where it breaks

    Cost, small effect sizes, baseline strength, definitions and the limits the authors name

    Premium
  6. 08Using it on a deployment

    Bringing intent-aware folding to a customer's support or booking agent

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →