โ† Flecto๐Ÿค– Agent Ready
๐Ÿ“„ ICLR 2026

Agentic Context Engineering:
Evolving Contexts for Self-Improving Language Models

Qizheng Zhang*, Changran Hu*, Shubhangi Upasani, Boyuan Ma, Fenglu Hong, Vamsidhar Kamanuru, Jay Rainton, Chen Wu, Mengmeng Ji, Hanchen Li, Urmish Thakker, James Zou, Kunle Olukotun

Stanford University ย ยทย  SambaNova Systems ย ยทย  UC Berkeley ย ย |ย ย  *Equal contribution

Abstract

Large language model (LLM) applications such as agents and domain-specific reasoning increasingly rely on context adaptation: modifying inputs with instructions, strategies, or evidence, rather than weight updates. Prior approaches improve usability but often suffer from brevity bias, which drops domain insights for concise summaries, and from context collapse, where iterative rewriting erodes details over time.


We introduce ACE (Agentic Context Engineering), a framework that treats contexts as evolving playbooks that accumulate, refine, and organize strategies through a modular process of generation, reflection, and curation. ACE prevents collapse with structured, incremental updates that preserve detailed knowledge and scale with long-context models. Across agent and domain-specific benchmarks, ACE optimizes contexts both offline (system prompts) and online (agent memory), consistently outperforming strong baselines: +10.6% on agents and +8.6% on finance.

What is Agentic Context Engineering?

Traditional LLM improvement requires retraining โ€” changing the model's internal weights, which is expensive and slow. Agentic Context Engineering (ACE) takes a different approach: instead of changing the model, it continuously improves what you feed into the model (the context). Think of it as writing an ever-better instruction manual that the AI reads before each task, rather than retraining the AI itself. The "agentic" part means this improvement process is itself automated by AI agents.

1. Introduction โ€” Overall Performance

Modern AI applications increasingly depend on context adaptation. Instead of modifying model weights, context adaptation improves performance after training by incorporating clarified instructions, structured reasoning steps, or domain-specific knowledge directly into the model's inputs.

Context Adaptation vs. Fine-Tuning

Fine-tuning bakes knowledge permanently into model weights โ€” it is costly, requires labelled data, and produces a new model checkpoint for every update. Context adaptation instead prepends instructions, examples, or strategies to the model's input at inference time. No GPU training is needed, updates are instant, and the same base model can serve many different tasks by simply swapping the context. ACE automates and optimises that context over time.

Overall performance comparison bar charts for AppWorld, FiNER, and Formula benchmarks
Figure 1: Overall Performance Results. ACE consistently outperforms strong baselines (Base LLM, ICL, GEPA, DC) across all tasks: AppWorld (42.4% โ†’ 59.5%), FiNER (70.7% โ†’ 78.3%), Formula (67.5% โ†’ 76.5%).

Our key findings:

2. Background & Motivation

2.1 Context Adaptation

Context adaptation refers to methods that improve model behavior by constructing or modifying inputs to an LLM, rather than altering its weights. Representative methods include Reflexion, TextGrad, GEPA, and Dynamic Cheatsheet โ€” all leveraging natural language feedback for iterative context improvement.

2.2 Limitations: Brevity Bias & Context Collapse

Brevity Bias: Prompt optimizers prioritize concise applicable instructions over comprehensive accumulation, omitting domain-specific heuristics and common failure modes critical in practice.
Context Collapse: Methods relying on monolithic rewriting by an LLM degrade into shorter, less informative summaries over time, causing sharp performance declines.

Why do these failure modes matter?

Imagine asking an AI to maintain a strategy guide for chess. Two problems emerge:

  • Brevity bias: The AI keeps trimming the guide to a short bullet list, discarding rare but important tactics ("zugzwang in king-and-pawn endgames").
  • Context collapse: Every time the guide is rewritten in one pass, it loses more detail โ€” after enough rewrites the guide is shorter than having no guide at all, and performance actually drops below the no-context baseline.

ACE fixes both by adding new items rather than rewriting everything, and only pruning exact duplicates.

Context collapse graph: tokens vs adaptation steps showing sharp collapse at step 60
Figure 2: Context Collapse. Monolithic rewriting collapses context from 18,282 tokens (accuracy 66.7) to just 122 tokens (accuracy 57.1) in a single step โ€” worse than the no-context baseline of 63.7.

3. Agentic Context Engineering (ACE)

ACE introduces a structured division of labor across three specialized LLM components, inspired by the agentic design of Dynamic Cheatsheet:

๐Ÿ”ง Generator
Produces reasoning trajectories for new queries using the current Context Playbook.
๐Ÿ” Reflector
Distills concrete insights from successes and errors; supports iterative refinement.
๐Ÿ“š Curator
Integrates insights into structured delta context updates, merged into the Playbook.

The "Evolving Playbook" metaphor

A playbook in sports or business is a living document of proven strategies โ€” it grows as teams learn from wins and losses. ACE applies this metaphor to AI: the Context Playbook starts empty and is updated after every task attempt. The Generator uses it, the Reflector extracts lessons from the outcome, and the Curator writes those lessons as new entries. Over dozens of iterations the playbook becomes a rich, task-specific knowledge base โ€” without ever retraining the underlying model.

ACE Framework architecture diagram: Generator to Reflector to Curator with delta updates
Figure 4: The ACE Framework. An agentic architecture with three specialized components: Generator, Reflector, and Curator. Delta Context Items are merged incrementally โ€” no costly full rewrites.

3.1 Incremental Delta Updates

Rather than regenerating contexts in full, ACE incrementally produces compact delta contexts: small sets of candidate bullets distilled by the Reflector and integrated by the Curator. This preserves past knowledge and avoids the computational cost of full rewrites.

Delta updates โ€” like Git for AI knowledge

Instead of rewriting the whole playbook after each task, ACE only appends the difference โ€” new tips, corrected strategies, observed failure patterns. This is analogous to a Git commit: each run produces a small diff that is merged into the main branch. The full history is preserved, nothing is lost, and the total cost per update is much lower than regenerating the entire document.

3.2 Grow-and-Refine

Beyond incremental growth, ACE ensures contexts remain compact through periodic or lazy refinement. A de-duplication step prunes redundancy by comparing bullets via semantic embeddings, maintaining comprehensive but non-redundant playbooks.

Semantic de-duplication explained

As the playbook grows, some entries will say essentially the same thing in different words. ACE detects this using semantic embeddings: each bullet is converted into a numerical vector that captures its meaning. Bullets whose vectors are very close together (cosine similarity above a threshold) are considered duplicates and one is removed. This keeps the playbook lean without discarding genuinely distinct knowledge.

Example ACE-generated context playbook on AppWorld with strategies, code snippets, and troubleshooting
Figure 3: Example ACE-Generated Context on AppWorld (partial). ACE contexts are detailed playbooks with strategies, code templates, and troubleshooting notes โ€” not concise summaries.

4. Results

4.3 Agent Benchmark: AppWorld (DeepSeek-V3.1-671B)

Method GT Labels Test-Normal Test-Challenge Average
TGCโ†‘ SGCโ†‘ TGCโ†‘ SGCโ†‘
DeepSeek-V3.1-671B as Base LLM
ReActโ€”63.742.941.521.642.4
Offline Adaptation
ReAct + ICLโœ“64.346.446.027.346.0
ReAct + GEPAโœ“64.944.646.030.246.4
ReAct + ACEโœ“76.264.357.339.659.4
ReAct + ACEโœ—75.064.354.435.257.2
Online Adaptation
ReAct + DC (CU)โœ—65.558.952.330.851.9
ReAct + ACEโœ—69.653.666.048.959.5

Table 1: AppWorld results. ACE outperforms all baselines by an average of +10.6%, and remains effective even without ground-truth labels.

Reading the AppWorld benchmark metrics

  • TGC (Task Goal Completion): Did the agent fully accomplish the assigned goal? Strict binary pass/fail.
  • SGC (Sub-Goal Completion): What fraction of intermediate steps were completed correctly? A softer measure.
  • Test-Normal vs Test-Challenge: "Challenge" tasks are harder multi-step workflows; performance gaps are larger there.
  • GT Labels (โœ“/โœ—): Whether the method used ground-truth outcome labels during adaptation. ACE without labels (โœ—) still beats supervised competitors (โœ“), showing it can self-improve from execution feedback alone.
  • Offline vs Online: Offline improves the system prompt before deployment; Online updates agent memory during live use.

4.4 Domain-Specific Benchmark: Finance (DeepSeek-V3.1)

Method GT Labels FiNER (Accโ†‘) Formula (Accโ†‘) Average
DeepSeek-V3.1 as Base LLM
Base LLMโ€”70.767.569.1
Offline Adaptation
ICLโœ“72.367.069.6
MIPROv2โœ“72.469.570.9
GEPAโœ“73.571.572.5
ACEโœ“78.385.581.9
ACEโœ—71.183.077.1
Online Adaptation
DC (CU)โœ“74.269.571.8
DC (CU)โœ—68.362.565.4
ACEโœ“76.776.576.6
ACEโœ—67.378.572.9

Table 2: Financial analysis results. ACE achieves +12.8% average improvement with GT labels in offline adaptation.

Why does domain-specific improvement matter?

Financial NLP tasks like FiNER (named-entity recognition in financial text) and Formula (financial formula reasoning) require highly specialised knowledge โ€” abbreviations, reporting conventions, sector-specific jargon โ€” that general LLM training underrepresents. ACE's playbook accumulates these domain nuances from in-domain examples, effectively giving the model a field-specific reference sheet that grows with every solved case. The +12.8% jump with ground-truth labels shows just how much headroom domain-specific context can unlock compared to a generic base LLM.

Key Findings

+10.6%
High-Performance Agents
Average gain on AppWorld agent benchmark, matching production-level GPT-4.1 agent with DeepSeek-V3.1.
+8.6%
Domain Reasoning
Average gain on financial analysis benchmarks (FiNER, Formula) with structured evolving playbooks.
โˆ’86.9%
Adaptation Latency
ACE achieves these gains efficiently, drastically reducing adaptation latency vs existing methods.
No GT
Label-Free Adaptation
ACE adapts effectively without labeled supervision โ€” uses execution feedback and environment signals only.

Resources

arXiv:2510.04618v3 [cs.LG] ย ยทย  Published at ICLR 2026

B2B Content

Any content, beautifully transformed for your organization

PDFs, videos, web pages โ€” we turn any source material into production-quality content. Rich HTML ยท Custom slides ยท Animated video.

View Services Contact Us