On the Effectiveness of Context Compression for Repository-Level Tasks: An Empirical Investigation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Feng, Jia, Qin, Zhanyue, Gao, Cuiyun, Wang, Ruiqi, Wang, Chaozheng, Ma, Yingwei, Xie, Xiaoyuan
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911595266834432
author Feng, Jia
Qin, Zhanyue
Gao, Cuiyun
Wang, Ruiqi
Wang, Chaozheng
Ma, Yingwei
Xie, Xiaoyuan
author_facet Feng, Jia
Qin, Zhanyue
Gao, Cuiyun
Wang, Ruiqi
Wang, Chaozheng
Ma, Yingwei
Xie, Xiaoyuan
contents 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, indicating they filter noise rather than just truncating. On efficiency, all paradigms reduce inference cost. Both visual and text-based compression achieve up to 50% reduction in end-to-end latency at high ratios, approaching the cost of inference without repository context. These findings establish context compression as a viable approach and provide guidance for paradigm selection.
format Preprint
id arxiv_https___arxiv_org_abs_2604_13725
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle On the Effectiveness of Context Compression for Repository-Level Tasks: An Empirical Investigation
Feng, Jia
Qin, Zhanyue
Gao, Cuiyun
Wang, Ruiqi
Wang, Chaozheng
Ma, Yingwei
Xie, Xiaoyuan
Software Engineering
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, indicating they filter noise rather than just truncating. On efficiency, all paradigms reduce inference cost. Both visual and text-based compression achieve up to 50% reduction in end-to-end latency at high ratios, approaching the cost of inference without repository context. These findings establish context compression as a viable approach and provide guidance for paradigm selection.
title On the Effectiveness of Context Compression for Repository-Level Tasks: An Empirical Investigation
topic Software Engineering
url https://arxiv.org/abs/2604.13725