Unified Context Evolution for LLM Agents

Zixuan Zhu, Yitong Hu, Yong Dai, Junfeng Fang, Chunyang Jiang, Senkang Hu, Yuzhi ZhaoarXiv 2026

TL;DR

Unified Context Evolution (UCE) is a gradient-free framework that allows LLM agents to learn across tasks by maintaining an evolving, structured library of "Evolvable Context Units" (ECUs). By categorizing agent experiences into four distinct knowledge types—Memory, Strategy, Workflow, and Skill—and dynamically managing them using a usage-based fitness score, UCE achieves massive performance boosts on interactive benchmarks and seamlessly transfers across different LLM backbones without retraining.

What Problem Does This Paper Address?

Most state-of-the-art LLM agents suffer from a form of operational amnesia. When deployed on multi-step interactive tasks, an agent starts every single episode with the exact same fixed context (system instructions, static few-shot examples, and tool schemas). Any clever shortcut, environment quirk, or recovery strategy the agent discovers during a task is completely lost the moment the episode ends.

While reinforcement learning can update model weights to retain knowledge, it requires gradient access and is incredibly expensive. Existing prompt-based methods either confine learning to a single task or dump all cross-task experiences into a flat, untyped text pool. These approaches fail to distinguish between different functional types of knowledge, track the quality of insights over repeated uses, or balance what the agent's knowledge library still lacks.

Methods

The authors introduce Unified Context Evolution (UCE), a framework that treats the agent's prompt context itself as the locus of learning. Instead of updating model weights, UCE externalizes experience into a structured library of Evolvable Context Units (ECUs).

Figure 1: Comparison of the ReAct loop (left) and the UCE architecture (right).

As shown in Figure 1, UCE augments the standard ReAct loop by retrieving and injecting relevant ECUs into the agent's prompt at decision time. The framework breaks knowledge down into four complementary types:

  1. Memory: Factual statements about environment mechanisms discovered via trial-and-error (e.g., "a sinkbasin can clean items without turning on the faucet").
  2. Strategy: Conditional decision rules at branching points, expressed in an IF-THEN format.
  3. Workflow: The canonical execution skeleton or step sequence for a specific task type.
  4. Skill: Reusable, multi-step sub-operations that apply across multiple task types.

The Evolution Cycle

The library evolves over discrete cycles across five distinct phases:

  • Phase 1: Evaluate: Performance is measured on a held-out evaluation set.
  • Phase 2: Collect: The agent runs on a collection task set, logging trajectories and rewards.
  • Phase 3: Schedule (KYS): A Knowledge Yield Scheduling module evaluates the library's current gaps and dynamically allocates a generation budget to the types where the library is weakest.
  • Phase 4: Generate: Type-specific prompts distill new candidate ECUs from the collected trajectories.
  • Phase 5: Cleanup: Low-value or redundant ECUs are pruned based on a Laplace-smoothed fitness score that tracks their empirical contribution over repeated usage outcomes.
Figure 2: Overview of the UCE architecture. Five phases per cycle: evaluate, collect, KYS, generate, and cleanup.

Datasets

The framework was evaluated on two popular interactive LLM agent benchmarks:

  • ALFWorld: A text-based household simulator containing 134 tasks split across six distinct task types (Pick, Look, Clean, Heat, Cool, Pick2).
  • WebShop: A simulated online shopping environment with a catalog of 1.18 million real Amazon products. The authors used a 100-task evaluation set partitioned into five domain subtypes (beauty, clothing, electronics, food, home).

Key Insights and Ideas

  • The Power of Typed Knowledge: Different tasks require different granularities of knowledge. Ablation studies revealed that while ALFWorld performance is heavily driven by procedural Workflows, the more complex WebShop environment requires a tight coordination of all four ECU types to help the agent escape local navigation traps.
  • Context as a Transferable Asset: Because the ECU library is completely decoupled from the underlying model weights and prompt formats, it is highly transferable. A library accumulated using a standard ReAct format can be plugged directly into alternative agent architectures (like Plan-and-Act or ReflAct) to instantly boost their performance without any retraining.
  • Dynamic Budgeting via KYS: Rather than blindly generating all types of knowledge at equal rates, the Knowledge Yield Scheduling (KYS) module prevents library saturation. It uses feasibility filtering, demand assessment, and historical yield tracking to focus LLM generation resources purely on the library's blind spots.

Key Results

UCE demonstrated substantial improvements over baseline methods across both benchmarks:

  • ALFWorld: UCE raised the overall success rate from 75.4% (ReAct baseline) to a peak of 96.3%. Notably, on the baseline's weakest task types (Look and Pick2), success rates jumped from 50.0% to 100.0% and 52.9% to 82.4%, respectively.
  • WebShop: The average task score improved from 45.1% to 61.3%, and the absolute purchase success rate climbed from 30.0% to 42.0%.
Figure 3: Per-cycle success rate on ALFWorld (C0–C4) and WebShop (C0–C10). Solid lines show full UCE, dashed lines show single-type ablations, and the star marks the peak cycle. C0 is the ReAct baseline.

As illustrated in Figure 3, the full UCE framework consistently outperformed single-type knowledge baselines over multiple evolution cycles. Furthermore, when transferring the accumulated ECU library to alternative actor backbones (such as Plan-and-Act), ALFWorld success reached an outstanding peak of 97.8% (up from a 73.1% no-library baseline).

Limitations and Future Work

While highly effective, the authors note several limitations:

  • Hand-Designed Categories: The four ECU types (Memory, Strategy, Workflow, Skill) were manually engineered. Future work could explore automatic type-discovery mechanisms to let the framework adapt its library structure to entirely new domains.
  • Discrete Text Environments: UCE was only validated on text-based environments with discrete action spaces. Its efficacy in continuous action spaces, multimodal settings, or environments with much longer planning horizons (e.g., AndroidWorld) remains untested.
  • Scale of Evaluation: The task pools used (134 for ALFWorld, 100 for WebShop) are relatively small. It is still an open question whether the scheduling signals will remain stable or if the library will eventually plateau/degrade over significantly longer evolution horizons.

Summary updated

BibTeX
@misc{zhu2026unified,
  author = {Zixuan Zhu and Yitong Hu and Yong Dai and Junfeng Fang and Chunyang Jiang and Senkang Hu and Yuzhi Zhao},
  title = {{Unified Context Evolution for LLM Agents}},
  year = {2026},
  eprint = {2606.02304},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.02304},
}
Figure