On the Effectiveness of Context Compression for Repository-Level Tasks: An Empirical Investigation
Jia Feng, Zhanyue Qin, Cuiyun Gao, Ruiqi Wang, Chaozheng Wang, Yingwei Ma, and Xiaoyuan Xie

TL;DR
This empirical study demonstrates that context compression methods significantly improve code completion and generation tasks by reducing noise and latency, with some methods outperforming full-context models.
Contribution
First systematic evaluation of context compression techniques for repository-level code tasks, comparing three paradigms and providing practical insights.
Findings
Continuous latent vector methods outperform full-context models at 4x compression.
All paradigms reduce inference costs, with visual and text-based methods cutting latency by up to 50%.
Context compression filters noise and enhances efficiency in code intelligence tasks.
Abstract
Repository-level code intelligence tasks require large language models (LLMs) to process long, multi-file contexts. Such inputs introduce three challenges: crucial context can be obscured by noise, truncated due to limited windows, and increased inference latency. Context compression mitigates these risks by condensing inputs. While studied in NLP, its applicability to code tasks remains largely unexplored. We present the first systematic empirical study of context compression for repository-level code intelligence, organizing eight methods into three paradigms: discrete token sequences, continuous latent vectors, and visual tokens. We evaluate them on code completion and generation, measuring performance and efficiency. Results show context compression is effective: at 4x compression, continuous latent vector methods surpass full-context performance by up to 28.3% in BLEU score,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
