atlas

Research map / Label-efficient and robust learning / Recognition and long-tail

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

AAAI 2024 · Label-efficient and robust learning › Recognition and long-tail · approach: Multilingual language representation pretraining · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes AdaCCD, a cross-lingual adaptation method that trains CodeBERT/GraphCodeBERT on labeled C/C++ code clones and adapts them to unlabeled languages (Rust, Ruby, JavaScript, Go, C#) via clustering-based contrast discovery, semantic-preserving transformations, and an adaptive preference schedule.

Problem

Code clone detection for low-resource programming languages lacks annotated data, and self-supervised multilingual code representations perform much worse than supervised fine-tuning for clone retrieval.

Approach

Discover semantic positive/negative contrasts in unlabeled target-language code by K-means clustering and top-k neighbor search with a source-trained model, mix these with transformation-based positives (identifier renaming, back-translation via CodeGeeX) using a linearly decaying preference alpha_t, and iterate contrastive training with alternating data splits.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add back translation instead of identifier renamingAdaCCD · cross-lingual adaptation (CodeBERT and GraphCodeBERT)MAP@RMixed
remove adaptive control and use a constant preference (ablation)CB-IR · C#MAP@R: 57.74 -> 57.66Hurt
remove adaptive control and use a constant preference (ablation)CB-IR · RustMAP@R: 56.91 -> 53.11Hurt
remove adaptive control and use a constant preference (ablation)CB-BT · C#MAP@R: 64.37 -> 62.38Hurt
remove adaptive control and use a constant preference (ablation)GCB-BT · RustMAP@R: 82.35 -> 81.09Hurt
remove adaptive control and use a constant preference (ablation)GCB-IR · C#MAP@R: 64.40 -> 63.42Hurt
remove adaptive control and use a constant preference (ablation)GCB-IR · RustMAP@R: 73.50 -> 70.37Hurt
remove adaptive control and use a constant preference (ablation)GCB-IR · JavaScriptMAP@R: 68.84 -> 67.75Hurt
remove adaptive control and use a constant preference (ablation)GCB-IR · GoMAP@R: 70.13 -> 68.43Hurt
remove transformed contrasts and train only on discovered contrasts (ablation)CB-IR · C#MAP@R: 57.74 -> 56.89Hurt
remove transformed contrasts and train only on discovered contrasts (ablation)CB-BT · RustMAP@R: 72.86 -> 54.77Hurt
remove transformed contrasts and train only on discovered contrasts (ablation)GCB-BT · RustMAP@R: 82.35 -> 75.47Hurt

Surprising findings

Limitations

Experimental setup

Datasets: POJ-104 GCJ CodeNet

Benchmarks: CodeNet-derived clone benchmark (Ruby, C#, Rust, JavaScript, Go)

Metrics: MAP@R NMI

Baselines: Text-embedding-ada-002 ContraCode-FT CodeBERT-FT GraphCodeBERT-FT ZeroTrans Whiten BM25

Builds on: CodeBERT GraphCodeBERT BERT-Whitening InfoNCE

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy