paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Cross-lingual Code Clone Detection: When LLMs Fail Short Against Embedding-based Classifier

跨语言代码克隆检测:当 LLM 不敌基于嵌入的分类器
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 4/10 · 论文研究跨语言代码克隆检测,属于机器学习与程序语言交叉,但与用户核心方向(面向ML/Agentic程序的静态分析、LLM改进静态分析/形式化验证、浮点或贝叶斯程序分析)距离较远;它更多是评估LLM在代码理解任务上的表现,未涉及静态分析工具、形式化验证或Agentic场景。不过其问题驱动地揭示LLM在复杂跨语言代码上的失败,对理解LLM作为代码分析工具的局限有一定参考价值。引用 7 inbox
Micheline Benedicte Moumoula, Abdoul Kader Kabore, Jacques Klein, Tegawende F. Bissyande
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:论文实验比较 LLM 与嵌入分类器在跨语言代码克隆检测上的表现,发现嵌入模型更稳健。

跨语言代码克隆检测因多语言软件开发而受到关注,近期 LLM 进展促使重新审视该问题。本文在 XLCoST 与 CodeNet 数据集上评估四种 LLM、八种提示以及一个预训练嵌入模型用于克隆对分类的表现。结果显示,LLM 在简单程序示例上 F1 可达 0.98,但在复杂案例和跨语言理解上表现不佳;嵌入模型将不同语言代码片段映射到共享表示空间,基于其训练的基础分类器在 XLCoST 和 CodeNet 上分别约高出 LLM 2 和 24 个百分点,表明嵌入表示更稳健,可实现跨语言代码克隆检测的先进性能。

问题
如何有效检测跨语言代码克隆,并评估 LLM 与嵌入模型在该任务上的优劣。
方法
在 XLCoST 和 CodeNet 数据集上,使用四种 LLM 和八种提示,以及一个预训练嵌入模型训练基础分类器进行对比。
评估
以 F1 等指标比较两类方法,发现嵌入分类器在两个数据集上分别约领先 LLM 2 与 24 个百分点。
原文摘要(Abstract)

Cross-lingual code clone detection has gained attention in software development due to the use of multiple programming languages. Recent advances in machine learning, particularly Large Language Models (LLMs), have motivated a reexamination of this problem.This paper evaluates the performance of four LLMs and eight prompts for detecting cross-lingual code clones, as well as a pre-trained embedding model for classifying clone pairs. Both approaches are tested on the XLCoST and CodeNet datasets.Our findings show that while LLMs achieve high F1 scores (up to 0.98) on straightforward programming examples, they struggle with complex cases and cross-lingual understanding. In contrast, embedding models, which map code fragments from different languages into a common representation space, allow for the training of a basic classifier that outperforms LLMs by approximately 2 and 24 percentage points on the XLCoST and CodeNet datasets, respectively. This suggests that embedding models provide more robust representations, enabling state-of-the-art performance in cross-lingual code clone detection.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{MoumoulaKKB24,
  title = {Cross-lingual Code Clone Detection: When LLMs Fail Short Against Embedding-based Classifier},
  author = {Micheline Benedicte Moumoula and Abdoul Kader Kabore and Jacques Klein and Tegawende F. Bissyande},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695335}
}