Papers for

multi-language code analysis tools

Papers whose findings have a practical use for this group, as judged from the abstract. Open a paper to read what it means in practice.

Layer-wise non-contrastive learning improves semantic code clone detection

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

Abstract: 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.

Tue 15 SeptSoftware EngineeringMachine Learning
The gist
Finding pieces of code that do the same thing but look different is hard. Traditional methods look at code words or structure but miss when code acts alike in different ways. The authors created a new way to teach computers to recognize these similar codes without needing tricky comparisons against bad examples. Their method learns from each stage inside the model to better understand code meaning. Tests show this approach works well across several programming languages.
Open 2609.17338v1