论文标题

部分可观测时空混沌系统的无模型预测

When Language Model Meets Private Library

论文作者

Zan, Daoguang, Chen, Bei, Lin, Zeqi, Guan, Bei, Wang, Yongji, Lou, Jian-Guang

论文摘要

随着预训练技术的快速发展,许多语言模型已在大规模代码语料库中进行了预先培训,并且在代码生成方面表现良好。在本文中,我们调查了如何为预训练的语言模型配备私人库代码生成的能力。实际上,程序员使用私人库编写代码很常见。但是,对于语言模型来说,这是一个挑战,因为他们在培训过程中从未见过私人API。在私人库通常带有精心设计的API文档的事实中,我们提出了一个具有两个模块的新型框架:ApiRetriever找到有用的API,然后使用这些API生成代码。对于ApiRetriever,我们提出了一个密集的检索系统,还设计了涉及用途的友好互动。对于Apicoder,我们可以直接使用现成的语言模型,也可以在包含API信息的代码语料库上不断预培养基本模型。这两个模块均经过来自公共图书馆的数据培训,可以推广到私人图书馆。此外,我们为私人图书馆制作了三个基准,名为Torchdataeval,Monkeyeval和Beatnumeval。实验结果证明了我们框架的令人印象深刻的表现。

With the rapid development of pre-training techniques, a number of language models have been pre-trained on large-scale code corpora and perform well in code generation. In this paper, we investigate how to equip pre-trained language models with the ability of code generation for private libraries. In practice, it is common for programmers to write code using private libraries. However, this is a challenge for language models since they have never seen private APIs during training. Motivated by the fact that private libraries usually come with elaborate API documentation, we propose a novel framework with two modules: the APIRetriever finds useful APIs, and then the APICoder generates code using these APIs. For APIRetriever, we present a dense retrieval system and also design a friendly interaction to involve uses. For APICoder, we can directly use off-the-shelf language models, or continually pre-train the base model on a code corpus containing API information. Both modules are trained with data from public libraries and can be generalized to private ones. Furthermore, we craft three benchmarks for private libraries, named TorchDataEval, MonkeyEval, and BeatNumEval. Experimental results demonstrate the impressive performance of our framework.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源