Memory control signals appear before actions in long horizon agents

Memory Control Signals Emerge Before Action in Long Horizon Agents

Artificial Intelligence

Summary

Longer conversations with language model agents require handling more past information, which slows down processing and makes remembering important details harder. The authors found the model internally signals when it needs to compress or recall memory just before taking an action, even without explicit cues about how long the conversation is. They designed a new method called PaMER that uses these early signals to manage memory more efficiently, combining fast compression with selective retrieval of key past information. This approach lowers the amount of information the model needs to consider while still performing well on tasks.

What this means in practice

  • For ai system engineers: Optimize large language model agents to handle long interactions efficiently by combining learned compression with targeted historical evidence retrieval.
  • For chatbot developers: Build chatbots that reduce computational costs and maintain responsiveness by managing memory using preaction signals inside the model.

Authors

Mingxuan Wang, Guorun Yao, Fei Luo, Yinglong Guo, Chao Ning, Bo Wang, Hongyue Chen, Yanbiao Ma, Jungong Han

Abstract

Long horizon language model agents continuously accumulate interaction history, increasing computational cost while making relevant information harder to preserve and reuse. Existing context management methods mainly focus on how to compress or retrieve history, but largely leave open whether the model itself already represents the need for these memory operations before they occur. We study the hidden state immediately before each agent action and find that compression and recall needs are already encoded in the model's internal representations. These signals cannot be explained by simple context length or interaction progress, and they exhibit distinct formation patterns across model depth. We further show that most memory decision information is preserved in a compact recent context, while selectively restored historical evidence complements the long range dependencies that recent context misses. Based on these findings, we propose Preaction Memory with Evidence Retrieval (PaMER), which combines state guided compression with external evidence retrieval. PaMER+ further introduces step level evidence selection to recover only the historical information required by the current task. Experiments on WorkBuddyBench, across multiple context management baselines and model backbones, show that our framework substantially reduces context consumption while maintaining competitive task performance.