Zero-Shot程序表示学习
Zero-Shot Program Representation Learning
摘要:
学习程序表示已经成为代码智能任务(如代码搜索和代码克隆检测)的核心先决条件。CodeBERT等最先进的预训练模型需要大规模代码语料库的可用性。然而,收集训练样本对于特定领域的语言(如智能合约的Solidity)来说可能是昂贵的,也是不可行的。在本文中,我们提出了Zecloud,一个零样本学习方法的代码表示。Zecloud是建立在一个预先训练好的程序设计语言模型之上的。为了有效地从预训练的模型中获取知识,Zeclord通过将可训练的提示插入原始输入,将下游任务转换为相同形式的预训练任务。然后,它采用快速学习技术,通过调整原始输入优化预训练模型。这使得表示模型能够有效地适应稀缺的面向任务的数据,同时重用预先训练的知识。我们在两种没有训练样本的程序语言(即Solidity和Go)中的三个代码智能任务中评估了Zeclash,并在Java等常见语言的语料库中训练了模型。实验结果表明,我们的方法显着优于基线模型在zero-shot和Few-Shot设置。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。