PReM: Learning What to Preserve and When to Refresh for Context Compression

Bohan Yu, Lei Shen, Chenxi Zhou, Chen Han, Junlin Liu +3 more
7/15/2026
cs.CLcs.AI

No confident code implementation found for this paper.

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.

Show full abstract

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.

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{yu2026prem,
  title  = {PReM: Learning What to Preserve and When to Refresh for Context Compression},
  author = {Bohan Yu and Lei Shen and Chenxi Zhou and Chen Han and Junlin Liu and Wenbo Su and Yu Cheng and Bo Zheng},
  year   = {2026},
  eprint = {2607.14327},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.14327v1}
}

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/2607.14327.svg)](https://codeofpaper.com/paper/2607.14327)

Discussion