arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2003.11768cs.LGcs.AIcs.SEstat.ML
收藏

使用元学习的源代码模型即时适应

On-the-Fly Adaptation of Source Code Models using Meta-Learning

Disha Shrivastava, Hugo Larochelle, Daniel Tarlow

AI总结:

本文提出将源代码模型适应视为元学习问题,训练基础模型利用文件内支持标记预测缺失标记,在行级维护任务上优于动态评估等基线,标识符和字面量性能分别提升44%和15%。

摘要:

适应未见过的局部上下文的能力是成功的源代码模型必须克服的重要挑战。此类模型适应最流行的方法之一是动态评估。使用动态评估时,当模型在未见过的文件上运行时,模型会在观察到该文件中每个标记后立即更新。在这项工作中,我们提出将上下文适应问题框架为元学习问题。我们的目标是训练一个基础源代码模型,该模型能够最好地从文件中的信息中学习,以改进对缺失标记的预测。与动态评估不同,这种表述允许我们选择更有针对性的信息(支持标记)进行适应,这些信息既可以在文件中目标空洞之前,也可以在其之后。我们考虑一种称为行级维护的评估设置,旨在反映IDE中代码自动补全的下游任务。利用元学习的最新进展,如一阶MAML和Reptile,我们在大规模Java GitHub语料库上的实验中,与其他适应基线(包括动态评估)相比,展示了改进的性能。此外,我们的分析表明,与非适应基线相比,我们的方法在标识符和字面量上的性能分别提高了44%和15%。

英文摘要:

The ability to adapt to unseen, local contexts is an important challenge that successful models of source code must overcome. One of the most popular approaches for the adaptation of such models is dynamic evaluation. With dynamic evaluation, when running a model on an unseen file, the model is updated immediately after having observed each token in that file. In this work, we propose instead to frame the problem of context adaptation as a meta-learning problem. We aim to train a base source code model that is best able to learn from information in a file to deliver improved predictions of missing tokens. Unlike dynamic evaluation, this formulation allows us to select more targeted information (support tokens) for adaptation, that is both before and after a target hole in a file. We consider an evaluation setting that we call line-level maintenance, designed to reflect the downstream task of code auto-completion in an IDE. Leveraging recent developments in meta-learning such as first-order MAML and Reptile, we demonstrate improved performance in experiments on a large scale Java GitHub corpus, compared to other adaptation baselines including dynamic evaluation. Moreover, our analysis shows that, compared to a non-adaptive baseline, our approach improves performance on identifiers and literals by 44\% and 15\%, respectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑