REMORY: Learning Residual Memory for Context Compaction
cs.CL, cs.AI
Submitted: 2026-10-08
Updated: 2026-10-11
Code: https://github.com/zapier/AutomationBench
License: http://creativecommons.org/licenses/by/4.0/
The gist: Long-horizon agents compact their history to continue within a finite context window, but a textual summary alone may not support every subsequent decision.
Terminology
Abstract
Long-horizon agents compact their history to continue within a finite context window, but a textual summary alone may not support every subsequent decision. We introduce REMORY, a neural memory network that supplements the summary with a bounded sequence of soft memory tokens. Given the history and summary, the network learns to generate tokens that help a frozen LLM approximate the continuation it would produce with the full history. The tokens are conditioned on the summary and appended after it, forming an analogue of a residual connection along the sequence dimension. On SummHay, REMORY improves source attribution at nearly unchanged insight coverage and approaches the full-context joint score using only 5.2% of the input positions. Across long-horizon agent benchmarks, Qwen3.8-27B and GLM-5.3-Flash show consistent gains with residual memory. Both models also exhibit substantially fewer repeated tool outputs and tool errors on BrowseComp and Terminal-Bench 2.1.
Sources
- DFlash: Block Diffusion for Flash Speculative Decoding
- End-to-End Context Compression at Scale
- JobBench: Aligning Agent Work With Human Will
- MMFineReason: Closing the Multimodal Reasoning Gap via Open Data-Centric Methods
- Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces
- MemGPT: Towards LLMs as Operating Systems
- AutomationBench
- BrowseComp: A Simple Yet Challenging Benchmark for Browsing Agents
- ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization
- AgentFold: Long-Horizon Web Agents with Proactive Context Management
- WebAnchor: Anchoring Agent Planning to Stabilize Long-Horizon Web Reasoning
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering