DMC-5: Dual-Model Collaboration with Cache-aware Context Compression for Long-horizon Agents
Organizations: Alibaba Group
Abstract
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
| 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) |
| 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% |
| 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 | |
| -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 |
| Tag | Source | Meaning |
| [O@i] | Observation | The summarized information is grounded in a tool or environment observation at turn . |
| [D@i] | Agent-side state at turn | The information is an agent-derived plan, inference, or intermediate conclusion associated with turn , rather than a directly observed result. |
| [UNSOURCED] | No explicit turn reference | A Key Data entry has no recognized source reference in the compressed summary. |
| Pointer | Canonical target | Restored content | Handling |
| <<TURN_i_RESULT>> | Observation | Exact tool or environment output, such as API responses, logs, documentation, returned text, or file contents. | Direct lookup and restoration. |
| <<TURN_i_ACTION>> | Action | Exact tool call, command, arguments, or write/edit operation. | Direct lookup and restoration. |
| <<TURN_i_WORK>> | Work-product action at turn | Exact artifact-related operation associated with a file. | Lookup followed by code-side matching and ordered aggregation of operations on the same file. |
| 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 128). 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. |
| Setting | Value |
| Compressor temperature | (greedy) |
| Compressor thinking | Disabled |
| Recent raw turns | |
| Compression interval | turns |
| Token trigger | new tokens |
| Agent decoding | Endpoint / benchmark default |
| Benchmark | Method | Task Quality | Cost |
| AppWorld | No Compression | ||
| DMC-5 | |||
| OfficeBench | No Compression | ||
| DMC-5 | |||
| 8-objective QA | No Compression | EM / F1 | |
| DMC-5 | EM / F1 |
| 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. |
| 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) |
| 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%) |
| 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% |
| Metric | No Compression | ACON | DMC-5 |
| Runs with Repeat | 31.3% | 28.3% | 32.3% |
| Runs with Same-Action Repeat | 4.0% | 6.2% | 3.2% |
| Runs with Same-Action Repeat | 1.2% | 1.6% | 0.2% |
| Maximum Same-Action Repeats | 9 | 39 | 6 |
| 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 |
| Method | AppWorld | OfficeBench | 8-objective QA |
| No Compression | 69 | 38 | 122 |
| ACON | 78 | 42 | 149 |
| DMC-5 | 94 | 44 | 186 |
| 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. |