Skip to main content
Back to timeline
arXivSource publication:

Long-horizon agents keep memory in plain files: CAMP-II averages 64.6% across five environments, above the 54.2% task-reward reference CAMP-I

Synopsis

Long-horizon agents accumulate interaction histories that outgrow the active context, so they must learn what to write down and when to read it back. Earlier on-policy distillation of memory control relied on dedicated memory tools or compaction protocols that neither the teacher nor the student had seen, which weakened guidance on the teacher side and left the student sampling too few meaningful memory actions. CAMP-II instead routes memory through ordinary Bash file operations that both models already have a prior for, training one policy jointly across five long-horizon environments to a 64.6% average task success rate against 54.2% for the task-reward reference CAMP-I, with transfer to Terminal-Bench 2.1 and SWE-Bench Pro V2.

AI-generated editorial illustration: Coding Agent Memory Post-Training II: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via On-Policy Distillation

Interpretation

Memory control for long-horizon agents now runs through ordinary file operations rather than dedicated memory tools or compaction protocols, and the trained policy reaches the highest average success rate across five long-horizon environments. Earlier memory distillation placed memory on an interface that neither the teacher nor the student had in pre-training, so the teacher could not give useful guidance on an interface it had never used and the student sampled too few meaningful memory actions. On the five CAMG-II environments, 128 test tasks each for 640 tasks in total, CAMP-II averages 64.6% success against 54.2% for CAMP-I; across five training seeds the five-environment mean is 64.9 with a standard deviation of 0.5.

Memory is carried by a single ordinary bash call, so the policy can create, revise, search and reuse files in a workspace that persists for the whole episode and keep task state outside the active context. When the context approaches its budget it is cleared, and before that replacement the policy must write a bounded continuation file; the new context then contains only that file's path, and the policy has to read it back itself. Training uses fully asynchronous on-policy distillation with a frozen Qwen3.8-27B teacher and Qwen3.5-4B and Qwen3.5-9B students, 100 learner updates of 64 episodes each, an equal mixture over the five environments, and no task rewards.

The learned memory behavior transfers to two benchmarks outside CAMG-II, and both trained policies exceed the models they start from. The 4B policy gains 6.9 points on each benchmark, and the 9B policy scores above the larger Qwen3.5-35B-A3B on both. On Terminal-Bench 2.1 and SWE-Bench Pro V2, CAMP-II-9B scores 38.0 and 30.1 and CAMP-II-4B scores 30.0 and 18.1, against 23.1 and 11.2 for the starting Qwen3.5-4B.

Perspective

The demonstrated scope is the five CAMG-II environments Shop, Coding, AutoResearch, General and Visual with 128 test tasks each, plus the network-free task subsets of Terminal-Bench 2.1 and SWE-Bench Pro V2; the intended readers are researchers training long-horizon agents and working on on-policy distillation.

The study covers students up to Qwen3.5-9B and a single frozen teacher; whether the gains persist at larger scales or carry over to multi-teacher on-policy distillation remains untested.