Manuscript Offprint

arXiv:2610.40545

Retrieval as Traversal: Value-Indexed Memory for Stateful Long-Context Agents

Daniel Strauß, Zhenshan Bing, Alois Knoll

Abstract

Long-context models repeatedly solve closely related retrieval problems. Attention or global retrieval can retain large stores, but each forward pass again searches for what matters. Recurrent compression avoids this search only by deciding earlier what information to preserve. Neither mechanism directly exploits that useful memories at neighbouring retrieval steps may substantially overlap. We propose an alternative in which retrieval is a persistent local traversal through an address space. We separate a memory's content from its address. Utility is defined by the information revealed by retrieving the content, while geometry determines only how cheaply that information can be reached. This leads to a cost-regularised indexing objective that preserves information value inside local neighbourhoods while charging for every memory made locally accessible. Its marginal-value form gives both attractive and exclusion pressures. Thus, complementary memories should be co-retrievable when the additional value exceeds retrieval cost, whereas redundant memories should not occupy the same retrieval set solely because they are individually useful. As a proof of principle, we test only the simplest fixed-geometry instance on MiniGrid Memory. A persistent local traversal head reaches 0.95 mean return after 0.59M training steps with a five-token context, compared with 0.94M for Gaussian absolute addressing and more than 2M for categorical absolute addressing. The experiment does not test learned geometry or repeated retrieval. Instead, it motivates the hypothesis that stateful retrieval may be easier to learn than stateless. To test the full proposed method further experimentation is necessary.

1 Introduction

Long-context models face a basic trade-off. Keeping a large history available preserves information, but attention or retrieval must repeatedly determine which parts of that history matter. Compressing the past into a bounded recurrent state avoids the scan, but the compression is performed before all future information needs are known. Sparse attention, approximate nearest-neighbour search, and external retrieval reduce the cost of a query, but typically still treat successive queries as fresh matching problems [5, 7, 9, 6].

This misses repetition, a third source of cost. The memories useful at two nearby inference steps need not be independent sets. In order to avoid this cost information about value of the to be retrieved memories has to be known before retrieving them. We investigate this idea as retrieval by traversal. Memories and the current context and retrieval heads are placed in an address space. The positions of the current context and the retrieval heads aim to hold the information about the current expected value of the to be retrieved memories, as all memories in ϵ\epsilon distance will be retrieved.

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: Long-Context Foundation Models.

Our proposal differs from semantic retrieval in one important respect: addresses should be shaped by the decision value of retrieving memory contents, rather than by similarity between the contents themselves. This distinction matters because two semantically similar memories may be redundant, whereas two dissimilar memories may only be useful together.

This paper makes two deliberately limited contributions. First, we give a decision-theoretic objective for learning such a geometry and derive how redundancy and complementarity affect local co-retrieval. Second, we report a small proof-of-principle experiment in which the geometry is fixed and only the persistent retrieval mechanism is learned. We do not claim that the learned value-index proposed here has yet been experimentally validated.

Related work. External differentiable memories have long separated computation from stored state. Neural Turing Machines combine content and location addressing [3]. Differentiable Neural Computers add dynamic allocation and temporal links [4]. Lie-access Neural Turing Machines are particularly close in mechanism. Here, memories occupy a continuous address manifold and read heads move by relative transformations [12]. Neural Map instead uses physical position as an external memory index [8]. Modern sparse-attention and retrieval systems use hashing, learned routing, nearest-neighbor search, or retrieval indices to avoid attending to every stored item [5, 9, 11, 6]. We ask instead whether the address space itself can be organized by the expected utility of future retrieval and then traversed persistently across related queries.

References (12)