# Small AI agents learn to keep working notes in plain files

A preprint from Peking University, JD.com and others trains 4B and 9B models to save their progress in ordinary files during long tasks. Teaching memory through familiar file commands worked better than teaching purpose-built memory tools.

- Category: Agents
- Readiness level: II (Benchmarked) on Science Underway's four-step scale, as proposed
- Published: 2026-11-12
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/small-ai-agents-learn-to-keep-working-notes-in-plain-files

## The study

Coding Agent Memory Post-Training II: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via On-Policy Distillation (preprint, not peer reviewed). DOI 10.48550/arxiv.2611.14009, arXiv 2611.14009. https://arxiv.org/abs/2611.14009

## At a glance

- What it shows: AI models working on long tasks lose track of earlier steps once their working space fills up. A small model, trained by a larger one to write and reread plain notes files, finished about two thirds of the authors' test tasks, up from under half.
- What it does not show: It does not show the method working in a real product, with models larger than 9B, or with code anyone can run yet. Most tests use environments the authors built themselves.
- Why it matters: Agents that run for hours need a reliable way to remember what they have done. This work suggests the simplest memory, a text file the model already knows how to use, may also be the easiest to teach.

## What the study shows

Language models can only see a limited amount of text at once, called the context window. On long agent tasks, such as fixing a bug over dozens of steps, early findings fall out of that window. The agent then has to decide what to write down and what to read back later.

The authors built a test suite called CAMG-II with five kinds of long task: multi-step online shopping, software repair, machine-learning experiments, business document work and website building. In every task the agent can run ordinary shell commands and keep files in a workspace that lasts the whole episode. When the context fills, it is wiped. Before that happens, the agent must write a short continuation file, and afterwards it gets only that file's location.

Their training method, CAMP-II, uses on-policy distillation: the small student model acts, and a larger frozen teacher model scores every word the student wrote, including the notes. No task rewards are used. The students were Qwen3.5 models with 4 billion and 9 billion parameters, and the teacher a 27 billion parameter Qwen model.

The authors report that the trained 4B model succeeded on about 65% of 640 test tasks on average. The untrained model managed about 45%, and an earlier version trained on task rewards alone about 54%. Five other memory methods, trained with the same teacher, all scored lower. Five repeat training runs gave almost the same average.

Two checks point to the notes as the source of the gain. Replacing plain files with dedicated memory tools, or with automatic summaries of the conversation, cost about 16 points. Switching off the training signal on the note-writing words alone removed most of the gain, while switching it off on the same number of random words did not.

On two outside coding and terminal benchmarks, the trained 4B model gained about 7 points on each over its starting model. The trained 9B model beat a larger 35B model from the same family on both. This is a preprint and has not been peer reviewed. Code is promised but not yet released. On our readiness scale it sits at level II, Benchmarked: there are public benchmark results, but no released code or documented production use.

## Our reading

In our reading, the useful idea here is about the interface, not the training maths. Teaching memory through an action that both teacher and student already perform well gives the teacher something it can judge and the student something it already tries. The authors back this with measurements taken before training: the student reached for files about three times as often as for dedicated memory tools, and the teacher was better at telling a relevant note from an irrelevant one when notes were files.

A concrete case from the paper shows what this looks like. A coding agent fixing a bug writes down the function, the line and the suspected faulty condition before its context is wiped. Afterwards it reads the note back and carries on from that line, and the fix passes the tests. For a team running agents on long support tickets or code reviews, this is the kind of hand-off that decides whether the agent starts over or finishes.

The results deserve caution. Most comparisons are on the authors' own environments, the headline numbers for the baselines come from single runs, and 128 tasks per domain leaves room for noise between close methods. The trained student still falls well short of its teacher on coding and business tasks.

The rest of the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/small-ai-agents-learn-to-keep-working-notes-in-plain-files

## How this was made

An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
