mlsanityData to 24 Nov 2026

Beyond Compressing Everything: Contrastive Memory Learning for Selective Context Compression

arXiv 2611.16384 ↗Submitted 12 Nov 2026cs.CL cs.AIcited by 0

On the map: Efficient LLM inference and serving → Prompt and context compression

Abstract (arXiv)

As large language models (LLMs) advance toward increasingly long inputs, soft context compression offers a promising approach to efficient inference by converting long inputs into compact memory slots. Under limited memory budgets, effective context compression remains challenging because task-relevant evidence varies substantially across queries, ranging from localized evidence to multiple distant spans or information dispersed throughout the full document. Instead of compressing everything indiscriminately, we propose CoMem, a query-guided selective context compression framework that learns memory representations conditioned on both the document and the query. CoMem develops Contrastive Compressor Learning to achieve query-sensitive yet context-preserving memory representations. To inject a strong prior over query-dependent evidence distributions, we devise a same-context hard negative mining strategy by pairing a single document with multiple queries, requiring the compressor to selectively retain information according to each query's distinct evidence needs. To address the restricted information flow imposed by causal masking, we further enable bidirectional attention among memory slots. Experiments demonstrate that CoMem consistently outperforms existing context compression methods across compression ratios on question answering and RULER-NIAH benchmarks. Our code is available at https://github.com/scar-on/CoMem.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Prompt and context compression, one of 12 directions in Efficient LLM inference and serving. Builds on 24 of its 38 references that are in the map. Submitted 12 Nov 2026.

Builds on

24 of 38 references.

Closest ancestors · 5

Same direction, newest first

  1. 2025Autoencoding-Free Context Compression for LLMs via Contextual Semantic Anchors10 Oct
  2. 2025DAC: A Dynamic Attention-aware Approach for Task-Agnostic Prompt Compression16 Jul
  3. 2024Prompt Compression for Large Language Models: A Survey16 Oct
  4. 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression19 Mar
  5. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression10 Oct

Other references · 19

  1. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,986
  2. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,765
  3. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,559
  4. 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,392
  5. 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 1,011
  6. 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 611
  7. 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 431
  8. 2024Long-context LLMs Struggle with Long In-context Learningcited by 318
  9. 2024Generative Representational Instruction Tuningcited by 254
  10. 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 136
  11. 2026DeepSeek-OCR 2: Visual Causal Flowcited by 86
  12. 2024NovelQA: Benchmarking Question Answering on Documents Exceeding 200K Tokenscited by 39
7 more
  1. 2023BeLLM: Backward Dependency Enhanced Large Language Model for Sentence Embeddingscited by 33
  2. 2025Provence: efficient and robust context pruning for retrieval-augmented generationcited by 32
  3. 2025PISCO: Pretty Simple Compression for Retrieval-Augmented Generationcited by 23
  4. 2025CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoningcited by 15
  5. 2025REFRAG: Rethinking RAG based Decodingcited by 13
  6. 2026Read As Human: Compressing Context via Parallelizable Close Reading and Skimmingcited by 11
  7. 2026Rethinking Soft Compression in Retrieval-Augmented Generation: A Query-Conditioned Selector Perspectivecited by 5

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026EnComp: Lightweight Encoder-Only Context Compression for Retrieval-Augmented Question Answering
  2. 2026SeDeM: Selective Decompression of Hidden-State Memories for Long-Context Question Answering
  3. 2024Retaining Key Information under High Compression Ratios: Query-Guided Compressor for LLMs
  4. 2025AttnComp: Attention-Guided Adaptive Context Compression for Retrieval-Augmented Generation
  5. 2026Compression Beyond the Uncompressed: A Two-Stage Training Recipe for Soft Context Compression in RAG
  6. 2026From Similarity to Structure: Training-free LLM Context Compression with Hybrid Graph Priors
  7. 2026AdaMem: Adaptive Memory Token Allocation for Soft Compression in Retrieval-Augmented Generation
  8. 2024QUITO: Accelerating Long-Context Reasoning through Query-Guided Context Compression