{
  "schema_version": "1.0",
  "id": "archive:https://arxiv.org/abs/2607.05378v1",
  "slug": "2607-05378v1-0j3vikd",
  "url": "https://feed7.dev/p/2607-05378v1-0j3vikd",
  "title": "CompactionRL: Reinforcement Learning with Context Compaction for Long-Horizon Agents",
  "why_included": "CompactionRL uses RL to teach agents to compact their own context mid-task, lifting GLM-4.5-Air 7 points to 66.8% on SWE-bench Verified; the recipe is now in GLM-5.2's training pipeline.",
  "summary": "**The gist** **CompactionRL** trains long-horizon agents to summarize their own trajectory and keep working under the compressed context, jointly optimizing execution and summary with token-level loss normalization and cross-trajectory advantage estimation. It lifts **GLM-4.5-Air to 66.8%** on SWE-bench Verified (**+7.0 points**) and 24.5% on Terminal-Bench 2.0, with GLM-4.7-Flash gaining **+5.5 and +6.8 points**.",
  "practical_implication": "**Why it matters** Compaction today is a harness-side trick — the framework summarizes when the window fills, but the model was never trained to resume from its own summaries. **Training through compaction** teaches the model to write summaries that preserve what the task actually needs — a failure mode anyone running long coding-agent sessions has hit. The recipe already ships in the training pipeline of **GLM-5.2 (750B-A40B)**.",
  "agent_context": "**The gist** **CompactionRL** trains long-horizon agents to summarize their own trajectory and keep working under the compressed context, jointly optimizing execution and summary with token-level loss normalization and cross-trajectory advantage estimation. It lifts **GLM-4.5-Air to 66.8%** on SWE-bench Verified (**+7.0 points**) and 24.5% on Terminal-Bench 2.0, with GLM-4.7-Flash gaining **+5.5 and +6.8 points**.\n\n**Why it matters** Compaction today is a harness-side trick — the framework summarizes when the window fills, but the model was never trained to resume from its own summaries. **Training through compaction** teaches the model to write summaries that preserve what the task actually needs — a failure mode anyone running long coding-agent sessions has hit. The recipe already ships in the training pipeline of **GLM-5.2 (750B-A40B)**.\n\n**Watch out** Gains are shown on **GLM models** and coding benchmarks (**SWE-bench Verified, Terminal-Bench 2.0**) only; whether trained compaction beats a well-engineered inference-time summarizer, or transfers beyond coding, isn't demonstrated.",
  "source": {
    "name": "arXiv",
    "url": "https://arxiv.org/abs/2607.05378v1",
    "published_at": null
  },
  "source_class": "blog_post",
  "content_type": "Paper",
  "layer": "agent",
  "domains": [
    "coding",
    "research"
  ],
  "topics": [
    "context-engineering",
    "coding-agents",
    "open-models"
  ],
  "verification": {
    "status": "needs_review",
    "label": "Needs Review",
    "method": "unverified",
    "verified_at": null
  },
  "uncertainty": [
    "Gains are shown on **GLM models** and coding benchmarks (**SWE-bench Verified, Terminal-Bench 2.0**) only; whether trained compaction beats a well-engineered inference-time summarizer, or transfers beyond coding, isn't demonstrated."
  ],
  "lifecycle": "Current",
  "published_at": null,
  "modified_at": null,
  "supersedes": [],
  "expires_at": null,
  "formats": {
    "html": "https://feed7.dev/p/2607-05378v1-0j3vikd",
    "json": "https://feed7.dev/p/2607-05378v1-0j3vikd.json",
    "markdown": "https://feed7.dev/p/2607-05378v1-0j3vikd.md"
  }
}