Root cause classification method for optimization defects of C language compiler
By building a systematic compiler optimization defect classification system, combining generative data enhancement and stacked integrated learning methods, the automated classification of compiler optimization defects is realized, solving the problem of low defect identification and repair efficiency in the existing technology, and improving the repair efficiency and accuracy of compiler optimization defects.
Patent Information
- Application Number
- CN202510443085.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-01
AI Technical Summary
The existing compiler optimization defect classification methods fail to explore the root causes of defects in depth, resulting in low efficiency in defect identification and repair, difficult defect positioning and repair, and lack of automated root cause analysis methods in the existing technology.
The iterative method of literature analysis, data observation and data verification is used to build a systematic classification system, the data set is expanded using generative data augmentation methods, and the RTA and Llama3.1 large language model are integrated through stacked integrated learning methods to achieve automated classification.
It improves the classification accuracy and efficiency of compiler optimization defects, reduces the workload of manual analysis, promotes the efficiency and effectiveness of compiler optimization work, and provides in-depth theoretical support for compiler development and research.
Smart Images

Figure CN120407250A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software engineering, specifically to the fields of compiler testing and software defect analysis, and relates to a root cause classification method for optimization defects of C language compilers. Background Art
[0002] The compiler is a core component in the software development toolchain, and its quality directly affects development efficiency and software running reliability. However, due to the high complexity of compilers, the process of diagnosing and fixing defects is extremely challenging. Compiler errors are not only difficult to detect in a timely manner but may also affect the source code written by developers, causing error propagation. The existing debugging information is limited, and there are numerous related files, increasing the difficulty of defect location and repair. In C language compilers, the optimization component is a part where errors occur frequently, and the average existence time of its defects is relatively long. Systematic classification and analysis of these optimization defects can help developers deeply understand the root causes of defects, narrow down the suspicious scope of defect repair, and thus improve the maintenance efficiency and reliability of compilers.
[0003] Existing technical methods for compiler defect classification are limited to describing the surface features and manifestations of defects. For example, C language compiler defects are classified into three major categories: "error compilation", "crash", and "performance". For optimization defects of GCC and LLVM, the above classification system is also followed, divided into three major categories: "crash during optimization", "mis-optimization", and "performance". These methods do not explore and study their deeper reasons, providing very limited help for developers to identify and solve compiler defects.
[0004] Therefore, there is currently no systematic and in-depth classification system for compiler optimization defects, seriously affecting the identification and repair of compiler optimization defects. And no researcher has conducted automated root cause analysis for compiler optimization defects. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a root cause classification method for optimization defects of C language compilers in view of the above-mentioned deficiencies of the prior art. An iterative method of literature analysis, data observation, and data verification is used to construct a systematic and effective classification system for optimization defects of C language compilers; a generative data augmentation method is used to expand the dataset, the data is appropriately preprocessed, and a stacked ensemble learning method is used to integrate two large language models, RTA and Llama3.1, to achieve automated classification, which helps developers improve repair efficiency and promote in-depth development of field research.
[0006] To achieve the above technical objectives, the technical solution adopted by the present invention is as follows:
[0007] A root cause classification method for optimization defects of C language compilers, comprising:
[0008] Step 1: Repeatedly iterate through manual analysis methods of literature analysis and data observation to construct a preliminary classification system;
[0009] Step 2: While constructing the dataset, improve the final classification system through data verification methods;
[0010] Step 3: Use generative data augmentation methods to expand the dataset and assist in improving the performance of the classifier;
[0011] Step 4: Appropriately preprocess the data, and use the stacked ensemble learning method to integrate two large language models, RTA and Llama 3.1, to achieve automated classification.
[0012] To optimize the above technical solutions, the specific measures taken also include:
[0013] The above Step 1 repeatedly iterates through manual analysis methods of literature analysis and data observation to construct a preliminary classification system, including:
[0014] First, the system collected and sorted out some high-quality research literature on compiler defects as the object of literature analysis. By deeply analyzing the root causes and repair methods of representative sample defects in these literatures, preliminary classification ideas were proposed. Then, a benchmark dataset for C compiler defect localization was further collected for data observation. Through systematic analysis of this dataset, it was found that most of the defects only involved a single repair file. Therefore, considering starting from the location where the defect occurred, by focusing on the file with problems and analyzing the functions implemented by the code of this file, the root cause of the Bug was deduced in reverse. This process requires a large amount of time for data observation and manual analysis. Through repeated iterative modifications, the classification system was continuously optimized and adjusted, and a two-layer classification system was initially established.
[0015] The above Step 2 improves the final classification system through data verification methods while constructing the dataset, including:
[0016] First, extract all historical commit records related to the optimization component from the GCC git repository. And extract the correspondence between defects and repair files from the historical commit records, and manually check whether the files are used to directly implement the optimization function. By analyzing the functions and roles implemented by the code of the file where the defect is located, and according to the correspondence between the defect report and it, data annotation is performed on the defect report. During the annotation process, not only the existing defects are classified, but also comprehensive supplementation and in-depth analysis are carried out for different types of compiler optimization defects. Through multiple rounds of repeated discussions and revisions, the classification system was gradually improved, and finally a classification system for the root causes of C language compiler optimization defects with a clear structure was formed, including a two-layer structure, eight categories and fourteen sub-categories.
[0017] The above-mentioned step 3 uses a generative data augmentation method to expand the dataset, which helps to improve the performance of the classifier, including:
[0018] First, train a classifier R using the original dataset. At the same time, design a prompt template. By giving GPT-4 model examples of defect reports and prompts, guide it to generate new defect report data in the same style, making full use of GPT-4's powerful generation ability and its own extensive knowledge base. Then, input the generated new data into the classifier R to filter out stable data. Finally, mix the filtered data with the original data to form a new dataset. Through this innovative data augmentation strategy, the robustness and accuracy of the classification model can be effectively improved, ensuring the efficiency and reliability of the model in practical applications.
[0019] The above-mentioned step 4 performs appropriate preprocessing on the data and uses the stacked ensemble learning method to integrate two large language models, RTA and Llama 3.1, to achieve automated classification, including:
[0020] Based on the technical idea of the "island parsing method", write a program for automatically separating code and natural language descriptions. First, regard the defect report as a body of water, and then use regular expressions to find a set of C language structures, which are used as the starting point and called islands. Then, explore the text around the islands and continue to expand the source code area until no more code areas can be found. Therefore, this program can extract C language code blocks from the defect report to separate the code and natural language parts for subsequent model training.
[0021] This automated classification method also designs a prompt template, embedding the separated report and code into the corresponding areas in the template respectively to guide the model to understand and generate more accurately.
[0022] By using the method of stacked ensemble learning, the prediction results of two large language models, RTA and Llama3.1, are integrated, and a random forest model is used as the final classification model. Specifically, first, the total dataset is randomly divided into five sub-datasets by the stratified sampling method. The first four sub-datasets are used as the training set, and the fifth sub-dataset is used as the test set. Then, four-fold cross-validation is performed on the training set to train the base models, namely RTA and Llama3.1, with the training methods being full-parameter fine-tuning and LoRA efficient fine-tuning respectively. The soft labels of the prediction results of the two base models are concatenated as meta-features. Then, a meta-model, namely a random forest, is trained on these meta-feature sets, and the hyperparameters are optimized by the Optuna method. Subsequently, the base models are trained again on the overall training set and evaluated on the test set to generate corresponding meta-features. Finally, the trained random forest model is used to predict the meta-features generated in the previous step to obtain the final prediction result, that is, the root cause of a defect.
[0023] In addition, four commonly used text classification models are trained for comparative verification of the effectiveness of this method, including the shallow machine learning model SVM, the deep learning model TextCNN, the word vector model FastText, and the pre-trained model BERT.
[0024] The present invention has the following beneficial effects:
[0025] The present invention systematically collects and collates the research results of compiler defects through methods such as literature analysis and data observation, establishes a preliminary classification system, and then forms a clear-structured and widely covered C language compiler optimization defect classification system through iterative modification and optimization. This system not only improves the accuracy of classification but also provides strong theoretical support for the research and repair of compiler optimization defects.
[0026] The present invention adopts a generative data augmentation method, uses large language models such as GPT-4 to generate new data with the same style as existing defect reports, provides more sample data for classifier training to reduce the impact brought by data imbalance. This method not only enhances the generalization ability of the classifier but also improves the accuracy and reliability of classification.
[0027] The present invention utilizes the deep learning technology of large language models, combines prompt engineering and efficient fine-tuning technology, and makes full use of the respective advantages of the domain-specific large model (RTA) and the general large model (Llama3.1). Further, by the method of stacked ensemble learning, it realizes the automated classification of compiler optimization defects, greatly reducing the workload of manual analysis and improving the classification efficiency. Through automated technology, a large number of compiler defects can be quickly and accurately identified and classified, promoting the efficiency and effectiveness of compiler optimization work.
[0028] The classification method and technical solution provided by the present invention offer new tools and methods for in-depth research on the optimization defects of C compilers. This helps compiler developers and researchers better understand the nature and repair strategies of compiler defects, promoting scientific research and technological progress in the fields of compiler technology and software engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flowchart of a method for constructing a root cause classification system for optimization defects of C compilers provided by the present invention;
[0030] Figure 2 It is a flowchart of an automated prediction method for root cause categories of optimization defects of C compilers provided by the present invention;
[0031] Figure 3 It is a prompt template for fine-tuning large language models provided by the present invention
[0032] Figure 4 It is a prompt template for data augmentation provided by the present invention DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0034] Although the steps in the present invention are numbered, they are not used to limit the order of the steps. Unless the order of the steps is clearly stated or the execution of a certain step requires other steps as a basis, the relative order of the steps can be adjusted. It can be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0035] A root cause classification method for optimization defects of C compilers disclosed by the present invention is characterized in that it is divided into two modules, a construction module of the classification system (as Figure 1 shown): Through an iterative technical method of literature analysis, data observation, and data verification, a systematic and effective root cause classification system directory for optimization defects of C compilers is constructed; an implementation module of the automated method (as Figure 2 shown): Using a deep learning pre-trained model and a stacked ensemble model, combined with prompt engineering and efficient fine-tuning technology, a classifier for defect reports is constructed, and the performance of the classifier is improved by using a generative data augmentation method.
[0036] The specific implementation process is as follows:
[0037] Step 1: Repeatedly iterate through manual analysis methods of literature analysis and data observation to construct a preliminary classification system.
[0038] First, collect and deeply study a wide range of relevant literature in the field of high-quality compiler defects, covering compiler testing, defect localization, and multiple empirical studies. These literatures contain 93 representative C language compiler defect instances as the objects of analysis. These instances provide rich data support to ensure the accuracy of manually analyzing the root causes of compiler defects and their repair methods. Through these analyses, the present invention preliminarily constructs a framework for classifying C language compiler optimization defects.
[0039] Next, a benchmark dataset containing 60 GCC defects and 60 LLVM defects for compiler defect localization is used for data observation. Through detailed study of these 120 defects, it is found that the vast majority of defects (a total of 118, accounting for about 99%) only involve a single file. Based on this finding, starting from the file location where the defect occurs, focus on analyzing the problematic file, and gradually reverse-derive the root cause of the defect by deeply exploring the functions implemented in the file.
[0040] This process requires a large amount of time for meticulous data observation and manual analysis, and through repeated iterative optimization, a two-layer classification system is gradually formed. Each data analysis and team discussion can identify new problems and challenges. Therefore, the present invention conducts strict reviews and meticulous evaluations of each layer of classification criteria to ensure the scientificity and rationality of the classification system. By continuously collecting feedback and adjusting the classification architecture, not only is the data accuracy effectively improved, but also the understanding of the compiler defect field is deepened, laying a solid foundation for subsequent research and applications.
[0041] Step 2: Improve the final classification system through data verification while constructing the dataset.
[0042] In the compilation stage of compiler intermediate code optimization independent of the platform, although there are differences in implementation details between GIMPLE used by GCC and the intermediate code representation (IR) used by LLVM, their design goals and optimization directions are highly similar. Therefore, the present invention focuses on this optimization stage to ensure that the research results have good generality and scalability.
[0043] Specifically, all historical commit records related to the tree optimization component were extracted from the GCC git repository using the command "git log --grep=\"tree-optimization\"". From the GCC commit records, the correspondence between defect numbers and fixed files was extracted, and through manual inspection, it was confirmed which files were related to the implementation of the optimization function. Finally, 728 file names were extracted, and after screening, it was confirmed that 208 of them were directly involved in the implementation of the optimization function. To further understand the specific content of the optimization defects, the functions and roles of the code implementation in these files were analyzed in depth. This analysis process obtained the correspondence between the fixed files and the root causes of the defects.
[0044] On this basis, according to the correspondence between defect reports and fixed files, these defect reports were carefully data-annotated. The process of constructing this dataset was quite cumbersome. For defects that only involved one fixed file, they could be directly classified into the corresponding category. However, for defects that involved multiple fixed files, it was necessary to carefully read the defect reports and repair information, combined with manual analysis, to accurately determine their classification. During the annotation process, not only were the existing defects finely classified, but also supplementary and in-depth analysis were carried out for different types of compiler optimization defects.
[0045] Through multiple rounds of discussion and revision, this classification system was gradually improved, and finally a systematic and effective classification system for C language compiler optimization defects was formed. This system includes eight major categories and fourteen minor categories, constituting a two-layer classification framework. This framework provides systematic data support for subsequent research on compiler optimization defects and can provide an effective theoretical basis for defect detection and repair of compilers.
[0046] Step 3: Use the generative data augmentation method to expand the dataset to assist in improving the performance of the classifier.
[0047] During the research process, it was found that the quantity of real data was small, the features were sparse, and the phenomenon of data imbalance was serious. To further improve the learning ability and generalization performance of the classifier, the generative data augmentation method was used to expand the dataset. First, an initial classifier R was trained using the original real dataset. On this basis, a data generation strategy based on prompt templates (as shown in Figure 4 ) was designed. By providing high-quality defect report examples and carefully designed prompts to the GPT-4 model, it was guided to generate virtual defect report data consistent with the style of the original reports. This process made full use of the powerful generation ability of GPT-4 and its extensive knowledge base to generate diverse and realistic training materials, and at the same time achieved the purpose of knowledge distillation.
[0048] The newly generated data is not directly used for training. Instead, it is first input into the classifier R. After being screened and verified for stability by the classifier, potential low-quality data is eliminated, and only enhanced data with high credibility and relevance is retained. Finally, the screened enhanced data is mixed with the original dataset to construct a larger and more diverse comprehensive dataset. Through this innovative data augmentation strategy, the robustness and precision of the classification model are effectively improved, ensuring the efficiency and reliability of the model in practical applications.
[0049] Step 4: Appropriately preprocess the data and use the stacked ensemble learning method to integrate two large language models, RTA and Llama 3.1, to achieve automated classification.
[0050] Defect reports usually contain natural language descriptions and code blocks that trigger bugs. For the analysis of compiler defects, the code blocks in test cases are particularly important. Therefore, in order to enable the classification model to more effectively utilize the semantic and structural features of the code, the present invention designs a data preprocessing process aimed at separating the code and natural language descriptions in the defect report and inputting them into the classification model separately. In this way, the model can process the natural language information and code elements of the text separately, thereby better capturing the complex semantics contained in the compiler defect report.
[0051] To achieve this goal, based on the technical idea of the "island parsing method", an automated program is written to extract C language code blocks from the defect report and effectively separate them from the natural language part of the report. The specific process is as follows: First, regard the defect report as a "body of water", and then use the method of regular expressions to find specific C language syntax structures, such as functions, variable declarations, etc., as the starting point, regarded as "islands". Then, continuously explore the text around the islands and continue to expand the source code area until no more valid code blocks can be found. This method not only ensures that each part of the report can be used by the model in the most suitable way, but also provides clear and structured data input for the subsequent training process. In previous studies on defect reports, code elements were usually treated as ordinary text. Therefore, the innovation of this process lies in enabling the model to fully utilize the potential features of code elements, such as semantics and structure.
[0052] In the final stage of preprocessing, a prompt template (as Figure 3 shown) is designed to embed the report and the code into the corresponding areas in the template, aiming to combine the prompt engineering method to guide the model to more accurately understand the task and generate content in the specified format. Through this systematic preprocessing, the overall performance of the classification model can be significantly improved, providing strong support for subsequent defect analysis and repair work.
[0053] In terms of model selection, large language models (RTA and Llama 3.1) are adopted to implement automated classification tasks. Compared with traditional machine learning models, large language models have significant advantages. Their large number of parameters enables them to capture complex language patterns and semantic information. Especially when dealing with multi-modal data containing natural language and code, they can provide more efficient reasoning capabilities. With the help of pre-trained models and transfer learning techniques, only fine-tuning the model can make it adapt to specific task requirements. In addition, there are now a large number of pre-trained large language models for code understanding, and these models have very strong capabilities in understanding the semantics, syntax rules, and code structures of programming languages, greatly improving the accuracy and efficiency of classification.
[0054] The RTA model adopts the RoBERTa architecture, which is a variant of BERT. The RTA model is used because it is specifically designed for automated software maintenance tasks and can accurately capture language features related to defect reports. In this invention, a classification head is added at the end of the model, which includes a dense layer, a dropout layer, and an output layer. It takes the [CLS] token as input and outputs the original predicted values, that is, Logits. Then, the Logits are converted into a probability distribution (i.e., soft labels) through the Softmax activation function. The full-parameter fine-tuning method is used to adjust and optimize the performance of RTA, and the performance of the checkpoint (i.e., the trained model) is evaluated on the validation set every 100 steps, and the best-performing model among them is selected as the base model for subsequent ensemble learning.
[0055] The Llama3.1-8B-Instruct model is a pre-trained and instruction-fine-tuned generative model. It is one of the most powerful open-source large models currently, and has the ability to understand the semantics and structure of code. The Unsloth fine-tuning framework is used to optimize the training process, greatly improving the speed and memory utilization of model training. Its performance is twice that of frameworks such as HuggingFace, and the memory usage is reduced by 60%. The rsLoRA method is used to efficiently fine-tune Llama3.1. It is a variant of LoRA that greatly improves the efficiency and performance of model fine-tuning by optimizing the rank and scaling factor of the matrix, achieving excellent model performance with fewer computational resources while maintaining fewer training parameters. The Llama-3.1-8B-Instruct model has 41.94 million trainable parameters, while using the raLoRA method, only 0.91 million parameters need to be trained. In the experiment, considering the balance between cost and performance, the core parameters of rsLoRA were set to "r = 16, lora_alpha = 16". The prompt templates constructed in the preprocessing module are also mainly used to fine-tune the Llama3.1 model. The model undergoes self-supervised learning, generates new text after "Response:", and then uses regular expressions to extract the predicted class words from the generated text. The output of the model is guided through prompt engineering to ensure that the model can accurately generate one of the eight class words. Finally, considering the powerful and flexible generation ability of the decoder only, each test data is evaluated in multiple rounds, and the statistical data is used as a probability distribution.
[0056] Stacking is an ensemble learning method that improves the overall performance by combining multiple base learners. Using the stacking ensemble learning method, the prediction results of two large language models, RTA and Llama3.1 (i.e., the base models), are integrated, and a random forest is used as the final classification model (i.e., the meta-model). Specifically, first, the total dataset is randomly divided into five sub-datasets by the stratified sampling method. The first four sub-datasets are used as the training set, and the fifth sub-dataset is used as the test set. Then, four-fold cross-validation is performed on the training set to train the base models (RTA and Llama3.1), and the training methods are full-parameter fine-tuning and Lora efficient fine-tuning respectively. The soft labels of the prediction results of the two models are concatenated as meta-features. Then, a random forest model is trained on these meta-feature sets, and the hyperparameters are optimized through Optuna. Subsequently, the base models are trained again on the overall training set and evaluated on the test set to generate the corresponding meta-features. Finally, the trained random forest model is used to predict the meta-features generated in the previous step to obtain the final prediction result, that is, the root cause of a defect.
[0057] In addition, to verify the effectiveness of the method, four of the most commonly used text classification models were also trained as comparison methods. These comparison methods include: the shallow machine learning model SVM (Support Vector Machine), the deep learning model TextCNN (Convolutional Neural Network), the word vector model FastText, and the pre-trained model BERT (Bidirectional Encoder Representations from Transformers). Experimental results on 5,573 GCC optimization defect data show that the method performs significantly better than the existing four text classification methods, with the average accuracy improvement ranging from 16.98% to 179.99%.
Claims
1. A root cause classification method for optimization defects of a C language compiler, characterized in that Including: Step 1: Repeatedly iterate through manual analysis methods of literature analysis and data observation to construct a preliminary classification system; Step 2: While constructing the dataset, improve the final classification system through data verification methods; Step 3: Use generative data augmentation methods to expand the dataset and assist in improving the performance of the classifier; Step 4: Appropriately preprocess the data and use the stacked ensemble learning method to integrate two large language models, RTA and Llama 3.1, to achieve automated classification.
2. The root cause classification method for optimizing defects of a C language compiler according to claim 1, characterized in that, The above Step 1 constructs a preliminary classification system through repeated iteration of manual analysis methods of literature analysis and data observation, including: First, the system collected and sorted out some high-quality research literature on compiler defects as the object of literature analysis. By deeply analyzing the root causes and repair methods of representative sample defects in these literatures, preliminary classification ideas were proposed. Then, a benchmark dataset for C compiler defect localization was further collected for data observation. Through systematic analysis of this dataset, it was found that most of the defects only involved a single repair file. Therefore, considering starting from the location where the defect occurred, by focusing on the file with problems and analyzing the functions implemented by the code of this file, the root cause of the Bug was deduced in reverse. This process required a large amount of time for data observation and manual analysis. Through repeated iterative modification, the classification system was continuously optimized and adjusted, and a two-layer classification system was initially established.
3. A root cause classification method for optimizing defects of a C language compiler according to claim 1, characterized in that, The above Step 2 improves the final classification system through data verification methods while constructing the dataset, including: First, extract all historical commit records related to the optimization component from the GCC git repository. And extract the corresponding relationship between defects and repair files from the historical commit records, and manually check whether the files are used to directly implement the optimization function. By analyzing the functions and roles implemented by the code of the file where the defect is located, and according to the corresponding relationship between the defect report and it, data annotation is performed on the defect report. During the annotation process, not only the existing defects are classified, but also comprehensive supplementation and in-depth analysis are carried out for different types of compiler optimization defects. Through multiple rounds of repeated discussion and revision, the classification system is gradually improved, and finally a classification system for the root causes of C language compiler optimization defects with a clear structure is formed, including a two-layer structure, eight major categories and fourteen minor categories.
4. A root cause classification method for optimizing defects of a C language compiler according to claim 1, characterized in that, The above Step 3 uses generative data augmentation methods to expand the dataset and assist in improving the performance of the classifier, including; First, train a classifier R using the original dataset. At the same time, design a prompt template. By giving the GPT-4 model sample defect reports and prompts, guide it to generate new defect report data in the same style, making full use of the powerful generation ability of GPT-4 and its extensive knowledge base. Then, input the generated new data into the classifier R to screen out stable data. Finally, mix the screened data with the original data to form a new dataset. Through this innovative data augmentation strategy, the robustness and accuracy of the classification model can be effectively improved, ensuring the efficiency and reliability of the model in practical applications.
5. A root cause classification method for optimizing defects of a C language compiler according to claim 1, characterized in that, In step 4, appropriate preprocessing is performed on the data, and the stacking ensemble learning method is used to integrate two large language models, RTA and Llama3.1, to achieve automated classification, including: Based on the technical idea of the "island parsing method", a program for automatically separating code and natural language descriptions is written. First, the defect report is regarded as a water area, and then a set of C language structures are found using regular expressions, and this is used as the starting point, called an island. Then, the text around the island is explored, and the source code area is continuously expanded until no more code areas can be found. Therefore, this program can extract C language code blocks from the defect report to separate the code and natural language parts for subsequent model training. This automated classification method also designs a prompt template, embedding the separated report and code into the corresponding areas in the template respectively to guide the model to understand and generate more accurately. Through the stacking ensemble learning method, the prediction results of two large language models, RTA and Llama3.1, are integrated, and the random forest model is used as the final classification model. Specifically, first, the total data set is randomly divided into five sub-data sets by the stratified sampling method. The first four sub-data sets are used as the training set, and the fifth sub-data set is used as the test set. Then, four-fold cross-validation is performed on the training set to train the base models, namely RTA and Llama3.1, and the training methods are full-parameter fine-tuning and Lora efficient fine-tuning respectively. The soft labels of the prediction results of the two base models are concatenated as meta-features. Then, a meta-model, namely the random forest, is trained on these meta-feature sets, and the hyperparameters are optimized by the Optuna method. Subsequently, the base models are trained again on the overall training set and evaluated on the test set to generate the corresponding meta-features. Finally, the trained random forest model is used to predict the meta-features generated in the previous step to obtain the final prediction result, that is, the root cause of a defect. In addition, four commonly used text classification models are trained to compare and verify the effectiveness of this method, including the shallow machine learning model SVM, the deep learning model TextCNN, the word vector model FastText, and the pre-trained model BERT.