Type-IV Code Clone Detection via Layer-Wise Non-Contrastive Representation Learning (replication package)
收藏资源简介:
This repository contains the implementation, datasets, and experimental results for our paper. It includes preprocessing pipelines, model training scripts, and analysis artifacts to ensure full reproducibility of the reported results. To facilitate distribution, the repository is provided as a compressed archive (replication.zip). The baseline model and checkpoints are in separate files (models_codebert_cl.tar.xz and checkpoints.tar.xz) due to their size. These need to be extracted inside the data/ folder. For example the path to the baseline has to be data/models_codebert_cl/ For the vicreg models, the path is data/checkpoints/ Repository Structure required_packages.txtList of required Python dependencies. Install using:pip install -r required_packages.txt data/Contains all data and experiment artifacts: dataset/ – datasets used in the experiments checkpoints/ – saved checkpoints for VICReg-based implementations models_codebert_cl/ – baseline model results/ – experimental results organized by research question (RQ) to support reproducibility src/Source code for the full pipeline, including preprocessing, training, and evaluation. analysis.ipynbJupyter notebook containing the analysis corresponding to each research question. Note:To avoid retraining models (which may take several hours), extract the provided models.tar.xz and checkpoints.tar.xz archives into the data/ directory. Usage The main pipeline can be executed via: python -m src.main --models <model_name> Supported configurations: VICReg-based models --models vicreg – VIC4Code --models vicreg-layer – LWVIC4Code LLM-based clone detection --models llm – performs clone detection using large language models Contrastive Baseline To run the contrastive baseline (Codebert_CL): python -m src.baseline --models codebert_cl RQ5: To remove training with GPTCloneBench pairs, set GPTCLONEBENCH_TRAIN = False in src/config.py. Requirements Python 3 Install dependencies:pip install -r required_packages.txt LLM support:Requires an active Ollama server (default local port: 11434). Port configurations can be adjusted in the resources/ directory. Reproducibility All experimental results are stored in the data/results/ directory and organized by research question. Pretrained models and checkpoints are provided to facilitate reproducibility without requiring retraining.



