While pre-trained language models (LM) for code have achieved great success in code completion, they generate code conditioned only on the contents within the file, i.e., in-file context, but ignore the rich semantics in other files within the same project, i.e., cross-file context, a critical source of information that is especially useful in modern modular software development. Such overlooking constrains code language models' capacity in code completion, leading to unexpected behaviors such as generating hallucinated class member functions or function calls with unexpected arguments. In this work, we develop a cross-file context finder tool, CCFINDER, that effectively locates and retrieves the most relevant cross-file context. We propose CoCoMIC, a framework that incorporates cross-file context to learn the in-file and cross-file context jointly on top of pretrained code LMs. CoCoMIC successfully improves the existing code LM with a 33.94% relative increase in exact match and a 28.69% relative increase in identifier matching for code completion when the cross-file context is provided.
Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);University of Chinese Academy of Sciences(中国科学院大学);The University of Sydney(悉尼大学);University of California, Irvine(加州大学欧文分校);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所)
Enhancing Project-Specific Code Completion by Inferring Internal API Information
State Key Laboratory of Blockchain and Data Security, Zhejiang University(区块链与数据安全国家重点实验室,浙江大学);Ant Group(蚂蚁集团);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算机与信息系)
针对项目代码补全中内部 API 未显式导入的问题,提出基于使用示例与语义描述推断 API 信息并构建知识库的方法,同时发布 ProjBench,实验显著提升补全性能。
Alibaba Group(阿里巴巴集团);University of Science and Technology of China(中国科学技术大学);University of Chinese Academy of Sciences(中国科学院大学);Shanghai Jiao Tong University(上海交通大学)
Enhancing Knowledge Density via Hierarchical Context Pruning for Retrieval-Augmented Repository-Level Code Completion
MIIT Key Laboratory of Pattern Analysis and Machine Intelligence(信息科技模式分析与机器智能国家重点实验室);College of Computer Science and Technology(计算机科学与技术学院);Huaneng Information Technology Co Ltd(华能信息技术有限公司);Hunan Vanguard Group Corporation Co Ltd(湖南 Vanguard集团有限公司);Tsinghua University(清华大学);Zhejiang University(浙江大学);PowerChina Huadong Engineering Co Ltd(国家电网华东工程有限公司)
FEA-Bench: A Benchmark for Evaluating Repository-Level Code Generation for Feature Implementation
State Key Laboratory of Multimedia Information Processing, School of Computer Science, Peking University(信息处理国家重点实验室,计算机学院,北京大学);Microsoft Research Asia(微软亚洲研究院)
Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completion
Nanjing University(南京大学);State Key Laboratory for Novel Software Technology, Nanjing University(南京大学计算机软件新技术国家重点实验室);National Institute of Healthcare Data Science, Nanjing University(南京大学国家卫生数据科学研究院)
SWE-MISBEHAVIOR: Benchmarking and Mitigating Boundary Violations in Software Coding Agents
National University of Singapore(新加坡国立大学);Vietnam National University, Hanoi(越南国家大学河内);University of Virginia, USA(弗吉尼亚大学);Agency for Science, Technology and Research (A*STAR), Singapore(新加坡科技研究局);Tufts University, USA(塔夫茨大学);Virginia Tech, USA(弗吉尼亚理工大学);Salesforce AI Research, USA(Salesforce AI 研究)