Code completion plays a prominent role in modern integrated development environments (IDEs). Machine learning has become ubiquitous in analogous natural language writing and search software, surfacing more relevant autocompletions and search suggestions in fewer keystrokes. Prior research has reported training high-accuracy, deep neural networks for modeling source code, but little attention has been given to the practical constraints imposed by interactive developer tools. In particular, neural language models for source code modeling like the one described in Maybe Deep Neural Networks are the Best Choice for Modeling Source Code are framed around code completion, but only report accuracy of next-token prediction. However, in order for a language model (LM) to work well within real-world code completion systems, it must also always make suggestions that produce valid code that typechecks to support code completion's role in correctness-checking; return instantaneous results to help programmers code more efficiently in fewer keystrokes; and be small enough to fit comfortably on disk and in memory on developer workstations, since virtually all modern IDEs run locally and support offline usage. To meet these additional requirements, we propose a novel design for predicting top-k next tokens that combines static analysis' ability to enumerate all valid keywords and in-scope identifiers with the ability of a language model to place a probability distribution over them. Our model mixes character-level input representation with token output to represent out-of-vocabulary (OOV) tokens meaningfully and minimize prediction latency. OOV tokens can be predicted through detection of local repetition common in software. This design achieves state-of-art accuracy in source code modeling and fits the constraints imposed by real-world code completion implementations in modern IDEs.
Comparative Analysis of Large Language Models for Context-Aware Code Completion using SAFIM Framework
University of California San Diego(加利福尼亚大学圣迭戈分校);Simon Fraser University(西蒙菲莎大学);Duke University(杜克大学);University of Amsterdam(阿姆斯特丹大学);Johns Hopkins University(约翰斯·霍普金斯大学)
When Neural Code Completion Models Size up the Situation: Attaining Cheaper and Faster Completion through Dynamic Model Inference
Beihang University(北京航空航天大学);Monash University(莫纳什大学);State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所计算机科学国家重点实验室);University of Chinese Academy of Sciences(中国科学院大学);Nanjing Institute of Software Technology(南京软件技术研究所);National University of Defense Technology(国防科技大学);Yunnan Key Laboratory of Software Engineering(云南省软件工程重点实验室)
Teaching LLMs a Low-Resource Language: Enhancing Code Completion in Pharo
Graz University of Technology(格拉茨工业大学);Software Institute – USI(软件研究所 - 瑞士意大利大学);Università della Svizzera italiana(瑞士意大利大学);Univ. Lille, Inria, CNRS, Centrale Lille and Lifeware SA(里尔大学、法国国家信息与自动化研究院、法国国家科学研究中心、里尔中央理工学院和Lifeware公司);CIRAD(法国农业研究国际中心);CNRS, University of Bordeaux(法国国家科学研究中心、波尔多大学);Bordeaux INP, LaBRI, UMR5800(波尔多理工学院、拉布里实验室)
Don't Complete It! Preventing Unhelpful Code Completion for Productive and Sustainable Neural Code Completion Systems
Singapore Management University(新加坡管理大学);Monash University(莫纳什大学);Key Laboratory of System Software (Chinese Academy of Sciences)(中国科学院系统软件重点实验室);State Key Laboratory of Computer Science(计算机科学国家重点实验室);Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);Nanjing Institute of Software Technology(南京软件技术学院);National University of Defense Technology(国防科技大学);University of Technology Sydney(悉尼科技大学);Beihang University(北京航空航天大学)