← 研踪 PaperTrailACL Anthology · ACL 2026:acl:2026.acl-short.64 · 记录 #1
Late Code Chunking: A Code Chunking Strategy for Repository-Level Code Completion
来源日期(仅到月份) 2026-07
来源记录日期 2026-07
雷达观测 2026-11-01 21:44
摘要
This paper introduces Late Code Chunking (LC^2), a chunking strategy designed to improve the semantic understanding of code segments for Large Language Models (LLMs). Repository-level code completion requires predicting the completion of unfinished code by leveraging cross-file context spread across a repository. However, when retrieved fragments have missing semantics—the loss of structural or behavioral information during chunking—LLMs struggle to interpret the target code. To address this, LC^2 refines retrieved chunks by constructing a dual context: a “Code Retrieval Context” optimized for similarity-based search, and a “Code Comprehension Context” that serves as a late enrichment step through context expansion and augmentation. This dual-context design reduces information loss due to chunking and enhances the ability of LLMs to utilize retrieved code. Additionally, we introduce an Asymmetric Query-Chunk Sizing strategy to further optimize retrieval quality by minimizing query noise. Our experiments demonstrate that LC^2 provides robust performance gains, achieving a statistically significant 19.7% improvement in Exact Match accuracy on the CrossCodeEval benchmark compared to the best existing chunking method.
论文发现出处
这些页面提供论文线索,不代表同行评审或质量认证。
观测到的版本
平台记录号代表本站观测到的元数据变化,不是作者修订号。来源日期仅到月份或年份时,按该月或该年首日存档。
记录 #1 · 2026-07 · 最新观测版本
Late Code Chunking: A Code Chunking Strategy for Repository-Level Code Completion
This paper introduces Late Code Chunking (LC^2), a chunking strategy designed to improve the semantic understanding of code segments for Large Language Models (LLMs). Repository-level code completion requires predicting the completion of unfinished code by leveraging cross-file context spread across a repository. However, when retrieved fragments have missing semantics—the loss of structural or behavioral information during chunking—LLMs struggle to interpret the target code. To address this, LC^2 refines retrieved chunks by constructing a dual context: a “Code Retrieval Context” optimized for similarity-based search, and a “Code Comprehension Context” that serves as a late enrichment step through context expansion and augmentation. This dual-context design reduces information loss due to chunking and enhances the ability of LLMs to utilize retrieved code. Additionally, we introduce an Asymmetric Query-Chunk Sizing strategy to further optimize retrieval quality by minimizing query noise. Our experiments demonstrate that LC^2 provides robust performance gains, achieving a statistically significant 19.7% improvement in Exact Match accuracy on the CrossCodeEval benchmark compared to the best existing chunking method.
查看此版本解读 →查看此版本原文 ↗