paper-with-me

홈 › Papers

LongCodeZip: Compress Long Context for Code Language Models

2025-10-01 · Yuling Shi, Yichun Qian, Hongyu Zhang, Beijun Shen, Xiaodong Gu arxiv

Code generation under long contexts is becoming increasingly critical as Large Language Models (LLMs) are required to reason over extensive information in the codebase. While recent advances enable code LLMs to process long inputs, high API costs and generation latency remain substantial bottlenecks. Existing context pruning techniques, such as LLMLingua, achieve promising results for general text but overlook code-specific structures and dependencies, leading to suboptimal performance in programming tasks. In this paper, we propose LongCodeZip, a novel plug-and-play code compression framework designed specifically for code LLMs. LongCodeZip employs a dual-stage strategy: (1) coarse-grained compression, which identifies and ranks function-level chunks using conditional perplexity with respect to the instruction, retaining only the most relevant functions; and (2) fine-grained compression, which segments retained functions into blocks based on perplexity and selects an optimal subset under an adaptive token budget to maximize relevance. Evaluations across multiple tasks, including code completion, summarization, and question answering, show that LongCodeZip consistently outperforms baseline methods, achieving up to a 5.6x compression ratio without degrading task performance. By effectively reducing context size while preserving essential information, LongCodeZip enables LLMs to better scale to real-world, large-scale code scenarios, advancing the efficiency and capability of code intelligence applications.

📄 PDF Abstract BibTeX arXiv:2510.00446

Code (0)

등록된 구현이 없습니다.

Tasks

Question AnsweringCode GenerationCode Completion

Similar Papers 제목 키워드 기반

Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compression

2026-01-31 · Jianping Zhong, Guochang Li, Chen Zhi, Junxiao Han 외 arxiv

Large Language Models (LLMs) struggle with long-context code due to window limitations. Existing textual code compression methods mitigate this via selective filtering but often disrupt dependency closure, causing semant…

Question AnsweringCode Completion

End-to-End Context Compression at Scale

2026-06-08 · Ang Li, Sean McLeish, Haozhe Chen, Nimit Kalra 외 arxiv

Long-context language model inference is bottlenecked by memory, as the KV cache grows with context length. Recent techniques to compress the KV cache fall short: they either degrade model quality substantially or requir…

Speech Token Prediction via Compressed-to-fine Language Modeling for Speech Generation

2025-05-30 · Wenrui Liu, Qian Chen, Wen Wang, Yafeng Chen 외

Neural audio codecs, used as speech tokenizers, have demonstrated remarkable potential in the field of speech generation. However, to ensure high-fidelity audio reconstruction, neural audio codecs typically encode audio …

Language ModelingLanguage Modellingtext-to-speechText to Speech

LatentPress: Context Compression Beyond Text and Vision

2026-09-01 · Zhengze Zhou, Hejian Sang hf

Compressed context is usually carried as human-readable text or as rendered images that must be decoded, even when its consumer is a language model. We introduce LatentPress, which writes conversational histories and lon…

Text Summarization

Large Language Model as Token Compressor and Decompressor

2026-03-26 · Wenbing Li, Yiran Wang, Zikai Song, Jielei Zhang 외 arxiv

In this paper, we study whether an off-the-shelf LLM can be adapted into a discrete, variable-length token compressor and decompressor for long-context processing. To this end, we design a self-expressive autoencoding fr…