English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

ACE: Agentic Context Engineering — A Framework for Evolving Contexts in Self-Improving LLMs

Forum topic · QianXun · 2025-10-11

Summary

ACE (Agentic Context Engineering) is a framework that treats an LLM's context as an evolving playbook rather than a static prompt, addressing two failure modes of existing context-adaptation methods: brevity bias (optimization collapsing into short, generic prompts) and context collapse (full rewrites erasing accumulated knowledge). ACE divides adaptation among three roles — a Generator producing reasoning trajectories, a Reflector distilling lessons, and a Curator merging structured incremental delta updates into an itemized context, followed by grow-and-refine deduplication. Experiments using DeepSeek-V3.1 show consistent gains over baselines like ICL, MIPROv2, GEPA, and Dynamic Cheatsheet: up to +10.6% on agentic tasks (AppWorld) and +8.6% on financial reasoning (FiNER, Formula), with a small open-source model matching the top proprietary agent on the AppWorld leaderboard. ACE also cuts adaptation latency by up to 86.9% and reduces token cost, enabling scalable offline (system-prompt) and online (agent memory) context engineering.

ACE: Agentic Context Engineering — A Framework for Evolving Contexts in Self-Improving LLMs

1. Introduction

LLM applications such as agents and domain-specific reasoning increasingly rely on context adaptation — improving performance by modifying inputs (instructions, policies, evidence) rather than updating weights. Existing methods suffer from two problems:

  • Brevity bias: optimization collapses domain insights into short, generic prompts (e.g., iterative prompt optimizers repeatedly producing near-identical instructions), sacrificing domain-specific detail.
  • Context collapse: when an LLM fully rewrites accumulated context each step, it compresses it into shorter, less informative summaries. In an AppWorld case study, context of 18,282 tokens with 66.7% accuracy collapsed to 122 tokens with 57.1% accuracy at the next step — worse than the 63.7% no-adaptation baseline.
  • Building on Dynamic Cheatsheet's adaptive memory, ACE treats context as an evolving playbook that continuously accumulates, refines, and organizes strategies. It outperforms strong baselines by 10.6% on agentic tasks and 8.6% on financial tasks, while reducing adaptation latency and deployment cost.

    2. Background

    Current context-adaptation techniques use natural-language feedback: the model inspects its context plus execution traces and generates feedback for modification. Representative methods include:

  • Reflexion — improving agent planning by reflecting on failures
  • TextGrad — gradient-like textual feedback for prompt optimization
  • GEPA — reflection-based prompt evolution from execution traces
  • Dynamic Cheatsheet — an adaptive external memory accumulating lessons during inference
  • 3. The ACE Framework

    ACE introduces a modular division of labor:

    Generator → Reflector → Curator → Context Playbook

    1. Generator produces reasoning trajectories for new queries, revealing effective strategies and pitfalls. 2. Reflector critiques trajectories to extract concrete lessons, optionally refined over multiple iterations. 3. Curator synthesizes lessons into compact incremental delta entries, deterministically merged into the context via lightweight, non-LLM logic.

    3.1 Incremental Delta Updates

    Context is represented as a structured collection of itemized bullets (not a monolithic prompt), each with metadata (unique ID, useful/harmful counters) and content (a reusable strategy, domain concept, or failure mode). This yields:

  • Localization — only relevant bullets are updated
  • Fine-grained retrieval — the generator focuses on the most relevant knowledge
  • Incremental adaptation — efficient merging, pruning, and deduplication during inference
  • 3.2 Grow-and-Refine

    New bullets are appended with fresh identifiers; existing ones are updated in place (counter increments). Deduplication via semantic embeddings prunes redundancy, executed eagerly (after each delta) or lazily (when the context window overflows).

    4. Experimental Results

    Evaluated with DeepSeek-V3.1 (non-thinking mode) for all three roles, on:

  • AppWorld — agentic tasks involving API understanding, code generation, and environment interaction (Normal and Challenge splits)
  • FiNER & Formula — XBRL-based financial reasoning (token tagging with 139 entity types; numerical reasoning from structured files)
  • Key findings

  • ACE enables self-improving agents via execution feedback alone, raising AppWorld accuracy by up to 17.1% without ground-truth labels. A smaller open-source model (ReAct + ACE, 59.4%) matches the top-ranked proprietary agent IBM CUGA (60.3%, GPT-4.1-based) on the leaderboard (as of Sep 20, 2025), and exceeds it on the harder Test-Challenge split with online adaptation.
  • On financial reasoning, ACE beats ICL, MIPROv2, GEPA, and Dynamic Cheatsheet by +8.6% on average, and +10.9% in the offline setting.
  • Ablations confirm the Reflector, multi-epoch refinement, and offline warmup each contribute significant gains.
  • Cost and speed

  • Offline AppWorld adaptation vs. GEPA: 82.3% latency reduction (53,898s → 9,517s), 75.1% fewer rollouts.
  • Online FiNER adaptation vs. Dynamic Cheatsheet: 91.5% latency reduction (65,104s → 5,503s), 83.6% lower token-dollar cost ($17.7 → $2.9).
  • 5. Discussion

  • Longer context ≠ higher serving cost: KV-cache reuse, compression, and offloading make rich, frequently reused contexts increasingly practical; amortized costs keep falling.
  • Online and continual learning: context adaptation is cheaper than weight updates and is human-interpretable, enabling selective unforgetting for privacy, legal, or correctness reasons.

6. Conclusion

ACE resolves brevity bias and context collapse by maintaining context as a comprehensive, evolving playbook of domain knowledge. Its modular generate–reflect–curate pipeline with incremental updates delivers significant accuracy gains, lower adaptation latency, and lower deployment cost — making it well suited for scalable, self-improving LLM systems.

> "Context should serve as a comprehensive, evolving playbook — detailed, inclusive, and rich with domain insights — rather than a terse summary."

Tags

#llm#agentic-context-engineering#context-engineering#prompt-optimization#agents#self-improving-models#appworld#deepseek

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/175998203