更少的 Context,更好的 Agent

arXiv: 2606.10209 · 2026-06-08 · Microsoft
Abhilasha Lodha et al.
保留最近 5 對 tool call/response + 自動摘要,完成率 91.6%%,token 少 62.7%%,時間少 60.2%%。

關鍵數據

配置完成率Token(K)時間(hrs)Wilson 95%% CI
C1: No user model8.0%%532.63.08-
C2: Full context71.0%%1,481.014.56[65.1,76.3]
C3: Last 5 TC79.0%%535.35.39[73.5,83.6]
C4: Last 5+Summary91.6%%553.45.79[87.5,94.4]

GPT-5 + D365 F&O hotel expense itemization,50 任務,5 獨立 runs。C4 Wilson CI 與 C3 完全不重疊。SD: C2 4.4, C3 8.2, C4 1.7。

機制拆解

元件作用限制
Recency pruning N=5保留最近 5 對 tool call/response,消除 stale form state失去 running balance 致 premature termination (C3: 18/53)
Summarization W=3最近 3 筆互動生成進度摘要每次 eviction 多 1 次 LLM call (+3.4%% token)
User model GPT-4.1回答 agent 查詢、強化完成協議GPT-5 必需,Claude Sonnet 4.5 不需要

失敗模式分類

失敗模式C2C3C4趨勢
Stale-state reference3464pruning 消除主因
Premature termination9183pruning 引入, summary 消除
Wrong subcategory896policy-invariant
Duplicate/skipped12115summary 幫助追蹤
Tool/nav error652不變
Residual mismatch441接近零
總失敗73532171%%

跨類別泛化

類別/模型nC2C4C2-C4
Hotel GPT-55071.0%%91.6%%+20.6pp
Travel GPT-53076.0%%95.0%%+19.0pp
Meals&Gifts GPT-53275.6%%96.1%%+20.5pp
Hotel Sonnet 4.55088.0%%*94.5%%+6.5pp

Sensitivity Analysis

Sweep設定完成率Token(K)
Pruning NN=374.0%%425
N=579.0%%535.3
N=1080.0%%820
N=inf (C2)71.0%%1,481
Summary WW=186.4%%540
W=391.6%%553.4
W=592.0%%575
W=-192.0%%615

落地應用建議

1. Hermes N=5 tool-call pruner
每次 inference 前保留最近 5 對 tool call/response。不需額外 LLM call。
2. sleep-consolidation 擴為 running summary
eviction 時用 Agnes 免費模型做 inline summary,成本 +3.4%% token。
3. 失敗模式分類做品質診斷
stale-state / premature termination / wrong mapping 可自適應 Hermes。
4. N=5 直接套用
典型 task 3-8 tool calls,N=5 覆蓋 1-2 輪完整操作。
限制: 論文在 D365 F&O 驗證。Hermes tool response 為 HTML/JSON,optimal N 需實測。Summary 先用 Agnes 免費模型。

我們的筆記

對 Hermes 有直接工程價值。每天面對 context rot。pruning+summary 極簡極有效極穩定。先從 context pruner 開始。

回論文筆記首頁 · DKY 學習中心