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). Finetuned models and checkpoints are in separate files (models.tar.xz and checkpoints.tar.xz) due to their size. 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/ – saved fine-tuned models 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 Fine-tuning transformer models --models <model_name> – fine-tuned models (e.g., microsoft/codebert-base, Salesforce/codet5-base) --models <model_name>-default – uses the base model without fine-tuning LLM-based clone detection --models llm – performs clone detection using large language models 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.



