Decoupling Memory from Context: Structured Memory for Token-Efficient Test-Time Continual Learning

Yehya Farhat, Michael Desmond, Anastasios Kyrillidis
10/2/2026
cs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) are increasingly deployed in enterprise, scientific, and medical applications, where agents must incorporate domain-specific knowledge and adapt from experience. Context engineering offers a practical alternative to weight updates by improving model behavior through instructions, strategies, and evidence supplied at inference time.

Show full abstract

However, adapting context online typically requires a costly trial-and-error process, while queries are often processed independently, preventing useful experience from carrying forward. Memory systems address this limitation by retaining information across interactions, but approaches that continually append information to a shared context face increasing token costs, context-window limits, and performance degradation as the context expands. We introduce a unified formulation of context optimization and show that an agent memory system update can be interpreted as an optimization update procedure over the model's context. This perspective attempts to provide a principled framework for studying memory design and its efficiency. We then propose GraphMemory, a lightweight graph-based memory that accumulates, refines, organizes, and connects reusable strategies. For each query, GraphMemory retrieves only the relevant subgraph, enabling online context adaptation without exposing the model to the entire memory. Under bounded retrieval, the amount of retrieved memory remains constant as the number of processed examples grows. Experiments show that GraphMemory achieves competitive downstream performance while using approximately 81-85% fewer memory-construction tokens than our baselines.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{farhat2026decoupling,
  title  = {Decoupling Memory from Context: Structured Memory for Token-Efficient Test-Time Continual Learning},
  author = {Yehya Farhat and Michael Desmond and Anastasios Kyrillidis},
  year   = {2026},
  eprint = {2610.02687},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.02687v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.02687.svg)](https://codeofpaper.com/paper/2610.02687)

Discussion