TRANSMISSION // 2611.31800v1
Teaching LLM Agents What to Remember
Source published
A preprint explores whether LLM agents can replace growing interaction histories with compact, inspectable state programs while maintaining task performance.

LLM agents often carry every past action and observation into each new decision. A study on household, science, and navigation tasks tests a different approach: learn a small, readable program that tracks what may matter next and drops the rest.
An AI agent working through a multi-step task builds up a record: what it saw, what it tried, and what happened. Many language-model agents feed that entire history back into the model at each turn. This is safe in one sense—nothing has been deliberately forgotten—but the record grows, and the model must repeatedly sift through it.
A new preprint asks a practical question: what does an agent actually need to remember to keep doing the task well? Rather than compressing a long conversation after it has grown, the authors try to identify a compact state that can be updated throughout the interaction.
A state that serves a particular agent
The proposed “state” is not meant to capture everything about the environment or preserve exactly what the original agent would say and do. It is considered sufficient if the same fixed agent can still complete tasks at about the same rate when given the compact state instead of its full history. That distinction matters: several different action sequences may all solve a task, so matching every choice is stricter than preserving success.
The state is a deterministic recursive program. At each step, it takes the previous state, the latest observation, and the preceding action, then produces an updated state. In principle, it could turn a string of observations into a structured record—such as the agent’s location, which containers it has searched, or whether an object has been heated—and discard text whose useful information has already been captured.
To find these programs, the researchers used an LLM-guided genetic search. Candidate programs were tested by having a fixed language-model agent interact with task environments. A language model proposed mutations or combinations of programs and helped revise candidates that did not meet the performance constraint. The search favored programs that reduced the agent’s input while keeping success within a set tolerance of the full-history version.
The main tests covered ALFWorld, a text-based household environment, and ScienceWorld, where agents carry out interactive science tasks. The authors learned separate abstractions for different task families, using some examples to develop them and held-out instances to evaluate them. They also report a longer-horizon test in BabyAI.
Less input, but not every task equally
Across ALFWorld task families, some learned states cut mean policy input by roughly 69–71%; the largest reduction reported in the abstract is 71%. In ScienceWorld, the maximum was 57%. The researchers report no systematic difference in success between their learned states and full-history input across three evaluation runs. The pooled estimate was a 1.7 percentage-point success difference in favor of the learned states, but its 95% confidence interval ranged from −1.8 to +5.3 points. That interval does not establish that the abstraction improves success; it is consistent with no systematic difference.
The results varied by task. Some programs retained structured facts about objects, locations, task stages, or experimental progress. Others stayed close to a bounded recent history and achieved little reduction. In one ScienceWorld task, the learned input was slightly larger than full history. The study’s central finding is therefore not that every task has a tiny state, but that useful memory can often be selective—and that what needs to be retained depends on the task.
For the longer BabyAI test, the authors report a 95% reduction in mean policy input, with no statistically detectable success difference from full history in that evaluation. They also describe the resulting programs as inspectable: a person can examine the update rules to see what the system keeps, changes, and discards. The authors contrast this explicit program representation with opaque latent vectors; their experiments do not establish that all other compression methods are difficult to interpret.
What the evidence does—and does not—show
These are results for particular environments, task families, and a fixed reference agent, not proof that the same memory programs will work for other tasks or models. The authors’ definition is explicitly policy-relative: an abstraction that preserves one agent’s competence may omit information another agent needs. In a cross-model test on ALFWorld, transferring programs learned for one model to another produced a pooled success difference of −1.5 points, with an interval spanning both negative and positive values; the paper cautions that transfer is not guaranteed.
The search itself also has a cost. It evaluates many candidate programs through environment rollouts and uses language models to propose and repair code. The reported reduction concerns the policy’s input tokens; it should not be read as a full accounting of the resources required to discover the abstraction. The paper notes that its compression baselines also use online language-model inference, whereas the learned update program does not require another model call at deployment.
Finally, the source is an arXiv preprint, not evidence of peer review. The experiments support a promising approach in the tested settings, but further work would be needed to establish how reliably these learned states generalize across tasks, environments, and agents.
- LLM agents
- AI memory
- state abstraction
- context reduction
- genetic algorithms
- ALFWorld
- ScienceWorld
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
MemChain Gives AI Agents a Working Memory Trace
Source published
Shared keywords: ai memory, llm agents
How Shared AI Memory Can Become an Insider Attack
Source published
Shared keywords: llm agents
Reasoning and Memory in a Changing File System
Source published
Shared keywords: ai memory
How AI Memory Can Forget Without Losing Its Index
Source published
Shared keywords: ai memory
MemForest aims to make AI memory updates faster
Source published
Shared keywords: ai memory