Manuscript Offprint

arXiv:2610.21165

From Long Context to Selective Memory:A Survey of Memory-Centric Compression for Large Language Models

Chaogui Gou

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Long-context capability has become essential for large language models (LLMs) to handle complex tasks, yet continuously expanding the context window does not remove the computational, storage, and information-selection pressures incurred at inference time. Existing work on prompt compression, KV-cache management, efficient serving, retrieval augmentation, and agent memory is usually discussed in isolation, leaving the flow of information between storage and computation insufficiently understood. This survey reframes long-context compression as a memory-management problem for allocating inference-time resources. We distinguish compute-active memory, which directly participates in model computation, from compute-inactive memory, which lies outside the computation path but can be stored, retrieved, updated, or forgotten, and we characterize offloaded KV caches, persistent prefix caches, and precomputed KV states as intermediate states on the activation path. On this basis, we formulate writing, offloading, recall, retrieval-and-injection, materialization, eviction, consolidation, and forgetting as state transitions within an information lifecycle, and introduce a budgeted cost model that places these operations in a single cost account. The resulting framework unifies short-term context compression, long-term memory management, and the transitions between them, and shows that the central challenge is not merely reducing information volume but deciding which information should participate in costly inference, when, and in what form. We further summarize evaluation dimensions, benchmark gaps, and open challenges, and argue that future research should move from static, pointwise compression toward dynamic, governable, lifecycle-aware memory management.

Keywords: large language models, long-context inference, context compression, memory management, KV cache, retrieval-augmented generation, agent memory

1 Introduction

Long-context capability has become a prerequisite for large language models (LLMs) on complex tasks. As context windows have grown from several thousand to hundreds of thousands or even millions of tokens (Google, 2026; OpenAI, 2026; Xu et al., 2026a), long-document understanding, codebase analysis, multi-turn dialogue, tool-use trajectories, retrieval-augmented generation (RAG), and long-term personalized assistance increasingly depend on a model's ability to receive and exploit large amounts of contextual information (Liu et al., 2025a).

A larger window, however, does not by itself yield more effective use of information (Hsieh et al., 2024; Liu et al., 2024c). Long inputs increase prefill computation and place growing pressure on key-value (KV) cache memory, memory bandwidth, and latency during decoding (Kwon et al., 2023; Xu et al., 2026a; Zhang et al., 2023), while realistic contexts contain repeated, obsolete, or irrelevant content that dilutes critical evidence. The long-context problem is therefore not only one of capacity but also one of management: how a system selects, compresses, and uses information under a finite computational budget.

Several research directions address this problem at different levels, including prompt compression, latent memory representations, KV-cache compression, architecture-level selective computation, efficient serving, retrieval augmentation, and external long-term memory (Jiang et al., 2023, 2024; Kwon et al., 2023; Lewis et al., 2020; Mu et al., 2023; Packer et al., 2023; Zhang et al., 2023). Existing surveys usually organize them by technical origin or application scenario (Liu et al., 2025a,c; Verma, 2024), which obscures a question they share: which information should enter the expensive attention-computation path, and which should instead be compressed, externalized, reused, updated, or forgotten?

This survey answers this question from a memory-centric perspective. We call information that directly participates in the current model computation compute-active memory, and information that lies outside the current computation path but can be stored, retrieved, updated, or forgotten compute-inactive memory. The distinction concerns an item's participation in computation at a given inference step rather than its storage location: the same content may be stored externally, later retrieved and injected into the context, and finally written back after inference. Between the two lie intermediate states, in which information has left the attention path but can be restored without re-retrieval or re-encoding, as with offloaded KV caches and precomputed prefix caches. Long-context compression thus becomes the management of an information lifecycle across these states. Recent surveys have also proposed unified views of LLM memory based on memory operations, context engineering, or agent memory (Du et al., 2025; Hu et al., 2025; Mei et al., 2025); we instead organize the field by the computational participation of information and its cost. The main contributions are as follows.

  1. We propose a framework that distinguishes compute-active from compute-inactive memory, incorporates intermediate states on the activation path, and casts long-context compression as lifecycle management under a finite computational budget.

  2. We formulate writing, offloading, recall, retrieval-and-injection, materialization, eviction, consolidation, and forgetting as state-transition operators and introduce a budgeted cost model that places these operations in a single cost account.

  3. We review representative work up to 2026 along this lifecycle, from input, representation, and KV-cache compression to external long-term memory, learned memory policies, and transition mechanisms such as retrieval-and-injection, KV offloading and materialization, and agent-side context folding.

  4. We summarize evaluation dimensions, benchmark gaps, and open challenges, and pose a concrete research question for each challenge.

Scope. This survey focuses on the intersection of long-context modeling, KV-cache management, retrieval augmentation, and agent memory: how a system decides which information enters the current inference path, compresses its representation, controls its cost, and later updates or forgets it. Methods that only extend the context window without changing information selection, cache management, or memory mechanisms are treated as background. Parametric memory is included only in a limited way, because knowledge editing, continual pre-training, and parameter-efficient fine-tuning incur their cost mainly at training time and do not selectively activate information within a single inference; methods that blur this boundary, such as test-time neural memory (Behrouz et al., 2025) and self-study-trained KV caches (Eyuboglu et al., 2025), are discussed where they affect inference-time memory allocation.

The remainder of the survey is organized as follows. Section 2 reviews the costs of long-context inference and positions this survey relative to prior reviews. Section 3 presents the framework. Sections 4 and 5 review compute-active and compute-inactive memory, Section 6 discusses state transitions, Section 7 covers evaluation, Section 8 discusses open challenges, and Section 9 concludes.

References (100)

Couldn't load all references. Reload the page to try again.