GraphCodeBERT for Cross-Language Code Clone Retrieval through Data-Flow Alignment and Hard-Negative Mining
cs.AI, cs.LG, cs.SE
Submitted: 2026-11-28
Updated: 2026-11-28
Comments: 16 pages, 8 figures,2 tables
License: http://creativecommons.org/licenses/by-nc-sa/4.0/
The gist: This paper proposes a GraphCodeBERT adaptation that combines soft data flow alignment with reliability filtered hard negative mining.
Abstract
This paper proposes a GraphCodeBERT adaptation that combines soft data flow alignment with reliability filtered hard negative mining. The alignment component compares variable dependency representations across paired implementations without requiring identical identifiers or graph topology. The mining component excludes known equivalent solutions, retains a mixture of random and challenging candidates, and gradually increases negative difficulty. A reproducible evaluation design separates programming tasks across training, validation, and testing and covers six directed retrieval settings involving Java, Python, and Go. Across the six settings, the joint configuration has mean reciprocal rank 0.814, compared with 0.731 for a matched GraphCodeBERT baseline. Removing alignment reduces this score to 0.786, whereas replacing filtered mining with random negatives reduces it to 0.772. The evaluation framework also addresses retrieval depth, perturbation tolerance, mining contamination, and indexing cost under a fixed candidate protocol. The component comparison separates structural supervision from negative selection and identifies their respective contributions to the ranking profile. The resulting design provides an auditable route for investigating whether language independent dependencies and carefully selected distractors improve cross language code retrieval under realistic annotation and computational constraints. The absolute mean reciprocal rank increase is 0.083, corresponding to approximately 11.4% relative to the baseline; this aggregate comparison does not establish statistical significance.
Related papers
- Beyond Moral Performance: Empirical Assessment of LLMs' Moral Competence Through Judgment Stability
- K12Vista: Exploring the Boundaries of MLLMs in K-12 Education
- A Matter of TASTE: Improving Coverage and Difficulty of Agent Benchmarks
- FlowSteer: Towards Agents Designing Agentic Workflows via Reinforced Progressive Canvas Editing
- Tokengeist: Multi-Turn Attribution Tracing in Agentic Conversations
- VESTA: Visual Exploration with Statistical Tool Agents