论文标题
零击计划表示学习
Zero-Shot Program Representation Learning
论文作者
论文摘要
学习程序表示形式一直是代码智能任务的核心先决条件,例如代码搜索和代码克隆检测。诸如Codebert之类的最先进的预培训模型需要大规模代码语料库的可用性。但是,收集培训样品对于特定于智能合约的固体性语言而言可能是昂贵且不可行的。在本文中,我们提出了Zecoler,这是一种用于代码表示的零击学习方法。 Zecoler建立在预先训练的编程语言模型的基础上。为了有效地从预训练的模型中获取知识,Zecoler通过将可训练的提示插入原始输入中,将下游任务施加到相同形式的预训练任务中。然后,它采用及时的学习技术,该技术仅通过调整原始输入来优化预训练的模型。这使表示模型能够有效地拟合面向任务的稀缺数据,同时重用预训练的知识。我们用两种没有培训样本的程序语言中的三个代码智能任务评估Zecoler,即固体和GO,并通过使用Java等通用语言的语料库进行了培训的模型。实验结果表明,我们的方法在零拍和很少的设置中都显着优于基线模型。
Learning program representations has been the core prerequisite of code intelligent tasks such as code search and code clone detection. The state-of-the-art pre-trained models such as CodeBERT require the availability of large-scale code corpora. However, gathering training samples can be costly and infeasible for domain-specific languages such as Solidity for smart contracts. In this paper, we propose Zecoler, a zero-shot learning approach for code representations. Zecoler is built upon a pre-trained programming language model. In order to elicit knowledge from the pre-trained models efficiently, Zecoler casts the downstream tasks to the same form of pre-training tasks by inserting trainable prompts into the original input. Then, it employs the prompt learning technique which optimizes the pre-trained model by merely adjusting the original input. This enables the representation model to efficiently fit the scarce task-oriented data while reusing pre-trained knowledge. We evaluate Zecoler in three code intelligent tasks in two program languages that have no training samples, namely, Solidity and Go, with model trained in corpora of common languages such as Java. Experimental results show that our approach significantly outperforms baseline models in both zero-shot and few-shot settings.