Complex instruction generation method based on data label graph structure

Through the complex instruction generation method based on the data label graph structure, the problem of insufficient follow-up ability of large models when executing complex instructions is solved, efficient and flexible generation of complex instruction data is achieved, and the application capability and data quality of the model are significantly improved.

CN119884755APending Publication Date: 2025-04-25SHANGHAI QISI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510079150.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Existing large models show insufficient following capabilities when executing complex and multi-step instructions, resulting in poor performance in practical application scenarios, such as automated task processing, advanced dialogue systems, and complex decision support.

Method used

A complex instruction generation method based on the data label graph structure is adopted, and instruction data is automatically generated through an automated label system and machine learning algorithm, a tag relationship diagram is constructed and a label combination is obtained using a graph traversal algorithm, and complex instructions are generated in combination with a large language model.

Benefits of technology

It significantly improves the understanding and execution ability of large language models for complex query instructions, improves the practicality and scope of application of the model, optimizes the quality and efficiency of data generation, and reduces the cost of data preparation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884755A_ABST
    Figure CN119884755A_ABST
Patent Text Reader

Abstract

The invention relates to a data label graph structure-based complex instruction generation method, which comprises the following steps of: collecting a data set for instruction fine tuning in a question-answer pair form; labeling the collected open source data; based on a label result, obtaining a label category, and carrying out aggregation de-duplication on similar labels; the nodes with the co-occurrence relation are associated to form a label relation graph; a graph traversal algorithm is utilized to effectively obtain a label combination; entering an instruction generation stage; in the stage, a tag combination is used as input, and a fine-tuned large language model is called for text generation in combination with a specific generation template; and finally, the generated instruction needs to pass through a series of manual verification processes. The problem that an existing large model is insufficient in following capacity when executing complex and multi-step instructions is solved, the flexibility and wide adaptability of data generation are improved, the complex instruction processing capacity of a language model is enhanced, and the quality and efficiency of data generation are optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a natural language processing technology, and in particular to a complex instruction generation method based on a data label graph structure. Background Art

[0002] In the field of artificial intelligence and natural language processing, large language models (such as GPT and BERT) have been widely used in various text generation and understanding tasks. These models are trained on large-scale datasets to learn the deep semantics and structural laws of language, and are able to generate semantically coherent and grammatically correct text. Despite this, direct application to specific tasks often requires further optimization to improve its performance and accuracy in specific fields. Instruction fine-tuning is part of this optimization process, which retrains the model on a specific dataset to better understand and execute specific types of instructions. However, the performance of these models is often limited by the quality and complexity of the training data. Especially in application scenarios that require the execution of complex and precise instructions, such as programming, technical maintenance, or advanced user interface operations, traditional language models often perform poorly when handling such complex tasks due to the lack of complex and diverse training data.

[0003] There are several key problems in the existing methods of building large model datasets. First, these methods usually rely on a large amount of manual annotation, which is not only costly but also inefficient, limiting the rapid expansion and updating of datasets. Second, automatically generated data often lacks diversity and authenticity, which may lead to limited generalization capabilities of the model. Furthermore, when dealing with complex data in specific fields, such as tabular data and specific domain corpora, existing methods often require complex preprocessing and fine-tuning processes, which increases the difficulty of technical implementation. Such as the following three related technologies:

[0004] Invention 1: Xu Tongming; Zhao Guobo; Li Bozhao; Li Weilong, et al. A method and device for constructing a large model data set:,CN118152543A[P].2024.

[0005] Invention 2: Liu Juhua; Li Haiyun; Zhong Qihuang. A method and device for generating language large model data for aspect-level sentiment analysis:, CN118210920A[P].2024.

[0006] Invention 3: Fang Jianwen; Wang Benqiang; Liu Yidong. Method and device for multi-table question answering:,CN118503386A[P].2024.

[0007] Invention 1 provides a method and device for constructing a large model dataset, focusing on enhancing the mathematical computing capabilities of large language models. By constructing basic paradigms of various mathematical operation types and corresponding derivation logic, specific mathematical problem instances and answers are generated. This method aims to train the model by systematically expanding the input commands and adjusting the data ratio corresponding to the difficulty coefficient in order to improve its mathematical processing performance. However, this method has some obvious limitations. First, it is highly focused on mathematical problems, which limits its applicability in non-mathematical fields and has limited help in improving the versatility of the model. Secondly, the technology may face the challenge of covering all mathematical problems in practical applications in the process of accurately defining mathematical paradigms and problem instances, which may lead to insufficient adaptability of the model in actual operations. In addition, although attempts are made to improve the adaptability of the model by generating diverse input commands and adjusting the dataset, the complexity of this method may introduce additional processing burdens, thereby affecting the training efficiency and real-time performance of the model.

[0008] Invention 2 relates to a method and device for generating language large model data for aspect-level sentiment analysis, which aims to automatically extract and expand aspect words from unlabeled corpus through a preset language model, and then generate labeled training data. The method first uses different prompt word strategies to automatically extract aspect words from unlabeled corpus, and selects the optimal strategy by comparing the extraction accuracy of different strategies. Subsequently, the extracted aspect words are spliced ​​according to sentiment polarity to form bigrams, which are then used to generate the final training data through context learning technology and model distillation process. Although this method can effectively utilize the capabilities of large language models to generate a large amount of training data, thereby improving the accuracy and efficiency of aspect-level sentiment analysis, the technology still relies on high-quality preset models and accurate aspect word extraction, and erroneous aspect word extraction may lead to a decrease in the quality of generated data. In addition, in practical applications, this technology may cause problems such as incoherent content and low sample diversity due to the limitations of data enhancement methods, which may affect the performance of the final model.

[0009] The technical solution of Invention 3 proposes a tabular question-answering method for large models, which aims to improve the performance of large models in tabular question-answering tasks through automatic corpus generation, prompt learning and fine-tuning techniques. First, text corpora related to tabular data are automatically generated through preset templates and rules, and then these corpora are used to perform prompt-based preference learning on the language large model. Finally, the question-answering task is processed by the improved RCI method to achieve effective matching of tabular data with questions and generate answers. This technology aims to reduce the resource consumption of model training and improve the accuracy of questions and answers by combining the LoRA fine-tuning method and prompt learning. However, the limitation of this technology is that it is highly complex. For non-professional users, the setting of generating templates and rules may require professional knowledge and technical support. At the same time, the quality of automatic corpus generation directly affects the performance of the final model, and accurate fine-tuning and prompt generation also require a lot of experiments and optimization to achieve the best results. In addition, models that rely on large-scale unsupervised corpora may perform poorly on specific question-answering tasks and require further adaptation and optimization in specific fields.

[0010] Existing methods currently have the following disadvantages:

[0011] 1. Limited application scope: Existing data generation methods are usually specialized for specific types of data, such as solving mathematical problems or processing tabular data in a specific format, which greatly limits their application in a wider range of fields.

[0012] 2. Insufficient diversity of generated data: Due to reliance on fixed templates or simple generation rules, existing methods often cannot effectively cope with scenarios that require a large amount of different types of data, limiting the training and application effects of the model.

[0013] 3. Automation and efficiency issues: Although existing methods can achieve a certain degree of automation, they still require a large amount of manual intervention when processing complex data and requirements, which is inefficient and costly.

[0014] 4. Logic and relevance issues of data quality: Existing automatic data generation methods are difficult to ensure the logical coherence and deep relevance of data, especially when it comes to complex scenarios and fine-grained information.

[0015] Existing large models have insufficient follow-up capabilities when executing complex, multi-step instructions. Although current large language models perform well in understanding single or simple instructions, they often have difficulty understanding and executing complex instructions that require multi-dimensional thinking and long-term logical coherence. This limitation hinders the use of large models in broader and more practical application scenarios, such as automated task processing, advanced dialogue systems, and complex decision support. The core of this problem is that the training data is too single and simple, and does not fully stimulate the potential of large models. Summary of the invention

[0016] Aiming at the problem that existing large models have insufficient following ability when executing complex, multi-step instructions, a complex instruction generation method based on data label graph structure is proposed.

[0017] The present invention hopes to use efficient complex instruction data generation to train models and enhance their application capabilities in complex tasks in the real world. The present invention aims to solve the following key technical problems, all of which are due to the shortcomings of existing methods in terms of complex data set construction and processing efficiency:

[0018] 1. High cost and low efficiency of data labeling: Existing methods rely on a large amount of manual labeling to generate and maintain data sets, which is not only time-consuming but also costly. The present invention significantly reduces manual involvement by building an automated labeling system and using machine learning algorithms to automatically generate instruction data, thereby reducing costs and time consumption.

[0019] 2. Improvement of versatility and adaptability: Traditional data generation methods are usually highly targeted, such as specifically targeting mathematical problems or tabular data, which limits their wide applicability in different application fields. The present invention achieves data generation in a wide range of fields through flexible label combinations and graph structures, improving the versatility and adaptability of the method.

[0020] 3. Limitations of data diversity and complexity: Traditional methods are inefficient in processing complex data structures and generating diversified data. The present invention constructs a label graph structure and utilizes the label co-occurrence relationship within the structure to automatically generate complex instructions with high logical and semantic associations, thereby improving data diversity and adaptability.

[0021] 4. Issues with the logic and relevance of generated data: Existing methods often fail to ensure the logic and relevance of generated content when automatically generating data. This invention ensures the logical coherence and depth of generated data through the depth and breadth-first traversal technology of the label graph, effectively improving the data quality.

[0022] The technical solution of the present invention is:

[0023] A complex instruction generation method based on a data label graph structure comprises the following steps:

[0024] Step 1: Collect data sets for instruction fine-tuning and ensure the comprehensiveness and representativeness of the data, mainly in the form of question-answer pairs;

[0025] Step 2: Label the collected open source data: Select the open setting and use the large language model for labeling;

[0026] Step 3: Based on the label results, obtain the label category and aggregate and remove duplicates of similar labels;

[0027] Step 4: An instruction can have multiple tags. The relationship between tags that appear in the same instruction at the same time is called co-occurrence. There is a co-occurrence relationship in open source data. The two nodes are associated to form a tag relationship graph.

[0028] Step 5: Use graph traversal algorithm to effectively obtain label combinations;

[0029] Step 6: Enter the instruction generation stage. In this stage, the label combination is used as input, combined with the specific generation template, and the fine-tuned large language model is called to generate text.

[0030] Step 7. Finally, the generated instructions need to go through a series of manual verification processes, including syntax checking, logical consistency testing, and execution feasibility assessment.

[0031] Further, the method specifically includes the following steps:

[0032] Step 1: The system comprehensively uses the data sets for instruction fine-tuning to ensure the comprehensiveness and representativeness of the data; these data sets are mainly in the form of question-answer pairs, where each piece of data can be specifically represented as an instruction Query and an answer Response; the collected open source data format is unified into the form of (Query, Response);

[0033] Step 2: Label the collected open source data; select open settings and use a large language model for labeling to cope with the ever-changing user query needs; the specific labeling process is: for each data instruction part Query i , through prompt engineering, and using fewshot in the prompt to guide the large language model to generate query-based i The set of k tags of the content (tag1, tag2, tag3, ..., tag k );

[0034] Step 3: Based on the labeling results of the above full open source dataset, we get the label categories; aggregate and remove duplicates of similar labels, and merge some highly related labels into an atomic label through frequency filtering, rule aggregation, and semantic aggregation to reduce the redundancy of labels; finally, we get different labels from the open source dataset, covering various fields, and record the total number of labels as N, and the set of all labels as (tag1, tag2, tag3, ..., tag N ); Then, the label results of the open source dataset are optimized for each instruction according to the above filtering and aggregation methods;

[0035] Step 4: An instruction can have multiple tags. Here, the relationship between tags that appear in the same instruction at the same time is called co-occurrence. Each tag is defined as a node in the tag relationship graph to be constructed. If there are two tags in the total N tags in step 3 m and tags n (1≤m≤N, 1≤n≤N) There is a co-occurrence relationship in the open source data, so these two nodes can be associated to form a label relationship graph;

[0036] Step 5: After adding all the labels in the open source data to the relationship graph, the label combination can be obtained according to the graph; first, a starting label is selected, which can be randomly selected or selected according to the data type desired by the user; the graph traversal algorithm can be used to effectively obtain the label combination; in specific implementation, through the depth-first search and breadth-first search strategies, starting from any selected starting label, according to the set depth or breadth, the set number of label nodes reached can be traversed to form different label combinations;

[0037] Step 6: Get the tag combination (tag1, tag2, tag3, ..., tag p ), where p is the set target number of label nodes, and then enters the instruction generation stage; in this stage, the label combination is taken as input, combined with the specific generation template, and the fine-tuned large language model is called to generate text; the generation template design includes a fixed instruction format part and a variable label slot, and a complete instruction generation request is formed by filling the label combination into the slot; the generated instruction will directly reflect the semantic relationship and logical structure of the label in the label relationship graph, ensuring that the generated instruction is not only grammatically correct but also logically coherent; in addition, this method can generate multi-level instructions from simple to complex according to the size of the label combination;

[0038] Step 7. Finally, the generated instructions need to go through a series of manual verification processes, including syntax checking, logical consistency testing, and execution feasibility assessment.

[0039] Optionally, the construction of the label relationship diagram in step 4 may also be carried out by manual annotation or by using a semi-automatic tool combined with manual review.

[0040] Optionally, the graph traversal algorithm in step 5 may also use a heuristic search algorithm, such as an A* algorithm or a Dijkstra algorithm, to select a label combination.

[0041] Optionally, in step 6, when generating instructions, an automatic text generation model based on machine learning may be used, such as a model based on a variational autoencoder or a generative adversarial network.

[0042] Optionally, the verification process in step 7 may introduce natural language understanding techniques, such as sentiment analysis and semantic role labeling.

[0043] The beneficial effects of the present invention are:

[0044] Improved flexibility and wide adaptability of data generation: This invention achieves flexible control of complex instruction generation by building a tag-based graph structure. Compared with existing methods, it can quickly adapt to different scenarios and needs by adjusting tag combinations and their generation logic, providing more extensive data support.

[0045] Enhanced language model's ability to process complex instructions: Fine-tuning using the complex instruction data generated by the present invention can significantly improve the large language model's ability to understand and execute complex query instructions. This not only improves the model's practicality, but also expands the model's scope of application in multiple fields.

[0046] Optimized the quality and efficiency of data generation: Through label optimization and aggregation processing, the redundancy and noise of data are reduced, and the accuracy and relevance of generated data are improved. This improvement significantly enhances the practical value of generated data and reduces the workload of subsequent processing and cleaning.

[0047] Improved data generation diversity: By selecting a variety of label combinations through the graph traversal algorithm, the present invention can generate a wide range of instruction types, from simple to complex multi-level data. This is crucial for training more complex and robust language models.

[0048] Improved economic benefits: Reduced reliance on professionals for manual data annotation and generation, reduced data preparation costs. At the same time, improved data generation efficiency, helping to reduce the time and economic costs of the entire project. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is an example diagram of the label relationship diagram constructed in step 4 of the complex instruction generation method of the present invention;

[0050] Figure 2 It is a sub-schematic diagram of a specific embodiment of the label relationship diagram constructed in steps 1 to 4 of the complex instruction generation method of the present invention;

[0051] Figure 3 A specific flow chart of the complex instruction generation method of the present invention;

[0052] Figure 4 This is a sub-schematic diagram of a specific implementation example of using a large language model to generate complex instructions according to label combinations in step 6 of the complex instruction generation method of the present invention. DETAILED DESCRIPTION

[0053] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0054] The present invention improves dataset construction in a highly automated and intelligent way. The solution uses advanced natural language processing technology and machine learning algorithms to automatically extract and expand useful information from large-scale unlabeled corpora. At the same time, through innovative prompt learning and model fine-tuning technology, it improves the quality of data and the adaptability of models, thereby providing strong data support for large models in various application scenarios.

[0055] The objects of the present invention include the following points:

[0056] 1. Improve the breadth of application: Through the innovative label graph structure and flexible traversal technology, the present invention is not limited to the generation of specific types of data, but can be widely applied to scenarios with various data requirements.

[0057] 2. Enhance the diversity and innovation of data: Through dynamic label combination and adjustment of traversal strategy, the present invention can generate highly innovative and diverse data to meet the needs of different model training.

[0058] 3. Improvement of automation and efficiency: The present invention significantly improves the efficiency of data processing and reduces costs through a fully automated data generation process.

[0059] 4. Improve the quality and adaptability of data: By utilizing the logical relationships and co-occurrences within the label graph structure, the data generated by the present invention is more logically coherent and semantically tighter, which helps to improve the learning effect of the model and its ability to adapt to complex applications.

[0060] In general, the present invention significantly optimizes the quality and efficiency of data generation through its innovative methods and technical means, provides strong support for a wide range of application fields, and especially shows significant advantages in complex systems that require high-quality and high-diversity data.

[0061] The key points of the present invention are:

[0062] Label graph construction method: One of the key technologies adopted by this invention is to automatically generate labels by systematically collecting and processing open source data sets, and build a complex relationship graph based on these labels. This graph not only captures the co-occurrence relationship between labels, but also reflects their semantic connection, which is the basis for improving the quality and relevance of instruction generation.

[0063] Graph traversal algorithm applied to label selection: a method that uses graph traversal techniques such as depth-first search (DFS) and breadth-first search (BFS) to extract label combinations from the relationship graph. The application of this method can flexibly control the complexity and diversity of output data according to different traversal strategies, and is a key technical point for achieving efficient and high-quality data generation.

[0064] Dynamic instruction generation technology based on tag combination: Another innovation of the present invention is to directly use the tag combination in the diagram to generate text instructions. This generation method based on dynamic tag combination and predefined template (prompt) enables the generated instructions to maintain a high degree of relevance and logic, while also having scalability and the ability to adapt to different application scenarios.

[0065] Verification and optimization process of generated instructions: Systematically verify the generated instructions, including syntax checking, logical consistency testing, and execution feasibility assessment. This step ensures that the generated instructions not only meet the requirements in form, but are also accurate in content and suitable for practical applications. It is the key to ensuring the practicality and effectiveness of the invention.

[0066] The overall architecture and workflow of the complex instruction generation system: This invention describes in detail the complete process from data collection, label generation, graph construction, label combination extraction to instruction generation and verification. This complete technical solution architecture is the basis for achieving the goals of this invention and is highly innovative and practical.

[0067] A complex instruction generation method based on a data label graph structure comprises the following steps:

[0068] Step 1. Currently, many datasets for instruction fine-tuning have been developed in the open source field. The first step of the present invention is to systematically and comprehensively collect these datasets to ensure the comprehensiveness and representativeness of the data. These datasets are mainly in the form of question-answer pairs, where each piece of data can be specifically represented as an instruction Query and an answer Response. The collected open source data format is unified into the form of (Query, Response).

[0069] Step 2: Label the collected open source data. In this step, we do not use the predefined label ontology, but choose to open the setting and use the large language model for labeling to cope with the ever-changing user query needs. The specific labeling process is as follows: For each data instruction part Query i , through prompt engineering, and using fewshot (a few examples) in the prompt to guide the large language model to generate query-based i The set of k tags of the content (tag1, tag2, tag3, ..., tag k), such as (mathematics, programming, Python, logical calculations).

[0070] Step 3. Based on the labeling results of the above full open source dataset, we obtained tens of thousands of label categories. Many of these labels are redundant, that is, the semantics are consistent, but the descriptions are slightly different, such as "Python program" and "Python code". Therefore, a set of standardized processes is needed to optimize and denoise the open set labeling results generated by the large model, solve the problems of inconsistent formats and uneven granularity in the original annotations, aggregate and remove similar labels, and improve the accuracy and practicality of the labels. Specifically, through frequency filtering (removing long-tail labels with too low frequency), rule aggregation (unifying the label format and removing special characters), and semantic aggregation (obtaining the vector representation of the label through the word embedding model, and aggregating according to the similarity between the vectors), some highly correlated labels are merged into an atomic label to reduce the redundancy of the label. Finally, about 10,000 different labels were obtained from the open source dataset, covering various fields. We record the total number of labels as N, and the set of all labels as (tag1, tag2, tag3,..., tag N ). Next, we used the above filtering and aggregation methods to optimize the label results of the open source dataset for each instruction.

[0071] Step 4: An instruction can have multiple tags. Here we refer to the relationship between tags that appear in the same instruction as co-occurrence. We define each tag as a node in the tag relationship graph to be constructed by the present invention. If there are two tags in the total N tags in step 3 m and tags n (1≤m≤N, 1≤n≤N) has a co-occurrence relationship in the open source data, so we can associate these two nodes, and the resulting label relationship graph example is shown below Figure 1 shown.

[0072] Figure 2 This is an example of building a label relationship graph. For two instructions Query1 and Query2 in the open source data, after labeling with a large language model and removing redundant labels, we get a label set (Arduino, hardware, connectivity) for Query1 and a label set (FPGA, deep learning, hardware) for Query2. For these two label combinations, we can build a label relationship graph. For Query1, we can connect the three nodes of Arduino, hardware, and connectivity; for Query2, we can connect the three nodes of FPGA, deep learning, and hardware in Query1. In the end, we can get the following: Figure 2 The label relationship diagram shown.

[0073] Step 5. After adding all the labels in the open source data to the relationship graph, we can obtain the label combination based on the graph. First, select a starting label, which can be randomly selected or selected according to the type of data the user wants. We can use the graph traversal algorithm to effectively obtain label combinations. In the specific implementation, through the depth-first search (DFS) and breadth-first search (BFS) strategies, we can start from any selected starting label, traverse the set number of label nodes reached according to the set depth or breadth, and thus form different label combinations. This method can not only ensure that a large number of possible label relationships are covered while ensuring the semantic relationship and logical structure between labels, but also flexibly control the complexity and diversity of the combination according to the adjustment of the traversal depth and width.

[0074] Step 6: Get the tag combination (tag1, tag2, tag3, ..., tag p )(where p is the set target number of label nodes), we enter the instruction generation stage. In this stage, the label combination is taken as input, combined with the specific generation template (prompt), and the fine-tuned large language model is called for text generation. The generation template design includes a fixed instruction format part and a variable label slot. By filling the label combination into the slot, a complete instruction generation request is formed. For example, a template may be "Execute {action} according to {tag1} and {tag2}", where {tag1} and {tag2} are dynamically replaced by the content provided by the label combination, and {sction} is the specific instruction generation request. The generated instructions will directly reflect the semantic relationship and logical structure of the labels in the label relationship graph, ensuring that the generated instructions are not only grammatically correct, but also logically coherent. In addition, this method can generate multi-level instructions from simple to complex according to the size of the label combination, effectively improving the performance of the large model when processing multi-dimensional instructions.

[0075] like Figure 4As shown, the instruction template includes the following content: "SYSTEM: You are an artificial intelligence assistant who is good at creating complex questions. USER: I now have several categories of text content, and you now need to give another language model a complex question / instruction. The instruction needs to meet the following requirements: 1. The instructions should be as complex as possible in multiple small aspects, detailed and comprehensive, and the content of the instruction should belong to these given categories as much as possible. 2. The language style of the instructions you give is natural, and the instruction categories should be as diverse and innovative as possible. 3. The instructions you give need to be as complex as possible, and meet multiple requirements, including requirements for answer content and answer format. Your instructions must contain a markdown table, requiring the other party to analyze based on the table data. 4. The logic of the instructions is clear and organized, and the instructions need to be related and logically connected before and after, and there should be no random patchwork without any connection before and after. On the premise that the language and logic of the instructions remain coherent, the most complex Chinese questions / instructions that belong to the categories of Arduino, hardware, connectivity, deep learning, and FPGA can be:"

[0076] Among them, "SYSTEM" is the role prompt word of the large model; "USER" is the instruction generation request formed by filling the label combination into the slot. For the instruction template, "ASSISTANT" is the instruction generated by the large language model. Figure 4 As shown in the figure, the large language model generates a complex instruction based on the filled instruction template. Finally, a simple manual verification process is performed to evaluate whether the complex instruction is usable.

[0077] Step 7. Finally, the generated instructions need to go through a series of manual verification processes, including syntax checking, logical consistency testing, and execution feasibility assessment. This step is necessary because the automatically generated text may have incoherent sentences or confusing logic. Through these verifications, the output of the model can be further optimized to ensure that the generated instructions are of high quality and practicality. These steps not only improve the scope of application of the model, but also enhance its adaptability and accuracy in real environments.

[0078] Here are some alternatives:

[0079] Alternative methods for label graph construction: In addition to using open source datasets to automatically generate labels and build relationship graphs, label graphs can also be constructed through manual annotation by experts or by using semi-automated tools combined with manual review. Although this method can provide a more precise definition of label relationships, it consumes much more time and resources than automatic labeling.

[0080] Alternative graph traversal algorithms: In addition to depth-first search (DFS) and breadth-first search (BFS), you can also use heuristic search algorithms such as A* or Dijkstra's algorithm to select label combinations. These algorithms can optimize the search process based on specific heuristic information (such as weights between labels) and may be more suitable for large-scale graphs.

[0081] Alternative technologies for instruction generation: When generating instructions, in addition to using predefined templates (prompts), you can also use machine learning-based automatic text generation models, such as models based on variational autoencoders (VAE) or generative adversarial networks (GAN). However, the instructions generated by these smaller models cannot compare with large language models in terms of fluency, logic, diversity, and complexity.

[0082] Technical alternatives to the verification process: For the verification of generated instructions, in addition to manual inspection, natural language understanding (NLU) technologies such as sentiment analysis and semantic role labeling can be introduced, but the effect and accuracy are not as good as manual evaluation.

[0083] The above-mentioned embodiment only expresses one implementation mode of the present invention, and its description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.

Claims

1. A complex instruction generation method based on a data tag graph structure, characterized in that: The following steps are involved: Step 1: Collect data sets for instruction fine-tuning and ensure the comprehensiveness and representativeness of the data, mainly in the form of question-answer pairs; Step 2: Label the collected open source data: Select the open setting and use the large language model for labeling; Step 3: Based on the label results, obtain the label category and aggregate and remove duplicates of similar labels; Step 4: An instruction can have multiple tags. The relationship between tags that appear in the same instruction at the same time is called co-occurrence. There is a co-occurrence relationship in open source data. The two nodes are associated to form a tag relationship graph. Step 5: Use graph traversal algorithm to effectively obtain label combinations; Step 6: Enter the instruction generation stage. In this stage, the label combination is used as input, combined with the specific generation template, and the fine-tuned large language model is called to generate text. Step 7. Finally, the generated instructions need to go through a series of manual verification processes, including syntax checking, logical consistency testing, and execution feasibility assessment.

2. The complex instruction generation method based on the data tag graph structure according to claim 1 is characterized in that: The specific steps include: Step 1: The system comprehensively uses the data sets for instruction fine-tuning to ensure the comprehensiveness and representativeness of the data; these data sets are mainly in the form of question-answer pairs, where each piece of data can be specifically represented as an instruction Query and an answer Response; the collected open source data format is unified into the form of (Query, Response); Step 2: Label the collected open source data; select open settings and use a large language model for labeling to cope with the ever-changing user query needs; the specific labeling process is: for each data instruction part Query i , through prompt engineering, and using fewshot in the prompt to guide the large language model to generate query-based i The set of k tags of the content (tag1, tag2, tag3, ..., tag k ); Step 3: Based on the labeling results of the above full open source dataset, we get the label categories; aggregate and remove duplicates of similar labels, and merge some highly related labels into an atomic label through frequency filtering, rule aggregation, and semantic aggregation to reduce the redundancy of labels; finally, we get different labels from the open source dataset, covering various fields, and record the total number of labels as N, and the set of all labels as (tag1, tag2, tag3, ..., tag N ); Then, the label results of the open source dataset are optimized for each instruction according to the above filtering and aggregation methods; Step 4: An instruction can have multiple tags. Here, the relationship between tags that appear in the same instruction at the same time is called co-occurrence; Define each label as a node in the label relationship graph to be constructed; If there are two tags in the total N tags in step 3 m and tags n (1≤m≤N, 1≤n≤N) There is a co-occurrence relationship in the open source data, so these two nodes can be associated to form a label relationship graph; Step 5: After adding all the labels in the open source data to the relationship graph, the label combination can be obtained according to the graph; first, a starting label is selected, which can be randomly selected or selected according to the data type desired by the user; the graph traversal algorithm can be used to effectively obtain the label combination; in specific implementation, through the depth-first search and breadth-first search strategies, starting from any selected starting label, according to the set depth or breadth, the set number of label nodes reached can be traversed to form different label combinations; Step 6: Get the tag combination (tag1, tag2, tag3, ..., tag p ), where p is the set target number of label nodes, and then enters the instruction generation stage; in this stage, the label combination is taken as input, combined with the specific generation template, and the fine-tuned large language model is called to generate text; the generation template design includes a fixed instruction format part and a variable label slot, and a complete instruction generation request is formed by filling the label combination into the slot; the generated instruction will directly reflect the semantic relationship and logical structure of the label in the label relationship graph, ensuring that the generated instruction is not only grammatically correct but also logically coherent; in addition, this method can generate multi-level instructions from simple to complex according to the size of the label combination; Step 7. Finally, the generated instructions need to go through a series of manual verification processes, including syntax checking, logical consistency testing, and execution feasibility assessment.

3. The complex instruction generation method based on the data tag graph structure according to claim 2 is characterized in that: The construction of the label relationship diagram in step 4 can also be done by manual annotation or by using a semi-automatic tool combined with manual review.

4. The complex instruction generation method based on the data tag graph structure according to claim 2 is characterized in that: The graph traversal algorithm in step 5 can also use a heuristic search algorithm, such as an A* algorithm or a Dijkstra algorithm, to select a label combination.

5. The complex instruction generation method based on the data tag graph structure according to claim 2 is characterized in that: In step 6, when generating instructions, you can also use an automatic text generation model based on machine learning, such as a model based on a variational autoencoder or a generative adversarial network.

6. The complex instruction generation method based on the data tag graph structure according to claim 2 is characterized in that: The verification process in step 7 can introduce natural language understanding techniques, such as sentiment analysis and semantic role labeling.