PReM: Learning What to Preserve and When to Refresh for Context Compression
Bohan Yu, Lei Shen, Chenxi Zhou, Chen Han, Junlin Liu, Wenbo Su, Yu Cheng, Bo Zheng
Abstract
Efficient long-context inference is not only about reducing memory cost, but also about keeping useful contextual evidence accessible as generation proceeds. However, existing compression-oriented approaches, such as key-value (KV) cache compression and context compression, often either make an early decision about which contextual information to keep or rely on an external compressor. Such designs make it difficult to adapt the compressed context to the evidence needed by later reasoning steps. This paper introduces PReM (Preserve and Refresh Memory), a context-compression framework that maintains the long context as the model's internal layer-wise KV memory and learns what to preserve and when to refresh it. Specifically, PReM uses a dedicated memory layer to make memory-selection decisions, and a special memory token <m> to trigger refreshes during generation. To train this behavior, PReM introduces Phase-Separated Refresh Training, aligning memory selection with memory-conditioned generation while preserving continuity across refreshes. Experiments with 32K-token contexts show that PReM outperforms strong baselines under both 16x and 32x compression, while maintaining a favorable balance between answer quality and inference efficiency.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
Related papers
VarRate: Training-Free Variable-Rate KV Cache Compression for Long-Context LLMs
Shared title terminologycs.CLShahrzad Esmat, Dhawal Shah, Ali Jannesari
DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target's Sparsity
Shared title terminologycs.CLHong Liu, Rui Cen, Junhan Shi et al.
NORMCRAFT: Cultural Norm Generation for Context-Aware Language Model Alignment
Shared title terminologycs.CLTangyuan Zhang, Zhuang Li, Fatemeh Shiri et al.
Beyond Fixed-Context Likelihood: Zero-Shot AI-Generated Text Detection via Context Perturbation Discrepancy
Shared title terminologycs.CLYifan Tang, Jingran Li, Yihao Wang et al.
Semantic Register Compression in Multi-Agent LLM Cascades
Shared title terminologycs.CLManuele Tele Junior Fernandez
Do Value Vectors in Deep Layers Need Context from the Residual Stream?
Shared title terminologycs.CLMuyu He, Yuchen Liu, Qingya Huang et al.