Issue title generation model robustness improvement method based on adversarial learning

Through adversarial learning and data augmentation strategies, the robustness of the issue title generation model is improved, and the problem of unstable title quality generated by existing models when faced with slight perturbations in the input data is solved, achieving higher quality and more accurate issue Title generation.

CN119476271APending Publication Date: 2025-02-18BEIJING INFORMATION SCI & TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411547174.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing issue title generation model is poor in the face of slight perturbations in the input data, resulting in unstable quality of the generated titles and is difficult to meet the needs of practical applications.

Method used

Adopting an adversarial learning-based approach, using a large language model to generate adversarial samples, simulate the complex situations and input changes that the model may face in real application scenarios, and mix adversarial samples with the original samples through data augmentation strategies to retrain the model. To improve the robustness of the model.

Benefits of technology

It significantly improves the robustness of the issue title generation model, allowing the model to generate higher quality and more accurate issue titles when facing slight perturbations of the input data, and improves users' trust in the output results of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476271A_ABST
    Figure CN119476271A_ABST
Patent Text Reader

Abstract

The invention discloses an adversarial learning-based issue title generation model robustness improvement method, and relates to the technical field of adversarial learning. Comprising the following steps: inputting an issue original sample in an original training set into a large language model, generating an adversarial sample which may induce an existing issue title generation model to generate a wrong title or a low-quality title by using a thinking chain prompt method and the large language model, repeating the generation process to obtain an issue adversarial training set, and enhancing the adversarial training set by using a data enhancement strategy. The issue adversarial training set and the original training set are mixed to generate a mixed training set, the mixed training set is used for retraining an existing issue title generation model, a robust model is obtained, a sample is input into the robust model, and a generated issue title is obtained. According to the method, complex conditions and input changes possibly faced by the model in a real application scene can be effectively simulated, and the robustness of the model is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of adversarial learning technology, and in particular to a method for improving the robustness of an issue title generation model based on adversarial learning. Background Art

[0002] In open source platforms such as GitHub, developers use issues to record software defects, propose functional suggestions, or report missing documents, which plays a role similar to defect reports. However, due to limitations in professional knowledge and writing skills, the quality of issues varies, making it difficult for software maintainers to accurately obtain effective information from them, resulting in increased time and cost for software maintenance. To improve the quality of issues, large companies such as Mozilla and IBM provide issue writing guidelines or templates for users to refer to. In these commonly used guidelines and templates, the title is an important field that must be filled in, and users need to clearly and accurately summarize the key content of the issue in the title. High-quality issue titles can help software maintainers quickly understand the core content of the issue before reading the main description, helping them more effectively assign defect labels, set defect handling priorities, and develop defect repair plans, thereby reducing maintenance costs. However, studies have found that users and project contributors may not be able to accurately summarize the content of the issue due to limitations in professional level and experience, resulting in low-quality titles.

[0003] To solve the above problems, researchers have proposed methods for automatically generating issue titles, mainly including sequence-to-sequence-based methods and pre-trained model-based methods. Among them, the sequence-to-sequence-based method regards the issue body description and issue title as the article and article summary respectively, and uses a sequence-to-sequence-based model to generate the issue title, but its performance depends on the quality of the data set used in the training process. The method based on the pre-trained model applies a transfer learning strategy. By fine-tuning the pre-trained model, a model suitable for issue title generation can be quickly constructed. However, such methods are difficult to fully utilize the prior knowledge of the pre-trained model, and may also cause the model performance to deteriorate when the training data is insufficient. At the same time, deep learning models usually have the problem of poor robustness. Replacing a word, adding a punctuation mark, or even modifying a letter in the input data may cause the model results to change. Even large language models such as ChatGPT will change the model output due to small perturbations in the input. Therefore, in the issue title generation task, it is necessary to consider the robustness of the model to ensure that the model is as unaffected by small perturbations as possible and to improve the user's trust in the model output results.

[0004] Therefore, how to provide a method for improving the robustness of an issue title generation model is an urgent problem that technicians in this field need to solve. Summary of the invention

[0005] In view of this, the present invention provides a method for improving the robustness of an issue title generation model based on adversarial learning, which can effectively simulate the complex situations and input changes that the model may face in real application scenarios, and retrain the model to significantly improve the robustness of the model.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A method for improving the robustness of an issue title generation model based on adversarial learning includes the following steps:

[0008] S1. Adversarial sample generation: input the original issue samples in the original training set into the large language model, use the thought chain prompt method, and use the large language model to generate adversarial samples that may induce the existing issue title generation model to generate wrong titles or low-quality titles;

[0009] S2. Improve the robustness of the model. Repeat step S1 to generate an issue adversarial training set. Use the data enhancement strategy to mix the issue adversarial training set with the original training set to generate a mixed training set. Use the mixed training set to retrain the existing issue title generation model to obtain a robust model. Input the sample into the robust model to obtain the generated issue title.

[0010] In the above method, optionally, adversarial sample generation specifically includes:

[0011] S1.1: Extract the original samples of the issues to be processed from the original training set and perform data preprocessing;

[0012] S1.2: Input the original issue sample into the large language model LLMs and use LLMs to analyze its deep semantic information;

[0013] S1.3: Extract important elements from the original sample, including words and sentences, through LLMs;

[0014] S1.4: Use a large language model to perturb the extracted words and generate multiple word replacement pairs;

[0015] S1.5: Use a large language model to perturb the extracted sentences and generate multiple sentence replacement pairs;

[0016] S1.6: After obtaining word replacement pairs and sentence replacement pairs that are diverse and cover various possible perturbations, replace the corresponding parts in the original issue sample to obtain the initial test sample set T = t 1 ,t 2 ,…,tn ;

[0017] S1.7: Input the first generation test samples one by one into the target model to generate issue titles, and obtain the corresponding issue title set Y = y 1 ,y 2 ,…,y n , then calculate each issue title y i The mass change Δ i And sort them;

[0018] S1.8: According to the ranking results of the quality change values, select the top k samples with higher rankings in the initial test sample set. The selected samples are the generated adversarial samples;

[0019] S1.9: Output the generated issue adversarial sample.

[0020] In the above method, optionally, the original issue sample in S1.1 is discrete data, and the generation method of the issue adversarial sample includes character-level, word-level and sentence-level methods.

[0021] In the above method, optionally, the character-level adversarial sample generation method includes: taking a single character in the original sample of the issue as an object of adversarial perturbation, and the operation includes modifying, adding, and deleting the character;

[0022] The word-level adversarial sample generation method includes: taking the words in the original issue sample as the object of adversarial perturbation, and the operations include replacing, inserting, and deleting the words;

[0023] The sentence-level adversarial sample generation method includes: taking the entire sentence in the original issue sample as the object of adversarial perturbation, and the operation includes rewriting the original sentence and adding irrelevant sentences.

[0024] The above method, optionally, the mass change value Δ in S1.7 i The calculation method is:

[0025] Δ i =SCORE(y i ,refs)-SCORE(y i ',refs);

[0026] Among them, y i and i ' respectively correspond to the target model for the title of the original sample of the i-th issue and the corresponding first-generation adversarial sample, refs is the reference title, and SCORE is used to calculate the similarity between the title generated by the target model and the reference title.

[0027] The above method can be optionally used to improve the robustness of the model, including:

[0028] S2.1: Repeat step S1 to generate issue adversarial samples for each issue original sample;

[0029] S2.2: Collect all the issue adversarial samples generated in S2.1 together to form the issue adversarial training set;

[0030] S2.3: Mix the issue training set and the issue adversarial training set to generate a mixed training set, and use the mixed training set to fine-tune the target model;

[0031] S2.4: Save the fine-tuned trained model;

[0032] S2.5: Perform data preprocessing on the issue samples for which titles are to be generated, and input them into the trained robust model to generate issue titles;

[0033] S2.6: Output the issue title generated by the robust model.

[0034] It can be seen from the above technical solution that compared with the prior art, the present invention provides a method for improving the robustness of an issue title generation model based on adversarial learning, which has the following beneficial effects: 1) The present invention utilizes the semantic understanding ability of a large language model and combines it with a thought chain prompt method to generate issue adversarial samples that are semantically closer to the original samples. These adversarial samples can effectively simulate the complex situations and input changes that the model may face in real application scenarios; 2) The present invention applies a data enhancement strategy to mix the original samples and the generated issue adversarial samples, and input them into the model together for fine-tuning training, so that the model can be exposed to more diverse samples during the training process, helping it to adapt to slight perturbations in the issue content, thereby significantly improving the robustness of the model and enabling the model to generate higher quality and more accurate issue titles. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0036] Figure 1 This is a schematic diagram of a method for improving the robustness of an issue title generation model based on adversarial learning disclosed in the present invention;

[0037] Figure 2 This is a flow chart of a method for improving the robustness of an issue title generation model based on adversarial learning disclosed in the present invention;

[0038] Figure 3 A flowchart for generating adversarial samples disclosed in the present invention;

[0039] Figure 4 This is a flow chart of the method for improving model robustness disclosed in the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0042] Reference Figure 1 and Figure 2 As shown, the present invention discloses a method for improving the robustness of an issue title generation model based on adversarial learning, comprising the following steps:

[0043] S1. Adversarial sample generation: input the original issue samples in the original training set into the large language model, use the thought chain prompt method, and use the large language model to generate adversarial samples that may induce the existing issue title generation model to generate wrong titles or low-quality titles;

[0044] S2. Improve the robustness of the model. Repeat step S1 to generate an issue adversarial training set. Use the data enhancement strategy to mix the issue adversarial training set with the original training set to generate a mixed training set. Use the mixed training set to retrain the existing issue title generation model to obtain a robust model. Input the sample into the robust model to obtain the generated issue title.

[0045] Specifically, after adding a small perturbation to the issue sample, the model should generate semantically identical titles for similar issue samples. However, the existing issue title generation model has the problem of poor robustness. The issue titles generated by the model may undergo significant semantic changes, reducing the robustness and usability of the existing model in actual use. The present invention uses a large language model and combines the Chain-of-Thought (CoT) prompt method to generate issue adversarial samples. At the same time, it uses a data enhancement strategy to mix the issue adversarial samples with the original samples to construct a new training set, and uses the new training set to fine-tune the existing model, thereby improving the robustness of the model.

[0046] Furthermore, adversarial samples refer to input data that is designed to have specific perturbations added to it. These perturbations are usually imperceptible to humans, but are sufficient to cause deep learning models to produce erroneous outputs or produce content that is significantly different from the original output with a high degree of confidence. In order to measure and improve the robustness of the model, adversarial sample generation methods can be used to create specialized inputs to evaluate and improve the performance and stability of the model in the face of these minor perturbations.

[0047] Furthermore, the thought chain prompting method includes: decomposing a complex problem into multiple smaller and more manageable sub-problems, requiring LLMs to answer each sub-problem before outputting the final result, and outputting the final answer to the original problem by gradually solving the sub-problems and integrating the results of multiple sub-problems.

[0048] Further, see Figure 3 As shown in Figure 2, adversarial sample generation specifically includes:

[0049] S1.1: Extract the original samples of the issues to be processed from the original training set and perform data preprocessing;

[0050] S1.2: Input the original issue sample into the large language model LLMs and use LLMs to analyze its deep semantic information;

[0051] S1.3: Extract important elements from the original sample, including words and sentences, through LLMs;

[0052] S1.4: Use a large language model to perturb the extracted words and generate multiple word replacement pairs;

[0053] S1.5: Use a large language model to perturb the extracted sentences and generate multiple sentence replacement pairs;

[0054] S1.6: After obtaining word replacement pairs and sentence replacement pairs that are diverse and cover various possible perturbations, replace the corresponding parts in the original issue sample to obtain the initial test sample set T = t 1 ,t 2 ,…,t n ;

[0055] S1.7: Input the first generation test samples one by one into the target model to generate issue titles, and obtain the corresponding issue title set Y = y 1 ,y 2 ,…,y n , then calculate each issue title y i The mass change Δ i And sort them;

[0056] S1.8: According to the ranking results of the quality change values, select the top k samples with higher rankings in the initial test sample set. The selected samples are the generated adversarial samples;

[0057] S1.9: Output the generated issue adversarial sample.

[0058] Furthermore, the original issue sample in S1.1 is discrete data, and the generation methods of issue adversarial samples include character-level, word-level, and sentence-level methods.

[0059] Furthermore, the character-level adversarial sample generation method includes: taking a single character in the original sample of the issue as the object of adversarial perturbation, and the operation includes modifying, adding, and deleting the character;

[0060] The word-level adversarial sample generation method includes: taking the words in the original issue sample as the object of adversarial perturbation, and the operations include replacing, inserting, and deleting the words;

[0061] The sentence-level adversarial sample generation method includes: taking the entire sentence in the original issue sample as the object of adversarial perturbation, and the operation includes rewriting the original sentence and adding irrelevant sentences.

[0062] Furthermore, the mass change value Δ in S1.7 i The calculation method is:

[0063] Δ i =SCORE(y i ,refs)-SCORE(y i ',refs);

[0064] Among them, y i and i' respectively correspond to the target model for the title of the original sample of the i-th issue and the corresponding first-generation adversarial sample, refs is the reference title, and SCORE is used to calculate the similarity between the title generated by the target model and the reference title.

[0065] Specifically, SCORE can be calculated using indicators such as ROUGE, BLEU, and METEOR. These indicators are often used to evaluate the performance of tasks such as machine translation and text generation.

[0066] Further, see Figure 4 As shown in Figure 2, the model robustness improvement specifically includes:

[0067] S2.1: Repeat step S1 to generate issue adversarial samples for each issue original sample;

[0068] S2.2: Collect all the issue adversarial samples generated in S2.1 together to form the issue adversarial training set;

[0069] S2.3: Mix the issue training set and the issue adversarial training set to generate a mixed training set, and use the mixed training set to fine-tune the target model;

[0070] S2.4: Save the fine-tuned trained model;

[0071] S2.5: Perform data preprocessing on the issue samples for which titles are to be generated, and input them into the trained robust model to generate issue titles;

[0072] S2.6: Output the issue title generated by the robust model.

[0073] Furthermore, the issue adversarial training set in S2.2 contains more and more diverse issue samples than the original issue training set;

[0074] The fine-tuned model is more robust than the original target model and can adapt to perturbations in the issue text.

[0075] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0076] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for improving the robustness of an issue title generation model based on adversarial learning, characterized in that: The following steps are involved: S1. Adversarial sample generation: input the original issue samples in the original training set into the large language model, use the thought chain prompt method, and use the large language model to generate adversarial samples that may induce the existing issue title generation model to generate wrong titles or low-quality titles; S2. Improve the robustness of the model. Repeat step S1 to generate an issue adversarial training set. Use the data enhancement strategy to mix the issue adversarial training set with the original training set to obtain a mixed training set. Use the mixed training set to retrain the existing issue title generation model to obtain a robust model. Input the sample into the robust model to obtain the generated issue title.

2. According to claim 1, a method for improving the robustness of an issue title generation model based on adversarial learning is characterized in that: Adversarial sample generation specifically includes: S1.1: Extract the original samples of the issues to be processed from the original training set and perform data preprocessing; S1.2: Input the original issue sample into the large language model LLMs and use LLMs to analyze its deep semantic information; S1.3: Extract important elements from the original sample, including words and sentences, through LLMs; S1.4: Use a large language model to perturb the extracted words and generate multiple word replacement pairs; S1.5: Use a large language model to perturb the extracted sentences and generate multiple sentence replacement pairs; S1.6: After obtaining word replacement pairs and sentence replacement pairs that are diverse and cover various possible perturbations, replace the corresponding parts in the original issue sample to obtain the initial test sample set T = t1, t2, ..., t n ; S1.7: Input the first generation test samples one by one into the target model to generate issue titles, and obtain the corresponding issue title set Y = y1, y2, ..., y n , then calculate each issue title y i The mass change Δ i And sort them; S1.8: According to the ranking results of the quality change values, select the top k samples with higher rankings in the initial test sample set. The selected samples are the generated adversarial samples; S1.9: Output the generated issu e Adversarial examples.

3. According to claim 2, a method for improving the robustness of an issue title generation model based on adversarial learning is characterized in that: The original issue samples in S1.1 are discrete data, and the generation methods of issue adversarial samples include character-level, word-level, and sentence-level methods.

4. According to claim 3, a method for improving the robustness of an issue title generation model based on adversarial learning is characterized in that: The character-level adversarial sample generation method includes: taking a single character in the original sample of the issue as the object of adversarial perturbation, and the operation includes modifying, adding, and deleting the character; The word-level adversarial sample generation method includes: taking the words in the original issue sample as the object of adversarial perturbation, and the operations include word replacement, insertion, and deletion; The sentence-level adversarial sample generation method includes: taking the entire sentence in the original issue sample as the object of adversarial perturbation, and the operation includes rewriting the original sentence and adding irrelevant sentences.

5. According to claim 2, a method for improving the robustness of an issue title generation model based on adversarial learning is characterized in that: S1.7 Mass change value Δ i The calculation method is: Δ i =SCORE(y i ,refs)-SCORE(y i ′,refs); Among them, y i and i ′ respectively correspond to the titles generated by the target model for the original sample of the i-th issue and the corresponding first-generation adversarial sample, refs is the reference title, and SCORE is used to calculate the similarity between the title generated by the target model and the reference title.

6. According to claim 1, a method for improving the robustness of an issue title generation model based on adversarial learning is characterized in that: The model robustness improvements include: S2.1: Repeat step S1 to generate issue adversarial samples for each issue original sample; S2.2: Collect all the issue adversarial samples generated in S2.1 together to form the issue adversarial training set; S2.3: Mix the issue training set and the issue adversarial training set to generate a mixed training set, and use the mixed training set to fine-tune the target model; S2.4: Save the fine-tuned trained model; S2.5: Perform data preprocessing on the issue samples for which titles are to be generated, and input them into the trained robust model to generate issue titles; S2.6: Output the issue title generated by the robust model.