Prompt Compression with Context-Aware Sentence Encoding for Fast and Improved LLM Inference
Barys Liskavets, Maxim Ushakov, Shuvendu Roy, Mark Klibanov, Ali Etemad, Shane K. Luke
摘要
Large language models (LLMs) have triggered a new stream of research focusing on compressing the context length to reduce the computational cost while ensuring the retention of helpful information for LLMs to answer the given question. Token-based removal methods are one of the most prominent approaches in this direction, but risk losing the semantics of the context caused by intermediate token removal, especially under high compression ratios, while also facing challenges in computational efficiency. In this work, we propose context-aware prompt compression (CPC), a sentencelevel prompt compression technique where its key innovation is a novel context-aware sentence encoder that provides a relevance score for each sentence for a given question. To train this encoder, we generate a new dataset consisting of questions, positives, and negative pairs where positives are sentences relevant to the question, while negatives are irrelevant context sentences. We train the encoder in a contrastive setup to learn context-aware sentence representations. Our method considerably outperforms prior works on prompt compression on benchmark datasets and is up to 10.93× faster at inference compared to the best token-level compression method. We also find better improvement for shorter length constraints in most benchmarks, showing the effectiveness of our proposed solution in the compression of relevant information in a shorter context. Finally, we release the code and the dataset for quick reproducibility and further development: https://github.com/Workday/cpc .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 14 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Read As Human: Compressing Context via Parallelizable Close Reading and Skimming 引用了 RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective Augmentation
- Read As Human: Compressing Context via Parallelizable Close Reading and Skimming 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective Augmentation 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- A Survey on In-context Learning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- What Makes a Good Natural Language Prompt? 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- LightMem: Lightweight and Efficient Memory-Augmented Generation 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- COMI: Coarse-to-fine Context Compression via Marginal Information Gain 引用了 RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective Augmentation
- COMI: Coarse-to-fine Context Compression via Marginal Information Gain 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
引用它的顶会 Paper14
- LightMem: Lightweight and Efficient Memory-Augmented GenerationJizhan Fang, Xinle Deng, Haoming Xu, Ziyan Jiang 等ICLR 2026 · 162 次引用
- COMI: Coarse-to-fine Context Compression via Marginal Information GainJiwei Tang, Shilei Liu, Zhicheng Zhang, Yujin Yuan 等ICLR 2026 · 17 次引用
- Efficient Prompt Compression with Evaluator Heads for Long-Context Transformer InferenceWeizhi Fei, Xueyan Niu, Guoqing Xie, Yingqing Liu 等NeurIPS 2025 · 14 次引用
- What Makes a Good Natural Language Prompt?Do Xuan Long, Duy Dinh, Ngoc-Hai Nguyen, Kenji Kawaguchi 等ACL 2025 · 13 次引用
- Read As Human: Compressing Context via Parallelizable Close Reading and SkimmingJiwei Tang, Shilei Liu, Zhicheng Zhang, Qingsong Lv 等ACL 2026 · 10 次引用
它引用的 Paper17
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu 等ICLR 2022 · 18,833 次引用
- A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng 等EMNLP 2024 · 479 次引用
- RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective AugmentationFangyuan Xu, Weijia Shi, Eunsol ChoiICLR 2024 · 260 次引用
相关 Paper
- Leveraging Attention to Effectively Compress Prompts for Long-Context LLMsYunlong Zhao, Haoran Wu, Bo XuAAAI 2025 · 10 次引用
- TACO-RL: Task Aware Prompt Compression Optimization with Reinforcement LearningShivam Shandilya, Menglin Xia, Supriyo Ghosh, Huiqiang Jiang 等ACL Findings 2025 · 9 次引用
- GMSA: Enhancing Context Compression via Group Merging and Layer Semantic AlignmentJiwei Tang, Zhicheng Zhang, Shunlong Wu, Jingheng Ye 等ACL 2026 · 24 次引用
- 500xCompressor: Generalized Prompt Compression for Large Language ModelsZongqian Li, Yixuan Su, Nigel CollierACL 2025 · 35 次引用
- From Reading to Compressing: Exploring the Multi-document Reader for Prompt CompressionEunseong Choi, Sunkyung Lee, Minjin Choi, June Park 等EMNLP Findings 2024
