Answers are grounded in this paper and cite their sources.
Background Code clone detection is important for software maintenance, but detecting semantic clones remains challenging. Many existing methods rely on Graph Neural Networks (GNNs), which require high computational resources. Large Language Models (LLMs) can also be computationally expensive and may not effectively capture the structural relationships present in source code. This study proposes an efficient approach that combines structural program information with a Small Language Model (SLM) for code clone detection. Methods Program Dependence Graphs (PDGs) are generated from the BigCloneBench dataset and converted into a standard Graphviz text representation. This structural representation is used to fine-tune a 0.5-billion-parameter SLM using Parameter-Efficient Fine-Tuning (PEFT) with Low-Rank Adaptation (LoRA). The model is trained to detect code clones, identify their clone types, and locate the corresponding cloned lines of code. Results The proposed method achieved competitive F1-scores compared with existing code clone detection methods while using only approximately 5.5 GB of GPU memory. The Graphviz-based structural representation enabled the SLM to learn relationships within source code effectively while maintaining low computational requirements. The model also provided interpretable predictions by identifying clone types and locating cloned code segments. Conclusions The results demonstrate that combining structural graph information with an SLM provides an efficient approach to code clone detection. The proposed method reduces computational requirements while maintaining competitive detection performance and providing interpretable results. This approach offers a practical solution for code clone detection in software maintenance and related software engineering tasks.
No takes yet. Share an insight, caveat, or question.
Bhattacharyya et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: