paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Multiple Representation Transformer with Optimized Abstract Syntax Tree for Efficient Code Clone Detection

面向高效代码克隆检测的多表示 Transformer 与优化抽象语法树
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 3/10 · 该论文属于深度学习用于代码克隆检测,核心是优化 AST 表示与 Transformer/Siamese 网络,未涉及 Agentic 程序、LLM/Agent 辅助静态分析、浮点程序分析或贝叶斯程序分析等用户核心方向。虽然与机器学习+程序语言交叉相关,但距离用户当前追踪的问题较远。引用 3 inbox
Tianchen Yu, Li Yuan, Liannan Lin, Hongkui He
crossref: 2026-09-12

AI 速览

一句话:提出 MRT-OAST,通过优化 AST 多表示与孪生网络,实现高效且准确的代码克隆检测。

现有基于深度学习的代码克隆检测存在两个问题:AST 等代码表示信息利用率低、冗余严重,导致性能下降;评估时克隆检测效率低,实际使用时间成本过高。为此,本文提出 MRT-OAST,一种多表示 Transformer 与优化抽象语法树方法。该方法对 AST 进行策略性剪枝和增强,并利用前序与后序遍历构造两种表示,以保留结构信息;同时采用纯 Siamese 网络和余弦相似度比较代码相似性,加速评估。实验表明,该方法在 Java 和 C/C++ 中将 AST 序列分别压缩至原长度的 40% 和 39%;在 OJClone 与 Google Code Jam 上超越现有最优方法;在 BigCloneBench 上相比最优轻量模型提速 5 倍、相比 BERT 模型提速 563 倍,F1 值仅分别下降 0.3% 和 0.9%。

问题
现有深度学习方法在代码克隆检测中 AST 表示信息利用率低且冗余,导致性能下降;同时评估效率低,实际使用时间成本过高。
方法
提出 MRT-OAST,对 AST 进行策略性剪枝与增强,使用前序和后序遍历构造两种表示,并采用纯 Siamese 网络与余弦相似度进行高效比较。
评估
在 OJClone、Google Code Jam 和 BigCloneBench 上评估;AST 序列显著缩短,检测性能超过或接近现有最优方法,并在 BigCloneBench 上实现大幅加速且 F1 仅小幅下降。
原文摘要(Abstract)

Over the past decade, the application of deep learning in code clone detection has produced remarkable results. However, the current approaches have two limitations: (a) code representation approaches with low information utilization, such as vanilla Abstract Syntax Tree (AST), leading to information redundancy which results in performance degradation; (b) low efficiency of clone detection on evaluation, resulting in excessive time costs during practical use. In this paper, we propose a Multiple Representation Transformer with an Optimized Abstract Syntax Tree (MRT-OAST) to introduce an efficient code representation method while achieving competitive performance. Specifically, MRT-OAST strategically prunes and enhances the AST, utilizing both pre-order and post-order traversals to represent two different representations. To speed up the evaluation process, MRT-OAST utilizes a pure Siamese Network and employs cosine similarity to compare the similarity between codes. Our approach effectively reduces AST sequences to 40 % and 39 % of their original length in Java and C/C++ while preserving structural information. In code clone detection tasks, our model surpasses state-of-the-art approaches on OJClone and Google Code Jam. During the evaluation of BigCloneBench, our model has a 5x speed improvement compared to the state-of-the-art lightweight model and a 563x speed improvement compared to the BERT-based model, with only a 0.3 % and 0.9 % decrease in$F_{1}$-score.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8918,
  title = {A Multiple Representation Transformer with Optimized Abstract Syntax Tree for Efficient Code Clone Detection},
  author = {Tianchen Yu and Li Yuan and Liannan Lin and Hongkui He},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00050}
}