Method and system for expanding large model instruction fine adjustment data set
By adopting depth and breadth augmentation methods in large model fine-tuning data sets, using adding constraints, instruction deepening, concretization and inference steps to generate high-quality complex data sets, the problem of insufficient data sets and insufficient complexity is solved, and the model is improved. Training efficiency and performance.
Patent Information
- Application Number
- CN202411095213.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the fine-tuning process of large models, the insufficient number and complexity of data sets makes data labeling time-consuming and labor-intensive, and manual labeling has fatigue problems, which affects model performance and generalization capabilities.
Expand the data set through two aspects: depth and breadth. In terms of depth, we use adding constraints, deepening instructions, specifying instructions, and adding reasoning steps. In terms of breadth, we use prompt words to generate other questions in the same field as the original instructions, and use large models to generate responses. And make judgments to eliminate failed instructions to form high-quality and complex data sets.
It significantly saves manual time and energy, generates a large number of high-quality and complex instruction data sets, increases the number and complexity of data sets, and improves the training efficiency and performance of the model.
Smart Images

Figure CN118627591A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a method and system for expanding a large model instruction fine-tuning data set. Background Art
[0002] Fine-tuning a large model requires the use of a large number of instruction datasets. The steps usually include: ① Collecting data, which may require crawling data from the Internet, using public datasets, or obtaining data from internal systems. ② Labeling data, classifying text data, entity labeling, sequence labeling, etc. according to the needs of the task. ③ Data preprocessing, text cleaning and other operations before the data is fed into the model. There are some difficulties and challenges in making a dataset, such as: ① For certain specific domain tasks, it is difficult to collect sufficient quantity and quality of data. ② Data labeling may be a time-consuming process that requires professional knowledge. For some special tasks, such as entity recognition or relationship extraction, the participation of domain experts is required to ensure the accuracy of the labeling. ③ The data may have problems such as category imbalance or label noise, which affects the performance and generalization ability of the model. ④ Creating a dataset by manual labeling is time-consuming and labor-intensive, and people are prone to fatigue and cannot maintain high-intensity work to generate a sufficient proportion of complex or difficult instruction data. In short, it takes a lot of time and resources to make an instruction dataset, and various challenges need to be solved. Summary of the invention
[0003] Aiming at the problem of small number and insufficient complexity of data sets, the present invention proposes a method and system for expanding the data set of large model instruction fine-tuning, mainly in terms of quantity and complexity. Through the present invention, a large number of high-quality and complex instruction data sets can be generated, which greatly saves manual time and energy.
[0004] In order to achieve the above purpose, the technical solution adopted in this application is: In a first aspect, the present invention provides a method for expanding a large model instruction fine-tuning data set, comprising: acquiring a data set, expanding the data set in depth and breadth; in depth, adding constraints, deepening instructions, concretizing instructions, and increasing reasoning steps; in breadth, prompting words are used to allow the large model to generate other problems in the same field as the original instructions, sending the generated instructions to the large model to obtain responses, and finally, judging whether the newly generated instructions and responses are successful and meaningful, and eliminating failed instructions.
[0005] Furthermore, adding constraints means writing prompt words, allowing the large model to add a constraint or requirement based on the original instructions, making the original instructions a slightly more complex version.
[0006] Furthermore, instruction deepening is to write prompt words, so that the large model can increase the depth and breadth of related questions based on the original instructions, making the original instructions a slightly more complex version.
[0007] Furthermore, the instruction concretization is to write prompt words, so that the big model can replace some more specific concepts in the original instructions with general concept outputs.
[0008] Furthermore, to increase the reasoning step, prompt words are written to let the big model determine whether the original instructions can be solved through some thinking process. If so, let the big model rewrite the original instructions and require multi-step reasoning.
[0009] In a second aspect, the present invention provides a system for expanding a large model instruction fine-tuning data set, comprising: The acquisition module is used to obtain the data set; The data expansion module expands the data set in both depth and breadth. In terms of depth, it adds constraints, deepens instructions, specifies instructions, and increases reasoning steps. In terms of breadth, it uses prompt words to let the big model generate other questions in the same field as the original instructions, and then sends the generated instructions to the big model to get responses. Finally, it judges whether the newly generated instructions and responses are successful and meaningful, and eliminates failed instructions.
[0010] Compared with the prior art, the advantages and positive effects of the present invention are: The present invention expands the data set in two aspects: depth and breadth. In terms of depth, constraints are added, instructions are deepened, instructions are concretized, and reasoning steps are increased. In terms of breadth, prompt words are used to allow the large model to generate other problems in the same field as the original instructions, mainly in terms of quantity and complexity. The present invention can generate a large number of high-quality and complex instruction data sets, greatly saving manual time and energy. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0012] Figure 1 It is a flowchart diagram of the method for expanding a large model instruction fine-tuning a data set according to the present invention. DETAILED DESCRIPTION
[0013] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0014] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.
[0015] Embodiment 1, as Figure 1 As shown, this embodiment proposes a method for expanding the instruction fine-tuning data set of the big model. The data set is mainly expanded from two aspects: depth and breadth. The data set is a data set in the field of question and answer. This embodiment uses a data set in a general field, and it can also be a data set in the field of law and finance. First, expand in depth and perform the following four steps: add constraints, deepen instructions, concretize instructions, and increase reasoning steps. Adding constraints is to write prompt prompts, so that the big model adds a constraint or requirement on the basis of the original instructions, so that the original instructions become a slightly more complex version; deepening instructions is to write prompt prompts, so that the big model increases the depth and breadth of the inquiry of related questions on the basis of the original instructions, so that the original instructions become a slightly more complex version; concretizing instructions is to write prompt prompts, so that the big model replaces some more specific concepts in the original instructions with general concept outputs; adding reasoning steps is to write prompt prompts, so that the big model determines whether the original instructions can be solved through some thinking processes. If so, let the big model rewrite the original instructions and require multi-step reasoning. If not, continue to execute the original instructions. The above limits the newly generated instructions of the large model to no more than 20 words compared to the original instructions when writing prompt words.
[0016] Then, we expand the breadth of the problem by using prompts to let the big model generate other questions in the same field as the original instructions. Specifically, we write prompts to let the big model generate new instructions in the same field based on the original instructions, and the length and difficulty level of the instructions are similar to the original instructions.
[0017] For example, the original instruction is: "What is the attention mechanism?" After expanding it through the above steps and adding constraints, the instruction obtained is: "What is the key role of the attention mechanism in neural networks, especially the impact and complexity of processing large-scale data sets." After deepening the instruction, the instruction obtained is: "As an important technology in the field of deep learning, what role does the attention mechanism play?" After the instruction is concretized, it is obtained "What is the specific operating principle of the attention mechanism in deep learning and its application effect in natural language processing tasks." After adding the reasoning step, it is obtained "How to use multi-step reasoning to deeply explore the implementation of the attention mechanism in neural networks and its optimization strategy in different tasks." After expanding the breadth, it is obtained "How to achieve more effective information fusion when the application of the attention mechanism is extended to multimodal data processing." All generated instructions are sent back to the large model to generate responses. Of course, the large model may fail in the expansion of depth and breadth, and instruction elimination operations are needed to filter out the failures.
[0018] First, for the data set obtained by the above process, determine whether it is successful and meaningful. The judgment rules are as follows: 1. Compared with the original instruction, the newly generated instruction does not add any information. This judgment is handed over to the large model. 2. The newly generated instruction only contains symbols and some stop words. 3. The newly generated instruction duplicates some words in the prompt word. 4. The newly generated instruction is difficult to generate a response. When the generated response contains "sorry" and the length is less than 50, it is judged as a failure. If it fails, the instruction is deleted.
[0019] Through the above method, the original one data set can be expanded into five new data sets, and the complexity of the data set is improved.
[0020] Specifically, the prompt word projects corresponding to the four steps of deep expansion are as follows: Add constraint steps, add constraint prompts: I hope the big model will act as a prompt rewriter. The goal of the big model is to rewrite the #given prompts# given below into a slightly more complex version, making it difficult for some AI systems such as chagpt to handle. The rewritten prompts must be reasonable, understandable and answerable by humans. When rewriting, the big model should not omit non-text parts such as code, tables, etc. in the #given prompts#. The big model should use the following method to complicate the given prompts: Please add another constraint / requirement to the #given prompts#. The big model should try not to make "#rewrite prompts#" lengthy. #rewrite prompts# can only add 10 to 20 words based on the #given prompts#.
[0021] Instruction deepening step, words such as "given prompt words" and "rewritten prompt words" should not appear in #rewritten prompt words#; #given prompt words#: <fill in the original prompt words> #rewrite prompt words#: instruction deepening prompt words: I hope that the big model will play a prompt word rewriter. The goal of the big model is to rewrite the #given prompt words# given below into a slightly more complex version, which makes it difficult for some AI systems such as chagpt to handle. The rewritten prompt words must be reasonable and understandable to humans and can be answered. When rewriting, the big model should not omit non-text parts such as codes and tables in #given prompt words#. The big model should use the following method to make the given prompt words complicated: If the "given prompt words" contain inquiries about certain questions, the depth and breadth of the inquiry can be increased. The big model should try not to make "#rewrite prompt words#" lengthy. The #rewrite prompt words# can only add 10 to 20 words to the #given prompt words#. Words such as "given prompt words" and "rewritten prompt words" should not appear in #rewritten prompt words#.
[0022] Instruction specific step, #given prompt word#: <fill in the original prompt word> #rewrite prompt word#: Instruction specific prompt word: I hope the big model will play the role of a prompt word rewriter. The goal of the big model is to rewrite the #given prompt word# given below into a slightly more complex version, making it difficult for some AI systems such as chagpt to handle. The rewritten prompt word must be reasonable and understandable to humans and can be answered. When rewriting, the big model should not omit non-text parts such as codes, tables, etc. in the #given prompt word#. The big model should use the following method to make the given prompt word complex: Please replace general concepts with more specific concepts. The big model should try not to make "#rewrite prompt word#" too long. The #rewrite prompt word# can only add 10 to 20 words based on the #given prompt word#. Words such as "given prompt word" and "rewritten prompt word" should not appear in the #rewritten prompt word#.
[0023] Add reasoning steps, #given prompt words#: <fill in the original prompt words> #rewrite prompt words#: add reasoning steps prompt words: I hope the big model will play a prompt word rewriter. The goal of the big model is to rewrite the #given prompt words# given below into a slightly more complicated version, making it difficult for some AI systems such as chagpt to handle. The rewritten prompt words must be reasonable and understandable to humans and can be answered. When rewriting, the big model should not omit non-text parts such as codes, tables, etc. in the #given prompt words#. The big model should use the following method to complicate the given prompt words: If the #given prompt words# can be solved by some thinking process, the big model can rewrite it and require multi-step reasoning. The big model tries not to make "#rewrite prompt words#" too long. #rewrite prompt words# can only add 10 to 20 words to the #given prompt words#. "Given prompt words", "rewritten prompt words" and other words should not appear in #rewritten prompt words##Given prompt words#: <Fill in the original prompt words>#Rewrite prompt words#Breadth-expanded prompt words: The big model is expected to play the role of a prompt word generator. The goal of the big model is to get inspiration from the #given prompt words# to create a brand new prompt word. This new prompt word should be in the same field as the #given prompt words#. The length and difficulty level of the #generated prompt words# should be similar to the #given prompt words#. The #generated prompt words# must be reasonable and must be understood and responded to by humans. "Given prompt words", "generated prompt words" and other words should not appear in #generated prompt words#; #given prompt words#: <Fill in the original prompt words>#Generated prompt words#: Send the above-generated prompt words to the big model and get a response.
[0024] Embodiment 2, the present invention provides a system for expanding a large model instruction fine-tuning data set, comprising: Acquisition module, used to acquire data sets; The data expansion module expands the data set in both depth and breadth. In terms of depth, it adds constraints, deepens instructions, specifies instructions, and increases reasoning steps. In terms of breadth, it uses prompt words to let the big model generate other questions in the same field as the original instructions, and then sends the generated instructions to the big model to get responses. Finally, it judges whether the newly generated instructions and responses are successful and meaningful, and eliminates failed instructions.
[0025] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for expanding a large model instruction fine-tuning data set, characterized in that: include: Obtain a data set and expand it in depth and breadth. In terms of depth, add constraints, deepen instructions, concretize instructions, and increase reasoning steps. In terms of breadth, prompt words are used to let the big model generate other questions in the same field as the original instructions, and the generated instructions are sent to the big model to get responses. Finally, judge whether the newly generated instructions and responses are successful and meaningful, and eliminate failed instructions.
2. The method for expanding a large model instruction fine-tuning data set as claimed in claim 1, characterized in that: Adding constraints means writing prompt words to allow the large model to add a constraint or requirement based on the original instructions.
3. The method for expanding a large model instruction fine-tuning data set as claimed in claim 1, characterized in that: Instruction deepening is to write prompt words so that the large model can increase the depth and breadth of related questions based on the original instructions.
4. The method for expanding a large model instruction fine-tuning data set as claimed in claim 1, characterized in that: To make instructions concrete, you need to write prompt words and let the big model replace the specific concepts in the original instructions with general concept outputs.
5. The method for expanding a large model instruction fine-tuning data set as claimed in claim 1, characterized in that: To add reasoning steps, you need to write prompt words to let the big model determine whether the original instructions can be solved through some thinking processes. If so, let the big model rewrite the original instructions and require multi-step reasoning.
6. A system for expanding a large model instruction fine-tuning data set, characterized in that: include: The acquisition module is used to obtain the data set; The data expansion module expands the data set in both depth and breadth. In terms of depth, it adds constraints, deepens instructions, specifies instructions, and increases reasoning steps. In terms of breadth, it uses prompt words to let the big model generate other questions in the same field as the original instructions, and then sends the generated instructions to the big model to get responses. Finally, it judges whether the newly generated instructions and responses are successful and meaningful, and eliminates failed instructions.
Citation Information
Patent Citations
Visual language model instruction fine tuning method and device
CN117975475A
Method and system for optimizing cue word, electronic equipment and storage medium
CN118428492A
Retrieval enhanced question and answer method and system in combination with historical data
CN118467706A
Method, device, and program product for creating extent array in storage system
US20220171552A1
Cited By
Remote sensing image processing method and system based on space-based remote sensing model, electronic equipment and medium
CN119152373A
