Code completion has become an essential component of integrated development environments. Contemporary code completion methods rely on the abstract syntax tree (AST) to generate syntactically correct code. However, they cannot fully capture the sequential and repetitive patterns of writing code and the structural information of the AST. To alleviate these problems, we propose a new code completion approach named CCAG, which models the flattened sequence of a partial AST as an AST graph. CCAG uses our proposed AST Graph Attention Block to capture different dependencies in the AST graph for representation learning in code completion. The sub-tasks of code completion are optimized via multi-task learning in CCAG, and the task balance is automatically achieved using uncertainty without the need to tune task weights. The experimental results show that CCAG has superior performance than state-of-the-art approaches and it is able to provide intelligent code completion.
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(约翰斯·霍普金斯大学)
What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Code
National Engineering Research Center for Big Data Technology and System, Services Computing Technology and System Lab, Cluster and Grid Computing Lab, HUST(华中科技大学(HUST)大数据技术与系统国家工程研究中心、服务计算技术与系统实验室、集群与网格计算实验室);School of Computer Science and Technology, Huazhong University of Science and Technology(华中科技大学计算机科学与技术学院);University of Newcastle(纽卡斯尔大学);School of Computer Science, University of Technology Sydney(悉尼科技大学计算机学院)
在本文中,我们提出了一种新的端到端的AI辅助代码完成方法,称为Pythia。它生成方法和API建议的排名列表,可供软件开发人员在编辑时使用。该系统目前部署为Visual Studio Code IDE中Intellicode扩展的一部分。Pythia利用了最先进的大规模深度学习模型,这些模型是在从抽象语法树中提取的代码上下文上训练的。它被设计为在高吞吐量下工作,预测100个$ms$数量级的最佳匹配代码完成。我们描述了该系统的架构,执行比较基于频率的方法和基于调用的马尔可夫链语言模型,并讨论了轻量级客户端设备上的Pythia模型服务的挑战。在2700个Python开源软件GitHub存储库上获得的离线评估结果显示,对于项目内和跨项目设置,前5名的准确率为92%,超过基线模型20%。
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(波尔多理工学院、拉布里实验室)
Corrigendum and Supplement to "Improve Language Modelling for Code Completion through Learning General Token Repetition of Source Code (with Optimized Memory)"