Type-IV Code Clone Detection via Layer-Wise Non-Contrastive Representation Learning

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.

Link
https://www.semanticscholar.org/paper/674205d467acb5b3cccdc5eb19f3e25a96100cf7
Found by
Semantic Scholar
Authors
Luciano Marchezan, Kevin Delcourt, Eugene Syriani, H. Sahraoui
Categories
dataset
Published
2026-09-15
Last seen by the radar
2026-09-17
Citations
0
Influential citations
0
Radar score
26.75 / 100 (how it is scored)
Why it scored so
Matched: dataset; Primary record: Semantic Scholar
Related links
https://arxiv.org/abs/2609.17338
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar