arXiv:2410.05275cs.IR2024-10被引 5

让GraphCodeBERT识别代码相似性时能说明理由,提升可解释性。

Augmenting the Interpretability of GraphCodeBERT for Code Similarity Tasks

  • 基于GraphCodeBERT构建可解释的代码相似性判断方法
  • 能准确识别代码片段语义相似性并给出匹配依据
  • 适合需要理解推荐结果的开发者或代码审查场景

评估代码片段的相似程度对保障软件质量至关重要,但因需捕捉代码深层语义而具挑战性。传统语法方法常无法识别此类关联。近期进展虽有所突破,却往往牺牲可解释性。为此,本文提出一种改进方法,利用GraphCodeBERT增强相似性判断的透明度,能够识别代码片段间的语义关系,并阐明判断依据,帮助开发者更好理解与信任结果。代码实现已开源。

原文摘要 · Abstract (English)

Assessing the degree of similarity of code fragments is crucial for ensuring software quality, but it remains challenging due to the need to capture the deeper semantic aspects of code. Traditional syntactic methods often fail to identify these connections. Recent advancements have addressed this challenge, though they frequently sacrifice interpretability. To improve this, we present an approach aiming to improve the transparency of the similarity assessment by using GraphCodeBERT, which enables the identification of semantic relationships between code fragments. This approach identifies similar code fragments and clarifies the reasons behind that identification, helping developers better understand and trust the results. The source code for our implementation is available at https://www.github.com/jorge-martinez-gil/graphcodebert-interpretability.

代码相似性可解释AIGraphCodeBERT

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。