Dynamic Content-Aware Segment Compression for Memory Encoder-Decoders
Replace fixed trailing-token extraction with an adaptive entropy-gated selection mechanism to dynamically retain salient segment states into the global memory bank.
Time
Compute level
Resources
What the paper used
Prerequisites
Scope
The Gap
In Section 3.1 and Appendix B.1, MemOnce constructs its global persistent memory bank G_t by taking a static trailing fraction (the last 1/r tokens) of final-layer hidden states from each historical segment of length n_i.
Limitation
Taking a fixed trailing fraction assumes semantic information aggregates uniformly into segment end tokens, failing to capture crucial information in segments with non-uniform density or key entity mentions located in segment headers.
Proposed Solution
Formulate a dynamic state extraction module that computes attention entropy and gradient-based saliency scores across all segment tokens to adaptively select key hidden states for retention, maintaining a flexible memory budget per chunk while keeping overall memory growth bounded.
Why This Matters
Dynamic token selection could significantly improve fine-grained factual recall in non-homogeneous text documents without increasing overall persistent memory footprint.
How to Get Started
How to test it: Evaluate on LongMemEval and LoCoMo benchmarks using Qwen3.5-4B with dynamic compression versus static r=8 trailing compression. Measure gain in open-ended factual QA accuracy against a stopping threshold of less than 0.5% gain.
- Reproduce the MemOnce post-training setup on Qwen3.5-4B using the released MemOnce-1M dataset to establish the r=8 baseline.
- Implement an attention-entropy scoring function over final-layer hidden states to identify top-k informative tokens per segment.
- Modify Algorithm 1 Step 1 to extract variable-length key states based on entropy thresholding instead of slice indexing.
- Fine-tune the dynamic encoder on MemOnce-1M and evaluate performance on LoCoMo.
Suggested by AI. Adapt it to your setup.
Has This Been Done?
Works like Dynamic Memory Compression and Ecco explore entropy-aware cache compression and dynamic pruning for LLMs, but they do not specifically formulate a segment compression approach combining attention entropy and gradient-based saliency for memory encoder-decoders with a flexible per-chunk budget.
- Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inference · 2024 · 122 citations
- Ecco: Improving Memory Bandwidth and Capacity for LLMs via Entropy-Aware Cache Compression · 2025 · 30 citations
We searched OpenAlex and arXiv for “adaptive segment compression hidden state caching memory architectures long context LLM” and “Dynamic Content-Aware Segment Compression for Memory Encoder-Decoders” and an AI compared the idea with the top 10 results. A small search can miss relevant work.
Source Paper
MemOnce: A Scalable Memory Architecture for Large Language ModelsChang Nie, Chaoyou Fu, Songlin Liu +2 more · 2026
MemOnce introduces a scalable foundation memory architecture for large language models that maintains reusable memory states without linear memory growth or quadratic prefill complexity. It compresses context by caching a small subset of final-layer hidden states as global memory representations and decodes them on-demand via lightweight MLPs into multi-layer key-value caches. By computing query-conditioned sparse attention routing indices only once across all layers, MemOnce maintains a constant active memory cache footprint and achieves linear-time inference while outperforming full-context baselines.
Related Ideas
- Adaptive Attention-Based Memory CompressionHelios: Real Real-Time Long Video Generation Model🟠Medium
- Prompt-Relevant Historical Memory Retrieval and Entropy-Calibrated Layer-Head KV CompressionMovieRoll: A Systematic Framework for Rolling Out Long-Form Videos🟡Fairly easy
- Learned Dynamic Prefill Chunk Fetching for Unbounded Multi-Page Document ParsingUnlimited OCR Works🔴Hard
- Importance-Weighted Semantic Memory Compaction for Ultra-Long Horizon TasksGamer: A Generalist Vision-Language-Action Foundation Model for Long-Horizon Real-Time Game Agent🟡Fairly easy
- Extending Reference Sliding Window Attention to Long-Horizon Translation and Speech Recognition with Global Terminology MemoryUnlimited OCR Works🟠Medium