Injecting Structural Graph Context into Small Language Models for Efficient Code Clone Detection
F1000Research · 16.11.2026 · 15 · 1918
DOI: 10.12688/f1000research.187740.1 ↗Kurz gefasst
Fachartikel in der Zeitschrift F1000Research, online erschienen am 16.11.2026. Verfasst von Akash Bhattacharyya und 1 weiteren Autor:innen. Die Arbeit nennt 40 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: Kalinga Institute of Industrial Technology.
Abstract (Originalsprache)
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.
Förderung
- Kalinga Institute of Industrial Technology
Zitieren
APA
Bhattacharyya, A., & Singh, J. (2026). Injecting Structural Graph Context into Small Language Models for Efficient Code Clone Detection. F1000Research, 15, 1918. https://doi.org/10.12688/f1000research.187740.1
Vancouver
Bhattacharyya A, Singh J. Injecting Structural Graph Context into Small Language Models for Efficient Code Clone Detection. F1000Research. 2026;15:1918. doi:10.12688/f1000research.187740.1
BibTeX
@article{Bhattacharyya2026,
author = {Bhattacharyya, Akash and Singh, Jagannath},
title = {Injecting Structural Graph Context into Small Language Models for Efficient Code Clone Detection},
journal = {F1000Research},
year = {2026},
volume = {15},
pages = {1918},
doi = {10.12688/f1000research.187740.1}
}
EUVIMED