Type-IV Code Clone Detection via Layer-Wise Non-Contrastive Representation Learning
Not on the map. Why?
Abstract (arXiv)
Software clones are fragments of code that are similar or functionally equivalent to each other. They pose significant challenges for maintenance, refactoring, and bug detection. Detecting Type-IV clones, which are semantically equivalent but may differ syntactically, is particularly difficult for traditional token- or syntax-based methods. Recent machine learning approaches rely on contrastive learning, which requires careful negative sampling and can introduce bias. In this paper, we propose LWVIC4Code, a non-contrastive representation learning approach specifically designed for Type-IV clone detection. Building on the Variance-Invariance-Covariance Regularization (VICReg) framework and prior layer-wise VICReg training, LWVIC4Code introduces cross-layer consistency regularization and depth-dependent layer weighting to progressively refine semantic information across transformer layers, producing robust and discriminative code representations. We conduct an empirical study comparing LWVIC4Code against a contrastive learning baseline and zero-shot large language models on Python (Kamino) and multi-language (GPTCloneBench) datasets. Results show that LWVIC4Code achieves competitive or superior performance without negative samples, benefits from layer-wise supervision, and generalizes effectively from Python to other languages, particularly Java and C#. These results demonstrate that non-contrastive, layer-wise representation learning is a promising direction for robust semantic code clone detection.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 22 of its 57 references that are in the map. First posted on arXiv 15 Sep 2026.
Builds on
22 of 57 references.
References · 22
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learningcited by 1,057
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
- 2022Contrastive and Non-Contrastive Self-Supervised Learning Recover Global and Local Spectral Embedding Methodscited by 149
- 2025A Comprehensive Survey in LLM(-Agent) Full Stack Safety: Data, Training and Deploymentcited by 116
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2023AI-assisted Code Authoring at Scale: Fine-tuning, deploying, and mixed methods evaluationcited by 21
- 2019A Literature Study of Embeddings on Source Codecited by 18
- 2021Challenging Machine Learning-based Clone Detectors via Semantic-preserving Code Transformationscited by 15
10 more
- 2023A systematic literature review on source code similarity measurement and clone detection: techniques, applications, and challengescited by 14
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 14
- 2023GPTCloneBench: A comprehensive benchmark of semantic clones and cross-language clones using GPT-3 model and SemanticCloneBenchcited by 11
- 2018Path-Based Function Embedding and its Application to Specification Miningcited by 8
- 2022Generalizability of Code Clone Detection on CodeBERTcited by 4
- 2025Functional Consistency of LLM Code Embeddings: A Self-Evolving Data Synthesis Framework for Benchmarkingcited by 4
- 2020What You See is What it Means! Semantic Representation Learning of Code based on Visualization and Transfer Learningcited by 3
- 2024The Struggles of LLMs in Cross-lingual Code Clone Detectioncited by 3
- 2024Assessing the Code Clone Detection Capability of Large Language Modelscited by 1
- 2025Detecting Semantic Clones of Unseen Functionalitycited by 1
Built on by
Not cited yet.