Data instruction generation method and device, data instruction enhancement method and device and terminal equipment

Through Prompt engineering and large language models, the instruction generation model is built, and key information is extracted from aerospace text data and Q&A instructions are generated, which solves the problem of relying on manual extraction of aerospace expertise in the existing technology, and efficient and automated instruction data set generation is achieved, improving data quality and coverage.

CN120354935APending Publication Date: 2025-07-22XIAN ZHONGKE TIANTA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510348657.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing instruction dataset generation method relies on manual extraction of expertise in aerospace, which is inefficient and costly, and cannot fully utilize the text generation capabilities of large models. The existing automation methods require manual design of seed data, which is time-consuming and labor-intensive.

Method used

The command generation model is built using Prompt engineering and large language models, a seed data pool is built through aerospace text data, and iterative data expansion is used to automatically generate Q&A instructions to realize a fully automated process.

Benefits of technology

It greatly reduces labor costs and time consumption, improves the efficiency and quality of instruction data generation, ensures the diversity and coverage of data sets, and has rich domain knowledge and logical relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354935A_ABST
    Figure CN120354935A_ABST
Patent Text Reader

Abstract

The invention discloses a data instruction generation and enhancement method and device and terminal equipment. The method comprises the steps that an instruction generation model is built based on Prompt engineering and a large language model, and a seed data pool is built based on the instruction generation model and spaceflight text data; the seed data pool comprises a plurality of question and answer instructions; initializing an enhanced data pool, and iteratively updating the enhanced data pool based on a preset reference data value, the instruction generation model and the seed data pool; in each iteration process, randomly extracting a plurality of pieces of sample instruction data from the enhanced data pool and the seed data pool based on the reference data value; performing data expansion on the sample instruction data on the basis of the instruction generation model and a preset three-level logic judgment rule to obtain expanded instruction data, and updating the enhanced data pool on the basis of the expanded instruction data; and stopping iteration until the number of instructions in the enhanced data pool reaches a preset requirement, and completing data enhancement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of aerospace command generation, and particularly to a method, device and terminal device for data instruction generation and enhancement. Background Art

[0002] An instruction dataset is a collection containing specific instructions and related inputs and outputs, aiming to train and evaluate machine learning models, especially natural language processing (NLP) models. Such datasets usually contain instructions for various tasks, such as question answering, text generation, dialogue, text classification, etc. Instruction datasets are generally used for supervised fine-tuning of base large models and private domain large models, and can also be used as an ability evaluation dataset for large models. The instruction datasets commonly used for fine-tuning aerospace private domain large models typically have a storage size ranging from about 10MB to 1GB. Such datasets contain a large amount of professional knowledge in the aerospace field. To improve the language generation ability of the large model after fine-tuning, it is necessary to enrich each knowledge point to fill the knowledge gap of the base model in the aerospace professional field. A 10MB instruction dataset file can store 5,242,880 characters. To obtain sufficient fine-tuning data, we usually need to perform data augmentation on the existing instruction datasets. Existing text data augmentation methods focus on replacing synonyms while maintaining semantics. For example, word vector models such as Word2Vec and BERT are used to replace the original words with synonyms having the highest vector similarity, or machine translation tools are used to translate the text into another language and then translate it back to increase the diversity of the text. There are mainly two existing methods for generating instruction datasets. One is manual generation, which consumes a large amount of manpower and time and is difficult to use in actual work. The other is to generate instruction datasets based on the Self-Instruct algorithm, which is a semi-automatic instruction set generation method. This method requires manually designing several instructions for different tasks as a seed pool, and then using a large model to select a small number of instructions from it as a reference to generate new instructions. After cleaning the new instructions, they are added to the seed pool, and this step is repeated until there is enough data in the seed pool.

[0003] Existing methods for generating instruction datasets do not fully utilize the text extraction and generation capabilities of large models, and preliminary domain knowledge question-answer pairs need to be obtained through manual extraction methods first. Although the Self-Instruct algorithm can generate instruction datasets in batches, it still requires manually designing some seed data. Manually extracting aerospace professional knowledge from various aerospace documents and materials consumes a large amount of time, has a high labor cost, and is inefficient. Summary of the Invention

[0004] The present invention provides a method, device and terminal device for data instruction generation and enhancement to improve the efficiency of generating instruction data in the aerospace field.

[0005] To solve the above technical problems, an embodiment of the present invention provides a method for generating and enhancing data instructions, including:

[0006] Construct an instruction generation model based on Prompt engineering and large language models, and construct a seed data pool based on the instruction generation model and aerospace text data; the seed data pool includes several Q&A instructions;

[0007] Initialize the enhanced data pool, and iteratively update the enhanced data pool based on a preset reference data value, the instruction generation model, and the seed data pool;

[0008] In each iteration process, randomly extract several sample instruction data from the enhanced data pool and the seed data pool respectively based on the reference data value; and perform data augmentation on the sample instruction data based on the instruction generation model and a preset three-level logic judgment rule to obtain augmented instruction data, and update the enhanced data pool based on the augmented instruction data;

[0009] Stop iterating until the number of instructions in the enhanced data pool reaches the preset requirement, and complete data enhancement.

[0010] By using Prompt engineering and large language models to construct an instruction generation model, the present invention can directly extract key information from text data in the aerospace field, generate Q&A instructions, and thus construct a seed data pool, avoiding the cumbersome process of relying on manual extraction of professional knowledge from documents in the traditional method, thereby greatly reducing labor costs and time consumption. At the same time, through the preset reference data value, mixed sampling of seed data and existing enhanced data is realized, and then the large language model is used to combine the preset three-level logic judgment rule to perform logical judgment on the sample data to achieve data augmentation, realizing a fully automated process from preliminary seed data to data enhancement, and expanding the diversity and coverage of Q&A pairs in the instruction data based on the three-level logic judgment, ensuring that the generated data has richer domain knowledge and logical relationships, improving the efficiency and data quality of instruction data generation in the aerospace field, and reducing the need for manual intervention.

[0011] Further, the randomly extracting several sample instruction data from the enhanced data pool and the seed data pool respectively based on the reference data value includes:

[0012] Obtain a first sample quantity value and a second sample quantity value based on the reference data value; the sum of the first sample quantity value and the second sample quantity value is equal to the reference data value;

[0013] Randomly extract sample instruction data from the seed data pool based on the first sample quantity value;

[0014] Randomly extract sample data instructions from the enhanced data pool based on the second sample quantity value.

[0015] In the present invention, by performing balanced random sampling from the seed data pool and the enhanced data pool, it is ensured that a controlled amount of seed data and the enhanced data generated in the previous stage are used in each iteration. This avoids the error accumulation and "hallucination" phenomena that may occur when only using enhanced data, and at the same time enhances the diversity of the data. By controlling the sample quantity, it is ensured that the ratio of the seed data to the enhanced data is consistent, avoiding over-reliance on manual data or completely machine-generated data. This balanced process improves the generation efficiency and the quality of the final data set.

[0016] Furthermore, the three-level logical judgment rules include causal judgment, parallel judgment, and cross judgment; the data expansion of the sample instruction data is performed based on the instruction generation model and the preset three-level logical judgment rules to obtain expanded instruction data, and the enhanced data pool is updated based on the expanded instruction data, including:

[0017] Traverse any one sample instruction in the sample instruction data, and perform data expansion on each sample instruction based on the causal judgment and the parallel judgment to obtain causal expansion instructions and parallel expansion instructions;

[0018] Traverse any two sample instructions in the sample instruction data, and perform data expansion on the any two sample instructions based on the cross judgment to obtain cross expansion instructions;

[0019] Generate expanded instruction data based on the causal expansion instructions, parallel expansion instructions, and cross expansion instructions, and add the expanded instruction data to the enhanced data pool to update the enhanced data pool.

[0020] In the present invention, by using causal judgment and parallel judgment to expand a single sample instruction, the causal relationship and parallel relationship related to the original problem can be refined from different angles, so that the generated new Q&A instructions cover a richer knowledge background and logical reasoning, and the diversity and depth of the data are improved. Moreover, by performing cross judgment on any two sample instructions, the cross-correlations between different Q&A can be discovered and integrated, so as to generate instruction data with comprehensiveness and extensibility, which helps to capture more complex knowledge associations in the field and enhance the comprehensive coverage ability of the data set.

[0021] Furthermore, the traversing any one sample instruction in the sample instruction data, and performing data expansion on each sample instruction based on the causal judgment and the parallel judgment to obtain causal expansion instructions and parallel expansion instructions, includes:

[0022] Traversing any sample instruction in the sample instruction data, performing causal judgment on each sample instruction, obtaining a causal relationship of the sample instruction, and performing data expansion on the sample instruction based on the causal relationship to obtain a causal expansion instruction;

[0023] Traverse any sample instruction in the sample instruction data, perform parallel judgment on each sample instruction, obtain the parallel relationship of the sample instructions, perform data expansion on the sample instructions based on the parallel relationship, and obtain parallel expansion instructions.

[0024] The present invention can automatically identify and extract the causal relationship by performing causal judgment on each sample instruction, and then expand and generate new instruction data based on this relationship; at the same time, through parallel judgment, the parallel logic existing in the instruction is identified, and then a variety of parallel expansion instructions are generated.

[0025] Further, traversing any sample instruction in the sample instruction data, performing causal judgment on each sample instruction, obtaining the causal relationship of the sample instruction, and performing data expansion on the sample instruction based on the causal relationship to obtain the causal expansion instruction includes:

[0026] Traversing any sample instruction in the sample instruction data;

[0027] For any sample instruction, determine whether there is a causal relationship between the question and the answer of the sample instruction;

[0028] If there is a causal relationship, the question and answer of the sample instruction are inverted to generate a causal expansion instruction.

[0029] By performing causal judgment on each sample instruction, the present invention can automatically detect whether there is a causal relationship between the question and the answer, thereby providing a basis for subsequent data expansion and avoiding the tedious work of manual analysis one by one. At the same time, when it is judged that there is a causal relationship, new causal expansion instructions are generated by inverting the question and the answer. The new data generated by the inversion processing can capture the causal chain that is not fully presented in the original question and answer pair, thereby realizing knowledge complementarity and expansion at the data level, and improving the coverage and expression ability of the overall data set.

[0030] Further, traversing any sample instruction in the sample instruction data, performing parallel judgment on each sample instruction, obtaining the parallel relationship of the sample instructions, performing data expansion on the sample instructions based on the parallel relationship, and obtaining the parallel expanded instruction, includes:

[0031] Traversing any sample instruction in the sample instruction data;

[0032] For any sample instruction, determine whether there is a parallel relationship in the question or answer of the sample instruction;

[0033] If there is a parallel relationship in the question of the sample instruction, based on the parallel relationship, perform differentiation processing on the question of the sample instruction to generate a number of parallel questions, and generate parallel expansion instructions based on the parallel questions;

[0034] If there is a parallel relationship in the answer of the sample instruction, based on the parallel relationship, perform differentiation processing on the answer of the sample instruction to generate a number of parallel answers, and generate parallel expansion instructions based on the parallel answers.

[0035] In the present invention, when there is a parallel relationship in the question or answer, through differentiation processing, complex or compound expressions can be split into multiple independent questions or answers. The parallel questions or answers after differentiation processing can generate a number of parallel expansion instructions, thereby enriching the structure and content of the data set, not only expanding the data volume, but also providing knowledge expressions from multiple angles, improving the diversity and coverage of the data.

[0036] Further, traverse any two sample instructions in the sample instruction data, and perform data expansion on the any two sample instructions based on cross-judgment to obtain cross-expansion instructions, including:

[0037] Traverse any two sample instructions in the sample instruction data;

[0038] For any two sample instructions, obtain the association relationship between the two sample instructions based on cross-judgment, and integrate the questions and answers of the two sample instructions based on the association relationship to generate cross-expansion instructions.

[0039] In the present invention, through cross-judgment, the potential association relationship between different question-and-answer instructions is identified, the comprehensive knowledge points that may be missed in a single instruction are supplemented, and the information dimension of the data set is enriched. Thus, the questions and answers in the two instructions are integrated to generate new cross-expansion instructions, which helps to construct comprehensive questions across knowledge points, enabling the data set to no longer be limited to information from a single source, but to be able to integrate multiple viewpoints and logical relationships from different instructions, thereby greatly enhancing the data diversity and overall quality.

[0040] Further, in the first iteration process, the enhanced data pool is an empty set, and a number of sample instruction data are randomly selected from the seed data pool based on the reference data value.

[0041] In a second aspect, the present invention provides a data instruction generation and enhancement device, including: an instruction generation module and an instruction enhancement module;

[0042] The instruction generation module is used to build an instruction generation model based on Prompt engineering and a large language model, and build a seed data pool based on the instruction generation model and aerospace text data; the seed data pool includes a number of Q&A instructions;

[0043] The instruction enhancement module is used to initialize the enhancement data pool, and iteratively update the enhancement data pool based on a preset reference data value, the instruction generation model, and the seed data pool;

[0044] In each iteration process, a number of sample instruction data are randomly selected from the enhancement data pool and the seed data pool respectively based on the reference data value; and data expansion is performed on the sample instruction data based on the instruction generation model and a preset three-level logical judgment rule to obtain expanded instruction data, and the enhancement data pool is updated based on the expanded instruction data;

[0045] Until the number of instructions in the enhancement data pool reaches the preset requirement, stop the iteration and complete the data enhancement.

[0046] In a second aspect, the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the data instruction generation and enhancement method described above is implemented. Description of the Drawings

[0047] Figure 1 It is a schematic flowchart of a data instruction generation and enhancement method provided by an embodiment of the present invention;

[0048] Figure 2 It is a schematic diagram of instruction data generation provided by an embodiment of the present invention;

[0049] Figure 3 It is a schematic flowchart of instruction enhancement provided by an embodiment of the present invention. Detailed Embodiments

[0050] The following combines the drawings and embodiments to further describe in detail the specific embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0051] The terms "first" and "second" in the specification, claims, and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0052] As used herein, the reference to "embodiment" means that the specific features, structures, or characteristics described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears at various positions in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.

[0053] Embodiment 1

[0054] See Figure 1 , Figure 1 which is a schematic flowchart of a method for generating and enhancing data instructions provided by an embodiment of the present invention. An embodiment of the present invention provides a fuel cell performance recovery method, including steps 101 to 102, specifically as follows:

[0055] Step 101: Construct an instruction generation model based on Prompt engineering and a large language model, and construct a seed data pool based on the instruction generation model and aerospace text data; the seed data pool includes a number of Q&A instructions;

[0056] In this embodiment, relevant documents, technical reports, papers, etc. in the aerospace field are collected as the knowledge source of the large language model. Background knowledge, professional terms, and context descriptions in the aerospace field are added to Prompt engineering so that the model can understand the context and professional requirements of the task.

[0057] Please refer to Figure 2 , Figure 2 which is a schematic diagram of instruction data generation provided by an embodiment of the present invention.

[0058] In this embodiment, Prompt engineering instructions are set, and the instructions include identity information, task information, task requirements, etc. Specifically, the instructions are clarified through Prompt engineering, and the large language model is given the identity of "an expert in asking questions about aerospace domain expertise". For example, the Prompt may include a description such as "You are a senior aerospace domain expert, proficient in extracting key information from complex aerospace literature and generating high-quality Q&A questions". At the same time, the task requirements for generating Q&A instructions are detailed in the Prompt, including question types (fill-in-the-blank, multiple-choice, Q&A) and how to handle issues such as subject omission and pronoun substitution in long texts.

[0059] In this embodiment, the large language model uses the context information provided in the Prompt to parse the input aerospace text, identify key concepts, relationships, and logical structures. Moreover, for the case where the subject appears only once in the long text and is replaced by a pronoun subsequently, the model is guided by the subject complement rule to automatically complete the subject, ensuring that each generated question is a complete and independent sentence.

[0060] In this embodiment, the aerospace text is input into the large language model in the form of word documents and TXT documents.

[0061] In this embodiment, after guiding the large model to generate professional questions, it is given a new identity of "Aerospace Field Question Answering Expert", enabling it to accurately locate the answers to the questions with the help of retrieval capabilities given the knowledge source. At the same time, it is stipulated that the large model can only output the answers in the form of instruction data.

[0062] In this embodiment, after obtaining the instruction questions and instruction answers, the Q&A pairs are combined and saved to the specified JSON file in a formatted manner.

[0063] In this embodiment, based on the parsing results, the model extracts the key information in the text, converts it into Q&A instructions, and stores the Q&A instructions based on a preset format and preset structure.

[0064] In this embodiment, the large language model is also optimized by adding successful cases or failure cases in the Prompt.

[0065] In this embodiment, the failure cases include Q&A pairs weakly related to the aerospace field or Q&A pairs with incorrect structures, and the successful cases include Q&A pairs strongly related to aerospace instructions.

[0066] In this embodiment, after initially generating the Q&A pairs, through manual verification, the screened high-quality Q&A instructions are fed back to the large model, and the instruction generation model is obtained by iteratively adjusting the Prompt parameters.

[0067] In this embodiment, building an instruction generation model based on Prompt engineering can not only make full use of the powerful text understanding and generation capabilities of the large language model, but also automatically convert complex aerospace field texts into high-quality and standardized instruction data through prompts and examples, thus significantly reducing the time and labor costs of manual extraction of domain knowledge and improving the efficiency and professionalism of data generation.

[0068] Step 102: Initialize the enhanced data pool, and iteratively update the enhanced data pool based on the preset reference data values, the instruction generation model, and the seed data pool;

[0069] In each iteration process, a number of sample instruction data are randomly selected from the enhanced data pool and the seed data pool respectively based on the reference data value; and data augmentation is performed on the sample instruction data based on the instruction generation model and a preset three-level logic judgment rule to obtain augmented instruction data, and the enhanced data pool is updated based on the augmented instruction data;

[0070] Stop iterating until the number of instructions in the enhanced data pool reaches the preset requirement, and complete data augmentation.

[0071] In this embodiment, in the first iteration process, the enhanced data pool is an empty set, and a number of sample instruction data are randomly selected from the seed data pool based on the reference data value.

[0072] In this embodiment, the enhanced data pool is initialized to be an empty set.

[0073] In this embodiment, since the enhanced data pool is an empty set in the first iteration process, all the sample instruction data for augmentation come from the seed data pool.

[0074] In this embodiment, the reference data value n is a preset fixed value.

[0075] In this embodiment, the randomly selecting a number of sample instruction data from the enhanced data pool and the seed data pool respectively based on the reference data value includes:

[0076] Obtain a first sample quantity value and a second sample quantity value based on the reference data value; the sum of the first sample quantity value and the second sample quantity value is equal to the reference data value;

[0077] Randomly select sample instruction data from the seed data pool based on the first sample quantity value;

[0078] Randomly select sample data instructions from the enhanced data pool based on the second sample quantity value.

[0079] In this embodiment, the first sample data value and the second sample data value are equal, and their values are

[0080] Please refer to Figure 3 , Figure 3 which is a schematic flow diagram of an instruction enhancement provided by an embodiment of the present invention.

[0081] In this embodiment, based on the first sample quantity value, select n instruction data, and send the n instruction data to the instruction generation model to continue generating a number of instruction data, and iterate this process.

[0082] In this embodiment, in the initial stage, the number of enhanced data generated by the instruction generation model is 0. At this time, all reference data comes from the seed data pool. After the first generation of enhanced data by the instruction generation model, several (more than n) pieces of data will be obtained, and these data will be stored in the enhanced data pool and wait for the next round of selection. In each generation process, the seed instruction data accounts for half of the instruction data volume, effectively preventing the instruction generation model from having a superimposed negative impact on the results due to hallucination problems after multiple rounds of generation.

[0083] In this embodiment, the three-level logic judgment rules include causal judgment, parallel judgment, and cross judgment; the data augmentation of the sample instruction data based on the instruction generation model and the preset three-level logic judgment rules to obtain augmented instruction data, and updating the enhanced data pool based on the augmented instruction data includes:

[0084] Traverse any one sample instruction in the sample instruction data, and perform data augmentation on each sample instruction based on the causal judgment and parallel judgment to obtain causal augmented instructions and parallel augmented instructions;

[0085] Traverse any two sample instructions in the sample instruction data, and perform data augmentation on the any two sample instructions based on the cross judgment to obtain cross-augmented instructions;

[0086] Generate augmented instruction data based on the causal augmented instructions, parallel augmented instructions, and cross-augmented instructions, and add the augmented instruction data to the enhanced data pool to update the enhanced data pool.

[0087] In this embodiment, by using causal judgment and parallel judgment to augment a single sample instruction, the causal relationship and parallel relationship related to the original problem can be refined from different angles, so that the generated new Q&A instructions cover a richer knowledge background and logical reasoning, and improve the diversity and depth of the data. And, by performing cross judgment on any two sample instructions, the cross-correlation between different Q&As can be discovered and fused, so as to generate comprehensive and extensible instruction data, which helps to capture more complex knowledge associations in the field and enhance the comprehensive coverage ability of the dataset.

[0088] In this embodiment, logical judgment rules are used to automatically generate augmented instruction data, reducing manual intervention, improving the efficiency of data augmentation, and ensuring that the generated data has a reasonable logical structure and domain relevance. By combining causal, parallel, and cross-augmentation methods, sample data can be optimized and supplemented from multiple levels to form a rigorously structured and diverse enhanced data pool, thereby providing high-quality training data for subsequent model fine-tuning and reducing the "hallucination" risk caused by single or insufficient data in the model.

[0089] In this embodiment, traversing any one of the sample instructions in the sample instruction data, and performing data augmentation on each sample instruction based on the causal judgment and parallel judgment to obtain causal augmented instructions and parallel augmented instructions, including:

[0090] Traversing any one of the sample instructions in the sample instruction data, performing a causal judgment on each sample instruction to obtain the causal relationship of the sample instruction, and performing data augmentation on the sample instruction based on the causal relationship to obtain causal augmented instructions;

[0091] Traversing any one of the sample instructions in the sample instruction data, and performing a parallel judgment on each sample instruction to obtain the parallel relationship of the sample instruction, and performing data augmentation on the sample instruction based on the parallel relationship to obtain parallel augmented instructions.

[0092] In this embodiment, by performing a causal judgment on each sample instruction, the causal relationship therein can be automatically identified and extracted, and then new instruction data can be generated by augmenting based on this relationship.

[0093] In this embodiment, by performing a parallel judgment on each sample instruction, the parallel logic existing in the instruction is identified, and then diverse parallel augmented instructions are generated.

[0094] In this embodiment, causal augmented instructions can capture the knowledge chain behind the causal logic, while parallel augmented instructions can reflect the parallel relationship of multiple related concepts or problems. The two augmentation methods work together to greatly enrich the logical dimension and content depth of the dataset, providing more comprehensive and representative training data for subsequent model fine-tuning. Through an automated causal and parallel judgment mechanism, logically extended data can be automatically generated without a large amount of manual intervention, thereby greatly reducing the workload and cost of manual annotation and improving the data generation efficiency.

[0095] In this embodiment, traversing any one of the sample instructions in the sample instruction data, performing a causal judgment on each sample instruction to obtain the causal relationship of the sample instruction, and performing data augmentation on the sample instruction based on the causal relationship to obtain causal augmented instructions, including:

[0096] Traversing any sample instruction in the sample instruction data;

[0097] For any sample instruction, determine whether there is a causal relationship between the question and the answer of the sample instruction;

[0098] If there is a causal relationship, the question and answer of the sample instruction are inverted to generate a causal expansion instruction.

[0099] In this embodiment, it is determined whether there is an obvious causal relationship. If so, an attempt is made to swap the positions of the question and the answer, using the result as the question and the cause as the answer to generate a new question-answer pair.

[0100] For example, a sample instruction currently includes: a question and an answer, the question is: "What is the result of event A?"; the answer is: "The result of event A is event B." If the sample instruction has a causal relationship, the sample instruction is inverted to generate an extended sample, and the question is: "What is the cause of event B?" The answer is: "The cause of event B is event A".

[0101] In this embodiment, by performing causal judgment on each sample instruction, the system can automatically detect whether there is a causal relationship between the question and the answer, providing a basis for subsequent data expansion and avoiding the tedious work of manual analysis one by one. At the same time, when it is determined that there is a causal relationship, new causal expansion instructions are generated by inverting the question and answer. The new data generated by the inversion processing can capture the causal chain that is not fully presented in the original question and answer pair, thereby realizing knowledge complementarity and expansion at the data level, and improving the coverage and expression ability of the overall data set.

[0102] In this embodiment, when a causal relationship is determined to exist, a new causal expansion instruction is generated by inverting the question and the answer. This data expansion method can provide a complementary perspective to the original data and further enrich the logical structure and semantic diversity of the data set.

[0103] In this embodiment, traversing any sample instruction in the sample instruction data, performing parallel judgment on each sample instruction, obtaining the parallel relationship of the sample instructions, performing data expansion on the sample instructions based on the parallel relationship, and obtaining the parallel expansion instruction includes:

[0104] Traversing any sample instruction in the sample instruction data;

[0105] For any sample instruction, determining whether the question or answer of the sample instruction has a parallel relationship;

[0106] If there is a parallel relationship in the problems of the sample instructions, the problems of the sample instructions are differentiated based on the parallel relationship to generate a number of parallel problems, and parallel extended instructions are generated based on the parallel problems;

[0107] If there is a parallel relationship in the answers of the sample instructions, the answers of the sample instructions are differentiated based on the parallel relationship to generate a number of parallel answers, and parallel extended instructions are generated based on the parallel answers.

[0108] In this embodiment, when traversing the individual problems or answers of each sample instruction, it is also determined whether there is a parallel relationship in its statement. If so, it is divided into multiple problems or answers, and the format can be multiple question-and-answer questions, or fill-in-the-blank, true-or-false questions.

[0109] In this embodiment, there is an existing sample instruction, whose problem is: "What is the result generated by event A?"; the answer is: "The result generated by event A is event B or event C or event D or event C." Then there is a parallel relationship in the answer of this sample instruction. Based on this parallel relationship, this sample instruction is differentiated to generate a number of parallel extended instructions. For example, one parallel extended instruction problem is: "What is the result generated by event A?"; the answer is: "The result generated by event A may be event B"; another parallel extended instruction problem is: "Question: "What cannot be the consequence caused by event A? Select the correct option 1) B 2) C (3) D (4) E"; the answer is: "4) E".

[0110] In this embodiment, when there is a parallel relationship in the problem or answer, through differentiation processing, complex or compound expressions can be split into multiple independent problems or answers. The parallel problems or answers after differentiation processing can generate a number of parallel extended instructions, thereby enriching the structure and content of the data set, not only expanding the data volume, but also providing knowledge expressions from multiple angles, improving the diversity and coverage of the data.

[0111] In this embodiment, traversing any two sample instructions in the sample instruction data, and based on cross-judgment, data expansion is performed on the any two sample instructions to obtain cross-expanded instructions, including:

[0112] Traverse any two sample instructions in the sample instruction data;

[0113] For any two sample instructions, based on cross-judgment, obtain the association relationship between the two sample instructions, and integrate the problems and answers of the two sample instructions based on the association relationship to generate cross-expanded instructions.

[0114] In this embodiment, when traversing any two sample instructions, an attempt is made to extract the correlation relationships contained in two different question-and-answer pairs. When it is found that there are overlapping knowledge points in the two question-and-answer pairs, the large model combines the two question-and-answer pairs and generates a comprehensive professional question.

[0115] In this embodiment, there are two existing sample instructions. One: the question is "How is numerical value A calculated?"; the answer is "The calculation formula for numerical value A is A = B + C". The other: the question is "How is numerical value D calculated?"; the answer is "The calculation formula for numerical value D is D = A + E". Based on cross-judgment, these two sample instructions have a correlation relationship. Based on this correlation relationship, these two sample instructions are synthesized to generate a cross-expanded instruction. The cross-expanded instruction is: the question is "How is numerical value E calculated through B, C, and D?"; the answer is "The calculation formula for numerical value E is E = D - B - C".

[0116] In this embodiment, through cross-judgment, the potential correlation relationships between different question-and-answer instructions are identified, the comprehensive knowledge points that may be missing in a single instruction are supplemented, and the information dimension of the data set is enriched. Thus, the questions and answers in the two instructions are integrated to generate a new cross-expanded instruction, which helps to construct comprehensive questions across knowledge points, making the data set no longer limited to information from a single source, but able to integrate diverse viewpoints and logical relationships from different instructions, thereby greatly enhancing data diversity and overall quality.

[0117] In this embodiment, by using Prompt engineering and large language models to construct an instruction generation model, key information can be automatically extracted from the text data in the aerospace field to generate question-and-answer instructions, thereby constructing a seed data pool, avoiding the cumbersome process of relying on manual extraction of professional knowledge from documents in traditional methods, thus greatly reducing labor costs and time consumption. At the same time, through preset reference data values, hybrid sampling of the seed data and existing enhanced data is achieved, and then the large language model is used to perform logical judgment on the sample data in combination with the preset three-level logical judgment rules to achieve data expansion. An all-automated process from preliminary seed data to data enhancement is realized, and based on the three-level logical judgment, the diversity and coverage of the question-and-answer pairs in the instruction data are expanded, ensuring that the generated data has richer domain knowledge and logical relationships, improving the efficiency and data quality of aerospace field instruction data generation, and reducing the need for manual intervention.

[0118] Embodiment 2

[0119] In this embodiment, based on Chapter 13 of "Understanding Spaceflight", the input text is obtained. The input text specifically includes:

[0120] “Radio stations generate signals using accelerating charges in antennas. Then, the signals are sent out in the form of electromagnetic waves and received by the antennas on the vehicle. There, the charges are accelerated again and turned into the music you hear.

[0121] Radio stations transmit carrier signals at a specific frequency. This frequency is regulated and licensed by the Federal Communications Commission in the United States. Then, the transmitter forcibly modulates the information to be sent - music, data, news - onto the carrier using some typical modulation methods. The commonly used modulation methods are frequency modulation and amplitude modulation (AM and FM), while spacecraft use other methods. The signal is emitted from the antenna of the radio station and encounters your radio receiving antenna. At the antenna, more charges are accelerated. Your receiver uses the antenna to detect the movement of the charges and then converts it into the original signal. Then, the receiver demodulates the amplitude-modulated or frequency-modulated signal and separates this information from the carrier signal. Thus, you can hear music even when driving on the road.

[0122] Now let's learn more about communication systems and study some basic principles and constraints. Use a light bulb to explain the key principles. Similar to a radio transmitter, a light bulb also radiates electromagnetic waves, but at a different frequency, within the visible light range. If a light bulb is placed in the center of a room, the light will shine in all directions (assuming the light bulb is flawless). The light intensity or density at a certain distance from the light bulb is called the power flux density. The farther away from the light bulb, the dimmer the light. That is to say, the farther the distance, the smaller the power flux density, and the dimmer the light we feel. Through experiments, it is determined that the power flux density is inversely proportional to the square of the distance because the output light is distributed on a spherical surface centered on the light source.

[0123] Visible light, like the light emitted by a light bulb, is a simple electromagnetic wave. Similar to the example of the light bulb, the property that radiation propagates in all directions with the same intensity is called "omnidirectional" or "isotropic". What should we do if we only want to enhance the brightness or power flux density in a certain direction? Use the direct output of the light bulb, which is the method used by flashlights. Or use an ideal light bulb and place a parabolic reflector behind it. In this way, most of the light in a certain direction is reflected by the mirror surface and projected in the opposite direction, resulting in a beam of light - a spotlight - rather than an omnidirectional light source. By effectively concentrating most of the light in a small area, the result is that the brightness in a specific direction is much stronger than the intensity of the omnidirectional radiation of the light bulb. That is, a larger power density is obtained by using a parabolic reflector.

[0124] In this embodiment, the Qwen-2.5-72B-Instruct large language model is used to generate data and enhance the instruction data. For the above text, the questions raised by the "Expert in Asking Questions about Aerospace Professional Knowledge" include:

[0125] 1. What is the principle of a radio station?

[0126] 2. Why can you hear music on the radio while driving on the road?

[0127] 3. What is the key principle of a light bulb?

[0128] 4. How can the brightness of a light bulb be enhanced in a certain direction?

[0129] In this embodiment, based on the above questions, the answers given by the "Space Domain Q&A Expert" are as follows:

[0130] 1. A radio station uses the accelerated charges in the antenna to generate electromagnetic wave signals and transmits them at a carrier wave of a specific frequency. After the receiving antenna receives the signal, the charges are accelerated again, and the receiver extracts the original information, such as music, data, or news, through demodulation, thus restoring the sound.

[0131] 2. The signals of a radio station are transmitted in the form of electromagnetic waves. The receiving antenna can continuously receive these signals and restore the original music information through demodulation by the receiver. Therefore, even when moving, you can listen to the radio stably.

[0132] 3. The light emitted by a light bulb is a kind of electromagnetic wave. The intensity of the light weakens as the distance increases, and the power flow density is inversely proportional to the square of the distance. The light of the light bulb is omnidirectional radiation, that is, it spreads evenly in all directions.

[0133] 4. The light intensity can be directly enhanced by using a flash, or a parabolic condenser can be placed behind the light bulb to reflect and concentrate most of the light in a specific direction, thereby increasing the brightness in that direction.

[0134] In this embodiment, based on the text data, preliminary instruction Q&A pairs available for training are obtained. In the data enhancement link, the above Q&A pairs are used as seed data input, and a new Q&A pair given by the large model in the process of traversing one by one is as follows:

[0135] Question: What will be the impact of placing a parabolic condenser behind the light bulb?

[0136] Answer: The condenser can reflect and concentrate the light that originally diverges in all directions in a specific direction, making the light in that direction stronger, thus forming a condensing effect.

[0137] The output can be understood as a causal logic transformation. The large model successfully identified the causal logic in the fourth question. After the transformation, we obtained a new instruction-answer pair. In the next round of generation, this new instruction-answer pair will potentially be input into the model as seed data. The following example is the new data enhanced through pairwise traversal of this instruction-answer pair. In the pairwise traversal stage, we focus on the knowledge fusion of two question-answer pairs:

[0138] Question: What will happen if a parabolic condenser is placed behind a light bulb?

[0139] Answer: The condenser can reflect and concentrate the light rays that were originally diverging in all directions onto a specific direction, making the light in that direction stronger, thus forming a condensing effect. Since the light rays are guided into a smaller area, the optical power density (light intensity) per unit area increases, making the light in this direction brighter instead of being evenly distributed in all directions. The radiation pattern of the light changes from omnidirectional radiation (propagating evenly in all directions) to directional radiation (mainly concentrated in a specific direction), which is very important in applications such as lighting, communication, and radar. For example, satellite antennas also adopt a similar parabolic design to make radio waves propagate in a specific direction, improving signal strength and communication quality.

[0140] Then we use the enhanced dataset to perform SFT fine-tuning on the small-parameter model of Qwen-2.5-7B. The goal is to obtain a private large model in the aerospace field with a relatively small number of parameters but capable of reaching the level of large-parameter models such as 72B in terms of reasoning ability and professional domain knowledge reserve. This model uses a decoder structure based on Transformer. The key elements of the model structure are: GQA (Grouped Query Attention mechanism) that helps with efficient KV cache utilization, the SwiGLU non-linear activation function, RoPE for encoding position information, QKV bias in the attention mechanism, and RMSNorm with pre-normalization. The latter two are to ensure stable training.

[0141] In this embodiment, the small-parameter model after fine-tuning will have reasoning ability when answering questions, and the reply quality when answering professional questions in the aerospace field will be greatly improved compared to before fine-tuning, and it can accurately answer the knowledge instilled into the large model through internal documents or confidential files.

[0142] The present invention adopts a concurrent method to perform data augmentation on the instruction data set in the aerospace field. When generating reference data, a number of reference question-and-answer pair sets with a length of n are generated in one batch, and then a concurrent method is used to simultaneously call multiple large model interfaces to generate new question-and-answer pairs, greatly reducing the generation time of new data. After testing, there will still be about 15% of useless data in the aerospace instruction data set generated and enhanced according to the present invention. However, when there is sufficient original data, this method can generate more than 10MB of instruction data within 24 hours, greatly reducing the time to obtain aerospace instruction data.

[0143] An embodiment of the present invention also provides a data instruction generation and enhancement device, including: an instruction generation module and an instruction enhancement module;

[0144] The instruction generation module is used to construct an instruction generation model based on Prompt engineering and a large language model, and construct a seed data pool based on the instruction generation model and aerospace text data; the seed data pool includes a number of question-and-answer instructions;

[0145] The instruction enhancement module is used to initialize the enhanced data pool, and iteratively update the enhanced data pool based on a preset reference data value, the instruction generation model, and the seed data pool;

[0146] In each iteration process, a number of sample instruction data are randomly selected from the enhanced data pool and the seed data pool respectively based on the reference data value; and data expansion is performed on the sample instruction data based on the instruction generation model and a preset three-level logical judgment rule to obtain expanded instruction data, and the enhanced data pool is updated based on the expanded instruction data;

[0147] Until the number of instructions in the enhanced data pool reaches the preset requirement, stop the iteration and complete the data augmentation.

[0148] In an embodiment of the present invention, a terminal device is also provided, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the above data instruction generation and enhancement method is implemented.

[0149] In an embodiment of the present invention, a computer-readable storage medium is also provided. The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the above data instruction generation and enhancement method.

[0150] Exemplarily, a computer program can be segmented into one or more modules. One or more modules are stored in a memory and executed by a processor to implement the present invention. One or more modules can be a series of computer program instruction segments capable of accomplishing specific functions, and these instruction segments are used to describe the execution process of the computer program in a terminal device.

[0151] The terminal device can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server, etc. The terminal device may include, but is not limited to, a processor, a memory, and a display. Those skilled in the art can understand that the above components are merely examples of the terminal device and do not constitute a limitation to the terminal device. It may include more or fewer components than those described, or combine certain components, or have different components. For example, the terminal device may also include input / output devices, network access devices, a bus, etc.

[0152] The so-called processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the terminal device, and connects various parts of the entire terminal device through various interfaces and circuits.

[0153] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory, and by calling the data stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, a text conversion function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.), etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0154] Among them, when the module for generating and enhancing data instructions is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0155] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for generating and enhancing data instructions, characterized in that, Including: Construct an instruction generation model based on Prompt engineering and large language models, and construct a seed data pool based on the instruction generation model and aerospace text data; The seed data pool includes several Q&A instructions; Initialize the enhanced data pool, and iteratively update the enhanced data pool based on a preset reference data value, the instruction generation model, and the seed data pool; In each iteration process, randomly extract several sample instruction data from the enhanced data pool and the seed data pool respectively based on the reference data value; and perform data augmentation on the sample instruction data based on the instruction generation model and a preset three-level logical judgment rule to obtain augmented instruction data, and update the enhanced data pool based on the augmented instruction data; Stop iterating until the number of instructions in the enhanced data pool reaches the preset requirement, and complete data augmentation.

2. The data instruction generation and enhancement method according to claim 1, wherein The randomly extracting several sample instruction data from the enhanced data pool and the seed data pool respectively based on the reference data value includes: Obtain a first sample quantity value and a second sample quantity value based on the reference data value; the sum of the first sample quantity value and the second sample quantity value is equal to the reference data value; Randomly extract sample instruction data from the seed data pool based on the first sample quantity value; Randomly extract sample data instructions from the enhanced data pool based on the second sample quantity value.

3. A method for generating and enhancing data instructions according to claim 1, characterized in that, The three-level logical judgment rule includes causal judgment, parallel judgment, and cross judgment; the performing data augmentation on the sample instruction data based on the instruction generation model and the preset three-level logical judgment rule to obtain augmented instruction data, and updating the enhanced data pool based on the augmented instruction data includes: Traverse any one sample instruction in the sample instruction data, and perform data augmentation on each sample instruction based on the causal judgment and parallel judgment to obtain causal augmented instructions and parallel augmented instructions; Traverse any two sample instructions in the sample instruction data, and perform data augmentation on the any two sample instructions based on the cross judgment to obtain cross augmented instructions; Generate augmented instruction data based on the causal augmented instructions, parallel augmented instructions, and cross augmented instructions, and add the augmented instruction data to the enhanced data pool to update the enhanced data pool.

4. A method for generating and enhancing data instructions according to claim 3, characterized in that, The traversing any one sample instruction in the sample instruction data, and performing data augmentation on each sample instruction based on the causal judgment and parallel judgment to obtain causal augmented instructions and parallel augmented instructions includes: Traverse any one sample instruction in the sample instruction data, perform a causal judgment on each sample instruction to obtain the causal relationship of the sample instruction, and perform data augmentation on the sample instruction based on the causal relationship to obtain causal augmented instructions; Traverse any one sample instruction in the sample instruction data, and perform a parallel judgment on each sample instruction to obtain the parallel relationship of the sample instruction, and perform data augmentation on the sample instruction based on the parallel relationship to obtain parallel augmented instructions.

5. A method for generating and enhancing data instructions according to claim 4, characterized in that, Traverse any one of the sample instruction data, perform causal judgment on each sample instruction, obtain the causal relationship of the sample instruction, and perform data augmentation on the sample instruction based on the causal relationship to obtain causal augmented instructions, including: Traverse any one of the sample instruction data; For any one sample instruction, determine whether there is a causal relationship between the question and the answer of the sample instruction; If there is a causal relationship, invert the question and the answer of the sample instruction to generate a causal augmented instruction.

6. The data instruction generation and enhancement method according to claim 4, wherein Traverse any two sample instructions in the sample instruction data, perform data augmentation on the any two sample instructions based on cross judgment, and obtain cross-augmented instructions, including: Traverse any one of the sample instruction data; For any one sample instruction, determine whether there is a parallel relationship in the question or the answer of the sample instruction; If there is a parallel relationship in the question of the sample instruction, perform differentiation processing on the question of the sample instruction based on the parallel relationship to generate several parallel questions, and generate parallel augmented instructions based on the parallel questions; If there is a parallel relationship in the answer of the sample instruction, perform differentiation processing on the answer of the sample instruction based on the parallel relationship to generate several parallel answers, and generate parallel augmented instructions based on the parallel answers.

7. The data instruction generation and enhancement method according to claim 3, wherein Traverse any two sample instructions in the sample instruction data, perform data augmentation on the any two sample instructions based on cross judgment, and obtain cross-augmented instructions, including: Traverse any two sample instructions in the sample instruction data; For any two sample instructions, obtain the association relationship between the two sample instructions based on cross judgment, and integrate the questions and answers of the two sample instructions based on the association relationship to generate cross-augmented instructions.

8. A method for generating and enhancing data instructions according to any one of claims 1 to 7, characterized in that In the first iteration process, the enhanced data pool is an empty set, and several sample instruction data are randomly selected from the seed data pool based on the reference data value.

9. A data instruction generation and enhancement device, characterized in that, Including: An instruction generation module and an instruction enhancement module; The instruction generation module is used to construct an instruction generation model based on Prompt engineering and a large language model, and construct a seed data pool based on the instruction generation model and aerospace text data; the seed data pool includes several Q&A instructions; The instruction enhancement module is used to initialize the enhanced data pool, and iteratively update the enhanced data pool based on a preset reference data value, the instruction generation model, and the seed data pool; In each iteration process, several sample instruction data are randomly selected from the enhanced data pool and the seed data pool respectively based on the reference data value; and data augmentation is performed on the sample instruction data based on the instruction generation model and a preset three-level logical judgment rule to obtain augmented instruction data, and the enhanced data pool is updated based on the augmented instruction data; Until the number of instructions in the enhanced data pool reaches the preset requirement, stop the iteration and complete the data enhancement.

10. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a method for generating and enhancing data instructions as described in any one of claims 1 to 8.