Balancing Consistency and Diversity in Automated C Code Generation for Software Defect Detectors

Machine learning (ML) techniques have gained traction in software bug detection. A persistent challenge in ML-based approaches arises from the imbalance between correct and incorrect training data. Specifically, there is a scarcity of incorrect data (containing bugs) compared to the abundance of correct data, degrading model performance. To mitigate this, researchers have proposed artificially injecting bugs into correct code to augment datasets. In addition to balancing data distribution, diversity in training examples significantly affects model performance. Programs written in high-level languages can exhibit a wide range of syntactic variations while maintaining identical functionality. Motivated by this observation, the objective of our research is to generate diverse incorrect examples stemming from a single root cause (i.e., a specific bug). Specifically, we plan to inject bugs into LLVM IR code and translate it into high-level source code using a probabilistic language model. In this paper, we present a preparatory step toward that goal: the generation of correct, bug-free examples using an IR-to-C translator based on a sequence-to-sequence (seq2seq) architecture. We investigate the resulting consistency and diversity of the generated correct examples by training the model on real-world software code.

Authors

Institutions

Publication Details

Journal
International Journal of Reliability Quality and Safety Engineering
Published
2026-05-21
DOI
https://doi.org/10.1142/s0218539326500282
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Balancing Consistency and Diversity in Automated C Code Generation for Software Defect Detectors

Mamoru Ohara, Chisato Murakami, Yuto Sugawa
International Journal of Reliability Quality and Safety Engineering
Software Engineering Research
article

Balancing Consistency and Diversity in Automated C Code Generation for Software Defect Detectors

Mamoru Ohara, Chisato Murakami, Yuto Sugawa
article en

Abstract

Machine learning (ML) techniques have gained traction in software bug detection. A persistent challenge in ML-based approaches arises from the imbalance between correct and incorrect training data. Specifically, there is a scarcity of incorrect data (containing bugs) compared to the abundance of correct data, degrading model performance. To mitigate this, researchers have proposed artificially injecting bugs into correct code to augment datasets. In addition to balancing data distribution, diversity in training examples significantly affects model performance. Programs written in high-level languages can exhibit a wide range of syntactic variations while maintaining identical functionality. Motivated by this observation, the objective of our research is to generate diverse incorrect examples stemming from a single root cause (i.e., a specific bug). Specifically, we plan to inject bugs into LLVM IR code and translate it into high-level source code using a probabilistic language model. In this paper, we present a preparatory step toward that goal: the generation of correct, bug-free examples using an IR-to-C translator based on a sequence-to-sequence (seq2seq) architecture. We investigate the resulting consistency and diversity of the generated correct examples by training the model on real-world software code.

International Journal of Reliability Quality and Safety Engineering
Nihon University (JP), Toho University (JP), Tokyo Metropolitan Industrial Technology Research Institute (JP)
Openalex Percentile: Top 1%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.