REMORY: Learning Residual Memory for Context Compaction

Hugging Face Daily Papers Papers

Summary

REMORY introduces a neural memory network that supplements textual summaries with a bounded sequence of soft memory tokens for context compaction in long-horizon agents, enabling a frozen LLM to approach full-context performance using only 5.2% of input positions with consistent gains on Qwen3.8-27B and GLM-5.3-Flash.

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.
Original Article
View Cached Full Text

Cached at: 10/09/26, 10:20 AM

Paper page - REMORY: Learning Residual Memory for Context Compaction

Source: https://huggingface.co/papers/2610.11287

Abstract

Long-horizonagentscompacttheirhistorytocontinuewithinafinitecontextwindow,butatextualsummaryalonemaynotsupporteverysubsequentdecision.WeintroduceREMORY,aneuralmemorynetworkthatsupplementsthesummarywithaboundedsequenceofsoftmemorytokens.Giventhehistoryandsummary,thenetworklearnstogeneratetokensthathelpafrozenLLMapproximatethecontinuationitwouldproducewiththefullhistory.Thetokensareconditionedonthesummaryandappendedafterit,formingananalogueofaresidualconnectionalongthesequencedimension.OnSummHay,REMORYimprovessourceattributionatnearlyunchangedinsightcoverageandapproachesthefull-contextjointscoreusingonly5.2%oftheinputpositions.Acrosslong-horizonagentbenchmarks,Qwen3.8-27BandGLM-5.3-Flashshowconsistentgainswithresidualmemory.BothmodelsalsoexhibitsubstantiallyfewerrepeatedtooloutputsandtoolerrorsonBrowseCompandTerminal-Bench2.1.

View arXiv pageView PDFProject pageGitHub0Add to collection

Models citing this paper2

#### mocoV3/Qwen3.8-27B-REMORY-1.9B 2B• Updatedabout 4 hours ago • 49 #### mocoV3/GLM-5.3-Flash-REMORY-1.24B 1B• Updatedabout 1 hour ago

Datasets citing this paper0

No dataset linking this paper

Cite arxiv.org/abs/2610.11287 in a dataset README.md to link it from this page.

Spaces citing this paper0

No Space linking this paper

Cite arxiv.org/abs/2610.11287 in a Space README.md to link it from this page.

Collections including this paper0

No Collection including this paper

Add this paper to acollectionto link it from this page.

Similar Articles

REMORY: Learning Residual Memory for Context Compaction

arXiv cs.CL

Remory 提出一种神经记忆网络,用有限的软记忆 token 补充文本摘要,使冻结的 LLM 在仅用 5.2% 输入位置的情况下逼近全上下文表现,并在 BrowseComp 和 Terminal-Bench 2.1 等长时程 agent 基准上带来一致提升、显著减少重复工具输出和错误。

Understanding Is Done Early: A Depth Division of Labor in Large Language Models and Its Use for Unbounded-Context Memory

arXiv cs.CL

This paper introduces CoMem, a method that exploits the depth-wise division of labor in LLMs to cache intermediate residual tensors and recompute only upper layers for retrieval, enabling bounded read compute and memory independent of stored-context length. Evaluated on Qwen3-8B, CoMem achieves strong long-context performance with significant memory savings and prefill speedups.