SD-Cache: Learnable Memory Consolidation with State-Guided Dynamic Caching
Yuanhong Chen, Yiping Ji, Cameron Gordon, Emily Hackett-Jones, Hemanth Saratchandran, Anton van den Hengel
Abstract
Large language models (LLMs) are increasingly deployed as persistent services that must reason over large volumes of external knowledge. Retrieval-augmented generation (RAG) grounds model responses in relevant documents, but the retrieved content must still be encoded and stored in the key-value (KV) cache. As this content accumulates, the cache grows linearly, increasing memory consumption and inference cost. Existing memory-compression methods address this problem either by retaining a subset of cached states or by learning context compressors that map documents to compact latent representations. Despite these advances, consolidating information under tight memory budgets while preserving its usefulness for future queries remains challenging. We investigate how the model's native KV states can be selectively consolidated into a fixed-size working memory without access to future queries. To this end, we introduce SD-Cache (State-guided and Dynamically updated Cache), a query-agnostic KV-memory consolidation framework that operates alongside a frozen generator LLM. SD-Cache learns to consolidate layer-wise KV states into fixed-size memory through selective anchor-based pooling and state-guided refinement, processing new contexts in a single forward pass without context-specific optimisation. Experiments on retrieval-augmented question answering and synthetic long-context benchmarks show that SD-Cache maintains competitive downstream performance under constrained memory budgets.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
Related papers
MERIT: Experience-Guided Memory for Long-Horizon Persona-Specific Persuasive Dialogue
Shared title terminologycs.CLRohan Kirti, Akash Ghosh, Pratik Amrit et al.
Right Destination, Wrong Journey: Synthetic Counseling Dialogues Miss Human Interactional Dynamics
Shared title terminologycs.CLZiwei Gong, Yuchen Huang, Nicholas Deas et al.
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
Ontology-Compiled 2D Clinical State Fields with Bidirectional Diffusion Encoders for Zero-Training Cross-Ontology Medical Coding
Shared title terminologycs.CLZeqiang Wang
The Answer Is Not the State: Trajectory-Level Corrigibility in Diffusion Language Models
Shared title terminologycs.CLJunchi Liao, Wentao Li
Seeing Is Not Acting: WARD Diagnoses the Evidence-to-State-to-Action Gap in Longitudinal Clinical Agents
Shared title terminologycs.CLChao Ding, Yidong Jiang, Junzhi Ning et al.