Method and system for optimizing large model task planner based on cue words

Through an optimization method based on prompt words, combining intent recognition and multi-round dialogue to obtain user instructions, and using the task planning library and structured prompt word templates, the bias and illusion problems of large models in task planning are solved, and the accuracy of task planning is improved. performance and reliability, realizing the automation and intelligence of task planning.

CN118747209APending Publication Date: 2024-10-08NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP

Patent Information

Application Number
CN202410889434.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

In agent applications based on large models, the task planner lacks reliable reasoning capabilities and the user input is not accurate enough, resulting in poor executability, excessive divergence or incorrectness in the task planning process, which affects the final achievement of the task goal.

Method used

Through optimization methods based on prompt words, including intent recognition, multiple rounds of dialogue to obtain user instructions, retrieving the most similar task list from the task planning library, generating task plans based on context and available tools, and automatically adjusting through user feedback until requirements are met , using structured prompt word templates and task planning libraries for optimization.

Benefits of technology

It significantly improves the accuracy and reliability of task planning, solves the problem of bias and hallucination of large models in task reasoning in specific fields, and realizes the automation and intelligence of task planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747209A_ABST
    Figure CN118747209A_ABST
Patent Text Reader

Abstract

The invention discloses an optimization method and system of a large model task planner based on cue words, and the method comprises the steps that the large model task planner preferentially carries out the similarity retrieval from a task planning library of a knowledge base in response to a task demand of a user, taking the retrieved task list content and the tool list declaration which can be utilized by the Agent as a part of cue words, and inputting the cue words into a large model task planner for task planning reasoning; in the reasoning process, multiple rounds of conversations with a user are added to clarify user demand contents and boundaries, a feedback mechanism of the user for generated task planning is added, and the contents of the previous rounds of conversations are recorded in a memory component and are input to a large model task planner together to complete automatic revision of the task planning. And finally, the task plan confirmed by the user is sent to a task executor to be executed. The task reasoning capability of the large model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an optimization method and system for a large model task planner based on prompt words. Background Art

[0002] In Agent applications based on large models, compared with the "one step at a time" ReAct-type Agent, the "Plan and Solve Agent" with global planning capabilities is more suitable for complex task scenarios. It adopts the design idea of ​​separating the task planner and the task executor. The task planner first decomposes the goal into a series of required steps or subtasks, and then uses the executor to call one or more tools to complete the task. When solving complex tasks, the subtasks can be executed in parallel / batch, which is more efficient. However, due to the lack of reliable reasoning ability of large models for specific tasks in specific fields, coupled with the inaccuracy of user problem input, the most critical task planning process may be greatly affected by the problems of poor executable, excessive divergence or even incorrect task planning lists, thus affecting the final achievement of the entire task goal. The prompt word is the language for communicating with the large model, and it is the most direct way to stimulate the ability of the large model, which has a significant impact on the reasoning effect of the large model. There is no standard prompt word drafting specification at present, and the industry is also actively exploring it. Excellent prompt words for task planner optimization are still relatively rare. Summary of the invention

[0003] In view of this, the present invention provides an optimization method and system for a large model task planner based on prompt words.

[0004] The present invention discloses an optimization method for a large model task planner based on prompt words, which comprises:

[0005] Step 1: The large model task planner responds to the user's task requirements by first identifying and judging the user's intentions and obtaining more potential instruction information from the user through multiple rounds of dialogue.

[0006] Step 2: When the large model task planner is inferring, it will first search from the task planning library and query the task planning execution list with the highest similarity to the current task as an important reference for formulating the task plan list;

[0007] Step 3: When the large model task planner is inferring, the prompt words directly input include the context user dialogue {message} in the short-term memory function, the retrieved task list information {context}, and the list of tools that the agent can call {toollist}, generating the first task plan from a multi-dimensional perspective;

[0008] Step 4: The large model task planner automatically optimizes and adjusts the inferred task plan based on user feedback until a task plan that meets user needs is generated. After obtaining user confirmation and permission, the task plan list that is consistent with user needs is sent to the task executor for execution.

[0009] Furthermore, the step 1 comprises:

[0010] Step 11: The user logs in from the web interface and enters the task requirements in the new dialog box;

[0011] Step 12: The large model task planner first performs intent recognition and determines whether the user needs to provide additional relevant information to complete the task.

[0012] Furthermore, the step 2 comprises:

[0013] Step 21: If additional relevant information is needed, return the answer and add another round of dialogue to inquire;

[0014] Step 22: The user completes the relevant information in the dialog box as required;

[0015] Step 23: After the large model task planner obtains sufficient user instructions, it preferentially retrieves the task planning execution list with the highest similarity to the problem from the task planning library in the knowledge base.

[0016] Furthermore, the step 3 comprises:

[0017] The large model task planner performs task planning reasoning based on the contextual conversation content {message}, the retrieved fragments {context} and the list of available tools {toollist} declared in the Agent to generate the first task planning list.

[0018] Furthermore, the step 4 comprises:

[0019] Step 41: The first task planning list Plan 1 needs to be confirmed by the user and a round of dialogue is continued;

[0020] Step 42: The user provides feedback in the dialog box based on the quality of the first task planning list. If the user is satisfied with the task planning list, a satisfactory and next step execution instruction is sent to the task planner; if the user is not satisfied with the task planning list, the user enters the modification opinions into the task planner in the dialog box;

[0021] Step 43: The task planner automatically adjusts the task planning list based on the feedback, and the adjusted task list needs to be confirmed by the user again, and another round of dialogue continues;

[0022] Step 44: Repeat steps 42 and 43 until the user is satisfied, and then send the aligned task list {Plan-N} to the task executor;

[0023] Step 45: The manually aligned task planning list and questions are solidified in the task planning library in the form of key-value pairs. Next time a similar task is encountered, a task planning list that satisfies the user can be quickly generated.

[0024] Furthermore, the ability of the large model to plan tasks is stimulated by prompt words. The prompt words are in the form of reusable prompt word templates. The prompt word templates are structured in a way based on the thinking chain technique. The prompt word templates include roles, backgrounds, skills, goals, restrictions, output formats and workflows:

[0025] The workflow includes: 1) the user clearly describes the problem or functional requirement that he wants to solve; 2) the system asks for specific details and what information is needed to complete the task; 3) the system first searches the database based on the user's original question and the supplementary information; 4) the task planning list is generated based on the retrieved {context} fragment; when formulating the task planning list, the tool {toollist} is used first; 5) the system asks the user for the inferred task list, and can only continue execution after confirmation.

[0026] Furthermore, the task planning library, as a collection, induction and summary of tasks in a specified field, stores relevant information in a relational database or vector database in the form of text or vector; the relevant data includes task ID, task requirements, task description, task planning list, and number of citations;

[0027] Task ID: a unique number for the task; Task requirement: a concise task requirement name generated based on the problem summary entered by the user; Task description: a detailed description of the task; Number of citations: the number of times the task list has been cited, used to count the frequency of task use; Task planning list: a detailed task list generated based on the task, including subtask steps and the tools used.

[0028] The present invention also discloses an optimization system for a large model task planner based on prompt words, which is used to implement any of the above-mentioned optimization methods for a large model task planner based on prompt words, and comprises:

[0029] The intention confirmation module conducts multiple rounds of dialogue based on the user's input questions to obtain clearer and more accurate user instructions;

[0030] The knowledge retrieval module is used for the large model task planner to respond to the user's task requirements and preferentially retrieve the information fragments with the highest similarity to the problem from the task planning library of the knowledge base;

[0031] The task generation module sends various information including context dialogue information, callable tool list information, retrieved information fragments, etc. to the large model task planner for reasoning to generate the first task planning list;

[0032] The feedback execution module is used to generate a new task planning list based on the user's feedback on the initial task planning list, and then feed back the new task planning list to the user, and continue to generate the corresponding task planning list based on the user's feedback, and so on, until a task planning list that meets the user's needs is generated, and the task planning list that meets the user's needs is sent to the task executor for execution.

[0033] Due to the adoption of the above technical solution, the present invention has the following advantages:

[0034] 1. Based on the structured and COT (chain of thought) prompt word skills, this paper designs a set of optimization processes and prompt word templates for the agent planner, and proposes a basic task planning library table structure, which can optimize the "bias" and "hallucination" problems existing in large models during task reasoning, and is the actual application need of large models in the industry field.

[0035] 2. The present invention designs and optimizes the workflow of the task planner from multiple dimensions such as clear instructions, identity restrictions, multiple rounds of dialogue, and human feedback. Through the designed structured prompt word template, the working mode of the big model is set in the background of the program, aiming to solve the problems of missing user input semantics and big model's own bias and hallucinations, etc., with the big model's own capabilities as the center. The present invention can solve the unreliability problem of big models in specific tasks in specific fields to a great extent, and provides a design idea for the automation and intelligence of business personnel's daily operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0037] Figure 1 The present invention is a flowchart of an optimization method for a large model task planner based on prompt words according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The present invention is further described in conjunction with the accompanying drawings and embodiments, and the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of the embodiments of the present invention.

[0039] See also Figure 1 The present invention provides an embodiment of an optimization method of a large model task planner based on prompt words, which includes:

[0040] ① The user logs in from the web interface, creates a new dialog, and enters the task requirement query in the dialog box;

[0041] ② The large model's task planner first performs intent recognition to determine whether the user needs to provide additional relevant information to complete the task;

[0042] ③ If additional relevant information is needed, return the answer and add another round of dialogue to ask questions;

[0043] ④The user completes the relevant information in the dialog box as required;

[0044] ⑤ By using the short-term memory function in combination with the context, the query of the previous round of dialogue and the relevant information supplemented by the user this time can be combined. The large model will first search from the task planning library of the knowledge base, and retrieve the task planning execution list with the highest similarity to the question as the context; if it is not retrieved, it is considered to be the first task, and the task planning reasoning is performed based on the available tools list of the Agent plug-in.

[0045] ⑥ Combine the message in the memory and the retrieved context or tools list, and send them to the Planner for reasoning to generate the first task plan Plan 1;

[0046] ⑦Task plan 1 needs to be confirmed by the user to continue the conversation;

[0047] ⑧ The user provides human feedback in the dialog box based on the quality of Plan 1, adjusts the parts that need to be modified, and then provides feedback to the planner again;

[0048] ⑨Planner also uses the short-term memory function combined with the context, and finally wins the adjusted task plan Plan 2;

[0049] ⑩Task plan Plan 2 needs to be confirmed by the user to continue the conversation;

[0050] The user provides human feedback in the dialog box based on the quality of Plan2. If satisfied with the plan, the user gives feedback to the planner.

[0051] The manually aligned task list can be solidified in the task planning library. When the next similar task needs to be planned, the most relevant task list can be obtained through similarity retrieval.

[0052] The Planner sends the finalized task list to the Executer for further execution.

[0053] See also Figure 1 , the task planner inputs prompt words, the prompt word template is as follows:

[0054] The prompt word template adopts a structured approach, including roles, background, skills, goals, restrictions, output format, workflow, etc.

[0055] The details are as follows:

[0056] System_template=""

[0057] -Role: You are an experienced task planning expert who can break down the input questions into tasks. You answer questions based on the retrieved content first. You only need to plan for specific needs and do nothing else. -Background: The user needs to solve problems related to XX, including XX, XX, etc.

[0058] -Skills: Thoughtful and wise decision-making ability. Ability to understand multiple sides of complex situations and come up with logical solutions.

[0059] -Goal: Design a system that can understand user needs and generate corresponding code or documentation.

[0060] -Limitations: The generated task list needs to be correct, executable, and consistent with common human thinking.

[0061] -Output format: Output text in string format. Please use Chinese for the answer.

[0062] -Workflow:

[0063] 1) Clearly describe the problem or functional requirement that the user wants to solve.

[0064] 2) In order to better complete the task, the system can add a round of dialogue to ask for specific task details and what additional information is needed to complete the task.

[0065] 3) The system first searches the task planning library based on the user's original question and supplementary information.

[0066] 4) Based on the retrieved {context} fragment, answer the question concisely and professionally; if no relevant fragment is retrieved, please say {'No relevant content was retrieved'} and make further inferences to generate a plan. When making a plan, give priority to using the following tools {toollist}.

[0067] 5) The system will ask the user for the inferred task list and can only continue execution after confirmation.

[0068] Let’s get started!

[0069] Question: {query}

[0070] ""

[0071] The task planning library in this embodiment is:

[0072] The task planning library is a collection, summary and conclusion of specific tasks in a specific field, which can be stored in the database in text or vector form. It includes the task ID, person name, task description, number of citations and the corresponding task plan execution list. Users can easily carry out the prescribed actions of daily operations and ensure the rationality, effectiveness and consistency of their task planning. The information stored in the task planning list mainly includes the following:

[0073] Task ID: A unique number for the task.

[0074] Task requirements: The task name generated based on the question summary entered by the user.

[0075] Task Description: A detailed description of the task.

[0076] Citation count: The number of times this task list has been cited. It is used to count the frequency of task usage, thus providing data for establishing a daily problem list or task baseline analysis.

[0077] Task planning list: a specific task list generated based on the task, including subtasks and tools used.

[0078] The present invention also provides an embodiment of an optimization system for a large model task planner based on prompt words, which is used to implement the optimization method for the large model task planner based on prompt words described in the above embodiment, and includes:

[0079] The intention confirmation module conducts multiple rounds of dialogue based on the user's input questions to obtain clearer and more accurate user instructions;

[0080] The knowledge retrieval module is used for the large model task planner to respond to the user's task requirements and preferentially retrieve the information fragments with the highest similarity to the problem from the task planning library of the knowledge base;

[0081] The task generation module sends various information including context dialogue information, callable tool list information, retrieved information fragments, etc. to the large model task planner for reasoning to generate the first task planning list;

[0082] The feedback execution module is used to generate a new task planning list based on the user's feedback on the initial task planning list, and then feed back the new task planning list to the user, and continue to generate the corresponding task planning list based on the user's feedback, and so on, until a task planning list that meets the user's needs is generated, and the task planning list that meets the user's needs is sent to the task executor for execution.

[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for optimizing a large model task planner based on prompt words, characterized in that: include: Step 1: The large model task planner responds to the user's task requirements by first identifying and judging the user's intentions and obtaining more potential instruction information from the user through multiple rounds of dialogue. Step 2: When the large model task planner is inferring, it will first search from the task planning library and query the task planning execution list with the highest similarity to the current task as an important reference for formulating the task plan list; Step 3: When the large model task planner is inferring, the prompt words directly input include the context user dialogue {message} in the short-term memory function, the retrieved task list information {context}, and the list of tools that the agent can call {toollist}, generating the first task plan from a multi-dimensional perspective; Step 4: The large model task planner automatically optimizes and adjusts the inferred task plan based on user feedback until a task plan that meets user needs is generated. After obtaining user confirmation and permission, the task plan list that is consistent with user needs is sent to the task executor for execution.

2. The optimization method of the large model task planner based on prompt words according to claim 1 is characterized in that: The step 1 comprises: Step 11: The user logs in from the web interface and enters the task requirements in the new dialog box; Step 12: The large model task planner first performs intent recognition and determines whether the user needs to provide additional relevant information to complete the task.

3. The optimization method of the large model task planner based on prompt words according to claim 2 is characterized in that: The step 2 comprises: Step 21: If additional relevant information is needed, return the answer and add another round of dialogue to inquire; Step 22: The user completes the relevant information in the dialog box as required; Step 23: After the large model task planner obtains sufficient user instructions, it preferentially retrieves the task planning execution list with the highest similarity to the problem from the task planning library in the knowledge base.

4. The optimization method of the large model task planner based on prompt words according to claim 1 is characterized in that: The step 3 comprises: The large model task planner performs task planning reasoning based on the contextual conversation content {message}, the retrieved fragments {context} and the list of available tools {toollist} declared in the Agent to generate the first task planning list.

5. The optimization method of the large model task planner based on prompt words according to claim 1 is characterized in that: The step 4 comprises: Step 41: The first task planning list Plan 1 needs to be confirmed by the user and a round of dialogue is continued; Step 42: The user provides feedback in the dialog box based on the quality of the first task planning list. If the user is satisfied with the task planning list, a satisfactory and next step execution instruction is sent to the task planner; if the user is not satisfied with the task planning list, the user enters the modification opinions into the task planner in the dialog box; Step 43: The task planner automatically adjusts the task planning list based on the feedback, and the adjusted task list needs to be confirmed by the user again, and another round of dialogue continues; Step 44: Repeat steps 42 and 43 until the user is satisfied, and then send the aligned task list {Plan-N} to the task executor; Step 45: The manually aligned task planning list and questions are solidified in the task planning library in the form of key-value pairs. Next time a similar task is encountered, a task planning list that satisfies the user can be quickly generated.

6. The optimization method of the large model task planner based on prompt words according to claim 1 is characterized in that: The prompt words are used to stimulate the large model's ability to plan tasks. The prompt words are in the form of reusable prompt word templates. The prompt word templates are structured in a way based on the thinking chain technique. The prompt word templates include roles, backgrounds, skills, goals, restrictions, output formats, and workflows: The workflow includes: 1) the user clearly describes the problem or functional requirement that he wants to solve; 2) the system asks for specific details and what information is needed to complete the task; 3) the system first searches the database based on the user's original question and the supplementary information; 4) the task planning list is generated based on the retrieved {context} fragment; when formulating the task planning list, the tool {toollist} is used first; 5) the system asks the user for the inferred task list, and can only continue execution after confirmation.

7. The optimization method of the large model task planner based on prompt words according to claim 1 is characterized in that: The task planning library collects, summarizes and concludes tasks in a specified field, and stores relevant information in a relational database or vector database in the form of text or vector; the relevant data includes task ID, task requirements, task description, task planning list, and number of citations; Task ID: a unique number for the task; Task requirement: a concise task requirement name generated based on the problem summary entered by the user; Task description: a detailed description of the task; Number of citations: the number of times the task list has been cited, used to count the frequency of task use; Task planning list: a detailed task list generated based on the task, including subtask steps and the tools used.

8. An optimization system for a large model task planner based on prompt words, used to implement the optimization method for a large model task planner based on prompt words according to any one of claims 1 to 7, characterized in that: include: The intention confirmation module conducts multiple rounds of dialogue based on the user's input questions to obtain clearer and more accurate user instructions; The knowledge retrieval module is used for the large model task planner to respond to the user's task requirements and preferentially retrieve the information fragments with the highest similarity to the problem from the task planning library of the knowledge base; The task generation module sends various information including context dialogue information, callable tool list information, retrieved information fragments, etc. to the large model task planner for reasoning to generate the first task planning list; The feedback execution module is used to generate a new task planning list based on the user's feedback on the initial task planning list, and then feed back the new task planning list to the user, and continue to generate the corresponding task planning list based on the user's feedback, and so on, until a task planning list that meets the user's needs is generated, and the task planning list that meets the user's needs is sent to the task executor for execution.

Citation Information

Patent Citations

  • Autonomous intelligent calculation method and system for biomedical data mining and medium

    CN117457226A

  • System for developing and designing AI service

    CN117875442A

  • Task execution method and device, equipment, medium and program product

    CN118193754A

  • Method and system for realizing industrial digital intelligence based on artificial intelligence

    CN118228694A

Cited By

  • Server, display device and task processing method

    CN119450124A

  • Cue word layered optimization method for complex problem decomposition

    CN120234399A

  • Autonomous task planning method and system of large model based on cloud side-end cooperation, terminal and storage medium

    CN121326586A

  • Demand information identification method and device based on voice information and large model

    CN121963739A

  • Electronic device and method of generating responses based on multi-agent

    TWI933708B