Efficient instruction evolution method based on label injection and readable storage medium
By constructing a tag pool and generating the optimal tag combination method, the iterative problem of instruction evolution methods in the prior art is solved, and the effect of efficiently generating diversified synthetic data is achieved.
Patent Information
- Application Number
- CN202510465093.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-15
AI Technical Summary
The existing instruction evolution method requires multiple rounds of iteration, resulting in time consumption and cumulative errors, making it difficult to efficiently generate high-quality synthetic data.
By building a tag pool, diversified and specific tags are extracted from the seed dataset, combining the difficulty budget to generate optimal tag combinations, and multiple rounds of evolution are carried out to generate synthetic data at different levels of difficulty, avoiding fixed strategies and iterative processes.
It realizes efficient generation of synthetic data of different difficulty levels without artificially designed evolution instructions, avoiding cumulative errors and time waste.
Smart Images

Figure CN120492031A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an efficient instruction evolution method based on label injection and a readable storage medium, belonging to the technical field of artificial intelligence. Background Art
[0002] Instruction evolution methods involve evolving the instructions of a seed dataset through a large model to gradually improve the quality of the original data. Existing instruction evolution methods include Evol-Instruct and Auto-Evol-Instruct. Evol-Instruct evolves the dataset through manually designed evolutionary instructions, while Auto-Evol-Instruct reduces the cost of manual design by allowing the large model to design specialized instructions for different domains and adapts the evolved instructions to different domains.
[0003] To obtain higher-quality instructions, existing instruction evolution methods require multiple rounds of evolutionary iterations, which not only consumes additional time but also introduces cumulative errors due to hallucinations. An ideal instruction evolution algorithm should have diverse and specific evolution strategies and be able to efficiently generate synthetic data of varying difficulty. Summary of the Invention
[0004] In order to solve the problem that traditional instruction evolution methods require multiple rounds of evolution iterations, which results in extra time consumption and the introduction of cumulative errors due to hallucinations, the present invention proposes an efficient instruction evolution method based on label injection and a readable storage medium.
[0005] The technical solution adopted by the present invention to solve the above problems is: the present invention comprises the following steps:
[0006] Step 1: Extract diverse and specific labels from the seed dataset and build a label pool;
[0007] Step 2: Obtain the optimal label combination and evolved instructions based on the original data, difficulty budget, and label combination of the corresponding data, and rewrite the evolved instructions;
[0008] Step 3: Set different difficulty budgets and repeat step 2 for multiple rounds of evolution to generate synthetic data of different difficulty levels.
[0009] Furthermore, step 1 specifically includes:
[0010] Step 1.1: Summarize the main characteristics of the sample from a macro perspective, where the main characteristics include at least task type, required skills, and arithmetic type. Use the prompt model to describe the macro characteristics of the sample and generate a list of aspects.
[0011] Step 1.2: Generate specific labels for each aspect based on the aspect list and use the labels as instructions for the evolution strategy.
[0012] Furthermore, step 2 specifically includes:
[0013] Step 2.1: Under the premise of controlling the difficulty budget, select the corresponding candidate label set candi from the label pool for each sample;
[0014] Step 2.2: Based on the difficulty budget b during the calculation process, select an optimal label combination t from the candidate label set candi so that the number of labels is equal to the budget b. Generate an injection plan based on the selected optimal label combination t and the original data;
[0015] Step 2.3: Generate evolved instructions based on the calculation and rewrite the evolved instructions;
[0016] Optimal label combination t and evolved instructions The calculation formula is:
[0017]
[0018] In formula (1), M θ (·)for.
[0019] Furthermore, step 2 specifically includes:
[0020] Step 2.1: Under the premise of controlling the difficulty budget, select the corresponding candidate label set candi from the label pool for each sample;
[0021] Step 2.2: Based on the difficulty budget b during the calculation process, select an optimal label combination t from the candidate label set candi so that the number of labels is equal to the budget b. Generate an injection plan based on the selected optimal label combination t and the original data;
[0022] Step 2.3: Generate evolved instructions based on the calculation and rewrite the evolved instructions;
[0023] Optimal label combination t and evolved instructions The calculation formula is:
[0024]
[0025] In formula (1), M θ (·)for.
[0026] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any one of steps 1-3 of the efficient instruction evolution method.
[0027] The beneficial effects of the present invention are:
[0028] 1. This invention redesigns the instruction evolution method from the perspective of labels. These labels represent the attributes contained in the instructions. A rich variety of specific labels are used as evolution strategies, and the degree of evolution is explicitly controlled by varying the combination and number of labels. In this way, the invention can avoid fixed strategies by combining labels and control the number of injected labels, thus directly generating difficult samples without iteration.
[0029] 2. The present invention does not require artificial design of evolution instructions when evolving instructions, and is more efficient during evolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A flowchart of an efficient instruction evolution method based on label injection provided by the present invention;
[0031] Figure 2 A flowchart of the calculation program of the efficient instruction evolution method provided by the present invention. DETAILED DESCRIPTION
[0032] Specific implementation method 1: Combination Figure 1 This embodiment is described as follows. Figure 1 As shown, the steps of an efficient instruction evolution method based on label injection described in this embodiment include:
[0033] S1: Build a label pool;
[0034] The goal of label pool construction is to extract as diverse and specific labels as possible from the seed dataset to guide the subsequent evolution process. In order to generate more specific and diverse labels, this scheme proposes a multi-step fine-grained labeling method, which includes:
[0035] S101: aspect generation;
[0036] The goal of this step is to summarize the main characteristics of the sample from a macro perspective, such as task type, required skills, arithmetic type, etc., by prompting the model to describe the macro characteristics of the sample in an abstract way and generate a list of aspects. These aspects ensure the diversity of the evolution strategy and are able to change the task category of the sample or add new constraints.
[0037] S102: label generation;
[0038] The goal of this step is to generate specific labels for each aspect based on the aspect list generated in S101. Specifically, the model generates specific labels based on the aspect list, and these labels will serve as the final evolution strategy.
[0039] S2: label sampling evolution;
[0040] The goal of label sampling evolution is to gradually increase the difficulty of samples by injecting appropriate label combinations. The specific steps are as follows:
[0041] S201: The purpose of this step is to select a suitable label combination for each sample under the premise of controlling the difficulty budget. Specifically, input the original data x, the difficulty budget b and the candidate label set candi sampled from the label pool, and output the evolved instruction and the selected tag combination t;
[0042] Optimal label combination t and evolved instructions The calculation formula is:
[0043]
[0044] In formula (1), M θ (·)for.
[0045] S202: Select a subset from the candidate label set so that the number of labels is equal to the budget b. After obtaining the labels, generate a detailed injection plan based on the original instructions and the selected labels, and generate evolved instructions based on the plan and rewrite the evolved instructions to remove possible hallucination content.
[0046] S203: This step aims to provide a fair comparison with existing Evol-Instruct methods. Therefore, this implementation also employs a multi-round evolutionary approach. First, different difficulty budgets are set for different domains. For example, for mathematics, 1 label, 3 labels, and 5 labels are set; for coding, 3 labels, 5 labels, and 7 labels are set. Multiple rounds of evolution are then performed on the seed dataset, each using a different difficulty budget to generate synthetic data of varying difficulty levels.
[0047] This paper redesigns the instruction evolution method from the perspective of labels. These labels represent the attributes contained in the instructions. It uses a rich variety of specific labels as the evolution strategy, and explicitly controls the degree of evolution through different combinations and quantities of labels. In this way, the present invention can avoid fixed strategies by combining labels and control the number of injected labels, thus directly generating difficult samples without iteration.
[0048] In addition, this embodiment proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the efficient instruction evolution methods in S1-S2, specifically the steps as follows: Figure 2 shown.
[0049] 1. Label Pool Construction
[0050] Original instruction: Create a C++ program for randomly shuffling an array of integers.
[0051] Prompt for the large model to extract tags:
[0052] You are a tagging system that provides useful tags for task intentions to distinguish tasks for a helpful AI assistant.
[0053] #Task
[0054] Create a C++ program for randomly shuffling an array of integers.
[0055] Please follow the steps below to assign tags to the given task.
[0056] Step 1: Consider from which aspects that tags can be assigned to cover main features of the task and provide a brief explanation. Aspects need to be summarizing, such as ’Required skill’. etc. Please summarize this task with as few aspects as possible.
[0057] Step 2: Based on the #Aspect List# obtained in Step 1, assign core tags to the given task from each aspect.
[0058] Please reply strictly in the following format: Step 1#Aspect List and Explanation#:
[0059] Step 2#Aspect2Tags#:
[0060] #Aspect2Tags#{"xxx":[tag1,tag2,...],"xxx":[tag1,tag2,...],...}wherexxx means aspect you get in step 1.
[0061] Obtained tag pool:
[0062] "Required skill":["Programming","Algorithm"],"Programming language":["C++"],"Tasktype":["Function Implementation"],"Data structure":["Array"]
[0063] 2. Label Sampling Evolution
[0064] Original instruction:
[0065] Sixteen is 64% of what number?
[0066] Select a tag:
[0067] ['exponentiation','geometry']
[0068] Evolution Instructions:
[0069] A square has a side length that is 64% of a certain number. If the area of the square is 256 square units, what is the original number?
[0070] In summary, through the calculation program of efficient instruction evolution in this embodiment, it can be seen that the present invention does not require artificial design of evolution instructions when evolving instructions, and is more efficient during evolution.
[0071] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the present profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical content disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement of the above embodiments made according to the technical essence of the present invention, within the spirit and principles of the present invention, without departing from the content of the technical solution of the present invention, shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. An efficient instruction evolution method based on label injection, characterized in that: The steps of the efficient instruction evolution method based on label injection include: Step 1: Extract diverse and specific labels from the seed dataset and build a label pool; Step 2: Obtain the optimal label combination and evolved instructions based on the original data, difficulty budget, and label combination of the corresponding data, and rewrite the evolved instructions; Step 3: Set different difficulty budgets and repeat step 2 for multiple rounds of evolution to generate synthetic data of different difficulty levels.
2. The efficient instruction evolution method based on label injection according to claim 1, characterized in that: Step 1 specifically includes: Step 1.1: Summarize the main characteristics of the sample from a macro perspective, where the main characteristics include at least task type, required skills, and arithmetic type. Use the prompt model to describe the macro characteristics of the sample and generate a list of aspects. Step 1.2: Generate specific labels for each aspect based on the aspect list and use the labels as instructions for the evolution strategy.
3. The efficient instruction evolution method based on label injection according to claim 1 is characterized in that: Step 2 specifically includes: Step 2.1: Under the premise of controlling the difficulty budget, select the corresponding candidate label set candi from the label pool for each sample; Step 2.2: Based on the difficulty budget b during the calculation process, select an optimal label combination t from the candidate label set candi so that the number of labels is equal to the budget b. Generate an injection plan based on the selected optimal label combination t and the original data; Step 2.3: Generate evolved instructions based on the calculation and rewrite the evolved instructions; Optimal label combination t and evolved instructions The calculation formula is: In formula (1), M θ (·) is the model used by the evolution instruction.
4. The efficient instruction evolution method based on label injection according to claim 1, characterized in that: Step 3 specifically includes: According to the different application fields of the instructions, set the corresponding difficulty budget and repeat step 2 to perform multiple rounds of Golden Garlic on the seed dataset. Each round of evolution uses a different difficulty budget to generate synthetic data of different difficulty levels.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the efficient instruction evolution method according to any one of claims 1 to 4 are implemented.