Large language model task planning method based on knowledge graph and reinforcement learning

By combining knowledge graphs and reinforcement learning in large language models, dividing task sets and optimizing task planning parameters, the problem of insufficient task planning efficiency and accuracy in the existing technology is solved, and more efficient and accurate task execution is achieved.

CN118642934BActive Publication Date: 2024-10-29XINGFAN XINGQI (CHENGDU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411102741.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-10-29
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

Existing task planning methods based on large language models have problems of low efficiency and low accuracy. They cannot make full use of the rich information in the knowledge graph, and it is difficult to optimize the planning strategy through dynamic learning, resulting in limitations in system capabilities.

Method used

A large language model task planning method based on knowledge graphs and reinforcement learning is used to divide the task set into sub-areas, collect and analyze various parameters, evaluate and optimize task planning performance, and combine human-computer interaction to optimize task disassembly and tool allocation. , path planning and verification reflection to improve the accuracy and efficiency of task execution.

Benefits of technology

It improves the performance and efficiency of large language models in complex tasks, ensures accurate task disassembly, reasonable tool allocation, and smooth path planning, reduces resource and time consumption, and improves the success rate and efficiency of overall task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642934B_ABST
    Figure CN118642934B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, in particular to a large language model task planning method based on knowledge graph and reinforcement learning, comprising the following steps: step 1: determining a task set to be planned as a target area, and dividing the target area into a plurality of sub-areas according to each task, step 2: collecting data for the sub-areas divided in step 1, step 3: analyzing the various parameters collected in step 2, step 4: evaluating various indicators of the task planning performance analyzed in step 3, step 5: optimizing the indicators with abnormalities calculated in step 4, step 6: comprehensively analyzing the performance reaching index of the indicators after the task planning performance of step 5 is optimized by an optimization module, and step 7: performing human-computer interaction on the comprehensive performance indicators of the large language model task planning obtained by comprehensive analysis in step 6; the present invention decomposes tasks through the semantic understanding ability of a large language model, thereby improving the performance and efficiency of the model in complex tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and specifically to a large language model task planning method based on knowledge graph and reinforcement learning. Background Art

[0002] Large Language Model (LLM) refers to a deep learning model trained with a large amount of text data. It can generate natural language text or understand the meaning of language text. It is widely used in intelligent question-answering systems, decision support systems, automated document generation and other fields. Knowledge graphs, as a structured knowledge representation method, can provide rich semantic information and relationships. Reinforcement learning can learn the optimal strategy through interaction with the environment and reward mechanism. The combination of knowledge graphs and reinforcement learning provides strong technical support for large language model task planning.

[0003] The existing LLM-based intelligent agent combined with additional capabilities can already realize the planning and execution of some tasks, but due to the illusion of LLM, the specific system capabilities are greatly limited. Therefore, traditional task planning methods often cannot fully utilize the rich information in the knowledge graph, and it is difficult to optimize the planning strategy through dynamic learning, resulting in problems such as low efficiency and low accuracy of planning methods. With the development of large language models, their performance in processing various natural language tasks is getting better and better. When facing complex tasks and diverse user needs, it is particularly important to improve the performance of large language model task planning.

[0004] Therefore, a large language model task planning method based on knowledge graph and reinforcement learning is provided to solve the above problems, especially the performance analysis of large language model task planning. By combining the semantic understanding ability of the large language model, the structured knowledge support of the knowledge graph and the optimization strategy ability of reinforcement learning, the model hallucination problem and planning hallucination problem are further solved. The correct capabilities and paths provided by the graph are strictly followed for planning, which helps to improve the performance and efficiency of the model in complex tasks. Summary of the invention

[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a large language model task planning method based on knowledge graph and reinforcement learning to solve the problems raised in the above-mentioned background technology.

[0006] To achieve the above object, the present invention provides the following technical solution: a large language model task planning method based on knowledge graph and reinforcement learning, comprising the following steps:

[0007] Step 1: Determine the task set to be planned as the target area, and divide the target area into several sub-areas according to each task;

[0008] Step 2: Collect data from the sub-areas divided in step 1 to obtain various parameters for analyzing the performance of large language model task planning;

[0009] Step 3: Analyze various parameters of the large language model task planning performance collected in step 2 to obtain various indicators for analyzing the large language model task planning performance;

[0010] Step 4: Evaluate various indicators of the large language model task planning performance analyzed in step 3 to obtain the performance index of each indicator;

[0011] Step 5: Optimize the abnormal indicators of the large language model task planning performance calculated in step 4 to obtain optimized evaluation indicators;

[0012] Step 6: Comprehensively analyze the performance index of the large language model task planning performance index after the optimization module in step 5 to obtain the comprehensive performance index of the large language model task planning;

[0013] Step 7: Comprehensively analyze step 6 to obtain the comprehensive performance indicators of large language model task planning for human-computer interaction.

[0014] Preferably, the parameters include target area information, software manager identity authentication information, planning agent task disassembly parameters, planning agent tool allocation parameters, planning agent task execution parameters and planning agent execution verification reflection parameters, wherein the planning agent task disassembly parameters are specifically subtask data sets, the number of disassembled subtasks, subtask dependency data sets, the number of subtask dependencies, the number of correctly disassembled subtasks and the number of correct dependencies; the planning agent tool allocation parameters are specifically tool allocation type data sets, the number of tool types, the number set of each tool type, the total number of tools allocated to subtasks and the number of successfully matched tools; the planning agent task execution parameters are specifically execution path sets, task allocation resource amount data sets, subtask execution path time data sets, the number of correctly executed paths, the amount of resources actually used by subtasks, the total number of task execution paths required based on the set tasks and the total execution path time; the planning agent execution verification reflection parameters are specifically checkpoint number sets, reflection number data sets, valid checkpoint number and valid reflection adjustment number.

[0015] Preferably, the analysis of the various parameters includes a planning agent task decomposition analysis unit, a planning agent tool allocation analysis unit, a planning agent task execution analysis unit and a planning agent execution verification reflection analysis unit, wherein the planning agent task decomposition analysis unit is used to calculate the planning agent task decomposition parameters, the planning agent tool allocation analysis unit is used to calculate the planning agent tool allocation parameters, the planning agent task execution analysis unit is used to calculate the planning agent task execution parameters and the planning agent execution verification reflection analysis unit is used to calculate the planning agent execution verification reflection parameters.

[0016] Preferably, obtaining the sub-region task decomposition accuracy index from various indicators of the large language model task planning performance includes the following steps:

[0017] Step 3.1.1: The planning agent decomposes the input sub-region tasks to obtain the sub-task data set , ,in Indicates A set of subtasks in a region, Indicates the number of subtasks to be disassembled. Indicates Region No. subtasks;

[0018] Step 3.1.2: For each decomposed subtask, identify the logical relationship between subtasks and obtain the task dependency dataset , ,in Indicates The task dependency dataset of each region, represents the number of identified subtask dependencies, Indicates Region No. dependencies;

[0019] Step 3.1.3: Set the number of subtasks required based on the task requirements and the number of task dependencies , compare the number of subtasks disassembled and identify the number of subtask dependencies , get the number of subtasks that are correctly disassembled and the correct number of dependencies , , , so the model of the sub-region task decomposition accuracy index is: ,in Indicates The regional task decomposition accuracy index, and They represent the influencing factors of the number of subtasks and the number of identified dependencies, respectively.

[0020] Preferably, obtaining the sub-region tool allocation rationality rate index from various indicators of the large language model task planning performance includes the following steps:

[0021] Step 3.2.1: Assign tools to each subtask and obtain a tool assignment category dataset , ,in Indicates A set of tool types assigned to each subtask. Indicates the number of tool types assigned to subtasks, Indicates The first subtask assigned tools;

[0022] Step 3.2.2: According to the tools assigned to each subtask, get the quantity set of each tool type , then The total number of tools assigned to each subtask is , ,in Indicates The number of tools allocated;

[0023] Step 3.2.3: Calculate the total number of tools required based on the set task requirements , compare the total amount of tools allocated to the sub-area obtained by the planning agent , , Indicates the number of subtasks to be disassembled and the number of tools that are successfully matched , , so the model of the reasonable rate indicator of sub-regional tool allocation is: ,in Indicates A reasonable rate indicator for regional tool allocation.

[0024] Preferably, obtaining the sub-region planning path success rate index from the various indicators of the large language model task planning performance includes the following steps:

[0025] Step 3.3.1: Input the subtasks with assigned tools as validation sets into the large language model based on knowledge graph and reinforcement learning, and search for the execution path set in the knowledge graph. , ,in Indicates Region No. The number of possible execution paths for a subtask;

[0026] Step 3.3.2: Based on the searched execution path set , obtain the resource quantity dataset of task allocation through the model monitoring tool , And the time dataset of the subtask execution path , ,in Indicates The amount of resources allocated to each subtask, Indicates Subtask No. execution path time, then The shortest execution time of a subtask is ;

[0027] Step 3.3.3: The total number of task execution paths required based on the set task and the total execution path time Compare and get the number of paths correctly executed by the planning agent And the sum of the shortest execution time , represents the number of disassembled subtasks, then the optimal path efficiency model is: ,in Indicates The optimal path efficiency in each region, Indicates The actual amount of resources used by each subtask. and They represent the factors affecting the execution path time and the amount of allocated resources, respectively. The path planning accuracy model is: ,in Indicates The accuracy of path planning in each area, , so the sub-region planning path efficiency index model is: ,in Indicates The success rate indicator of regional planning paths.

[0028] Preferably, obtaining the sub-region verification reflection perfection index from various indicators of the large language model task planning performance includes the following steps:

[0029] Step 3.4.1: Obtain the number of checkpoints set by the Agent during the search for the optimal execution path in the knowledge graph through the check log , ,in Indicates Region No. The number of checkpoints for each subtask;

[0030] Step 3.4.2: Obtain the number of times the agent reflects through the reflection log , ,in Indicates Region No. Number of reflections per subtask;

[0031] Step 3.4.3: Obtain the number of valid checkpoints in the sub-region according to the large language model monitoring tool and effective reflection adjustment times , so the model of sub-region verification reflection perfection index is: ,in Indicates Regional task verification reflection perfection indicators, , .

[0032] Preferably, the evaluation of the performance index of each indicator includes the following steps:

[0033] Step 4.1: Decompose the sub-regional tasks into accuracy indicators and analyze the calculation results Substituting into the formula: ,in It represents the performance index of the task decomposition accuracy indicator. Indicates the threshold value;

[0034] Step 4.2: Analyze and calculate the results of the reasonable rate index of the sub-regional tool allocation Substituting into the formula: ,in It represents the performance index of the tool allocation rationality rate indicator. Indicates the threshold value;

[0035] Step 4.3: Analyze and calculate the efficiency index of the sub-regional planning path Substituting into the formula: ,in Represents the performance index of the task planning path efficiency indicator, Indicates the threshold value;

[0036] Step 4.4: Analyze and calculate the sub-region verification and reflection completeness index results Substituting into the formula: ,in It represents the performance index of the task verification reflection perfection index. Indicates the threshold value.

[0037] Preferably, the optimization evaluation index is used to obtain the optimization evaluation index of the agent during task planning, and the maximum expected cumulative reward is , , ,in Indicates at time Accumulated rewards, Indicates at time The task planning status, Indicates the task, represents the task planning strategy, Indicates at time Rewards received, represents the discount factor, represents the total number of steps in task planning, represents mathematical expectation.

[0038] Preferably, the comprehensive analysis model of the comprehensive performance index of the large language model task planning is: ,in Represents the comprehensive performance index of large language model task planning, Represents the performance index of the task decomposition accuracy index after optimization The weight of The performance index of the tool allocation rationality index after optimization The weight of Represents the performance index of the optimized task planning path efficiency index The weight of Represents the performance index of the task verification reflection perfection index after optimization The weight occupied by a region, n represents the number of sub-regions.

[0039] Technical effects and advantages of the present invention:

[0040] 1. The present invention analyzes the task decomposition parameters of the planning agent to obtain an indicator to evaluate the accuracy and depth of the planning agent's understanding of the task and its ability to convert it into actionable steps. A higher task decomposition accuracy means that the agent can more accurately grasp the task requirements, thereby more effectively guiding the subsequent execution process;

[0041] 2. The present invention obtains an indicator to evaluate the ability of the planning agent to allocate appropriate tools to different subtasks by analyzing the planning agent tool allocation parameters. Reasonable tool allocation can ensure that each subtask can be processed most effectively, while reducing resource waste and costs, thereby improving the efficiency and success rate of overall task execution;

[0042] 3. The present invention analyzes the planning Agent task execution parameters to obtain an indicator to evaluate the model's ability to plan the execution sequence and path to optimize the efficiency of task completion. Effective path planning can ensure that the task can be executed smoothly as expected, which helps to minimize the consumption of time, resources or costs, thereby improving the efficiency and success rate of overall task execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the overall process of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] See also Figure 1 As shown, the present invention provides a large language model task planning method based on knowledge graph and reinforcement learning, including: a large language model task area division module, a large language model task data acquisition module, a large language model task planning analysis module, a large language model task planning evaluation module, a large language model task planning optimization module, a large language model task planning comprehensive analysis module and a large language model task planning human-computer interaction module.

[0046] The large language model task area division module is connected to the large language model task data acquisition module, the large language model task planning analysis module is respectively connected to the large language model task data acquisition module and the large language model task planning evaluation module, the large language model task planning optimization module is respectively connected to the large language model task planning analysis module, the large language model task planning evaluation module and the large language model task planning comprehensive analysis module, and the large language model task planning human-computer interaction module is connected to the large language model task planning comprehensive analysis module.

[0047] The large language model task area division module is used to divide the task set to be planned into areas, and output the divided areas to the large language model task data collection module;

[0048] The large language model task data collection module is used to collect data on the tasks input into the large language model in the divided areas, obtain various parameters for analyzing the planning performance of the large language model tasks, and output the task data set to the large language model task planning analysis module;

[0049] The large language model task planning analysis module is used to analyze various parameters to obtain various indicators for analyzing the performance of the large language model task planning, and transmit the various indicators to the large language model task planning evaluation module;

[0050] The large language model task planning evaluation module is used to compare the various indicators of the large language model task planning performance obtained by the above analysis module with the threshold, and output the comparison evaluation results to the large language model task planning optimization module and the large language model task planning comprehensive analysis module;

[0051] The large language model task planning optimization module is used to optimize the abnormal results calculated by the above-mentioned data evaluation module, and output the optimization results to the large language model task planning analysis module and the large language model task planning comprehensive analysis module;

[0052] The large language model task planning comprehensive analysis module is used to comprehensively analyze the comparative evaluation results obtained by the optimization module, and output the comprehensive analysis results to the large language model task planning human-computer interaction module;

[0053] The large language model task planning human-computer interaction module is used to output the large language model task planning performance comprehensive indicators transmitted by the above-mentioned comprehensive analysis module to the software management personnel information terminal.

[0054] A large language model task planning method based on knowledge graph and reinforcement learning includes the following steps: step 1: determining a task set to be planned as a target area, and dividing the target area into a plurality of sub-areas according to each task, step 2: collecting data on the sub-areas divided in step 1, and obtaining various parameters for analyzing the performance of large language model task planning, step 3: analyzing various parameters of the large language model task planning performance collected in step 2, and obtaining various indicators for analyzing the performance of large language model task planning, step 4: evaluating various indicators of the large language model task planning performance analyzed in step 3, and obtaining performance compliance indexes of various indicators, step 5: optimizing indicators of the large language model task planning performance calculated in step 4 with abnormalities, and obtaining optimized evaluation indicators, step 6: comprehensively analyzing the performance compliance indexes of the indicators of the large language model task planning performance after the optimization module in step 5, and obtaining the comprehensive performance indicators of the large language model task planning, and step 7: performing human-computer interaction on the comprehensive performance indicators of the large language model task planning obtained by the comprehensive analysis in step 6.

[0055] Step 1: Determine the task set to be planned as the target area, and divide the target area into several sub-areas according to each task, which are marked as 1, 2, 3, ..., i..., n in sequence;

[0056] Step 2: Collect data from the sub-areas divided in step 1 to obtain various parameters for analyzing the performance of large language model task planning, including target area information, software manager identity authentication information, planning agent task disassembly parameters, planning agent tool allocation parameters, planning agent task execution parameters, and planning agent execution verification reflection parameters, where the planning agent task disassembly parameters are specifically subtask data sets, the number of disassembled subtasks, subtask dependency data sets, the number of subtask dependencies, the number of correctly disassembled subtasks, and the number of correct dependencies; the planning agent tool allocation parameters are specifically tool allocation type data sets, the number of tool types, the number set of each tool type, the total number of tools allocated to subtasks, and the number of successfully matched tools; the planning agent task execution parameters are specifically execution path sets, task allocation resource amount data sets, subtask execution path time data sets, the number of correctly executed paths, the actual amount of resources used by subtasks, the total number of task execution paths required based on the set tasks, and the total execution path time; the planning agent execution verification reflection parameters are specifically checkpoint number sets, reflection number data sets, valid checkpoint number, and valid reflection adjustment number;

[0057] Step 3: Analyze various parameters of the large language model task planning performance collected in step 2 to obtain various indicators for analyzing the large language model task planning performance, wherein the analysis includes a planning agent task disassembly analysis unit, a planning agent tool allocation analysis unit, a planning agent task execution analysis unit, and a planning agent execution verification reflection analysis unit, wherein the planning agent task disassembly analysis unit is used to calculate the planning agent task disassembly parameters, the planning agent tool allocation analysis unit is used to calculate the planning agent tool allocation parameters, the planning agent task execution analysis unit is used to calculate the planning agent task execution parameters, and the planning agent execution verification reflection analysis unit is used to calculate the planning agent execution verification reflection parameters, and the analysis and calculation includes the following steps;

[0058] Step 3.1: By analyzing the planning agent task decomposition parameters, the planning agent's ability to accurately decompose tasks into executable subtasks can be measured, thereby more effectively guiding the subsequent execution process. Therefore, the planning agent decomposes and analyzes the tasks input by the sub-region from the planning agent task decomposition analysis unit to obtain the sub-region task decomposition accuracy index. The task decomposition analysis includes the following steps:

[0059] Step 3.1.1: Import the sub-area into the task As a task decomposition verification set, it is input into a large language model based on knowledge graph and reinforcement learning. For example, if the task of the sub-region input is "generate a review article on the application of artificial intelligence in the medical field", the planning agent decomposes the input sub-region task to obtain the sub-task data set. , ,in Indicates A set of subtasks in a region, Indicates the number of subtasks to be disassembled. Indicates Region No. For example, the agent breaks down the task into "collecting AI application cases in the medical field, analyzing the application effects of various technologies in medicine, writing the introduction, writing the technical background, and writing the detailed application of each technology";

[0060] Step 3.1.2: For each decomposed subtask, identify the logical relationship between subtasks and obtain the task dependency dataset , ,in Indicates The task dependency dataset of each region, represents the number of identified task dependencies, Indicates Region No. dependencies, for example, "writing the introduction" should come before "writing the technical background";

[0061] Step 3.1.3: Set the number of subtasks required based on the task requirements and the number of task dependencies , compare the number of subtasks disassembled and identify the number of subtask dependencies , get the number of subtasks that are correctly disassembled and the correct number of dependencies , , , that is, the number of subtasks that are consistent with the set task requirements, logically correct, and helpful in achieving the final goal. Therefore, the model of the sub-region task decomposition accuracy index is: ,in Indicates The regional task decomposition accuracy index, and Represent the influencing factors of the number of subtasks and the number of identified dependencies, respectively;

[0062] Step 3.2: By analyzing the planning agent tool allocation parameters, the ability of the planning agent to allocate appropriate tools to different subtasks can be measured, thereby improving the efficiency and success rate of the overall task execution. Therefore, one or more tools are allocated to each subtask in the planning agent tool allocation analysis unit to analyze the reasonable rate index of sub-area tool allocation. The tool allocation analysis includes the following steps:

[0063] Step 3.2.1: Input the disassembled subtasks as tool assignment verification sets into the large language model based on knowledge graph and reinforcement learning. According to the requirements of the subtasks and the tool information available in the knowledge graph, plan the Agent to access the tools in the tool library, assign tools to each subtask, and obtain the tool assignment category dataset. , ,in Indicates A set of tool types assigned to each subtask. Indicates the number of tool types assigned to subtasks, Indicates The first subtask assigned Tools such as literature search tools, natural language processing tools, data analysis tools, document editing tools, etc.

[0064] Step 3.2.2: According to the tools assigned to each subtask, get the quantity set of each tool type , then The total number of tools assigned to each subtask is , ,in Indicates The number of tools allocated;

[0065] Step 3.2.3: Calculate the total number of tools required based on the set task requirements , compare the total amount of tools allocated to the sub-area obtained by the planning agent , , Indicates the number of subtasks to be disassembled and the number of tools that are successfully matched , , so the model of the reasonable rate indicator of sub-regional tool allocation is: ,in Indicates The reasonableness rate indicator of regional tool allocation was used. For example, for the subtask of "analyzing the application effects of various technologies in medical treatment", the agent selected GPT-4 as a natural language processing tool to extract and analyze information in relevant literature.

[0066] Step 3.3: By analyzing the planning agent task execution parameters, the model's ability to plan execution order and path to optimize task completion efficiency can be measured, thereby improving the efficiency and success rate of overall task execution. Therefore, the planning agent task execution analysis unit searches for the optimal path in the knowledge graph to ensure that the subtasks are executed in a reasonable order and obtain the sub-region planning path success rate index. The planning path analysis includes the following steps:

[0067] Step 3.3.1: Input the subtasks with assigned tools as validation sets into the large language model based on knowledge graph and reinforcement learning, and search for the execution path set in the knowledge graph. , ,in Indicates Region No. The number of possible execution paths for a subtask;

[0068] Step 3.3.2: Based on the searched execution path set , obtain the resource quantity dataset of task allocation through the model monitoring tool , And the time dataset of the subtask execution path , ,in Indicates The amount of resources allocated to each subtask, Indicates Subtask No. execution path time, then The shortest execution time of a subtask is ;

[0069] Step 3.3.3: The total number of task execution paths required based on the set task and the total execution path time Compare and get the number of paths correctly executed by the planning agent And the sum of the shortest execution time , represents the number of disassembled subtasks, then the optimal path efficiency model is: ,in Indicates The optimal path efficiency in each region, Indicates The actual amount of resources used by each subtask. and They represent the factors affecting the execution path time and the amount of allocated resources, respectively. The path planning accuracy model is: ,in Indicates The accuracy of path planning in each area, , so the sub-region planning path efficiency index model is: ,in Indicates The success rate indicator of regional planning paths;

[0070] What needs to be specifically explained in this embodiment is that the ability of the large language model to search for the optimal path in the knowledge graph is evaluated from two aspects: the shortest execution path time and the amount of resources used. The ability of the large language model to sort subtasks according to the dependencies between subtasks to ensure that the subtasks are executed in a reasonable order is evaluated from the number of correctly executed paths.

[0071] What needs to be specifically explained in this embodiment is that for subtasks whose solutions cannot be directly obtained in the graph, these problems are first decomposed in a more fine-grained manner to generate a new subtask list; then the new subtasks are planned using the capabilities of the knowledge graph to try to find solutions; finally, the newly found solution path is added to the knowledge graph as a separate graph node to achieve graph expansion. By continuously accumulating new solutions and paths, the planning agent can gradually improve its ability to handle complex tasks and achieve self-learning.

[0072] Step 3.4: By analyzing the verification and reflection parameters of the planning agent, the model's ability to verify and reflect during execution to correct errors or optimize solutions can be measured, which helps promote the agent's continuous improvement and learning, making it more accurate and efficient in future task planning. Therefore, the planning agent performs verification and reflection on the execution of the planning agent in the verification and reflection analysis unit to obtain the sub-region verification and reflection completeness index to ensure that the agent's planning path is valid in the graph. The verification and reflection analysis includes the following steps:

[0073] Step 3.4.1: Obtain the number of checkpoints set by the Agent during the search for the optimal execution path in the knowledge graph through the check log , ,in Indicates Region No. The number of checkpoints for each subtask, such as data collection completeness check, literature analysis accuracy check, article structure rationality check, etc.

[0074] Step 3.4.2: Obtain the number of times the agent reflects through the reflection log , ,in Indicates Region No. Number of reflections per subtask;

[0075] Step 3.4.3: Obtain the number of valid checkpoints in the sub-region according to the large language model monitoring tool and effective reflection adjustment times , the number of effective checkpoints refers to the number of checkpoints that successfully found problems or potential errors, and the number of effective reflection adjustments refers to the number of effective adjustments made based on the reflection results. Therefore, the model of the sub-area verification reflection completeness index is: ,in Indicates Regional task verification reflection perfection indicators, , ;

[0076] Step 4: Evaluate the various indicators of the large language model task planning performance analyzed in step 3 to obtain the performance index of each indicator. The evaluation includes the following steps:

[0077] Step 4.1: Decompose the sub-regional tasks into accuracy indicators and analyze the calculation results Substituting into the formula: ,in It represents the performance index of the task decomposition accuracy indicator. Indicates the threshold value;

[0078] Step 4.2: Analyze and calculate the results of the reasonable rate index of the sub-regional tool allocation Substituting into the formula: ,in It represents the performance index of the tool allocation rationality rate indicator. Indicates the threshold value;

[0079] Step 4.3: Analyze and calculate the efficiency index of the sub-regional planning path Substituting into the formula: ,in Represents the performance index of the task planning path efficiency indicator, Indicates the threshold value;

[0080] Step 4.4: Analyze and calculate the sub-region verification and reflection completeness index results Substituting into the formula: ,in It represents the performance index of the task verification reflection perfection index. Indicates the threshold value;

[0081] What needs to be specifically explained in this embodiment is that , indicating that the large language model task planning performance is good, and its results are output to the large language model task planning comprehensive analysis module. Otherwise, it means that the task planning performance is abnormal, and its results are output to the large language model task planning optimization module;

[0082] Step 5: Optimize the abnormal indicators of the large language model task planning performance calculated in step 4. The planning agent introduces reinforcement learning technology during training to reduce the language hallucination and planning hallucination of the large language model. The optimization analysis includes the following steps:

[0083] Step 5.1: According to the evaluation results of step 4, the planning scheme generated in the above step 3 is used as the input of the reinforcement learning model, and the natural language processing technology is used to understand the intention of the task. The sub-region language hallucination reward function and the planning hallucination reward function are designed respectively. Through the continuous iterative training process, the parameters and strategies of the large language model are optimized, and rewards are given to the planning paths that meet the expectations, and penalties are given to the planning paths that produce hallucinations, so as to reduce the language hallucinations and planning hallucinations of the large language model. For example, for language hallucinations, a reward function can be designed to punish outputs that are inconsistent with the facts; for planning hallucinations, a reward function can be designed to encourage planning paths that are logical and realistic.

[0084] Step 5.2: According to the reward function of task planning, obtain the agent's optimization evaluation index during task planning, the maximum expected cumulative reward , , ,in Indicates at time Accumulated rewards, Indicates at time The task planning status, Indicates the task, represents the task planning strategy, Indicates at time Rewards received, represents the discount factor, represents the total number of steps in task planning, represents mathematical expectation;

[0085] It should be specifically explained in this embodiment that the higher the cumulative reward value, the better the performance of the agent. Under the task planning strategy, the expected cumulative reward indicator of the agent's interaction with the environment from the time it receives the task state measures the long-term effect of the strategy.

[0086] Step 6: Comprehensively analyze the performance index of the large language model task planning performance index after the optimization module in step 5 to obtain the comprehensive performance index of the large language model task planning. The comprehensive analysis model is: ,in Represents the comprehensive performance index of large language model task planning, Represents the performance index of the task decomposition accuracy index after optimization The weight of The performance index of the tool allocation rationality index after optimization The weight of Represents the performance index of the optimized task planning path efficiency index The weight of Represents the performance index of the task verification reflection perfection index after optimization The weight occupied, n represents the number of sub-regions;

[0087] Step 7: Perform human-computer interaction on the comprehensive performance indicators of the large language model task planning obtained through comprehensive analysis of step 6. When the comprehensive performance indicators of the task planning are within the set allowable range, it means that the large language model task planning performance is good. Otherwise, it prompts the software manager to take timely measures. Then, based on feedback and abnormal situations, dynamically adjust the execution plan or re-disassemble the task, and update and maintain the knowledge graph to ensure its timeliness and accuracy, which helps the model to handle complex tasks efficiently and intelligently.

[0088] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0089] The above contents are merely examples and explanations of the concept of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A large language model task planning method based on knowledge graph and reinforcement learning, characterized in that: The following steps are involved: Step 1: Determine the task set to be planned as the target area, and divide the target area into several sub-areas according to each task; Step 2: Collect data from the sub-areas divided in step 1 to obtain various parameters for analyzing the performance of large language model task planning; The parameters include target area information, software manager identity authentication information, planning agent task disassembly parameters, planning agent tool allocation parameters, planning agent task execution parameters and planning agent execution verification reflection parameters, wherein the planning agent task disassembly parameters are specifically subtask data sets, the number of disassembled subtasks, subtask dependency data sets, the number of subtask dependencies, the number of correctly disassembled subtasks and the number of correct dependencies; the planning agent tool allocation parameters are specifically tool allocation type data sets, the number of tool types, the number set of each tool type, the total number of tools allocated to subtasks and the number of successfully matched tools; the planning agent task execution parameters are specifically execution path sets, task allocation resource amount data sets, subtask execution path time data sets, the number of correctly executed paths, the actual amount of resources used by subtasks, the total number of task execution paths required based on the set tasks and the total execution path time; The planning agent performs verification reflection parameters, which are specifically the number of verification points, the number of reflections, the number of valid verification points, and the number of valid reflection adjustments; Step 3: Analyze various parameters of the large language model task planning performance collected in step 2 to obtain various indicators for analyzing the large language model task planning performance; The analysis of the various parameters includes a planning agent task disassembly analysis unit, a planning agent tool allocation analysis unit, a planning agent task execution analysis unit and a planning agent execution verification reflection analysis unit, wherein the planning agent task disassembly analysis unit is used to calculate the planning agent task disassembly parameters, the planning agent tool allocation analysis unit is used to calculate the planning agent tool allocation parameters, the planning agent task execution analysis unit is used to calculate the planning agent task execution parameters and the planning agent execution verification reflection analysis unit is used to calculate the planning agent execution verification reflection parameters; Obtaining the sub-region task decomposition accuracy index from the various indicators of the large language model task planning performance includes the following steps: Step 3.1.1: The planning agent decomposes the input sub-region tasks to obtain the sub-task data set , ,in Indicates A set of subtasks in a region, Indicates the number of subtasks to be disassembled. Indicates Region No. subtasks; ∈(1,2,…, L 1), ∈(1,2,…,n), n represents the number of sub-regions; Step 3.1.2: For each decomposed subtask, identify the logical relationship between subtasks and obtain the task dependency dataset , ,in Indicates The task dependency dataset of each region, represents the number of identified subtask dependencies, Indicates Region No. dependencies; Step 3.1.3: Set the number of subtasks required based on the task requirements and the number of task dependencies , compare the number of subtasks disassembled and identify the number of subtask dependencies , get the number of subtasks that are correctly disassembled and the correct number of dependencies , , , so the model of the sub-region task decomposition accuracy index is: ,in Indicates The regional task decomposition accuracy index, and Represent the influencing factors of the number of subtasks and the number of identified dependencies, respectively; Obtaining a sub-region tool allocation rationality index from various indicators of the large language model task planning performance includes the following steps: Step 3.2.1: Assign tools to each subtask and obtain a tool assignment category dataset , ,in Indicates A set of tool types assigned to each subtask. Indicates the number of tool types assigned to subtasks, Indicates The first subtask assigned tools; ∈(1,2,…, L 1), ∈(1,2,…,n), n represents the number of sub-regions; Step 3.2.2: According to the tools assigned to each subtask, get the quantity set of each tool type , then The total number of tools assigned to each subtask is , ,in Indicates The number of tools allocated; Step 3.2.3: Calculate the total number of tools required based on the set task requirements , compare the total amount of tools allocated to the sub-area obtained by the planning agent , , Indicates the number of subtasks to be disassembled and the number of tools that are successfully matched , , so the model of the reasonable rate indicator of sub-regional tool allocation is: ,in Indicates An indicator of reasonable rate of regional tool allocation; Obtaining the sub-region planning path success rate index from the various indicators of the large language model task planning performance includes the following steps: Step 3.3.1: Input the subtasks with assigned tools as validation sets into the large language model based on knowledge graph and reinforcement learning, and search for the execution path set in the knowledge graph. , ,in Indicates Region No. The number of possible execution paths for a subtask; ∈(1,2,…, L 1), ∈(1,2,…,n), n represents the number of sub-regions; Step 3.3.2: Based on the searched execution path set , obtain the resource quantity dataset of task allocation through the model monitoring tool , And the time dataset of the subtask execution path , ,in Indicates The amount of resources allocated to each subtask, Indicates Subtask No. execution path time, then The shortest execution time of a subtask is ; Step 3.3.3: The total number of task execution paths required based on the set task and the total execution path time Compare and get the number of paths correctly executed by the planning agent And the sum of the shortest execution time , represents the number of disassembled subtasks, then the optimal path efficiency model is: ,in Indicates The optimal path efficiency in each region, Indicates The actual amount of resources used by each subtask. and They represent the factors affecting the execution path time and the amount of allocated resources, respectively. The path planning accuracy model is: ,in Indicates The accuracy of path planning in each area, , so the sub-region planning path efficiency index model is: ,in Indicates The success rate indicator of regional planning paths; Obtaining the sub-region verification reflection perfection index from the various indicators of the large language model task planning performance includes the following steps: Step 3.4.1: Obtain the number of checkpoints set by the Agent during the search for the optimal execution path in the knowledge graph through the check log , ,in Indicates Region No. The number of checkpoints for each subtask; ∈(1,2,…, L 1), ∈(1,2,…,n), n represents the number of sub-regions; Step 3.4.2: Obtain the number of times the agent reflects through the reflection log , ,in Indicates Region No. Number of reflections per subtask; Step 3.4.3: Obtain the number of valid checkpoints in the sub-region according to the large language model monitoring tool and effective reflection adjustment times , so the model of sub-region verification reflection perfection index is: ,in Indicates Regional task verification reflection perfection indicators, , ; Step 4: Evaluate various indicators of the large language model task planning performance analyzed in step 3 to obtain the performance index of each indicator; The evaluation of the performance index of each indicator includes the following steps: Step 4.1: Decompose the sub-regional tasks into accuracy indicators and analyze the calculation results Substituting into the formula: ,in It represents the performance index of the task decomposition accuracy indicator. Indicates the threshold value; ∈(1,2,…,n), n represents the number of sub-regions; Step 4.2: Analyze and calculate the results of the reasonable rate index of the sub-regional tool allocation Substituting into the formula: ,in It represents the performance index of the tool allocation rationality rate indicator. Indicates the threshold value; Step 4.3: Analyze and calculate the efficiency index of the sub-regional planning path Substituting into the formula: ,in Represents the performance index of the task planning path efficiency indicator, Indicates the threshold value; Step 4.4: Analyze and calculate the sub-region verification and reflection completeness index results Substituting into the formula: ,in It represents the performance index of the task verification reflection perfection index. Indicates the threshold value; Step 5: Optimize the abnormal indicators of the large language model task planning performance calculated in step 4 to obtain optimized evaluation indicators; The optimization evaluation index is used to obtain the optimization evaluation index of the agent during task planning, and the maximum expected cumulative reward , , ,in Indicates at time Accumulated rewards, Indicates at time The task planning status, Indicates the task, represents the task planning strategy, Indicates at time Rewards received, represents the discount factor, represents the total number of steps in task planning, represents mathematical expectation; Step 6: Comprehensively analyze the performance index of the large language model task planning performance index after the optimization module in step 5 to obtain the comprehensive performance index of the large language model task planning; The comprehensive analysis model of the comprehensive performance index of the large language model task planning is: ,in Represents the comprehensive performance index of large language model task planning, Represents the performance index of the task decomposition accuracy index after optimization The weight of The performance index of the tool allocation rationality index after optimization The weight of Represents the performance index of the optimized task planning path efficiency index The weight of Represents the performance index of the task verification reflection perfection index after optimization The weight occupied, n represents the number of sub-regions, ∈(1,2,…,n); Step 7: Comprehensively analyze step 6 to obtain the comprehensive performance indicators of large language model task planning for human-computer interaction.

Citation Information

Patent Citations

  • Multi-unmanned aerial vehicle task planning method based on large language model

    CN117151338A

  • Medical data governance method and system based on knowledge graph and large language model

    CN118155780A