ACL Findings2026
CODEPROMPTZIP: Code-specific Prompt Compression for Retrieval-Augmented Generation in Coding Tasks with LMs
Pengfei He, Shaowei Wang, Tse-Hsun Chen
摘要
Retrieval-Augmented Generation (RAG) enhances coding tasks by incorporating retrieved code examples into prompts. However, lengthy prompts-often exceeding tens of thousands of tokens-introduce challenges related to limited context windows of language models (LMs) and high computational costs. Existing prompt compression techniques focus on natural language, lacking tailored solutions for code. To address the gap, we propose CODE-PROMPTZIP, a framework that compresses code examples before integrating into RAG workflows. Our framework employs a typeaware, priority-driven strategy to construct training samples for training code compression model. By using program analysis, we identify token types (e.g., Identifier) and perform ablation analysis to rank their removal priorities based on their impact on task performance. We then train a small LM as the compressor on these samples, enabling flexible compression conditioned on specified ratios while minimizing performance degradation. Specially, the compressor's architecture is augmented with a copy mechanism, allowing tokens to be directly copied from the original code snippets. Evaluation results show that CODEPROMPTZIP surpasses SOTA entropy-based and distillationbased baselines, improving by 23.4%, 28.7%, and 8.7% over the best baseline for Assertion Generation, Bugs2Fix, and Code Suggestion, respectively.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective Augmentation 引用了 Learning to Compress Prompts with Gist Tokens
- RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective Augmentation 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- What Makes In-Context Examples Effective for Code Generation? 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- What Makes In-Context Examples Effective for Code Generation? 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
引用它的顶会 Paper1
它引用的 Paper11
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
- Learning to Compress Prompts with Gist TokensJesse Mu, Xiang Li, Noah D. GoodmanNeurIPS 2023 · 488 次引用
- RECOMP: Improving Retrieval-Augmented LMs with Context Compression and Selective AugmentationFangyuan Xu, Weijia Shi, Eunsol ChoiICLR 2024 · 260 次引用
- Retrieval-Based Prompt Selection for Code-Related Few-Shot LearningNoor Nashid, Mifta Sintaha, Ali MesbahICSE 2023 · 156 次引用
相关 Paper
- Less Is More: Elevating RAG via Performance-Driven Context CompressionZiqiang Cui, Yunpeng Weng, Xing Tang, Peiyang Liu 等ICML 2026
- LongCodeZip: Compress Long Context for Code Language ModelsYuling Shi, Yichun Qian, Hongyu Zhang, Beijun Shen 等ASE 2025
- SRACG: A Code Generation Framework with Selective Retrieval AugmentationMengzhen Wang, Shukai Ma, Songwen Gong, Jiexin Wang 等AAAI 2026
- Symbolic Prompt Program Search: A Structure-Aware Approach to Efficient Compile-Time Prompt OptimizationTobias Schnabel, Jennifer NevilleEMNLP Findings 2024 · 7 次引用
- Example Quality Matters: Multi-Aspects Example Augmentation for Private Library ProgrammingYuhao Li, Haifeng Sun, Xuesong Zhang, Shu Yao 等ACL 2026
