Task decomposition method with adaptive multi-layer large model structure for complex tasks
Through the task decomposition method of adaptive multi-layer large model structure, the problems of low accuracy and insufficient flexibility of complex task decomposition are solved, and efficient and accurate task decomposition is achieved to meet the needs of large-scale task processing.
Patent Information
- Application Number
- CN202411095186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-12
AI Technical Summary
Existing task decomposition methods are difficult to meet the needs of large-scale task processing, especially when facing complex tasks, with low accuracy and lack of flexibility, and manual intervention is often required.
Adaptive multi-layer large-model structure for complex tasks is adopted, and vectorized operations are obtained by obtaining task text information, and the task text semantic vector is generated, and the atomic task library is matched to form high-correlation semantic information. It is generated by decomposition of prompt engineering and Agent modules. Task sequence, use semantic similarity to judge the correctness of the decomposition results, and obtain the high-semantic decomposition task sequence.
Effective decomposition of tasks of different complexity is achieved, the accuracy and automation of task decomposition are improved, manual intervention is reduced, and large-scale task processing needs are met.
Smart Images

Figure CN118627518B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a task decomposition method for an adaptive multi-layer large model structure for complex tasks. Background Art
[0002] Large Language Models (LLMs) are increasingly used in various application scenarios due to their powerful natural language understanding and generation capabilities. Traditional task decomposition methods mainly rely on artificially set rules and logic, while large language models, due to their excellent natural language processing capabilities, can perform many tasks that could only be completed by humans in the past, including task planning and task decomposition. When dealing with task decomposition problems, large language models can understand task information and generate corresponding task decomposition results. However, large language models can only deal with low-complexity task decomposition problems, and it is difficult to generate accurate results when faced with high-complexity tasks.
[0003] In order to meet this challenge, agent technology came into being. Agent technology relies on carefully designed rules and logic to call large language models for task splitting, so that it can handle more complex tasks. However, most agents in related technologies need to be pre-trained or set with fixed parameters. When faced with complex and changing tasks, it is difficult to fully cover all possible situations, which leads to low accuracy in task decomposition. In addition, agents lack sufficient flexibility and cannot adjust the decomposition strategy according to the dynamic changes of actual tasks, resulting in the lack of accuracy and efficiency of the task decomposition results they generate. In many cases, task decomposition still requires manual intervention, which not only reduces the degree of automation, but also makes it difficult to meet the needs of large-scale task processing. Summary of the invention
[0004] The present application provides a task decomposition method with an adaptive multi-layer large model structure for complex tasks, so as to solve the problem that task decomposition is difficult to meet the needs of large-scale task processing.
[0005] The present application provides a task decomposition method for an adaptive multi-layer large model structure for complex tasks, the method comprising:
[0006] Obtain the task text information of the target task and perform vectorization operations to generate a task text semantic vector;
[0007] Matching the task text semantic vector with the semantic vector in the atomic task library to form highly relevant semantic information;
[0008] Decomposing the highly relevant semantic information through prompt engineering and agent modules to generate a task sequence;
[0009] Based on the semantic similarity between the task sequence and the task text semantic vector in the vector space, judging whether the decomposed task sequence is correct;
[0010] If the decomposed task sequence is correct, a high-semantic decomposed task sequence is obtained based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space.
[0011] The above method first vectorizes the text information to convert it into a task text semantic vector with the same semantics, and then uses the text semantic similarity to determine whether an error occurs in the task decomposition process and whether the task is decomposed thoroughly. It further constrains the Agent and can decompose tasks of different complexities into natural language sequences at the atomic task level, thereby achieving effective decomposition of tasks of different complexities to solve the problem that task decomposition is difficult to meet the needs of large-scale task processing.
[0012] Optionally, task text information of the target task is obtained and vectorized to generate a task text semantic vector, including:
[0013] Obtaining a target task and extracting task text information of the target task;
[0014] Converting the task text information into a uniform format to generate a task text;
[0015] The semantic information of the unified format task text is mapped to a high-order vector space through a pre-trained word embedding model to obtain a task text semantic vector.
[0016] The above method firstly processes the task text information of different formats into a unique data format through format conversion, thereby improving the processing efficiency of the task text information and facilitating subsequent batch processing and analysis; and then maps the semantic information of the task text of the unified format to a high-order vector space through a pre-trained word embedding model, which can better capture the semantic information in the task text, thereby improving the semantic representation ability of the task text, and conveniently calculating the similarity or distance between different task texts, thereby improving the comparability of the task text. In addition, the pre-trained word embedding model is usually trained on a large-scale corpus, has strong migration and generalization capabilities, and can solve the problem of insufficient target task data to a certain extent.
[0017] Optionally, mapping the semantic information of the unified format task text to a high-order vector space through a pre-trained word embedding model to obtain a task text semantic vector includes:
[0018] Splitting the unified format task text into task text vocabulary;
[0019] Calculate the word frequency, inverse document frequency and word embedding vector of the task text vocabulary according to the task text vocabulary and the unified format task text;
[0020] The task text semantic vector is calculated by using the word frequency, the inverse document frequency and the word embedding vector.
[0021] The above method not only improves the accuracy of semantic representation and the generalization ability of the model, but also optimizes resource allocation, supports diverse application scenarios, and improves the interpretability of the model by splitting the unified format task text into task text vocabulary and calculating word frequency, inverse document frequency and word embedding vector.
[0022] Optionally, matching the task text semantic vector with the semantic vector in the atomic task library to form highly relevant semantic information includes:
[0023] Perform vectorization operations on all atomic tasks in the atomic task library to generate atomic task semantic vectors;
[0024] The task text semantic vector and the atomic task semantic vector are similarly matched to generate highly relevant semantic information.
[0025] The above method performs vectorization operations on all atomic tasks in the atomic task library to generate an atomic task semantic vector containing semantic information of the system's executable functions; and then performs similarity matching between the task text semantic vector and the atomic task semantic vector to enhance the text description of the input task and reduce the occurrence of task decomposition failures due to missing input text information, typos, or incoherent language.
[0026] Optionally, the highly relevant semantic information is decomposed by using a prompt engineering and an agent module to generate a task sequence, including:
[0027] Reconstructing the highly relevant semantic information into text through prompt engineering and task decomposition rules to generate reconstructed text information;
[0028] The reconstructed text information is transmitted to an Agent module having a hierarchical structure; the Agent module is used to perform task decomposition on the reconstructed text information according to a task decomposition rule;
[0029] The reconstructed text information is decomposed into tasks through the Agent module to generate a task sequence.
[0030] The above method reconstructs the text of the highly relevant semantic information by prompting engineering and task decomposition rules, which can normalize the highly relevant semantic information and help avoid problems in numerical calculations. The Agent module decomposes the reconstructed text information into tasks, reducing the need for manual writing and organization and the probability of errors. The Agent module with a hierarchical structure can be flexibly added or modified to adapt to different task requirements.
[0031] Optionally, judging whether the decomposed task sequence is correct based on the semantic similarity between the task sequence and the task text semantic vector in the vector space includes:
[0032] Performing vectorization operation on the task sequence to generate a task sequence semantic vector;
[0033] Calculating the semantic similarity between the task text semantic vector and the task sequence semantic vector according to the inner product;
[0034] If the semantic similarity is equal to or higher than the similarity threshold, the decomposed task sequence is correct.
[0035] The above method can accurately calculate the semantic similarity between the task text semantic vector and the task sequence semantic vector through vectorization operations and inner products. It can not only timely discover and correct errors in the task decomposition process, avoid the accumulation and amplification of errors in subsequent steps, and improve the quality of overall task execution and the accuracy of task decomposition, but also automatically detect errors in task decomposition without human intervention, thereby improving the degree of automation.
[0036] Optionally, the inner product is calculated as follows:
[0037] ;
[0038] in, is the inner product of vectors, is the semantic vector of the task text of the current operation; is the semantic vector of the task sequence of the current operation; is the dimension of the vector.
[0039] The calculation of the semantic similarity can measure the consistency of two vectors in the same dimension, and then determine whether an error occurs in the task decomposition process, so as to achieve effective decomposition of tasks of different complexity.
[0040] Optionally, based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, obtaining a high semantic decomposition task sequence includes:
[0041] Calculating the similarity between the subtasks and the atomic task in the task sequence according to the cosine similarity;
[0042] If the similarity between the subtask and the atomic task is greater than or equal to the cosine similarity threshold, the decomposed task is determined to be successful;
[0043] A high-semantic decomposition task sequence is output according to the task sequence.
[0044] By calculating the cosine similarity between each subtask and the atomic task in the task decomposition sequence, the thoroughness of the decomposition can be evaluated, and errors in the task decomposition can be discovered in a timely manner, avoiding the accumulation and amplification of errors in subsequent steps, improving the accuracy of task decomposition, and enhancing fault tolerance when facing complex or abnormal situations.
[0045] Optionally, based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, obtaining a high semantic decomposition task sequence further includes:
[0046] If the similarity between the subtask and the atomic task is lower than the cosine similarity threshold, generating feedback information;
[0047] The feedback information generates transmission parameters through the adaptive module;
[0048] The transfer parameters are decomposed again by the Agent module to regenerate the task sequence.
[0049] When the similarity between the subtask and the atomic task is lower than the threshold, the system will generate feedback information and trigger the adaptive module to adjust the parameters. This not only optimizes the task execution process, avoids ineffective work caused by incorrect task decomposition, and improves the efficiency of the overall task execution, but also does not require human intervention, thereby improving the degree of automation.
[0050] Optionally, the calculation formula of the cosine similarity is:
[0051] ;
[0052] in, is the cosine similarity, is the inner product of vectors, and They are vectors and The Euclidean norm of , is the semantic vector of the task text of the current operation; is the semantic vector of the task sequence of the current operation; is the dimension of the vector.
[0053] By using the cosine similarity calculation formula, the cosine similarity between each subtask and the atomic task in the task decomposition sequence can be accurately calculated, and then it can be judged whether the task decomposition process is thorough, so as to achieve effective decomposition of tasks of different complexity.
[0054] It can be seen from the above technical scheme that the present application provides a task decomposition method of an adaptive multi-layer large model structure for complex tasks, the method comprising: obtaining task text information of a target task and performing vectorization operations to generate a task text semantic vector; matching the task text semantic vector with the semantic vector in an atomic task library to form highly correlated semantic information; decomposing the highly correlated semantic information through prompt engineering and Agent modules to generate a task sequence; judging whether the decomposed task sequence is correct based on the semantic similarity between the task sequence and the task text semantic vector in the vector space; if the decomposed task sequence is correct, obtaining a highly semantically decomposed task sequence based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, thereby achieving effective decomposition of tasks of different complexities and solving the problem that task decomposition is difficult to meet the needs of large-scale task processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0056] Figure 1 A flowchart of a task decomposition method for a complex task-oriented adaptive multi-layer large model structure provided in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of a process for obtaining a semantic vector of a task text in a task decomposition method of an adaptive multi-layer large model structure for complex tasks provided in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of a process for generating highly relevant semantic information in a task decomposition method for a complex task-oriented adaptive multi-layer large model structure provided in an embodiment of the present application;
[0059] Figure 4 A schematic diagram of a process for generating a task sequence in a task decomposition method for a complex task-oriented adaptive multi-layer large model structure provided in an embodiment of the present application;
[0060] Figure 5 A flowchart of determining whether an error occurs in task decomposition in a task decomposition method for a complex task-oriented adaptive multi-layer large model structure provided in an embodiment of the present application;
[0061] Figure 6 A flowchart of obtaining a high-semantic decomposition task sequence in a task decomposition method for an adaptive multi-layer large model structure for complex tasks provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The embodiments will be described in detail below, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following embodiments do not represent all implementation methods consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application.
[0063] Agents rely on carefully designed rules and logic to call large language models for task splitting, so that they can handle more complex tasks. However, most agents in related technologies require pre-training or fixed parameters, which makes it difficult to fully cover all possible situations when faced with complex and changing tasks, resulting in low accuracy in task decomposition. In addition, agents lack sufficient flexibility and are unable to adjust decomposition strategies according to the dynamic changes of actual tasks, resulting in the lack of accuracy and efficiency in the task decomposition results they generate. In many cases, task decomposition still requires manual intervention, which not only reduces the degree of automation, but also makes it difficult to meet the needs of large-scale task processing.
[0064] To solve the problem that task decomposition cannot meet the needs of large-scale task processing, see Figure 1 The embodiment of the present application provides a task decomposition method for an adaptive multi-layer large model structure for complex tasks, the method comprising:
[0065] S100: Obtain task text information of a target task and perform vectorization operations to generate a task text semantic vector.
[0066] S200: Matching the task text semantic vector with the semantic vector in the atomic task library to form highly relevant semantic information.
[0067] S300: Decomposing the highly relevant semantic information through prompt engineering and Agent modules to generate a task sequence.
[0068] S400: Based on the semantic similarity between the task sequence and the task text semantic vector in the vector space, determining whether the decomposed task sequence is correct.
[0069] S500: If the decomposed task sequence is correct, a high-semantic decomposed task sequence is obtained based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space.
[0070] The above method first vectorizes the text information to convert it into a task text semantic vector with the same semantics, and then uses the text semantic similarity to determine whether an error occurs in the task decomposition process and whether the task is decomposed thoroughly. It further constrains the Agent and can decompose tasks of different complexities into natural language sequences at the atomic task level, thereby achieving effective decomposition of tasks of different complexities to solve the problem that task decomposition is difficult to meet the needs of large-scale task processing.
[0071] In some embodiments, see Figure 2 , obtain the task text information of the target task and perform vectorization operations to generate the task text semantic vector, including:
[0072] S110: Acquire a target task, and extract task text information of the target task.
[0073] S120: Convert the task text information into a uniform format to generate a task text.
[0074] It should be understood that format conversion is the process of converting raw text data into a preset, structured text format through a specific algorithm or tool. Specifically, the raw text data is first cleaned to remove irrelevant characters and information, and part-of-speech tagging, syntactic analysis, and entity recognition may be performed at the same time; then the processed data is converted into a continuous output sequence based on a deep learning model; finally, the generated text sequence is further structured into a specific format according to requirements.
[0075] S130: Mapping the semantic information of the unified format task text to a high-order vector space through a pre-trained word embedding model to obtain a task text semantic vector.
[0076] It should be understood that the unified format task text needs to be loaded, that is, the text file is loaded into the pre-trained word embedding model. The word embedding model is a technology that maps words to a high-order vector space. This technology can capture the semantic relationship between words, so that semantically similar words are also close in distance in the vector space. This application needs to use the word embedding model to perform vectorization operations.
[0077] The above method firstly processes the task text information of different formats into a unique data format through format conversion, thereby improving the processing efficiency of the task text information and facilitating subsequent batch processing and analysis; and then maps the semantic information of the task text of the unified format to a high-order vector space through a pre-trained word embedding model, which can better capture the semantic information in the task text, thereby improving the semantic representation ability of the task text, and conveniently calculating the similarity or distance between different task texts, thereby improving the comparability of the task text. In addition, the pre-trained word embedding model is usually trained on a large-scale corpus, has strong migration and generalization capabilities, and can solve the problem of insufficient target task data to a certain extent.
[0078] In some embodiments, mapping the semantic information of the unified format task text to a high-order vector space through a pre-trained word embedding model to obtain a task text semantic vector includes:
[0079] The unified format task text is split into task text words.
[0080] The word frequency, inverse document frequency and word embedding vector of the task text vocabulary are calculated according to the task text vocabulary and the unified format task text.
[0081] Specifically, we first need to calculate the vector representation of a single word, and then express the vector representation of a task text. To measure the importance of a word in the entire task text, we need to calculate two factors: word frequency and inverse document frequency. Refers to a word In the documentation The frequency of occurrence in . The calculation formula is:
[0082] ;
[0083] Inverse Document Frequency Measures the general importance of word t, which is used to reduce the influence of common words and increase the weight of rare words. The calculation formula is:
[0084] ;
[0085] in, is the total number of documents.
[0086] For a given word , whose word embedding vector It can be expressed as:
[0087] ;
[0088] in, Yes word The word embedding vector of .
[0089] The task text semantic vector is calculated by using the word frequency, the inverse document frequency and the word embedding vector.
[0090] Specifically, the document A series of words Composition, its task document semantic vector Can be expressed as all words The weighted average of the weighted word embedding vectors. In some embodiments, for a more accurate weighted average, the weight of each word should be taken into account. value, so the task text semantic vector It can be defined as:
[0091] ;
[0092] It should be understood that the use of the denominator in the definition formula of the task text semantic vector is to achieve normalization and ensure The weight correctly reflects the value.
[0093] In the above process, the unified format task text is converted into a vector form in the vector space, and these generated vectors have semantic information, so they are task text semantic vectors. Storing the task text semantic vector in the vector space can facilitate subsequent operations.
[0094] The above method not only improves the accuracy of semantic representation and the generalization ability of the model, but also optimizes resource allocation, supports diverse application scenarios, and improves the interpretability of the model by splitting the unified format task text into task text vocabulary and calculating word frequency, inverse document frequency and word embedding vector.
[0095] In some embodiments, see Figure 3 , matching the task text semantic vector with the semantic vector in the atomic task library to form highly relevant semantic information, including:
[0096] S210: Perform vectorization operations on all atomic tasks in the atomic task library to generate atomic task semantic vectors.
[0097] S220: Perform similarity matching on the task text semantic vector and the atomic task semantic vector to generate highly relevant semantic information.
[0098] It should be understood that in order for the system to successfully execute the encapsulated functions, the atomic task library is defined, and the system encapsulated functions are called through the set of all functions that the system can execute contained in the atomic task library. Therefore, the ultimate goal of task decomposition is to ensure that the decomposed tasks are semantically aligned with the atomic task library at the semantic level, that is, the subtasks generated by task decomposition must be semantically consistent with the system executable atomic tasks defined in the atomic task library. Therefore, it is necessary to perform similarity matching between the task text semantic vector and the atomic task semantic vector to generate highly relevant semantic information.
[0099] The above method performs vectorization operations on all atomic tasks in the atomic task library to generate an atomic task semantic vector containing semantic information of the system's executable functions; and then performs similarity matching between the task text semantic vector and the atomic task semantic vector to enhance the text description of the input task and reduce the occurrence of task decomposition failures due to missing input text information, typos, or incoherent language.
[0100] In some embodiments, see Figure 4 , decomposing the highly relevant semantic information through prompt engineering and agent modules to generate task sequences, including:
[0101] S310: reconstructing the highly relevant semantic information through prompt engineering and task decomposition rules to generate reconstructed text information.
[0102] S320: Transmitting the reconstructed text information to an Agent module having a hierarchical structure.
[0103] The Agent module is used to perform task decomposition on the reconstructed text information according to task decomposition rules.
[0104] S330: Decomposing the reconstructed text information into tasks through the Agent module to generate a task sequence.
[0105] It should be understood that prompt engineering is a technique applied in natural language processing and machine learning models, which is a method of stimulating models to produce high-quality output by designing and optimizing input prompts. In the context of the agent, prompts are instructions that specify the task decomposition work that the agent needs to perform. These prompts are designed to maximize the potential of the model so that it can correctly understand and perform the given tasks. Task decomposition rules define how to split a complex task into multiple subtasks. For example, if a task is to "organize a meeting", the task decomposition may include subtasks such as "determine participants", "arrange time" and "book a meeting room". These rules are combined with highly relevant semantic vectors to reconstruct text information, and the reconstructed text information is passed to the agent, so that the agent can automatically decompose the reconstructed text information according to the task decomposition rules, and generate a series of subtasks after task decomposition. These subtasks together constitute a task sequence.
[0106] The above method reconstructs the text of the highly relevant semantic information by prompting engineering and task decomposition rules, which can normalize the highly relevant semantic information and help avoid problems in numerical calculations. The Agent module decomposes the reconstructed text information into tasks, reducing the need for manual writing and organization and the probability of errors. The Agent module with a hierarchical structure can be flexibly added or modified to adapt to different task requirements.
[0107] In some embodiments, see Figure 5 , based on the semantic similarity between the task sequence and the task text semantic vector in the vector space, judging whether the decomposed task sequence is correct, including:
[0108] S410: Performing a vectorization operation on the task sequence to generate a task sequence semantic vector.
[0109] It should be understood that the task sequence semantic vector can be stored in a vector space to facilitate subsequent operations.
[0110] S420: Calculate the semantic similarity between the task text semantic vector and the task sequence semantic vector according to the inner product.
[0111] It should be understood that the inner product is the sum of the products of the corresponding elements of two vectors. Since the inner product combines the length and direction of the vector to measure the similarity, it is more suitable for situations where the text lengths are relatively close. If the lengths of the two texts differ greatly, the result of the inner product calculation may be dominated by the vector with the longer text length, which may not accurately reflect the semantic similarity between the texts. Therefore, the inner product is more effective when processing long texts, especially long texts with similar text lengths. In this application, because the task text semantic vector and the task sequence semantic vector are close in text length, the similarity calculation in this part is applicable to the inner product calculation to measure the degree of consistency of the two vectors in the same dimension.
[0112] S430: If the semantic similarity is lower than the similarity threshold, the decomposed task sequence is wrong.
[0113] It should be understood that the result of the inner product is a value between -1 and 1, indicating a similarity ranging from completely dissimilar (-1) to completely identical (1). The similarity threshold can be determined by multiple experiments to observe the system performance under different thresholds and select the optimal threshold. The similarity threshold is preferably 0.90-0.95. After determining that an error has occurred in the decomposed task sequence, it is necessary to return to step S100, re-extract the task text information and perform vectorization operations.
[0114] S440: If the semantic similarity is equal to or higher than the similarity threshold, the decomposed task sequence is correct.
[0115] The above method can accurately calculate the semantic similarity between the task text semantic vector and the task sequence semantic vector through vectorization operations and inner products. It can not only timely discover and correct errors in the task decomposition process, avoid the accumulation and amplification of errors in subsequent steps, and improve the quality of overall task execution and the accuracy of task decomposition, but also automatically detect errors in task decomposition without human intervention, thereby improving the degree of automation.
[0116] In some embodiments, the inner product is calculated as follows:
[0117] ;
[0118] in, is the inner product of vectors, is the semantic vector of the task text of the current operation; is the semantic vector of the task sequence of the current operation; is the dimension of the vector.
[0119] It should be understood that the inner product calculation formula is used for semantic similarity. The calculation of the semantic similarity can measure the consistency of two vectors in the same dimension, and then determine whether an error occurs in the task decomposition process, so as to achieve effective decomposition of tasks of different complexity.
[0120] In some embodiments, see Figure 6 , based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, a high semantic decomposition task sequence is obtained, including:
[0121] S510: Calculate the similarity between the subtasks and the atomic task in the task sequence according to the cosine similarity.
[0122] S520: If the similarity between the subtask and the atomic task is greater than or equal to the cosine similarity threshold, it is determined that the decomposed task is successful.
[0123] S521: Outputting a high-semantic decomposition task sequence according to the task sequence.
[0124] It should be understood that an atomic task refers to a basic task unit that cannot be further decomposed. Cosine similarity is a measure of the cosine value of the angle between two non-zero vectors, which reflects the similarity of the directions of the two vectors without considering their lengths. The range of cosine similarity is from -1 to 1, where 1 means they are exactly the same. The cosine similarity threshold can be set according to requirements, and the cosine similarity threshold is preferably 0.92-0.98. The calculation of cosine similarity has a low computational complexity and can support real-time or near real-time processing requirements.
[0125] By calculating the cosine similarity between each subtask and the atomic task in the task decomposition sequence, the thoroughness of the decomposition can be evaluated, and errors in the task decomposition can be discovered in a timely manner, avoiding the accumulation and amplification of errors in subsequent steps, improving the accuracy of task decomposition, and enhancing fault tolerance when facing complex or abnormal situations.
[0126] In some embodiments, see again Figure 6 , based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, obtaining a high semantic decomposition task sequence, further comprising:
[0127] S530: if the similarity between the subtask and the atomic task is lower than the cosine similarity threshold, generate feedback information;
[0128] S531: The feedback information generates transmission parameters through an adaptive module;
[0129] S532: The transferred parameters are decomposed again by the Agent module to regenerate the task sequence.
[0130] When the similarity between the subtask and the atomic task is lower than the threshold, the system will generate feedback information and trigger the adaptive module to adjust the parameters. This not only optimizes the task execution process, avoids ineffective work caused by incorrect task decomposition, and improves the efficiency of the overall task execution, but also does not require human intervention, thereby improving the degree of automation.
[0131] In some embodiments, the calculation formula of the cosine similarity is:
[0132] ;
[0133] in, is the cosine similarity, is the inner product of vectors, and They are vectors and The Euclidean norm of , is the semantic vector of the task text of the current operation; is the semantic vector of the task sequence of the current operation; is the dimension of the vector.
[0134] It should be understood that the vector and The Euclidean norm of the vector and Length.
[0135] By using the cosine similarity calculation formula, the cosine similarity between each subtask and the atomic task in the task decomposition sequence can be accurately calculated, and then it can be judged whether the task decomposition process is thorough, so as to achieve effective decomposition of tasks of different complexity.
[0136] It can be seen from the above technical scheme that the embodiment of the present application provides a task decomposition method of an adaptive multi-layer large model structure for complex tasks, the method comprising: obtaining task text information of a target task and performing vectorization operations to generate a task text semantic vector; matching the task text semantic vector with the semantic vector in an atomic task library to form highly correlated semantic information; decomposing the highly correlated semantic information through prompt engineering and Agent modules to generate a task sequence; judging whether the decomposed task sequence is correct based on the semantic similarity between the task sequence and the task text semantic vector in the vector space; if the decomposed task sequence is correct, obtaining a highly semantically decomposed task sequence based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, thereby achieving effective decomposition of tasks of different complexities and solving the problem that task decomposition is difficult to meet the needs of large-scale task processing.
[0137] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.
Claims
1. A task decomposition method for complex tasks with an adaptive multi-layer large model structure, characterized in that: The method comprises: Obtain the task text information of the target task and perform vectorization operations to generate a task text semantic vector; Matching the task text semantic vector with the semantic vector in the atomic task library to form highly relevant semantic information; Decomposing the highly relevant semantic information through prompt engineering and agent modules to generate a task sequence; Based on the semantic similarity between the task sequence and the task text semantic vector in the vector space, judging whether the decomposed task sequence is correct; If the decomposed task sequence is correct, based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, a high semantic decomposition task sequence is obtained; Based on the semantic similarity between the task sequence and the atomic tasks in the atomic task library in the vector space, obtaining a high semantic decomposition task sequence includes: Calculating the similarity between the subtasks and the atomic task in the task sequence according to the cosine similarity; If the similarity between the subtask and the atomic task is greater than or equal to the cosine similarity threshold, the decomposed task is determined to be successful; Outputting a high-semantic decomposition task sequence according to the task sequence; If the similarity between the subtask and the atomic task is lower than the cosine similarity threshold, generating feedback information; The feedback information generates transmission parameters through the adaptive module; The transfer parameters are decomposed again by the Agent module to regenerate the task sequence.
2. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 1 is characterized in that: Obtain the task text information of the target task and perform vectorization operations to generate the task text semantic vector, including: Obtaining a target task and extracting task text information of the target task; Converting the task text information into a uniform format to generate a task text; The semantic information of the unified format task text is mapped to a high-order vector space through a pre-trained word embedding model to obtain a task text semantic vector.
3. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 2 is characterized in that: The semantic information of the unified format task text is mapped to a high-order vector space through a pre-trained word embedding model to obtain a task text semantic vector, including: Splitting the unified format task text into task text vocabulary; Calculate the word frequency, inverse document frequency and word embedding vector of the task text vocabulary according to the task text vocabulary and the unified format task text; The task text semantic vector is calculated by using the word frequency, the inverse document frequency and the word embedding vector.
4. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 2 is characterized in that: Matching the task text semantic vector with the semantic vector in the atomic task library to form highly relevant semantic information, including: Perform vectorization operations on all atomic tasks in the atomic task library to generate atomic task semantic vectors; The task text semantic vector and the atomic task semantic vector are similarly matched to generate highly relevant semantic information.
5. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 1 is characterized in that: The highly relevant semantic information is decomposed through the prompt engineering and agent modules to generate a task sequence, including: Reconstructing the highly relevant semantic information into text through prompt engineering and task decomposition rules to generate reconstructed text information; Transmitting the reconstructed text information to an Agent module having a hierarchical structure, wherein the Agent module is used to perform task decomposition on the reconstructed text information according to a task decomposition rule; The reconstructed text information is decomposed into tasks through the Agent module to generate a task sequence.
6. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 1 is characterized in that: Based on the semantic similarity between the task sequence and the task text semantic vector in the vector space, judging whether the decomposed task sequence is correct includes: Performing vectorization operation on the task sequence to generate a task sequence semantic vector; Calculating the semantic similarity between the task text semantic vector and the task sequence semantic vector according to the inner product; If the semantic similarity is equal to or higher than the similarity threshold, the decomposed task sequence is correct.
7. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 6 is characterized in that: The calculation formula of the inner product is: ; in, is the inner product of vectors, is the semantic vector of the task text of the current operation; is the semantic vector of the task sequence of the current operation; is the dimension of the vector.
8. The task decomposition method of the adaptive multi-layer large model structure for complex tasks according to claim 1 is characterized in that: The calculation formula of the cosine similarity is: ; in, is the cosine similarity, is the inner product of vectors, and They are vectors and The Euclidean norm of , is the semantic vector of the task text of the current operation; is the semantic vector of the task sequence of the current operation; is the dimension of the vector.
