Fine-Tuning Code Language Models to Detect Cross-Language Bugs

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Li, Zengyang, Li, Yimeng, Huang, Binbin, Liang, Peng, Mo, Ran, Liu, Hui, Ma, Yutao
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866918458004865024
author Li, Zengyang
Li, Yimeng
Huang, Binbin
Liang, Peng
Mo, Ran
Liu, Hui
Ma, Yutao
author_facet Li, Zengyang
Li, Yimeng
Huang, Binbin
Liang, Peng
Mo, Ran
Liu, Hui
Ma, Yutao
contents Multilingual programming, which involves using multiple programming languages (PLs) in a single project, is increasingly common due to its benefits. However, it introduces cross-language bugs (CLBs), which arise from interactions between different PLs and are difficult to detect by single-language bug detection tools. This paper investigates the potential of pre-trained code language models (CodeLMs) in CLB detection. We developed CLCFinder, a cross-language code identification tool, and constructed a CLB dataset involving three PL combinations (Python-C/C++, Java-C/C++, and Python-Java) with nine interaction types. We fine-tuned 13 CodeLMs on this dataset and evaluated their performance, analyzing the effects of dataset size, token sequence length, and code comments. Results show that all 13 CodeLMs exhibited varying degrees of performance improvement after fine-tuning, with UniXcoder-base achieving the best F1 score (0.7407). Notably, within our experimental setup, small CodeLMs tended to performe better than large ones. CodeLMs fine-tuned on single-language bug datasets performed poorly on CLB detection, demonstrating the distinction between CLBs and single-language bugs. Additionally, increasing the fine-tuning dataset size significantly improved performance, while longer token sequences did not necessarily improve the model performance. The impact of code comments varied across models. Some fine-tuned CodeLMs' performance was improved, while others showed degraded performance.
format Preprint
id arxiv_https___arxiv_org_abs_2507_21954
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Fine-Tuning Code Language Models to Detect Cross-Language Bugs
Li, Zengyang
Li, Yimeng
Huang, Binbin
Liang, Peng
Mo, Ran
Liu, Hui
Ma, Yutao
Software Engineering
Artificial Intelligence
Multilingual programming, which involves using multiple programming languages (PLs) in a single project, is increasingly common due to its benefits. However, it introduces cross-language bugs (CLBs), which arise from interactions between different PLs and are difficult to detect by single-language bug detection tools. This paper investigates the potential of pre-trained code language models (CodeLMs) in CLB detection. We developed CLCFinder, a cross-language code identification tool, and constructed a CLB dataset involving three PL combinations (Python-C/C++, Java-C/C++, and Python-Java) with nine interaction types. We fine-tuned 13 CodeLMs on this dataset and evaluated their performance, analyzing the effects of dataset size, token sequence length, and code comments. Results show that all 13 CodeLMs exhibited varying degrees of performance improvement after fine-tuning, with UniXcoder-base achieving the best F1 score (0.7407). Notably, within our experimental setup, small CodeLMs tended to performe better than large ones. CodeLMs fine-tuned on single-language bug datasets performed poorly on CLB detection, demonstrating the distinction between CLBs and single-language bugs. Additionally, increasing the fine-tuning dataset size significantly improved performance, while longer token sequences did not necessarily improve the model performance. The impact of code comments varied across models. Some fine-tuned CodeLMs' performance was improved, while others showed degraded performance.
title Fine-Tuning Code Language Models to Detect Cross-Language Bugs
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2507.21954