跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 计算与语言

arXiv:2510.00446 (cs)
[提交于 2025年10月1日]

标题:LongCodeZip: Compress Long Context for Code Language Models

作者:Yuling Shi, Yichun Qian, Hongyu Zhang, Beijun Shen, Xiaodong Gu
查看论文《LongCodeZip: Compress Long Context for Code Language Models》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要: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.
评论: Accepted to ASE 2025. Code available at https://github.com/YerbaPage/LongCodeZip
主题: 计算与语言 (cs.CL); 软件工程 (cs.SE)
引用方式: arXiv:2510.00446 [cs.CL]
  (或者 arXiv:2510.00446v1 [cs.CL] 对于此版本)
  https://doi.org/10.48550/arXiv.2510.00446

提交历史

来自:Yuling Shi
[v1] 2025年10月1日 星期三 02:54:57 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.CL
< 上一篇   |   下一篇 >
最新 | 近期 | 2025-10
切换浏览方式为:
cs
cs.SE

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站