Source Document
Yunlong Deng, Yan Li, Xing Hu, Yida Zhu, Sean Du, Weiyang Liu, Guangyi Chen, "Editing as Language: Teaching LLM Agents a Grammar for Native Context Editing", arXiv:2610.25550 [cs.AI], submitted 2026-10-18, DOI 10.48550/arXiv.2610.25550. Affiliations: The Chinese University of Hong Kong, Nanyang Technological University, Meituan LongCat Team, Mohamed bin Zayed University of Artificial Intelligence, Carnegie Mellon University. Code and project page released, CC BY 4.0 license.
This is a preprint without peer review (cs.AI). The session's outbound network was blocked end-to-end, so the full text was checked against a GitHub Actions snapshot of the primary HTML source collected at 2026-10-20T22:07:58Z rather than a live fetch. The conflict of interest is explicit: first author Y. Deng did this work during a Meituan internship, "Meituan LongCat Team" appears among the co-author affiliations, and one of the two base models evaluated (LongCat-Flash-Lite-Sparse) is Meituan's own. Cross-validating with an open-weight second base model, Qwen3.6-35B-A3B, cuts against pure self-serving bias, though it does not remove the conflict.
Study Overview
The question is narrow: can an agent's context editing — summarizing, dropping, rewriting — become a capability native to the model's own vocabulary, instead of a prompted rule or an external tool call? The authors' answer, Native Context Editing (NCE), organizes the context into addressable blocks and adds 70 dedicated tokens to the model's vocabulary (64 address tokens, 3 operators, 2 envelope delimiters, 1 lock marker) so the model itself emits remove, replace, and add operations.
Training starts from a gap: recorded trajectories contain no edits. An offline teacher reads each full trajectory after the fact and decides, by citing the event that ended a block's use, the turn after which that block may be edited. An online teacher then sees only the released blocks and writes the actual edits, as the agent would at inference time. Training itself runs on contexts shaped by the edits already executed (an "evolving context"), and a single model, GLM 5.3, serves as both teachers over roughly 180K annotated trajectories. The two trained models are LongCat-Flash-Lite-Sparse (69B-A3B) and Qwen3.6-35B-A3B; the benchmarks are Terminal-Bench 2.0 (89 tasks, run in its reference harness Terminus-2) and SWE-bench Verified/Multilingual/Pro (500/300/731 tasks, run in Claude Code). Crucially, neither harness is aware of NCE — a runtime sits between the model server and the harness and executes edits transparently, so no dedicated interface is required.
Key Results
At a 256K-token budget, the paper compares the base model under the harness's own compaction (Comp.), a tool-call baseline trained on the identical edits (Tools), and NCE. The small number after each NCE score is its point gain over harness compaction; the token figure is NCE's change relative to compaction.
| Benchmark | Model | Compaction | Tool-call | NCE | Tokens (NCE vs. compaction) |
|---|---|---|---|---|---|
| Terminal-Bench 2.0 | LongCat | 32.6% | 32.6% | 38.2% (+5.6) | -31% |
| SWE-bench Verified | LongCat | 65.2% | 62.4% | 70.0% (+4.8) | -34% |
| SWE-bench Multilingual | LongCat | 56.0% | 54.3% | 62.3% (+6.3) | -44% |
| SWE-bench Pro | LongCat | 39.4% | 39.7% | 44.9% (+5.2) | -32% |
| Average (LongCat) | LongCat | 48.3% | 47.3% | 53.9% (+5.6) | -36% |
| Average (4 benchmarks) | Qwen3.6-35B-A3B | 52.4% | — | 56.9% (+4.5) | -15% |
The tool-call baseline is the number worth stopping on. Trained on exactly the same edits, it averages 47.3% success — below plain compaction's 48.3% — and saves only 6% of tokens. Most of NCE's 36% token saving, in other words, is not coming from what gets edited but from the model expressing the edit in its own vocabulary. The ranking holds as the budget shrinks from 256K down to 48K on Terminal-Bench 2.0 (LongCat): NCE's lead over compaction widens to +9.0 points at 128K, narrows to +5.6 at 64K, and reaches +10.1 at 48K, with token savings of 26–39% throughout. In a direct five-way comparison at a 128K budget (compaction, sliding window, fixed memory state, prompt compression, NCE), NCE topped every axis at once — 34.8% success, 3.70M tokens, 30.5K average context — while the other four clustered at 25.8–32.6% success, 4.6–6.1M tokens, and 38K–44K context.
Credibility Assessment
Three things earn trust. First, the tool-call baseline is trained on the identical data and the identical edits, which isolates "the edit content" from "the native expression" as separate causal factors. Second, the result transfers from Meituan's own LongCat to the open-weight Qwen3.6, so the effect is not confined to one company's model. Third, the paper quantifies its own supervision pipeline's defect rate: a single-teacher pass leaks future information into 30.0% of trajectories, and labeling directly on the original (unedited) history targets an already-removed block in 95.0% of trajectories; NCE's two-teacher, evolving-context pipeline lowers these to 5.0% and 0.0% respectively, and the share of trajectories with any defect from 80.0% (single pass) and 100.0% (original history) down to 37.5%.
The caveats are just as real. Every benchmark is a code or terminal task; nothing here speaks to GUI or multimodal transfer. The defect-rate audit itself rests on only 40 trajectories. Both teacher roles are filled by the same model (GLM 5.3), so that model's own judgment errors could propagate into the labels without any independent check. No run counts or variance are reported anywhere in the text, so there is no way to know how far the tabulated gaps exceed ordinary run-to-run noise. There is no dedicated funding disclosure; the only conflict-of-interest signal is the author affiliation line itself.
Related Work
- Zhang et al. (2025). Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks — the actual source of NCE's own tool-call baseline (Tools). That the tool-call version of the same edits underperforms NCE suggests the shared idea — put memory edits in the action space — is not where the extra gain comes from; the native vocabulary is.
- Sun et al. (2025). Scaling Long-Horizon LLM Agent via Context-Folding — a prior approach that folds a completed sub-trajectory into a summary through a branch/return mechanism trained with RL (FoldGRPO), rather than editing individual token-addressed blocks. The two lines solve a similar problem at different granularities.
- Li et al. (2025). Sculptor: Empowering LLMs with Cognitive Agency via Active Context Management — the representative tool-based system (fragment/summarize/hide/restore) that NCE's introduction explicitly argues against as harness-bound.
All three share the premise that an agent should actively manage its own context, but differ in the unit of action — tool call, folded sub-trajectory, or native vocabulary. NCE's central claim, that native expression itself carries the gain, is verified only against its own reimplementation of MemAct; there is no head-to-head numeric comparison against Context-Folding or Sculptor in this paper.
Reviewer's Judgement
First, the most operationally important number here is not the 36% token saving but the fact that the tool-call baseline underperforms plain compaction. Bolting a handful of memory-management tools onto an agent framework — a common pattern — may not pay for itself; the saving only materializes once you pay the cost of retraining the model to emit edits as native vocabulary.
Second, the defect-rate audit (80.0% for a single teacher, 100.0% for labeling on the original history, 37.5% for NCE) is, in my reading, a reusable diagnostic independent of whether anyone adopts NCE's token scheme. Any pipeline that builds training data for memory-editing agents can count the same two failure modes — future-information leakage and edits targeting an already-removed block.
Third, both base models here are mixture-of-experts architectures with roughly 3B active parameters. I judge it premature to extrapolate the specific percentages (36%, 15%) to much larger dense models or to GUI/multimodal tasks on the strength of this paper alone; the direction looks durable, the magnitudes do not yet generalize beyond this model and task family.
Putting It to Work
- Control-test tool calls first — before investing in native-token training, check whether exposing the same edits as plain tool calls already beats compaction for your harness. This paper's own Tools baseline shows that it may not.
- Separate the two teacher roles — when building memory-editing training data, keep "when a block may be released" (hindsight judgment) distinct from "how to edit it" (causal, in-the-moment judgment), and let only the release judgment see the full trajectory.
- Track a defect rate as a QA metric — measure future-information leakage and stale-target rates in memory-editing training data on an ongoing basis, independent of the target architecture.
- Sweep the budget, not one point — compare methods across a shrinking-budget range (256K down to 48K here) rather than at a single setting, since rankings can shift as the budget tightens.
- Cross-validate off your own model — if evaluating a context-management method built around your own model, repeat the comparison on an open-weight model before publishing, to bound the conflict-of-interest risk.
Conclusion
NCE's contribution is pulling context editing into the model's own vocabulary. The fact that the tool-call version of the identical edits scores below plain harness compaction is the strongest evidence for the paper's real claim — that how an edit is expressed, not merely what gets edited, drives the outcome. That said, the evaluation is confined to code and terminal tasks on two ~3B-active-parameter MoE models, no run counts or variance are reported, and the author affiliations carry a clear conflict of interest. Teams moving memory editing into an operational pipeline can pair this with the practical checklist in Memory Tool and Context Editing: Working Memory the Agent Edits Itself.
References
- Editing as Language: Teaching LLM Agents a Grammar for Native Context Editing — arXiv abstract (source)
- Full HTML text of the same paper — used to verify Tables 1, 2 and 5 (via a snapshot taken 2026-10-20T22:07:58Z, since the session's outbound network was blocked)
- Memory Tool and Context Editing: Working Memory the Agent Edits Itself — sunny34.com blog
Ask AI about this review
The assistant has read this review and the numbers it verified. Ask anything — it answers from the text and says so when something isn't in it.
Loading the chat…