论文标题

评估代码克隆检测的几个射击和对比度学习方法

Evaluating few shot and Contrastive learning Methods for Code Clone Detection

论文作者

Khajezade, Mohamad, Fard, Fatemeh Hendijani, Shehata, Mohamed S.

论文摘要

上下文:代码克隆检测(CCD)是一项软件工程任务,用于窃检测,代码搜索和代码理解。最近,基于深度学习的模型已在codexglue基准中获得了$ \ sim $ 95 \%的F1分数(用于评估分类器的度量)。这些模型需要许多培训数据,主要在Java或C ++数据集上进行了微调。但是,以前没有研究评估这些模型可用的这些模型的普遍性。 目的:这项研究的主要目的是评估CCD模型的能力以及对于看不见的编程问题和新语言的射击学习算法(即,该模型未接受这些问题/语言的培训)。 方法:我们通过设置三种情况来评估CCD最先进的CCD状态模型的普遍性(即,只有少数样本可用于微调):i)看不见的问题,ii)ii)看不见的语言,iii)组合,结合了新语言和新问题。我们选择三个数据集的BigCloneBench,POJ-104,Codenet和Java,C ++和Ruby语言。然后,我们采用模型不可知的元学习(MAML),该模型在其中学习了能够从火车组中提取可转移知识的元学习者;因此,可以使用一些样品对模型进行微调。最后,我们将对比度学习与MAML结合在一起,以进一步研究它是否可以改善MAML的结果。

Context: Code Clone Detection (CCD) is a software engineering task that is used for plagiarism detection, code search, and code comprehension. Recently, deep learning-based models have achieved an F1 score (a metric used to assess classifiers) of $\sim$95\% on the CodeXGLUE benchmark. These models require many training data, mainly fine-tuned on Java or C++ datasets. However, no previous study evaluates the generalizability of these models where a limited amount of annotated data is available. Objective: The main objective of this research is to assess the ability of the CCD models as well as few shot learning algorithms for unseen programming problems and new languages (i.e., the model is not trained on these problems/languages). Method: We assess the generalizability of the state of the art models for CCD in few shot settings (i.e., only a few samples are available for fine-tuning) by setting three scenarios: i) unseen problems, ii) unseen languages, iii) combination of new languages and new problems. We choose three datasets of BigCloneBench, POJ-104, and CodeNet and Java, C++, and Ruby languages. Then, we employ Model Agnostic Meta-learning (MAML), where the model learns a meta-learner capable of extracting transferable knowledge from the train set; so that the model can be fine-tuned using a few samples. Finally, we combine contrastive learning with MAML to further study whether it can improve the results of MAML.

扫码加入交流群

加入微信交流群

微信交流群二维码

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