TL;DR
SeDeM (Selective Decompression of Hidden-State Memories) is a novel framework for long-context question answering that decouples compact memory storage from decoder conditioning. By storing context as compressed hidden-state blocks, selecting only the query-relevant blocks, and decompressing them back into decoder-compatible states, SeDeM achieves superior QA accuracy and significantly lower latency compared to existing context-compression methods.
What Problem Does This Paper Address?
As large language models (LLMs) handle increasingly massive context windows, they face a dual challenge: efficiency and reliability. Mechanically, processing long inputs is incredibly expensive because self-attention during the "prefill" stage scales quadratically with sequence length, and the key-value (KV) cache balloons over time. Behaviorally, LLMs often suffer from the "lost in the middle" phenomenon, failing to retrieve and use evidence if it isn't at the very beginning or end of a prompt.
To fix this, researchers use context compression. Hard compression prunes discrete tokens, which can discard vital nuance. Soft compression condenses text into continuous "memory tokens." However, most soft-compression methods force the LLM to act as both the compressor and the decoder input, which can overwrite local information across layers. Furthermore, these highly compressed memory slots are fed directly into the decoder, forcing them to simultaneously store source information and act as effective decoder-conditioning states—a dual role that degrades performance at high compression ratios.
Methods
SeDeM introduces a two-stage approach that separates memory storage from decoder conditioning:
- Query-Independent Memory Construction: The long context is divided into segments. A frozen LLM encoder extracts hidden states from an intermediate layer ($\ell_{ext}$). These states are locally mean-pooled and projected via a shared linear layer into compact memory blocks, forming a global "Memory Bank."
- Query-Conditioned Memory Use: When a question is asked, a ColBERT-style late-interaction Top-$K$ Selector scores the memory blocks against the query. Only the top-$K$ most relevant blocks are passed to a Decompressor (a shared two-layer MLP). The decompressor expands these blocks back into full-sized hidden states, which are then injected directly into an intermediate decoder layer ($\ell_{inj}$) to generate the answer.
Training Strategy
- Stage 1 (Reconstruction Pretraining): Trains the compressor and decompressor on a general corpus (SlimPajama) using a combination of context-window next-token reconstruction, directional hidden-state alignment, and token-distribution distillation from a raw-context teacher model.
- Stage 2 (Task-Specific Training): Activates the selection module and trains the entire pipeline on downstream QA datasets using block-level evidence supervision (InfoNCE + margin loss) alongside standard QA generation loss via lightweight LoRA adapters.
Datasets
The authors evaluated SeDeM on four long-context question-answering benchmarks:
- HotpotQA-Distractor: A 2-hop reasoning dataset with a mix of gold and distractor paragraphs.
- 2WikiMultiHopQA: A complex multi-hop QA dataset.
- MuSiQue: A challenging 2–4 hop QA dataset requiring deep compositionality.
- QASPER: A long-document QA dataset based on scientific papers.
They also tested long-context scaling behavior using the RULER benchmark (qa_2 task) at lengths of 4K, 8K, and 16K tokens.
Key Insights and Ideas
- Decompression is Essential: The paper's core "aha moment" is that forcing an LLM to decode directly from compressed memory slots hurts performance. Controlled ablations showed that expanding memories back into decoder-compatible hidden states yields substantially higher QA accuracy.
- Intermediate Layer Injection Avoids Mismatch: Instead of feeding memory tokens into the very first layer of the decoder, SeDeM injects decompressed states into an intermediate layer. This bypasses the lower decoder layers, preventing the synthetic memory representations from being distorted before they reach the layers responsible for generation.
- Cross-Model Flexibility: Because the framework relies on projections and MLPs, it supports cross-model usage. The authors successfully demonstrated a setup where a smaller, cheaper 1B model acts as the encoder/compressor, and a larger 3B model acts as the decoder.
Key Results
SeDeM consistently outperformed standard soft-compression baselines (like ICAE, HMT, and 500xCompressor) across both 1B and 3B Llama-3.2 backbone configurations.
- Surpassing Full-Context Fine-Tuning: With a 3B backbone, SeDeM actually beat full-context fine-tuning on three out of four datasets (2WikiMHQA, QASPER, and HotpotQA), proving that filtering out irrelevant context can be better than letting the model look at everything.
- Inference Efficiency: Compared to ICAE, SeDeM achieved a 1.74× to 2.46× reduction in online Time-to-First-Token (TTFT) and a 1.08× to 1.10× increase in decoding throughput. This is because the decoder only processes the query and the $K$ selected blocks, rather than the entire compressed context.
- Mitigating Rank Collapse: Effective-rank analysis showed that SeDeM retains a significantly higher normalized effective rank than ICAE (78.7% vs 52.3% on average), indicating that its memory slots suffer far less from representation collapse.
Limitations and Future Work
- Supervision Dependency: The Top-$K$ selector relies on block-level evidence labels during training. While the authors showed that distant supervision (using answer strings) can work, performance drops slightly. Moving toward fully self-supervised selection is an open goal.
- Performance Decay at Scale: While SeDeM handles longer contexts better than ICAE on the RULER benchmark, its performance still degrades as context scales from 4K to 16K tokens. It is not entirely length-invariant.
- Task Scope: The framework was primarily optimized and evaluated for retrieval-heavy QA tasks. Broad-coverage tasks like text summarization will likely require different selection or aggregation strategies.
Summary updated