mlsanityData to 14 Oct 2026

Standing on the Shoulders of Giants: Stabilized Knowledge Distillation for Cross--Language Code Clone Detection

arXiv 2605.02860 ↗First posted 4 May 2026cs.AI cs.LG cs.SEcited by 0

On the map: Knowledge distillation → Knowledge distillation for LLMs

Abstract (arXiv)

Cross-language code clone detection (X-CCD) is challenging because semantically equivalent programs written in different languages often share little surface similarity. Although large language models (LLMs) have shown promise for semantic clone detection, their use as black-box systems raises concerns about cost, reproducibility, privacy, and unreliable output formatting. In particular, compact open-source models often struggle to follow reasoning-oriented prompts and to produce outputs that can be consistently mapped to binary clone labels. To address these limitations, we propose a knowledge distillation framework that transfers reasoning capabilities from DeepSeek-R1 into compact open-source student models for X-CCD. Using cross-language code pairs derived from Project CodeNet, we construct reasoning-oriented synthetic training data and fine-tune Phi3 and Qwen-Coder with LoRA adapters. We further introduce response stabilization methods, including forced conclusion prompting, a binary classification head, and a contrastive classification head, and evaluate model behavior using both predictive metrics and response rate. Experiments on Python--Java, Rust--Java, Rust--Python, and Rust--Ruby show that knowledge distillation consistently improves the reliability of compact models and often improves predictive performance, especially under distribution shift. In addition, classification-head variants substantially reduce inference time compared to generation-based inference. Overall, our results show that reasoning-oriented distillation combined with response stabilization makes compact open-source models more practical and reliable for X-CCD detection.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Knowledge distillation for LLMs, one of 12 directions in Knowledge distillation. Builds on 30 of its 53 references that are in the map. First posted on arXiv 4 May 2026.

Builds on

30 of 53 references.

Closest ancestors · 1

Same direction, newest first

  1. 2025An Empirical Study of Knowledge Distillation for Code Understanding Tasks21 Aug

Other references · 29

  1. 2022Training language models to follow instructions with human feedbackcited by 15,971
  2. 2015Distilling the Knowledge in a Neural Networkcited by 10,324
  3. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
  4. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  5. 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,917
  6. 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
  7. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  8. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  10. 2023LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attentioncited by 781
  11. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  12. 2023Textbooks Are All You Needcited by 569
17 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  2. 2022Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matterscited by 222
  3. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
  4. 2025Towards System 2 Reasoning in LLMs: Learning How to Think With Meta Chain-of-Thoughtcited by 109
  5. 2023Enhancing Large Language Models in Coding Through Multi-Perspective Self-Consistencycited by 46
  6. 2024Phi-3 Safety Post-Training: Aligning Language Models with a "Break-Fix" Cyclecited by 32
  7. 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChaincited by 31
  8. 2022Compressing Pre-trained Models of Code into 3 MBcited by 21
  9. 2023Greening Large Language Models of Codecited by 19
  10. 2023Towards Understanding the Capability of Large Language Models on Code Clone Detection: A Surveycited by 15
  11. 2024LLM2: Let Large Language Models Harness System 2 Reasoningcited by 12
  12. 2022Generalizability of Code Clone Detection on CodeBERTcited by 4
  13. 2023CCT-Code: Cross-Consistency Training for Multilingual Clone Detection and Code Searchcited by 4
  14. 2024Scaling Laws Behind Code Understanding Modelcited by 4
  15. 2024Towards Better Code Understanding in Decoder-Only Models with Contrastive Learningcited by 3
  16. 2024On the Compression of Language Models for Code: An Empirical Study on CodeBERTcited by 3
  17. 2022Cross-Language Source Code Clone Detection Using Deep Learning with InferCodecited by 2

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Evaluating Language Models on Cross-Language Code Functional Equivalence
  2. 2026Verify Before You Fix: Agentic Execution Grounding for Trustworthy Cross-Language Code Analysis
  3. 2026UNBIND: UNlearning By INference-time Directional Steering for Code LLMs
  4. 2025Functional Consistency of LLM Code Embeddings: A Self-Evolving Data Synthesis Framework for Benchmarking
  5. 2023On Extracting Specialized Code Abilities from Large Language Models: A Feasibility Study
  6. 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluation
  7. 2025CodeMirage: A Multi-Lingual Benchmark for Detecting AI-Generated and Paraphrased Source Code from Production-Level LLMs
  8. 2025Dynamic Benchmarking of Reasoning Capabilities in Code Large Language Models Under Data Contamination