Long-horizon agents repeatedly feed an ever-growing interaction trajectory to a specialized agent model. Prefix caching reuses computation over repeated history, but cannot prevent context growth or remove information irrelevant to the current decision. This is especially costly when the specialized agent lacks the cached-input discounts available to general-purpose models, making trajectory compression a natural alternative. However, existing compression methods on selective context risk losing global information, recursively rewriting summary leads to semantic drift, while repeatedly recompressing the full history shifts the growing cost to the compressor. Therefore, we introduce DMC-5 (Dual-Model Collaboration with CaChe-aware Context Compression), an asymmetric framework that assigns full-history integration to a general compression model and action generation to a specialized agent model. DMC-5 maintains the raw trajectory as an Append-only Canonical View, preserving global access while allowing the compressor to reuse a stable historical prefix instead of recursively rewriting or recomputing prior context. The agent operates only on a compact Decision View with recent raw interactions, reducing repeated input while retaining the information needed for the next action. DMC-5 further incorporates YAMATO (integritY-Aware Memory Abstractions for Tool Operations) to preserve execution-critical information during lossy compression. Experiments on AppWorld, OfficeBench, and 8-objective QA show that DMC-5 reduces agent model input by 38.5-57.0% and end-to-end cost by 14.5-28.0% with 78.0-85.0% compressor cache-hit rates, while improving task performance by 1.0-5.8% over the uncompressed baseline.
Figures & tables
Figure 1: Motivation and overview of DMC-5. (a) Long-horizon agents repeatedly reread a growing trajectory, increasing cost while decision-relevant information is sparse. (b) Existing compression patterns trade off global information, semantic stability, and repeated compressor processing. (c) DMC-5 separates full-history integration from action generation: an Append-only Canonical View enables stable prefix reuse for the general compressor, while a compact Decision View retains recent and execution-critical information for the specialized agent. (d) DMC-5 improves the cost–performance trade-off over the uncompressed specialized agent and existing compression baselines.
Figure 2: Overview of DMC-5. (a) A general compressor V integrates Append-only Canonical View, while a specialized agent Urizen acts on compact Decision View. (b) Each compression round reuses the stable historical prefix and only prefills new suffix. (c) YAMATO restores execution-critical records through pointers from raw records and combines them with recent raw turns.
Figure 3: Comparison on token, cost and quality across three benchmarks. (a) Total token volume, decomposed into agent and compressor input. (b) Billed cost under the same decomposition. (c) Change in the task performance relative to No Compression.
Figure 4Table 5
Metric
No Compression
ACON ( Kang et al., 2026 )
ACON w/ YAMATO
DMC-5 w/o YAMATO
DMC-5 w/ YAMATO
Overall outcome
Task Accuracy ↑
77.0%
67.3%
72.0%
69.1%
78.2%
End-to-End Cost ↓
13.71
11.57
12.11
13.31
10.31
Cost / Success ↓
0.1051
0.1024
0.1001
0.1147
0.0781
Integrity of compression
Compression with Errors ↓
–
4.2% (30/711)
1.0% (9/894)
3.0% (77/2581)
0.04% (1/2,460)
Table 5: Analysis of YAMATO over quality and integrity analysis on AppWorld.
Setting
Agent Cache Hit
Cached Price Ratio
Agent Cost
Comp. Cost
Total Cost
Success
Observed operating point
No Compression
70.5%
20.0%
35.72
–
35.72
71.5%
DMC-5
51.5%
20.0%
29.49
2.89
32.38 ( -9.4% )
73.9%
Break-even for agent cached price ratio
No Compression
70.5%
9.1%
29.80
–
29.80
71.5%
DMC-5
51.5%
9.1%
26.91
2.89
29.80
73.9%
Table 6: DMC-5 with a cache-enabled agent Qwen3.8-27B on AppWorld. Cached Price Ratio denotes pmhit/pmmiss . The break-even analysis fixes the agent uncached-input price pmmiss and uses the observed token traces.
Benchmark
Setting
Agent Input
Agent Cost
Comp. Cost
Total Cost
Successful Tasks
PinchBench
No Compression
13.14M
4.39
–
4.39
37/40
DMC-5
10.51M ( -20.0% )
3.55
0.48
4.03 ( -8.2% )
37/40
τ2 -bench
No Compression
10.59M
3.66
–
3.66
42/64
DMC-5
8.27M ( -21.9% )
2.85
0.50
3.35 ( -8.5% )
43/64
Table 7: Generalization to coding-style and heterogeneous tool-use environments. Results are reported on compression-triggered subsets, containing 40 PinchBench tasks and 64 τ2 -bench tasks.
Tag
Source
Meaning
[O@i]
Observation oi
The summarized information is grounded in a tool or environment observation at turn i .
[D@i]
Agent-side state at turn i
The information is an agent-derived plan, inference, or intermediate conclusion associated with turn i , rather than a directly observed result.
[UNSOURCED]
No explicit turn reference
A Key Data entry has no recognized source reference in the compressed summary.
Table 8: Turn-provenance tags used in the structured YAMATO summary.
Pointer
Canonical target
Restored content
Handling
<<TURN_i_RESULT>>
Observation oi
Exact tool or environment output, such as API responses, logs, documentation, returned text, or file contents.
Direct lookup and restoration.
<<TURN_i_ACTION>>
Action ai
Exact tool call, command, arguments, or write/edit operation.
Direct lookup and restoration.
<<TURN_i_WORK>>
Work-product action at turn i
Exact artifact-related operation associated with a file.
Lookup followed by code-side matching and ordered aggregation of operations on the same file.
Table 9: YAMATO pointer interfaces for restoring execution-critical state from the Append-only Canonical View.
Benchmark
Category
Example Task
AppWorld
Easy
Remove all the songs that I have liked from my Spotify queue, and then start the player.
Medium
Reset friends on venmo to be the same as my friends in my phone. Befriend and unfriend as needed.
Hard
My roommates and I went for a dinner yesterday. I paid for the taxi back and forth (total 60)andNancypaidforeveryone’sfood(total128). Both food and commute are supposed to be shared equally among all. Make necessary payment requests with a note ”For Taxi”, and a payment to Nancy with a note ”For Food”, on venmo.
OfficeBench
1-app
Add a meeting to Bob’s calendar at 5/17/2024 10:30 a.m to 11:00 a.m.
2-app
Schedule a team training session for all participants from excel file, create calendar events for each member in their name.
3-app
Convert Excel spreadsheet containing project tasks to task.pdf and email Alice with contents from the pdf file for review.
Table 11: Representative tasks from the evaluated benchmarks.
Setting
Value
Compressor temperature
0 (greedy)
Compressor thinking
Disabled
Recent raw turns K
1
Compression interval Δ
3 turns
Token trigger T
6,000 new tokens
Agent decoding
Endpoint / benchmark default
Table 13: Default hyperparameters.
Benchmark
Method
Task Quality ↑
Cost ↓
AppWorld
No Compression
77.0±2.4
13.71±0.58
DMC-5
78.2±0.9
10.31±0.35
OfficeBench
No Compression
87.0±1.9
5.25±0.30
DMC-5
88.0±1.0
4.49±0.14
8-objective QA
No Compression
EM 39.1±1.8 / F1 47.6±3.1
35.40±1.45
DMC-5
EM 44.9±0.3 / F1 54.0±1.0
25.50±0.53
Table 14: Run-to-run stability across three independent evaluations. Values are reported as mean ± standard deviation.
Table 15: Hyperparameter sensitivity on AppWorld. We vary one hyperparameter at a time while keeping the others fixed. Gray rows denote the default configuration used in the main experiments.
Metric
Definition
Execution-critical information
Historical values that may affect subsequent tool actions, including email addresses, monetary values, paths/filenames, UUID/hex IDs, access tokens, and URLs.
Compression with Errors
Fraction of compression events that contain at least one corrupted execution-critical item.
Corrupted Execution-Critical Items
Fraction of all execution-critical items in the compressed state whose values are inconsistent with the corresponding historical records.
Recall of Execution-Critical Items
Among execution-critical items that are both relevant to the current action and correct in the historical trajectory, the fraction that are present in the Decision View when the action is generated.
Table 16: Definitions of execution-critical information and integrity metrics.
Metric
ACON
ACON w/ YAMATO
DMC-5 w/o YAMATO
DMC-5 w/ YAMATO
Compression events
711
894
2,581
2,460
Compression with Errors
30/711 (4.2%)
9/894 (1.0%)
77/2,581 (3.0%)
1/2,460 (0.04%)
Execution-Critical Items
3,893
4,607
24,771
22,551
Corrupted Execution-Critical Items
48
16
82
3
Corruption rate
1.23%
0.35%
0.33%
0.013%
Recall of Execution-Critical Items
63.3% (279/441)
87.1% (608/698)
77.7% (839/1,079)
98.3% (1,008/1,025)
Table 17: Detailed integrity analysis on AppWorld. We compare recursive and append-only history organization with and without YAMATO. Uncertain cases are excluded from the corruption rate.
Metric
Result
Pointer restoration
Pinned references
5,181
Valid references
5,181 / 5,181 (100%)
Successfully resolved
5,181 / 5,181 (100%)
Byte-exact restoration
5,169 / 5,181 (99.77%)
Non-byte-exact restoration
12 / 5,181 (0.23%)
Table 18: Validation of pointer restoration and provenance consistency on AppWorld.
Metric
Count
Rate
Audited claim lines
49,700
–
Claims with provenance tags
38,325
77.1%
Correctly grounded tagged claims
37,991 / 38,325
99.13%
Correctly downgraded [UNSOURCED] items
12 / 12
100%
Incorrect [O@i] assignments
1 / 35,800
0.003%
Agent derivations incorrectly upgraded to [O@i]
1 / 2,525
0.040%
Table 19: Provenance consistency analysis on AppWorld.
Metric
No Compression
ACON
DMC-5
Runs with Repeat ≥1
31.3%
28.3%
32.3%
Runs with Same-Action Repeat ≥3
4.0%
6.2%
3.2%
Runs with Same-Action Repeat ≥5
1.2%
1.6%
0.2%
Maximum Same-Action Repeats
9
39
6
Table 20: Detailed analysis of repeated failed actions on AppWorld.
Figure 7: Composition of the compressed context over trajectory steps on AppWorld. (A) Token composition of V compressor output. (B) Token composition of Urizen Decision View after YAMATO restores execution-critical records from pinned pointers.
Metric
Method
Easy
Medium
Hard
Success
No Compression
91.2%
87.5%
57.1%
DMC-5 w/ DeepSeek-V4-flash
91.2%
83.3%
63.5%
DMC-5 w/ Qwen3.7-flash
91.2%
70.8%
58.7%
Steps
No Compression
19.9
29.1
38.5
DMC-5 w/ DeepSeek-V4-flash
19.7
31.3
39.1
DMC-5 w/ Qwen3.7-flash
19.9
31.3
39.4
Table 21: AppWorld results stratified by task difficulty. Agent Input denotes the average cumulative agent input per task, and Input Slope measures the average growth of agent input with each interaction step.
Figure 8: Pricing sensitivity on AppWorld using fixed trajectories. We recompute billed cost while varying one compressor pricing coefficient at a time and keeping all observed token counts and agent behaviors unchanged. (A) varies the compressor uncached-input price while keeping the cached-input price at 0.2× the uncached-input price. (B) varies the cached-input price ratio d , where phit=dpmiss . (C) varies the compressor output price. Vertical dashed lines denote the default configuration, and the horizontal dashed line denotes the No Compression cost.
Method
AppWorld
OfficeBench
8-objective QA
No Compression
69
38
122
ACON
78
42
149
DMC-5
94
44
186
Table 22: Average wall-clock latency per task (seconds).
Task
Outcome
Failure mode
DMC-5 behavior
986aa4e_1
ACON fails at 50 steps; DMC-5 passes 3/3
An access token disappears across recursive summaries, forcing re-login and causing a previously failed login action to be repeated.
YAMATO preserves the exact token in Key Data with provenance, avoiding re-login and repeated failure.
09b0ee6_2
ACON fails at 50 steps; DMC-5 passes 3/3
A recursive summary regresses from “all 83 songs processed” to “83 song IDs ready for lookup”, discarding accumulated aggregation state.
Append-only reconstruction avoids recursive state regression, while the final aggregate result remains grounded in Key Data .
634f342_1
ACON fails at 50 steps; DMC-5 passes 2/3
API documentation, access tokens, and completed file-processing state are lost or distorted, causing repeated documentation lookup, re-login, and re-execution.
Pinned raw records and grounded state preserve API results, credentials, and completed progress across compression rounds.
9016950_1
DMC-5 fails at 24 steps
All required historical information is preserved, but the agent incorrectly resolves the scope of “them” and performs an unnecessary action.
The failure originates from task interpretation rather than context loss, illustrating the boundary of YAMATO.
Table 23: Representative AppWorld trajectories. The first three cases illustrate compression-induced failures avoided by DMC-5, while the last case shows a failure outside the scope of YAMATO.
Long-horizon agents continuously accumulate interaction history during task execution, yet the importance of past interactions changes as the agent state evolves. Existing context management methods largely compress history based on fixed windows, periodic schedules, or current relevance, overlooking a more fundamental question: when has a past interaction become safe to replace? Premature compression may remove information still needed for future actions, while overly conservative retention leads to substantial context overhead. To address this, we propose State Conditioned Compression (StateComp), a framework that determines when historical interactions can be safely compressed according to the current agent state. StateComp constructs KEEP and READY supervision through a two-stage annotation procedure and trains an imbalance-aware router on hidden representations from a frozen language model. A bounded state representation further reduces the cost of evaluating long histories, while adjacent READY interactions are grouped into continuous spans and replaced with compact summaries during execution. Experiments on WorkBuddyBench show that StateComp reduces total agent and summarization tokens by 52.27% while maintaining task performance, and achieves a 12.67-fold speedup in representation extraction.
Mingxuan Wang, Hongyue Chen, Yinglong Guo +6
TierFlow Team · Gaoling School of Artificial Intelligence, Renmin University of China · Tsinghua University
Long-horizon LLM agents play an important role in solving complex and sustained tasks, with ever-growing interaction contexts. However, these accumulated contexts will raise substantial computational cost and obscure key decision-relevant evidence. Existing methods typically train external compressors or context-management agents to rewrite context as shorter hard-token sequences, but such external selection may not align with the LLM's evolving representation and is necessarily lossy. In this paper, we introduce Agentic Soft-Token Compression (ASTC), a training-free compression method using soft tokens within LLM agent for long-horizon tasks. Specifically, ASTC uses the model's native recurrent dynamics to determine the already absorbed information, leveraging the commonly-used hybrid Gated Delta Network (GDN)-attention. It then carries this information forward as agentic soft tokens while retaining exact values as hard tokens. The resulting compact sequence reduces later-layer computation and yields reusable KV caches, extending the savings across the agent's trajectory. Extensive experiments on long-horizon tasks show that ASTC matches or exceeds the uncompressed agent's accuracy with up to 59.84% fewer end-to-end Attention Pairs, while trained compressors require 12.3 to 194.9 times more Attention Pairs per successful task. These findings highlight agentic soft tokens as a model-native way to carry absorbed context forward as the task representation evolves.
Xuning He, Kai Fan, Runyu Zhang +4
Shanghai Jiao Tong University · Nanyang Technological University · Nankai University +2
Recurrent context compression controls context growth in long-horizon agents, but its behavioral effects remain poorly understood. In this preliminary empirical study, we show that compression can weaken the influence of recent interactions, increasing blocked actions, repeated exploration, and instability across runs. Motivated by these observations, we introduce TRACE, a verifier-guided framework that evaluates individual compaction events through paired closed-loop continuations from the same environment state and uses summary preferences to optimize a natural-language compression prompt while keeping all models frozen. Initial results on AppWorld show improvements over existing compression baselines in task performance, multi-run reliability, and context--execution efficiency. These findings provide early evidence for boundary-local evaluation as a promising direction for reliable agent context compression.
Guanghui Min, Liang Wu, Mayank Darbari +2
Department of Computer Science, University of Virginia, Charlottesville, VA, USA · Nokia, Sunnyvale, CA, USA