通过GraphCodeBERT和额外特征整合提升源代码相似性检测
Improving Source Code Similarity Detection Through GraphCodeBERT and Integration of Additional Features
AI总结:
本文提出通过GraphCodeBERT结合额外行为特征提升源代码相似性检测的性能。
摘要:
本文研究了使用变换器模型结合执行衍生信号进行源代码相似性检测。我们扩展了GraphCodeBERT,加入一个显式的、低维的行为特征,该特征捕捉代码片段之间的可观察一致性,并通过可训练的输出头将此信号与池化变换器表示融合。我们通过固定测试套件下的输出比较计算行为一致性,并利用观察到的输出一致性作为代码对之间语义相似性的操作近似。所得到的特征作为一种显式的行为签名,补充了基于词和图的表示。在已建立的克隆检测基准测试中,实验结果表明在精度、召回率和F1值上均优于未修改的GraphCodeBERT基线,其中在语义相同但语法不同的代码对上提升最大。展示我们方法的源代码可以从https://www.github.com/jorge-martinez-gil/graphcodebert-feature-integration下载。
英文摘要:
This paper investigates source code similarity detection using a transformer model augmented with an execution-derived signal. We extend GraphCodeBERT with an explicit, low-dimensional behavioral feature that captures observable agreement between code fragments, and fuse this signal with the pooled transformer representation through a trainable output head. We compute behavioral agreement via output comparisons under a fixed test suite and use this observed output agreement as an operational approximation of semantic similarity between code pairs. The resulting feature acts as an explicit behavioral signature that complements token- and graph-based representations. Experiments on established clone detection benchmarks show consistent improvements in precision, recall, and F$_1$ over the unmodified GraphCodeBERT baseline, with the largest gains on semantically equivalent but syntactically dissimilar pairs. The source code that illustrates our approach can be downloaded from https://www.github.com/jorge-martinez-gil/graphcodebert-feature-integration.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。