Large Language Models (LLMs) have demonstrated impressive capabilities in code completion tasks, where they assist developers by predicting and generating new code in real-time. However, existing LLM-based code completion systems primarily rely on the immediate context of the file being edited, often missing valuable repository-level information, user behaviour and edit history that could improve suggestion accuracy. Additionally, challenges such as efficiently retrieving relevant code snippets from large repositories, incorporating user behavior, and balancing accuracy with low-latency requirements in production environments remain unresolved. In this paper, we propose ContextModule, a framework designed to enhance LLM-based code completion by retrieving and integrating three types of contextual information from the repository: user behavior-based code, similar code snippets, and critical symbol definitions. By capturing user interactions across files and leveraging repository-wide static analysis, ContextModule improves the relevance and precision of generated code. We implement performance optimizations, such as index caching, to ensure the system meets the latency constraints of real-world coding environments. Experimental results and industrial practise demonstrate that ContextModule significantly improves code completion accuracy and user acceptance rates.
Beyond Function-Level Search: Repository-Aware Dual-Encoder Code Retrieval with Adversarial Verification
International Digital Economy Academy (IDEA)(国际数字经济学院);School of Electronic and Computer Engineering, Peking University(电子与计算机工程学院,北京大学);Shenzhen International Graduate School, Tsinghua University(深圳国际研究生院,清华大学)
Beyond Repository Boundaries: Cross-Repository Graph Retrieval for Code Generation
Quantum AI & Cyber Security Institute, FPT Corporation(量子人工智能与网络安全研究所,FPT公司);Hanoi University of Science and Technology(河内科学技术大学);Rutgers University(罗格斯大学);The University of Melbourne(墨尔本大学);Center for AI Research, VinUniversity(VinUniversity人工智能研究中心)
Measuring the State of Open Science in Transportation Using Large Language Models
Massachusetts Institute of Technology(麻省理工学院);Vanderbilt University(范德比大学);Portland State University(波特兰州立大学);Delft University of Technology(代尔夫特理工大学);Brigham Young University(Brigham Young 大学)
Contextualized Code Pretraining for Code Generation
Key Lab of HCST (PKU), MOE(高性能计算技术教育部重点实验室;计算机科学与技术学院,北京大学);SCS, Peking University(计算机科学与技术的学院,北京航空航天大学);School of Computer Science & Technology, Beihang University(空间信息集成系统国家重点实验室,中国科学院软件研究所);National Key Laboratory of Space Integrated Information System, Institute of Software Chinese Academy of Sciences(互联网信息协同深圳市重点实验室,哈尔滨工业大学(深圳));Shenzhen Key Laboratory of Internet Information Collaboration, Harbin Institute of Technology, Shenzhen
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(国家电网华东工程有限公司)