一种用于多任务学习的代码完成的自注意神经结构
A Self-Attentional Neural Architecture for Code Completion with Multi-Task Learning
摘要:
代码完成是集成开发环境(IDE)中最有用的功能之一,可以通过实时建议库、API和方法名称来加速软件开发。最近的研究表明,统计语言模型可以提高代码完成工具的性能,通过学习大规模的软件仓库。然而,这些模型有三个主要缺点:a)程序的层次结构信息在程序的表示中没有得到充分利用; b)在程序中,语义关系可能很长。现有的基于递归神经网络的语言模型不足以对长期依赖进行建模。c)现有的方法在一个模型中执行特定的任务,这导致对来自相关任务的信息的利用不足。为了解决这些挑战,在本文中,我们提出了一个自我注意的神经架构,用于多任务学习的代码完成。为了充分利用程序的层次结构信息,提出了一种新的方法,该方法考虑了从预测节点到根结点的路径。为了捕捉输入程序中的长期依赖性,我们采用了基于自注意结构的网络作为基本语言模型。为了实现相关任务之间的知识共享,我们创造性地提出了一个多任务学习(MTL)框架,以共同学习代码完成中的两个相关任务。三个真实世界的数据集上的实验证明了我们的模型的有效性相比,国家的最先进的方法。
英文摘要:
Code completion, one of the most useful features in the Integrated Development Environments (IDEs), can accelerate software development by suggesting the libraries, APIs, and method names in real-time. Recent studies have shown that statistical language models can improve the performance of code completion tools through learning from large-scale software repositories. However, these models suffer from three major drawbacks: a) The hierarchical structural information of the programs is not fully utilized in the program's representation; b) In programs, the semantic relationships can be very long. Existing recurrent neural networks based language models are not sufficient to model the long-term dependency. c) Existing approaches perform a specific task in one model, which leads to the underuse of the information from related tasks. To address these challenges, in this paper, we propose a self-attentional neural architecture for code completion with multi-task learning. To utilize the hierarchical structural information of the programs, we present a novel method that considers the path from the predicting node to the root node. To capture the long-term dependency in the input programs, we adopt a self-attentional architecture based network as the base language model. To enable the knowledge sharing between related tasks, we creatively propose a Multi-Task Learning (MTL) framework to learn two related tasks in code completion jointly. Experiments on three real-world datasets demonstrate the effectiveness of our model when compared with state-of-the-art methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。