GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
ICML 2026

ACON: Optimizing Context Compression for Long-horizon LLM Agents

Microsoft learns a context-compression prompt from the agent's own failures, then distills it into a small model. Peak tokens fell 26% to 54%, though tasks took more steps and more time.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2025
AUTHORS
Kang, Chen, Han, Inan, Wutschitz, Chen, Sim, Rajmohan
FROM
Microsoft, KAIST
PUBLISHED
Oct 2025 · ICML 2026
CITED BY
145Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 20% of this breakdown.

01

The paper in one minute

An agent working through a long task keeps every action and tool output in its context. On AppWorld, a benchmark of everyday app tasks that average over 40 API calls each, that context grows until it is expensive to process and full of stale detail. The obvious fixes are crude: keep only the last few steps, or ask a model to summarize. Both lose things like a file path or an account ID that a later step needs.

ACON (Agent Context Optimization) compresses two things: the history, when it passes a token threshold, and individual observations, when a tool returns something long. A compressor LLM does both, following a natural-language guideline.

The contribution is how the guideline is improved. ACON runs the agent on training tasks with and without compression and collects the tasks that succeed only without it. For each, a strong model (o3) compares the full and compressed contexts and writes feedback about what was lost: a variable, a precondition, a fact. That feedback is aggregated into a rewritten guideline, and several candidates are scored on the same tasks. This is the utility step. A second compression step looks at tasks that succeed with compression and asks what information was actually used, producing a shorter guideline.

Finally, the expensive compressor is distilled: a small model (Qwen3-14B, Qwen3-8B or Phi-4) is fine-tuned on the teacher's compressions, cutting the compressor's cost per example from $0.045 to $0.0004.

On AppWorld with gpt-4.1, ACON matched the uncompressed accuracy at 26% fewer peak tokens; on multi-objective QA, peak tokens fell 54%.

THE IDEA, VISUALLY
COMPRESS WHEN CONTEXT PASSES A THRESHOLD History > 4,096 tokens → LLM summary per guideline Observation > 1,024 → LLM extract per guideline OPTIMIZE THE GUIDELINE, NOT THE WEIGHTS UT: utility step tasks that pass uncompressed but fail compressed → o3 contrasts both contexts → rewrite the guideline CO: compression step tasks that pass compressed → which kept facts were used? → drop the rest, shorter summaries THEN DISTILL THE COMPRESSOR gpt-4.1 + optimized guideline teaches Qwen3-14B, Qwen3-8B or Phi-4 (LoRA); students keep >95% of teacher accuracy. gpt-4.1 $0.045 gpt-4.1-mini $0.014 Qwen3-14B, distilled $0.0004 Compressor cost per example. Guideline search: < $2. APPWORLD, gpt-4.1 AGENT AND COMPRESSOR accuracy peak (K) steps No compression 56.0 9.93 16.14 FIFO (recent k) 45.8 6.73 28.48 Naive prompting 43.5 6.93 24.01 ACON UT 51.2 7.17 20.92 ACON UTCO 56.5 7.33 22.82 peak −26%, but 41% more steps than no compression COST VS LATENCY PER TASK (TABLE 4) API cost latency No compression $0.331 73.24 s ACON history $0.285 87.68 s ACON observation $0.272 101.92 s cheaper context, plus an extra compressor call each time SMALL AGENTS GAIN MOST (QWEN3-14B) AppWorld 25.6 33.9 8-objective QA (EM x100) 15.8 23.0
ACON improves the instructions a compressor follows, not its weights: it compares runs that succeeded without compression against the same tasks failing with it, and rewrites the guideline to keep what was lost. The saving is in context size and API cost; the agent took more steps and more wall-clock time.
Research notes: the problem, approach and results
56.5% vs 56.0%

AppWorld accuracy with ACON history compression against no compression, at 26% lower peak tokens

$0.0004

compression cost per example with a distilled Qwen3-14B, against $0.045 with gpt-4.1

73 s → 88 s

median AppWorld latency per task without compression and with history compression

THE PROBLEM

Long-horizon agents accumulate history and verbose tool outputs until the context is expensive and the model is distracted by stale details. Generic summarization or keeping the last few steps loses the one file path or ID a later step needs, and fine-tuning the agent to compress is impossible with API models.

THE IDEA

Compress history past a token threshold and long observations past another, with an LLM following a written guideline. Optimize the guideline in natural language: collect tasks that succeed uncompressed but fail compressed, have a strong model contrast the two contexts and rewrite the guideline (utility step), then shorten it using what successful compressed runs actually used (compression step). Distill the result into a small compressor.

THE RESULT

On AppWorld with gpt-4.1, history compression matched uncompressed accuracy (56.5% vs 56.0%) at 26% lower peak tokens, beating naive summarization (43.5%). Peak-token savings reached 54% on multi-objective QA. Distilled compressors kept over 95% of the teacher's accuracy, and small agents improved 20% to 46%. Steps per task rose 41% and latency 20%.

02

Why it matters to an FDE

Every long-running agent you deploy will eventually hit its context limit or its budget. ACON is a practical template for compressing context without retraining the agent, and it works with API models.

Learn the guideline from failures. The useful part is the procedure, not a particular prompt: run tasks with and without compression, look at the ones compression broke, and write down what the compressor dropped. For a customer's workflow that might be "always keep ticket IDs, the customer's plan tier and any error code". Two or three rounds of this beat a generic "summarize the conversation".

Compress observations, not just history. Tool outputs are often the bulk: a 3,000-token API response where the agent needs four fields. Extracting what matters at arrival keeps the context small from the start.

Use a small compressor. A distilled 14B model did the job at about a hundredth of the cost of gpt-4.1, keeping over 95% of its accuracy.

Know the price. Compression saved money per task ($0.331 to $0.285 on AppWorld) but the agent took more steps (16.1 to 22.8) and longer (73 to 88 seconds median), because every compression is an extra model call and rewriting history invalidates the cached prefix. For latency-sensitive tasks, compress observations and leave history alone; for cost-sensitive batch work, compress both.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 149 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
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The thresholds, the two optimization steps, distillation, the results and three misreadings

    Free account
  2. 04How it works

    The compression calls, the optimization loop, the objective and the distillation step

    Premium
  3. 05The numbers that matter

    Results on three benchmarks, distillation, small agents, cost, latency and thresholds

    Premium
  4. 06Try it yourself

    Recompute the trade-offs, run the optimization loop in miniature, and watch summaries compound

    Premium
  5. 07Where it breaks

    Steps and latency, cache invalidation, GPT-centric evaluation, distillation gaps and slips

    Premium
  6. 08Using it on a deployment

    Building a compression guideline for a customer's agent from its own failures

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →