Skip to main navigation Skip to search Skip to main content

AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detection

  • Yangkai Du
  • , Tengfei Ma
  • , Lingfei Wu
  • , Xuhong Zhang
  • , Shouling Ji
  • Zhejiang University
  • Anytime.AI

Research output: Contribution to journalConference articlepeer-review

7 Scopus citations

Abstract

Code Clone Detection, which aims to retrieve functionally similar programs from large code bases, has been attracting increasing attention. Modern software often involves a diverse range of programming languages. However, current code clone detection methods are generally limited to only a few popular programming languages due to insufficient annotated data as well as their own model design constraints. To address these issues, we present AdaCCD, a novel cross-lingual adaptation method that can detect cloned codes in a new language without annotations in that language. AdaCCD leverages language-agnostic code representations from pre-trained programming language models and propose an Adaptively Refined Contrastive Learning framework to transfer knowledge from resource-rich languages to resource-poor languages. We evaluate the cross-lingual adaptation results of AdaCCD by constructing a multilingual code clone detection benchmark consisting of 5 programming languages. AdaCCD achieves significant improvements over other baselines, and achieve comparable performance to supervised fine-tuning.

Original languageEnglish
Pages (from-to)17942-17950
Number of pages9
JournalProceedings of the AAAI Conference on Artificial Intelligence
Volume38
Issue number16
DOIs
StatePublished - Mar 25 2024
Event38th AAAI Conference on Artificial Intelligence, AAAI 2024 - Vancouver, Canada
Duration: Feb 20 2024Feb 27 2024

Fingerprint

Dive into the research topics of 'AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detection'. Together they form a unique fingerprint.

Cite this