Task processing method and device based on causal agent cooperation, equipment and medium
By introducing causal agents into the multi-agent collaboration system to assist general agents to update task solutions, the problem of insufficient stability of large-model inference in the existing technology is solved, and the ability and stability of complex task processing is significantly improved.
Patent Information
- Application Number
- CN202510166709.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-06
AI Technical Summary
In the prior art, when multiple agents collaborate on complex tasks, the lack of large-model inference stability makes it difficult to effectively improve the ability to handle complex tasks.
Build a dual agent architecture that includes general agents and causal agents, determines the task to be processed through general agents, and performs intervention analysis, causal reasoning and process logic verification through causal agents, assist in updating the chain solution to improve matching and rationality.
The ability and stability of multi-agents to handle complex tasks is improved, ensuring that the task solution is highly matched with the task, the path is reasonable, and the results are globally optimal.
Smart Images

Figure CN120106216A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of artificial intelligence technology, and in particular, to a task processing method, device, equipment and medium based on causal agent collaboration. Background Art
[0002] In the existing technology, the processing of complex tasks can be achieved through multi-agent collaboration. Common collaboration modes include: teamwork mode, which emphasizes skill complementarity, information sharing and shared responsibility, and is suitable for tasks with clear final goals but complex processes and involving knowledge in different fields; hierarchical collaboration mode, which relies on the superior's decomposition, refinement and assignment of tasks to complete tasks such as agent recruitment, goal achievement and result evaluation. However, the above-mentioned collaboration mode is limited by the lack of stability of large model reasoning and cannot effectively improve the ability of large models to handle complex tasks. Summary of the invention
[0003] The present invention provides a task processing method, device, equipment and medium based on causal agent collaboration, which can improve the ability and stability of multiple agents in processing complex tasks.
[0004] In a first aspect, an embodiment of the present invention provides a task processing method based on causal agent collaboration, comprising:
[0005] Constructing a dual-agent architecture including a general agent and a causal agent, and determining a chain solution consisting of multiple ordered subtasks corresponding to the task to be processed through the general agent;
[0006] Performing intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed, and if not, updating the chain solution through the general agent until it matches;
[0007] Generate a thought chain of each subtask in the chain solution through the general intelligent agent, verify the process logic rationality of each thought chain through the causal intelligent agent, and update the thought chain that fails the verification through the general intelligent agent until it passes the verification;
[0008] The causal agent determines a successor task sequence of the current subtask in the chain solution, and the general agent performs counterfactual reasoning of the result effect based on the successor task sequence. The result of the counterfactual reasoning is used to update the chain solution.
[0009] In a second aspect, an embodiment of the present invention provides a task processing device based on causal agent collaboration, comprising:
[0010] A first processing module is used to construct a dual-agent architecture including a general agent and a causal agent, and determine a chain solution consisting of multiple ordered subtasks corresponding to a task to be processed through the general agent;
[0011] A second processing module is used to perform intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed, and if not, update the chain solution through the general agent until it matches;
[0012] The third processing module is used to generate a thinking chain of each subtask in the chain solution through the general intelligent agent, verify the process logic rationality of each thinking chain through the causal intelligent agent, and update the thinking chain that fails the verification through the general intelligent agent until it passes the verification;
[0013] The fourth processing module is used to determine the successor task sequence of the current subtask in the chain solution through the causal agent, and to perform counterfactual reasoning of the result effect according to the successor task sequence through the general agent, and the result of the counterfactual reasoning is used to update the chain solution.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to the first aspect.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0019] The technical solution of the embodiment of the present invention constructs a dual-agent architecture including a general agent and a causal agent, determines the chain solution corresponding to the task to be processed through the general agent; performs intervention analysis and chain causal reasoning through the causal agent, effectively assists the general agent in updating the chain solution, so that the updated chain solution and the task to be processed are reasonably matched, and the reliability of complex task processing is improved; the causal agent performs process logic rationality verification of the thinking chain of each subtask, effectively assists the general agent in updating the thinking chain that fails the verification, so that the specific execution process of each subtask is reasonable, and the interpretability of the complex task processing process is improved; the causal agent determines the subsequent task sequence of the current subtask, and the general agent performs counterfactual reasoning of the result effect of the subsequent task sequence, so as to achieve overall optimization of the complex task solution. Through the collaboration of the causal agent with the general agent, the solution ensures the high matching of the complex task solution and the task, the rationality of the task path and the global optimality of the task result, thereby improving the ability and stability of multi-agent processing of complex tasks.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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 of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flowchart of a task processing method based on causal agent collaboration provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flowchart of a task processing method based on causal agent collaboration provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a schematic diagram of a task-scenario rationality analysis provided according to the second embodiment of the present invention;
[0025] Figure 4 is a flowchart of a task processing method based on causal agent collaboration provided according to Embodiment 3 of the present invention;
[0026] Figure 5 is a schematic diagram of a process logic rationality analysis provided according to Embodiment 3 of the present invention;
[0027] Figure 6 is a schematic diagram of a counterfactual reasoning analysis provided according to Embodiment 3 of the present invention;
[0028] Figure 7 is a structural diagram of a task processing device based on causal agent collaboration provided according to a fourth embodiment of the present invention;
[0029] Figure 8 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] Figure 1 This is a flowchart of a task processing method based on causal agent collaboration provided according to the first embodiment of the present invention. This embodiment is applicable to the case of task processing based on causal agent collaboration. The method can be executed by a task processing device based on causal agent collaboration, which can be implemented in the form of software and / or hardware and integrated in an electronic device. Furthermore, the electronic device includes but is not limited to: computers, laptops, smart phones, servers, etc.
[0034] like Figure 1 As shown, the method includes:
[0035] S110, constructing a dual-agent architecture including a general agent and a causal agent, and determining a chain solution consisting of multiple ordered subtasks corresponding to the task to be processed through the general agent; executing S120; or executing S130; or executing S140.
[0036] The general intelligent agent can be implemented based on the general big model. The general big model can use open source big models, domain big models, etc. It is responsible for parsing the pending tasks and the subtasks corresponding to the pending tasks, generating chain solutions corresponding to the pending tasks, and comprehensively optimizing the chain solutions.
[0037] The causal agent can be implemented based on a causal big model that has completed the training task. The causal big model can be a big model with causal inference capabilities, which is responsible for analyzing the causal effects, process logic rationality, etc. of the chain solution, and providing optimization suggestions.
[0038] In this step, based on the general large model and the causal large model of the completed training task, the natural language can be used as a general interface to build a dual-agent architecture to solve complex artificial intelligence tasks, that is, to solve the tasks to be processed. Among them, the specific construction method of the dual-agent architecture adopts the construction method of the commonly used multi-agent system, which is not repeated here; the interaction of the agents in the dual-agent architecture is detailed in the following steps S120 to S140 in this embodiment.
[0039] In one embodiment, the learning process of the causal agent includes:
[0040] Constructing a causal corpus, wherein the causal corpus at least includes a causal effect dataset, a causal inference dataset, a behavioral causal dataset, a temporal causal dataset, and a common sense knowledge base;
[0041] The causal agent is obtained by pre-training and instruction learning based on the causal corpus, and the forms of samples involved in the instruction learning at least include causal identification tasks, chain causal reasoning tasks and causal reasoning tasks under hypothetical conditions.
[0042] The present invention aims to construct a comprehensive and multi-dimensional causal corpus, which is the basis for causal agent learning. By integrating various types of causal data sets, including causal effect data sets, causal inference data sets, behavioral causal data sets, temporal causal data sets, and common sense knowledge bases, a broad and in-depth causal knowledge environment can be provided for causal agents. These data sets not only cover causal phenomena in different fields, but also consider the impact of multiple factors such as time and behavior on causal relationships, thereby ensuring that causal agents can learn complex and accurate causal reasoning capabilities.
[0043] Causal effect data set: collect verified causal effect cases from scientific research papers, experimental reports, public databases and other channels; perform deduplication, formatting, error correction and other processing on the collected data to ensure the accuracy and consistency of the data; label and classify the data according to the type of causal relationship (such as direct causality, indirect causality, mediating effect, etc.), and integrate them into a causal effect data set.
[0044] Causal inference dataset: select instances with clear causal relationships from actual cases and historical events; for each instance, extract the key factors that affect the causal relationship as features; based on feature analysis, formulate causal inference rules or algorithm models to obtain a causal inference dataset.
[0045] Behavioral causal data set: collect individual or group behavioral data through behavioral logs, sensor data, etc.; use statistical analysis, machine learning and other methods to analyze the causal relationship between behavioral patterns and results; integrate the analysis results into a behavioral causal data set, and mark the mapping relationship between behavior and results.
[0046] Time series causal data set: For key areas such as medical care and meteorology, high-quality time series data is collected, and time series analysis methods such as Granger causality test are used to accurately identify and construct causal chains, and then organized into time series causal data sets in combination with relevant timestamps.
[0047] Common sense knowledge base: widely integrates common sense causal knowledge from encyclopedias, knowledge graphs and professional literature, uses natural language processing and knowledge graph technology to extract and structuredly store causal items such as physical laws and social norms, and builds a common sense knowledge base that is easy to query and reason.
[0048] On the basis of the completion of the construction of the causal corpus, pre-training and instruction learning are performed based on the causal corpus to obtain a causal agent, so that the causal agent can master complex causal reasoning capabilities such as causal knowledge application, chain causal reasoning, and counterfactual reasoning. Specifically, the pre-training process can adopt the commonly used large model pre-training method to perform pre-training of the causal large model on the causal corpus, which will not be repeated here; the instruction learning process can adopt the commonly used large model instruction learning method to perform instruction learning of the causal large model on the causal corpus, which will not be repeated here.
[0049] In the above instruction learning process, a series of targeted tasks can be designed to guide the causal agent to understand the basic concept of causality, learn how to build a causal chain, and explore the prediction of results under scenarios where conditions change. The forms of samples involved in instruction learning include but are not limited to the following:
[0050] Causal identification task: Given a series of events or situations, the causal agent is required to identify the causal relationship. The sample format can be {Eventi->Eventj}, where Eventi is the cause event and Eventj is the effect event.
[0051] Chain causal reasoning task: construct a series of events with temporal dependencies, requiring the causal agent to analyze the causal relationship between these events and infer the logical order of the entire event chain. This task aims to enhance the causal agent's ability to parse and reconstruct complex causal chains. The sample format can be {Event1->Event2->...->EventN}, where Eventi (i is one of 1 to N) is a node in the causal chain.
[0052] Causal reasoning task under hypothetical conditions: Given an initial state and a series of hypothetical changes, the causal agent is required to predict how these changes affect the final result. This task aims to improve the counterfactual reasoning and hypothesis analysis capabilities of the causal agent. The sample format can be State0->{Condition1,Condition2,...,ConditionM}->StateF, where State0 is the initial state, Conditioni (i is one of 1 to M) is the hypothetical condition, and StateF is the final state.
[0053] The content required for slot construction in the form of samples involved in the above instruction learning can be determined by methods such as being written by domain experts, automatically generated by algorithms, and extracting corresponding entities, events or conditions from the knowledge base for template filling.
[0054] In this step, the general agent can use the prompt method to determine the subtasks included in the task to be processed, the execution order of each subtask and the parallelization strategy based on the analysis of the task to be processed, and plan a chain solution (also known as solution) consisting of a series of ordered subtasks. Among them, the task to be processed can be a task to be processed by the dual-agent architecture, or a task determined based on user needs; the chain solution can be a method of decomposing the task to be processed into a series of related subtasks and processing them in a chain order.
[0055] In one embodiment, determining a chain solution consisting of a plurality of ordered subtasks corresponding to a task to be processed by the general agent includes:
[0056] Through the general intelligent agent, the task to be processed is decomposed and task dependency analyzed using the task parsing prompt template to obtain a chain solution consisting of multiple ordered subtasks; wherein each subtask is in the form of input information to output results, and the output result of each subtask should be able to serve as a valid input for the next subtask.
[0057] To ensure that the general agent can understand and plan tasks in detail from the perspective of user needs through intelligent analysis and decision-making, and then build an efficient and reasonable chain solution, the task parsing prompt template can be used as a guide for the general agent. Specifically, the task to be processed can be filled into the requirements (i.e. user needs) slot in the task parsing prompt template as input, and the general agent can be called to think about the task to be processed to obtain a chain solution.
[0058] Among them, the task parsing prompt template can be a prompt template for parsing the pending task into a corresponding chain solution. The prompt template can specify what structure the corresponding prompt should have and what specific content the structure should contain. The specific format of the task parsing prompt template can be as follows:
[0059] “Please deeply understand the specific requirements of the tasks to be processed according to the given tasks to be processed. If the user has directly provided a chain solution for the tasks to be processed, please directly analyze the rationality of this solution; if not, use logical reasoning ability to think deeply about the tasks to be processed, and perform necessary task decomposition to obtain a chain solution. In this process, identify and analyze the dependencies between the subtasks, clarify their execution order and whether they can be processed in parallel, so as to optimize the overall workflow.
[0060] Subsequently, plan and output the chain solution corresponding to the tasks to be processed in the form of a list. The solution consists of a series of ordered subtasks, formalized as {Task1, Task2, ..., TaskN}. Each subtask Taski (i is one of 1 to N) should be output in the form of {Qi->Ai}, where Qi is the input information required for the subtask, and Ai is the output result that should be produced after Qi is processed. It is important to ensure that the dependency between Qi+1 and Ai is taken into account during planning, that is, the output of Ai should be able to serve as a valid input for Qi+1, so as to ensure the smooth execution of the entire task chain. Based on the above analysis and planning, present your chain solution [solution] in the form of a list, and ensure that it accurately reflects the overall process of the tasks to be processed and the logical connection between the subtasks.
[0061] The task to be processed given by the user is: {requirements}. Now, please accurately identify the task objects and task goals in the task to be processed, analyze and optimize the solution through chain causal reasoning analysis of the solution, logical rationality analysis of the subtask process, and counterfactual result effect analysis, and output the optimized chain solution [solution] and the expected execution results. "
[0062] S120. Perform intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed. If not, update the chain solution through the general agent until it matches.
[0063] In this step, intervention analysis and chain causal reasoning analysis methods can be used to evaluate whether the chain solution proposed by the agent is reasonably matched with the task scenario (i.e., the task to be processed), that is, to evaluate the rationality of the task-scenario, so as to improve the reliability of the agent in handling complex tasks.
[0064] Specifically, through the causal agent, the intervention type analysis can be performed by using the prompt method and following the principles of causality, controllability, representativeness, etc., to analyze and extract the actions that may have a key role in each subtask included in the chain solution, determine the possible intervention type of each subtask based on these actions, and output the possible intervention type of each subtask in the form of an intervention type list. Among them, the intervention type list can be a list of possible intervention types for each subtask in the chain solution.
[0065] Through the causal agent, the first expected result of the intervention type corresponding to the application of each subtask and the second expected result of the intervention type not applied can be determined based on the intervention type list and the chain solution by using the prompt method, and the first expected result and the second expected result corresponding to each subtask can be output in the form of an expected result list; through the causal agent, the intervention effect analysis can be performed based on the expected result list and the chain solution by using the prompt method, and the difference between the first expected result and the second expected result corresponding to each subtask can be determined, and the intervention causal effect corresponding to each subtask can be obtained based on the determined difference summary, and the intervention causal effect corresponding to each subtask can be output in the form of an intervention effect list. Among them, the expected result list can be a list of the first expected result and the second expected result corresponding to each subtask in the chain solution; the intervention effect list can be a list of the intervention causal effects corresponding to each subtask in the chain solution; the intervention causal effect can be a causal effect obtained by summarizing the difference between the first expected result and the second expected result corresponding to each subtask.
[0066] Through the causal agent, we can use the prompt method to perform chain causal reasoning analysis based on the intervention effect list, chain solution, task objects and task goals corresponding to the pending tasks to determine whether the chain solution can complete the pending tasks. Specifically, it includes: understanding the chain solution, evaluating whether each subtask can complete the corresponding expected goal, analyzing the failure reasons of potential failure nodes in the chain solution and giving corresponding improvement suggestions.
[0067] If there are potential failure nodes in the chain solution, the chain solution can be updated by the general agent based on the corresponding improvement suggestions, and then the intervention type analysis, intervention effect analysis and chain causal reasoning analysis can be repeatedly performed by the causal agent until the updated chain solution can solve the pending task, that is, achieve a reasonable match between task and scenario.
[0068] S130, generating a thinking chain of each subtask in the chain solution through the general intelligent agent, verifying the process logic rationality of each thinking chain through the causal intelligent agent, and updating the thinking chain that fails the verification through the general intelligent agent until it passes the verification.
[0069] In this step, through the general intelligent agent, the prompt method can be used to generate a thinking chain for the process from Qi->Ai for each subtask in the chain solution. The thinking chain can be understood as the logical reasoning process or thinking path of gradually disassembling and analyzing Qi and finally deriving Ai; through the causal intelligent agent, the prompt method can be used to verify the process logic rationality of the thinking chain corresponding to each subtask. Specifically, it is analyzed whether each action in the thinking chain can complete the corresponding input to output task, whether the overall chain logic is coherent, and whether there are factual errors, so as to evaluate the process logic rationality of the thinking chain.
[0070] If there is a thinking chain that fails the verification, the causal agent will output the corresponding improvement suggestions; the general agent will optimize the thinking chain corresponding to the corresponding subtask based on the improvement suggestions; and the causal agent will repeat the process logic rationality check until the updated thinking chains have process logic rationality.
[0071] S140. Determine the successor task sequence of the current subtask in the chain solution through the causal agent, perform counterfactual reasoning of the result effect based on the successor task sequence through the general agent, and use the result of the counterfactual reasoning to update the chain solution.
[0072] The current subtask may be any subtask in the chain solution, and the subsequent task sequence may be a sequence of subsequent tasks directly or indirectly affected by the current subtask, and the subsequent task may be a task that may be executed after the current subtask.
[0073] In this step, the causal agent can use the prompt method to determine the successor task sequence of the current subtask in the chain solution based on the inference steps set by the user and the given chain solution, specifically including: understanding the detailed information of each subtask in the chain solution, determining the inference steps, analyzing the execution dependency, and outputting the successor task sequence.
[0074] Through the general agent, the prompt method can be used to perform counterfactual reasoning of the result effect based on the successor task sequence, specifically including: traversing the successor task sequence to perform task result reasoning one by one, chain analysis and reasoning to obtain the output result of the current subtask and how the output result affects the factual result of the successor task, outputting the result effect sequence corresponding to the successor task sequence of the current subtask, and outputting the execution result and potential impact of the last successor task in the successor task sequence. Among them, the result effect sequence can be a sequence formed by the result effect of each successor task in the successor task sequence.
[0075] Based on the result effect sequence output by the above process, the execution result and potential impact of the last successor task, technicians can make improvements such as regeneration or optimization of the chain solution according to the needs of the actual task, which is not limited here.
[0076] The technical solution of the embodiment of the present invention constructs a dual-agent architecture including a general agent and a causal agent, determines the chain solution corresponding to the task to be processed through the general agent; performs intervention analysis and chain causal reasoning through the causal agent, effectively assists the general agent in updating the chain solution, so that the updated chain solution and the task to be processed are reasonably matched, and the reliability of complex task processing is improved; the causal agent performs process logic rationality verification of the thinking chain of each subtask, effectively assists the general agent in updating the thinking chain that fails the verification, so that the specific execution process of each subtask is reasonable, and the interpretability of the complex task processing process is improved; the causal agent determines the subsequent task sequence of the current subtask, and the general agent performs counterfactual reasoning of the result effect of the subsequent task sequence, so as to achieve overall optimization of the complex task solution. Through the collaboration of the causal agent with the general agent, the solution ensures the high matching of the complex task solution and the task, the rationality of the task path and the global optimality of the task result, thereby improving the ability and stability of multi-agent processing of complex tasks.
[0077] Embodiment 2
[0078] Figure 2 It is a flowchart of a task processing method based on causal agent collaboration provided according to Example 2 of the present invention. This embodiment of the present invention is based on the above-mentioned Example 1, and performs intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed. If not, the chain solution is updated through the general agent until the match is further refined.
[0079] like Figure 2 As shown, the method includes:
[0080] S110, constructing a dual-agent architecture including a general agent and a causal agent, and determining a chain solution consisting of multiple ordered subtasks corresponding to the task to be processed through the general agent; executing S121; or executing S130; or executing S140.
[0081] S121. Through the causal agent, using the intervention type analysis prompt template, an intervention type analysis is performed on the chain solution based at least on the principles of causality, controllability, and representativeness to obtain an intervention type list, wherein the intervention type list includes the intervention type of each subtask.
[0082] S122. By means of the causal agent, a prompt template for expected results is used to generate an expected result, and based on the intervention type list and the chain solution, an expected result list is determined, wherein the expected result list includes a first expected result of the intervention type corresponding to the application of each subtask and a second expected result of the intervention type not applied.
[0083] S123. Through the causal agent, an intervention effect analysis is performed based on the expected result list and the chain solution using an intervention effect analysis prompt template to obtain an intervention effect list, wherein the intervention effect list includes the intervention causal effect determined by comparing the first expected result and the second expected result corresponding to each subtask.
[0084] S124. Through the causal agent, a chain causal reasoning analysis prompt template is used to perform a chain causal reasoning analysis based on the intervention effect list, the chain solution, the task objects and task goals corresponding to the tasks to be processed, to determine whether the chain solution can complete the tasks to be processed, and to output potential failure nodes and corresponding improvement suggestions.
[0085] S125. The general agent updates the chain solution based on the improvement suggestion, and the causal agent performs intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the updated chain solution until the updated chain solution matches the task to be processed.
[0086] Figure 3 is a schematic diagram of a task-scenario rationality analysis provided according to the second embodiment of the present invention. Figure 3 Detailed description of S121-S125:
[0087] Figure 3 The analysis of the intervention type corresponds to S121, specifically:
[0088] The intervention type analysis prompt template is used as a guide for the causal agent, the chain solution is filled into the solution slot in the intervention type analysis prompt template as input, and the causal agent is called to perform intervention type analysis. Among them, the intervention type analysis prompt template can be a prompt template for performing intervention type analysis, and the specific format can be as follows:
[0089] “When reading the solution [solution] given by the user, you will be faced with multiple subtasks in the solution. Each subtask requires in-depth analysis and identification of actions that may play a key role, which will become possible intervention types. For the input Qi of the current subtask [Taski], after implementing a certain type of operation [OPTypei], the output result is Ai, and the final expansion form of [Taski'] is {Qi->OPTypei->Ai}. In order to complete the task efficiently and accurately, please follow the following three core principles to identify these actions:
[0090] 1. Causality check: Think about what type of action changes can directly lead to the achievement or deviation of the subtask goal. Look for actions that have a direct causal relationship with the subtask goal.
[0091] 2. Controllability assessment: Confirm whether you have the ability to intervene or control these actions. Eliminate those actions that are important but whose impact cannot be directly assessed under current technology or resource conditions.
[0092] 3. Representativeness considerations: Select actions that represent the core features or difficulties of the subtask. These actions should accurately reflect the key challenges of the subtask and the entry point of the solution.
[0093] Output structure: Output the intervention type for each subtask in a list structure, denoted as [list_optype]. The subscript of each element in the list is the subtask number. For example, OPTypei represents the intervention type corresponding to the ith subtask. It is in the form of text description, and the specific content depends on the complexity of the subtask and the analysis results. The output format of list_optype is {…,OPTypei,…}.
[0094] The chain solution is: {solution}, based on the solution, please output the list of intervention types [list_optype]. ”
[0095] Figure 3 The analysis of the intervention effect corresponds to S122 and S123, specifically:
[0096] In order to conduct an in-depth expected result analysis of each subtask based on the intervention type of each subtask, ensure that the expected results of the generated subtasks are accurate and reliable, and provide a basis for the subsequent intervention effect analysis, the expected result generation prompt template is used as a guide for the causal agent, and the intervention type list and chain solution are filled into the corresponding slots in the expected result generation prompt template, and the causal agent is called to generate the expected results to obtain the expected result list. Among them, each subtask Taski contains the first expected result AiwOPTypei of the corresponding intervention type OPTypei and the second expected result AiwoOPTypei of the corresponding intervention type OPTypei not applied. The expected result generation prompt template can be a prompt template for generating expected results, and the specific format can be as follows:
[0097] “Please provide an in-depth analysis of the expected results for each subtask Taski based on the chain solution [solution] and the list of intervention types [list_optype].
[0098] Task requirements:
[0099] For a specific subtask Taski, assuming that the intervention type OPTypei is not applied, please use the causal inference method to imagine and describe in detail how the subtask will develop under the natural process, and finally infer the expected results of the subtask. Then, assuming that the intervention type OPTypei is applied, please describe the details of the possible impact of the intervention on Qi, especially how the intervention changes the impact point or impact path of the original factor, so as to deduce the expected results under this intervention.
[0100] Output structure: Output the expected result of each subtask in a list structure, denoted as [list_expectation]. Each element in the list represents a subtask and its expected result. list_expectation = {…, expectationi,…}, where i is the subtask number. expectation contains the following fields:
[0101] 1.subtask_id: subtask number;
[0102] 2.op_type: intervention type. The subtask only needs to handle one intervention type (OPTypei);
[0103] 3. expected_outcomes: expected results, including expected results when no intervention is applied and when intervention is applied:
[0104] 3.1.without_intervention: expected results when no intervention is applied E=AiwoOPTypei, including expected result description (description) and optional analysis notes (analysis_notes).
[0105] 3.2.with_intervention: expected results when applying the intervention E'=AiwOPTypei, including description (description), detailed analysis of the impact of the intervention (analysis_details, including a list of affected factors and a list of descriptions of the pathways or intensities of the changes) and optional analysis notes (analysis_notes).
[0106] Please ensure that your analysis is comprehensive and logical so that you can evaluate the effectiveness of different intervention types later. The chain solution is: {solution}, the list of intervention types for each subtask is: {list_optype}, and based on the above input, the output is a list of expected results [list_expectation]. ”
[0107] In order to accurately evaluate the causal effects of each intervention implementation and provide a basis for subsequent chain causal reasoning analysis, the intervention effect analysis prompt template is used as a guide for the causal agent, and the expected result list and chain solution are filled into the corresponding slots in the intervention effect analysis prompt template, and the causal agent is called to perform intervention effect analysis to obtain the intervention effect list. Among them, by comparing the expected results of applying the intervention and not applying the intervention, the difference in results caused by different intervention types is summarized, which is the causal effect of the intervention, which can be formally expressed as △Ei=|Ei-Ei'|, and then the causal effect of the intervention strategy for the subtask can be comprehensively analyzed, recorded as the intervention effect list list{CEi}. The intervention effect analysis prompt template can be a prompt template for intervention effect analysis, and the specific format can be as follows:
[0108] Please analyze the chain solution [solution] and the list of expected results [list_expectation] in depth. In this work, the causal effect (CE) of the intervention refers to the analysis and description of the problem of "the difference between the impact of intervention and no intervention on the results" in the subtask.
[0109] You need to analyze the average causal effect of the intervention type for each subtask. Please review each subtask one by one, compare the differences in the results when the corresponding intervention type is applied and when it is not applied, and summarize the differences, including the specific impact of each intervention on the subtask results and the impact mechanism.
[0110] Output structure: Output the intervention effect list of the average causal effect of each subtask in a list structure, denoted as list{CEi}, where CEi represents the description of the i-th subtask and the corresponding intervention causal effect, and contains the following fields:
[0111] 1.subtask_id: subtask number;
[0112] 2. CEi: represents the causal effect of the intervention type corresponding to the subtask.
[0113] Make sure your analysis is accurate and detailed, reflecting the causal logic of the intervention impact, and finally output list{CEi}. ”
[0114] Figure 3 The chain causal reasoning analysis corresponds to S124 and S125, specifically:
[0115] The general agent extracts the task objects and task goals from the pending tasks, interacts with the causal agent using the prompt method, guides the causal agent to perform chain causal reasoning analysis, evaluates whether each subtask in the chain solution can complete the expected goal of this step, and thus determines whether the chain solution can complete the pending tasks and outputs improvement suggestions. The specific implementation process is:
[0116] Task object and task goal extraction: Task objects and task goals are usually directly given by the pending tasks submitted by the user. The general agent needs to identify the task object [Origin] and task goal [Object] therein to provide a basis for the subsequent chain causal reasoning analysis. In practical applications, the task object and task goal can be extracted by using the prompt method. The prompts for the general agent have been given in the task parsing prompt template and will not be repeated here.
[0117] Chained causal reasoning analysis: In order to accurately complete the chained causal reasoning analysis for the solution, the chained causal reasoning analysis prompt template is used as a guide for the causal agent. The task object [Origin] and the task target [Object] are filled into the corresponding slots in the chained causal reasoning analysis prompt template, and the causal agent is called to perform chained causal reasoning analysis. The causal agent determines whether the chained solution can complete the pending task and outputs improvement suggestions, which are recorded as [Advice_chained_reasoning]. The chained causal reasoning analysis prompt template can be a prompt template for chained causal reasoning analysis, and the specific format can be as follows:
[0118] “Please review the chain solution [solution] provided above and the intervention effect list list {CEi} generated above, clarify the task object and task goal, perform chain causal reasoning analysis on the chain solution to identify potential failure nodes, and put forward corresponding improvement suggestions.
[0119] 1. Understand the chain solution: Carefully read and analyze the structure of the chain solution, clarify the input and output of the subtask represented by each node, and the causal relationship between them.
[0120] 2. Evaluate the risk of failure: Perform risk assessment on each subtask node in turn according to the temporal causal relationship. Based on the causal effect CE of the intervention for each subtask in the intervention effect list, consider historical data, external factors, internal dependencies and other factors, and evaluate whether each subtask in the chain solution can achieve the expected goal of this step.
[0121] 3. Analyze the specific reasons for potential failure nodes: Based on the above analysis, determine the nodes or node combinations that are most likely to cause the failure of the entire causal chain. Analyze the specific reasons for the failure of these potential failure nodes, whether it is data problems, technical limitations, human errors or other external factors.
[0122] 4. Summary Report: Write a detailed report outlining the process of the cause-effect chain analysis, the potential failure nodes identified, the failure cause analysis, and specific improvement suggestions for each potential failure node. Make sure the suggestions are actionable and measurable, and can clearly guide implementation and evaluate the effects. The report should be clear and organized so that decision makers can understand and adopt it.
[0123] Given that the task object is {Origin} and the task target is {Object}, based on chained causal reasoning analysis, output the analysis result of whether the chained solution can complete the task to be processed. If there is a potential failure node, please also output the potential failure node and the corresponding improvement suggestion Advice_chained_reasoning. "
[0124] If there are potential failure nodes, refer to Advice_chained_reasoning, and the general agent will analyze and generate a new chain solution. The causal agent will then repeat the intervention type analysis, intervention effect analysis, and chain causal reasoning analysis until the updated chain solution can solve the pending task, that is, achieve a reasonable match between task and scenario.
[0125] S130, generating a thinking chain of each subtask in the chain solution through the general intelligent agent, verifying the process logic rationality of each thinking chain through the causal intelligent agent, and updating the thinking chain that fails the verification through the general intelligent agent until it passes the verification.
[0126] S140. Determine the successor task sequence of the current subtask in the chain solution through the causal agent, perform counterfactual reasoning of the result effect based on the successor task sequence through the general agent, and use the result of the counterfactual reasoning to update the chain solution.
[0127] The technical solution of the embodiment of the present invention performs intervention type analysis, intervention effect analysis and chain causal reasoning analysis of the chain solution based on prompts by a causal agent to determine whether the chain solution matches the task to be processed; in case of mismatch, the chain solution is updated by a general agent, and then the updated chain solution is repeatedly analyzed by the causal agent until a reasonable match between the task and the scenario is achieved; the reliability of the agent in handling complex tasks can be improved.
[0128] Embodiment 3
[0129] Figure 4 It is a flowchart of a task processing method based on causal agent collaboration provided according to Example 3 of the present invention. This embodiment is based on the above-mentioned Example 1, and further refines the thinking chain of each subtask in the chain solution generated by the general agent, and verifies the process logical rationality of each thinking chain by the causal agent; and further refines the determination of the successor task sequence of the current subtask in the chain solution by the causal agent, and the counterfactual reasoning of the result effect by the general agent according to the successor task sequence.
[0130] like Figure 4 As shown, the method includes:
[0131] S110, constructing a dual-agent architecture including a general agent and a causal agent, and determining a chain solution consisting of multiple ordered subtasks corresponding to the task to be processed through the general agent; executing S120; or executing S131; or executing S141.
[0132] S120. Perform intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed. If not, update the chain solution through the general agent until it matches.
[0133] S131. Generate a thinking chain for each subtask in the chain solution by using the general intelligent agent and a thinking chain generation prompt template.
[0134] S132. Through the causal intelligent agent, a rationality check prompt template is used to perform process logic rationality check on each thinking chain based on causal check, chain logic check and fact verification principles to obtain a check result. The check result includes the overall rationality check result of the checked thinking chain, the step rationality check result of each step in the checked thinking chain, and the reasonable reasons or improvement suggestions corresponding to the step rationality check result.
[0135] S133. The thought chains that have not passed the verification are updated through the general intelligent agent until they pass the verification.
[0136] Figure 5 is a schematic diagram of a process logic rationality analysis provided according to the third embodiment of the present invention. Figure 5 Detailed description of S131-S133:
[0137] Figure 5 The CoT generation in S131 corresponds to:
[0138] This step uses the prompt method to generate a thought chain CoTi for each subtask Taski in the chain solution from Qi to Ai through a general agent, and outputs the thought chain sequence List{CoTi} in a list form. The CoTi corresponding to Taski should contain several steps. A specific step is a reasoning description that includes input, action, and output, in the form of Input->Action->Output. The thought chain generation prompt template will use the common CoT generation task prompt template, which will not be repeated here.
[0139] Figure 5 The CoT chain rationality check corresponds to S132, specifically:
[0140] The rationality check prompt template is used as a guide for the causal agent, the thought chain sequence List{CoTi} is filled into the corresponding slot in the rationality check prompt template, and the causal agent is called to perform chain rationality check. Among them, the rationality check prompt template can be a prompt template for rationality check of the thought chain, and the specific format can be as follows:
[0141] "Please verify the rationality of the chains of thought of multiple subtasks. When reading the chain of thought (CoT) of a subtask, you will be faced with a multi-step reasoning description in the CoT. Each step of the reasoning description contains the input, action, and output of this step, in the form of Input->Action->Output. You need to evaluate the rationality of the CoT by analyzing whether the Action of each step in the CoT can complete the Input->Output task, whether the overall chain logic is coherent, and whether there are factual errors. In order to complete the task efficiently and accurately, please follow the following three principles to evaluate the given CoT:
[0142] 1. Causality test: Check whether there is a clear causal relationship between the input and output of each step in CoT, whether the Action can complete the Input->Output task, and whether it is logical.
[0143] 2. Chain logic test: Evaluate whether the overall logic of CoT is coherent and whether there are logical jumps or contradictions between the steps.
[0144] 3. Fact verification: Retrieve external resources to verify whether the factual information in the CoT is accurate.
[0145] Output structure: Output the inspection results or improvement suggestions of the CoT of each subtask in a list structure, denoted as [Advice_cot]. Each element in the list is a dictionary, which is used to represent a subtask and its CoT inspection results or improvement suggestions. Each dictionary contains the following fields:
[0146] 1.subtask_id: indicates the serial number of the subtask;
[0147] 2.overallStatus: indicates the overall rationality check result of the CoT of the subtask. Its value can be "reasonable" or "unreasonable", which is used to judge the rationality of the CoT;
[0148] 3.details: This is a collection that represents the detailed inspection results of each step in the thinking chain, containing three fields:
[0149] 3.1.stepIndex: represents the step index in the thinking chain, usually a consecutive integer starting from 1, used to identify the position of each step in the thinking chain;
[0150] 3.2.status: This field indicates the result of the rationality check of the current step. Its value can be "reasonable" or "unreasonable", which is used to judge the rationality of the step;
[0151] 3.3.advice: Depending on the value of status, this field either provides a reasonable reason why the current step is reasonable, or provides improvement suggestions on how to improve if the step is unreasonable;
[0152] 4.overallReason (optional): This field provides additional explanation or summary of the rationality check results of the entire thinking chain. It is not required, but it can provide further explanation or point out the main problems when the overall judgment is unreasonable.
[0153] According to the above requirements, please analyze step by step without missing anything, and finally output the inspection results or improvement suggestions of each thinking chain in the thinking chain sequence List{CoT}. "
[0154] If all CoTs in the thinking chain sequence have process logic rationality, they are considered to have passed the test, otherwise CoT optimization is performed.
[0155] Figure 5 The CoT optimization in S133 is as follows:
[0156] The general agent optimizes the CoT corresponding to the corresponding subtask according to the improvement suggestions output above. This step uses the commonly used prompt template to further optimize the CoT according to the feedback improvement suggestions, which will not be repeated here.
[0157] S141. Through the causal agent, a successor task generation prompt template is used to determine a successor task sequence of the current subtask based on the chain solution and the set number of inference steps, wherein the successor task sequence includes successor tasks directly or indirectly affected by the current subtask.
[0158] S142. Through the general intelligent agent, counterfactual reasoning is performed on the result effect based on the successor task sequence using a counterfactual reasoning prompt template, and the output of each successor task in the successor task sequence is used as the input of the next successor task, and the result effect sequence corresponding to the successor task sequence, the execution result and potential impact of the last successor task in the successor task sequence are output.
[0159] Figure 6 is a schematic diagram of a counterfactual reasoning analysis provided according to Embodiment 3 of the present invention. The following contents are combined with Figure 6 Detailed description of S141-S142:
[0160] Figure 6 The subsequent task sequence inference corresponds to S141, specifically:
[0161] The successor task generation prompt template is used as a guide for the causal agent, and the chain solution and the set number of inference steps are filled into the corresponding slots in the successor task generation prompt template, and the causal agent is called to infer the successor task sequence. Among them, the set number of inference steps can be the number of steps of the successor task sequence inference set by the user, which is used to control the degree of evaluation of the causal agent on the impact of the task successor. Taking the case of step = 1 as an example, for a specific subtask Taski, based on the dependency relationship of "Taski output is also the input of the successor task Taski+1", the causal agent can infer which successor tasks will be affected by Taski's output after 1 step of reasoning, and thus output the successor task sequence, which is recorded as List{Taski->Task?}. The successor task generation prompt template can be a prompt template used to generate the successor task of the current subtask, and the specific format can be as follows:
[0162] “Please use the given chain solution to deeply analyze and infer the sequence of subsequent tasks of the current subtask based on the set number of inference steps.
[0163] The specific operations are as follows:
[0164] 1. Understand the task information: First, read and understand the detailed information of each subtask in the chain solution, including its input, expected output, and the possible timing dependencies between different subtasks.
[0165] 2. Confirm the number of inference steps: Assuming the number of inference steps is set to n, it means that we need to pay attention to the successor tasks {Taski+1, ..., Taskn} of Taski from i+1 to n, which means that we need to evaluate the indirect impact of Taski's output on the input of the successor task after several steps.
[0166] 3. Analyze execution dependencies: Based on the logic that the output of Taski will become the input of which subsequent tasks, use causal reasoning capabilities to build a workflow link from Taski to Task?
[0167] 4. Output the successor task sequence: Output all successor tasks (Task?) in the form of a list, where each entry represents a successor task that is directly or indirectly affected by the output of Taski.
[0168] Output structure: Output the successor task of each subtask in a list structure, recorded as List{Taski->Task?}. Set the number of inference steps to {step}, the chain solution to {solution}, execute the inference task, and output the successor task sequence List{Taski->Task?} = {Taski->Taski+1…->Taskj}, j = i+[setp]. "
[0169] Figure 6 The counterfactual reasoning of the subsequent task outcome effect corresponds to S142, specifically:
[0170] In order to accurately infer the expected results under the assumed conditions and provide a basis for subsequent analysis and tuning, the counterfactual reasoning prompt template is used to perform counterfactual reasoning on the result effect according to the above successor task sequence List{Taski->Task?}, and output the result effect of each successor task in the successor task sequence. For a specific subtask Taski, the general agent processes its output Ai through [step] steps as the input Qj of the successor task Taskj, j = i + [step], and infers the factual result Aj of the last step task Taskj. Reasoning from i to j is a chain reasoning based on prompts. The counterfactual reasoning prompt template can be a prompt template for counterfactual reasoning, and the format is as follows:
[0171] “The input is the successor task sequence List{Taski->Task?}, and the output (Ai) of the previous successor task (Taski) in the sequence is used as the input (Qi+1) of the next successor task (Taski+1).
[0172] The execution steps are:
[0173] 1. Traverse the sequence of subsequent tasks: Starting from the first task, examine each task and its subsequent task chain one by one, and reason about the task results one by one.
[0174] 2. Chain analysis and reasoning: For each task, based on the above information, analyze the output result Ai after Taski is executed, and how Ai affects the factual result Ai+1 of task Taski+1 in the subsequent task chain, considering all possible positive and negative effects.
[0175] 3. Output analysis results: Organize the result effect sequence of each Taski in the form of List{A?}, and ensure that all information is clear, accurate, and complete.
[0176] Please perform counterfactual reasoning of the execution results of the successor task according to the above requirements, and accurately output the result effect sequence List{A?} of the successor task, and output the last successor task execution result Ai+step and its potential impact (positive and negative effects) as potential outcome. "
[0177] The above output result potential outcome can be recorded as the "butterfly effect" after the current subtask is executed. Based on the specific result of the potential outcome, technicians can make improvements such as regenerating or optimizing the chain solution according to the needs of the actual task.
[0178] The technical solution of the embodiment of the present invention utilizes the prompt method to generate the thinking chain of each subtask in the chain solution through a general intelligent agent, and uses the causal intelligent agent to verify the process logic rationality of each thinking chain. The thinking chain that fails the verification is updated by the general intelligent agent until the verification passes, thereby ensuring the rationality of the task path and improving the interpretability of the complex task processing process; utilizing the prompt method, the causal intelligent agent determines the successor task sequence of the current subtask, and uses the general intelligent agent to perform counterfactual reasoning on the result effect of the successor task sequence, thereby ensuring the global optimality of the task result and achieving overall optimization of the complex task solution.
[0179] Embodiment 4
[0180] Figure 7 1 is a schematic diagram of a task processing device based on causal agent collaboration according to a fourth embodiment of the present invention. This embodiment is applicable to the case of task processing based on causal agent collaboration. Figure 7 As shown, the specific structure of the device includes:
[0181] The first processing module 71 is used to construct a dual-agent architecture including a general agent and a causal agent, and determine a chain solution consisting of multiple ordered subtasks corresponding to the task to be processed through the general agent;
[0182] The second processing module 72 is used to perform intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed, and if not, update the chain solution through the general agent until it matches;
[0183] The third processing module 73 is used to generate a thinking chain of each subtask in the chain solution through the general agent, verify the process logic rationality of each thinking chain through the causal agent, and update the thinking chain that fails the verification through the general agent until it passes the verification;
[0184] The fourth processing module 74 is used to determine the successor task sequence of the current subtask in the chain solution through the causal agent, and to perform counterfactual reasoning of the result effect according to the successor task sequence through the general agent. The result of the counterfactual reasoning is used to update the chain solution.
[0185] The task processing device based on causal agent collaboration provided in this embodiment constructs a dual-agent architecture including a general agent and a causal agent through a first processing module, and determines a chain solution consisting of multiple ordered sub-tasks corresponding to the task to be processed through the general agent; performs intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent through a second processing module to determine whether the chain solution matches the task to be processed, and if not, updates the chain solution through the general agent until it matches; generates a thinking chain of each subtask in the chain solution through the general agent through a third processing module, verifies the process logic rationality of each thinking chain through the causal agent, and updates the thinking chain that fails the verification through the general agent until it passes the verification; determines the successor task sequence of the current subtask in the chain solution through the causal agent through a fourth processing module, and performs counterfactual reasoning of the result effect according to the successor task sequence through the general agent, and the result of the counterfactual reasoning is used to update the chain solution. This scheme ensures the high matching between complex task solutions and tasks, the rationality of task paths, and the global optimality of task results through the collaboration of causal agents with general agents, thereby improving the ability and stability of multi-agents in handling complex tasks.
[0186] Furthermore, the learning process of the causal agent includes:
[0187] Constructing a causal corpus, wherein the causal corpus at least includes a causal effect dataset, a causal inference dataset, a behavioral causal dataset, a temporal causal dataset, and a common sense knowledge base;
[0188] The causal agent is obtained by pre-training and instruction learning based on the causal corpus, and the forms of samples involved in the instruction learning at least include causal identification tasks, chain causal reasoning tasks and causal reasoning tasks under hypothetical conditions.
[0189] Furthermore, the first processing module 71 is specifically used for:
[0190] Through the general intelligent agent, the task to be processed is decomposed and task dependency analyzed using the task parsing prompt template to obtain a chain solution consisting of multiple ordered subtasks; wherein each subtask is in the form of input information to output results, and the output result of each subtask should be able to serve as a valid input for the next subtask.
[0191] Furthermore, the second processing module 72 is specifically configured to:
[0192] By means of the causal agent, using an intervention type analysis prompt template, performing intervention type analysis on the chain solution based on at least the principles of causality, controllability, and representativeness to obtain an intervention type list, wherein the intervention type list includes intervention types for each subtask;
[0193] Determine, by the causal agent, a list of expected results based on the list of intervention types and the chain solution using an expected result generation prompt template, wherein the list of expected results includes a first expected result of each subtask corresponding to the intervention type applied and a second expected result of each subtask not applying the intervention type;
[0194] By means of the causal agent, an intervention effect analysis is performed based on the expected result list and the chain solution using an intervention effect analysis prompt template to obtain an intervention effect list, wherein the intervention effect list includes intervention causal effects determined by comparing the first expected result and the second expected result corresponding to each subtask;
[0195] Through the causal agent, a chain causal reasoning analysis prompt template is used to perform a chain causal reasoning analysis based on the intervention effect list, the chain solution, the task objects and task goals corresponding to the tasks to be processed, to determine whether the chain solution can complete the tasks to be processed, and to output potential failure nodes and corresponding improvement suggestions.
[0196] Furthermore, the second processing module 72 is specifically configured to:
[0197] The general agent updates the chain solution based on the improvement suggestion, and the causal agent performs intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the updated chain solution until the updated chain solution matches the task to be processed.
[0198] Furthermore, the third processing module 73 is specifically used for:
[0199] By means of the general intelligent agent, a thinking chain generation prompt template is used to generate a thinking chain of each subtask in the chain solution;
[0200] Through the causal intelligent agent, a rationality check prompt template is used to perform process logic rationality check on each thinking chain based on causal check, chain logic check and fact verification principles to obtain a check result. The check result includes the overall rationality check result of the checked thinking chain, the step rationality check result of each step in the checked thinking chain, and the reasonable reasons or improvement suggestions corresponding to the step rationality check result.
[0201] Furthermore, the fourth processing module 74 is specifically configured to:
[0202] Determining, by the causal agent, a successor task sequence of the current subtask based on the chain solution and a set number of inference steps using a successor task generation prompt template, wherein the successor task sequence includes successor tasks directly or indirectly affected by the current subtask;
[0203] Through the general intelligent agent, counterfactual reasoning of the result effect is performed based on the successor task sequence using a counterfactual reasoning prompt template, the output of each successor task in the successor task sequence is used as the input of the next successor task, and the result effect sequence corresponding to the successor task sequence, the execution result and potential impact of the last successor task in the successor task sequence are output.
[0204] The task processing device based on causal agent collaboration provided by the embodiment of the present invention can execute the task processing method based on causal agent collaboration provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0205] Embodiment 5
[0206] Figure 8 Schematic diagram of the structure of the electronic device implementing the embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0207] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0208] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0209] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a task processing method based on causal agent collaboration.
[0210] In some embodiments, the task processing method based on causal agent collaboration can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the task processing method based on causal agent collaboration described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the task processing method based on causal agent collaboration in any other appropriate manner (for example, by means of firmware).
[0211] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0212] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0213] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0214] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0215] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0216] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0217] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0218] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A task processing method based on causal agent collaboration, characterized in that: include: Constructing a dual-agent architecture including a general agent and a causal agent, and determining a chain solution consisting of multiple ordered subtasks corresponding to the task to be processed through the general agent; Performing intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed, and if not, updating the chain solution through the general agent until it matches; Generate a thought chain of each subtask in the chain solution through the general intelligent agent, verify the process logic rationality of each thought chain through the causal intelligent agent, and update the thought chain that fails the verification through the general intelligent agent until it passes the verification; The causal agent determines a successor task sequence of the current subtask in the chain solution, and the general agent performs counterfactual reasoning of the result effect based on the successor task sequence. The result of the counterfactual reasoning is used to update the chain solution.
2. The method according to claim 1, characterized in that The learning process of the causal agent includes: Constructing a causal corpus, wherein the causal corpus at least includes a causal effect dataset, a causal inference dataset, a behavioral causal dataset, a temporal causal dataset, and a common sense knowledge base; The causal agent is obtained by pre-training and instruction learning based on the causal corpus, and the forms of samples involved in the instruction learning at least include causal identification tasks, chain causal reasoning tasks and causal reasoning tasks under hypothetical conditions.
3. The method according to claim 1, characterized in that Determining a chain solution consisting of a plurality of ordered subtasks corresponding to the task to be processed by the general agent includes: Through the general intelligent agent, the task to be processed is decomposed and task dependency analyzed using the task parsing prompt template to obtain a chain solution consisting of multiple ordered subtasks; wherein each subtask is in the form of input information to output results, and the output result of each subtask should be able to serve as a valid input for the next subtask.
4. The method according to claim 1, characterized in that: Performing intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed, including: By means of the causal agent, using an intervention type analysis prompt template, performing intervention type analysis on the chain solution based on at least the principles of causality, controllability, and representativeness to obtain an intervention type list, wherein the intervention type list includes intervention types for each subtask; Determining, by the causal agent, an expected result list based on the intervention type list and the chain solution using an expected result generation prompt template, wherein the expected result list includes a first expected result of each subtask corresponding to the intervention type applied and a second expected result of each subtask not applying the corresponding intervention type; By means of the causal agent, an intervention effect analysis is performed based on the expected result list and the chain solution using an intervention effect analysis prompt template to obtain an intervention effect list, wherein the intervention effect list includes intervention causal effects determined by comparing the first expected result and the second expected result corresponding to each subtask; Through the causal agent, a chain causal reasoning analysis prompt template is used to perform a chain causal reasoning analysis based on the intervention effect list, the chain solution, the task objects and task goals corresponding to the tasks to be processed, to determine whether the chain solution can complete the tasks to be processed, and to output potential failure nodes and corresponding improvement suggestions.
5. The method according to claim 4, characterized in that Updating the chain solution by the general agent until a match is found, comprising: The general agent updates the chain solution based on the improvement suggestion, and the causal agent performs intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the updated chain solution until the updated chain solution matches the task to be processed.
6. The method according to claim 1, characterized in that The thought chain of each subtask in the chain solution is generated by the general agent, and the process logic rationality of each thought chain is verified by the causal agent, including: By means of the general intelligent agent, a thinking chain generation prompt template is used to generate a thinking chain of each subtask in the chain solution; Through the causal intelligent agent, a rationality check prompt template is used to perform process logic rationality check on each thinking chain based on causal check, chain logic check and fact verification principles to obtain a check result. The check result includes the overall rationality check result of the checked thinking chain, the step rationality check result of each step in the checked thinking chain, and the reasonable reasons or improvement suggestions corresponding to the step rationality check result.
7. The method according to claim 1, characterized in that Determining a successor task sequence of the current subtask in the chain solution by the causal agent, and performing counterfactual reasoning of the result effect according to the successor task sequence by the general agent, including: Determining, by the causal agent, a successor task sequence of the current subtask based on the chain solution and a set number of inference steps using a successor task generation prompt template, wherein the successor task sequence includes successor tasks directly or indirectly affected by the current subtask; Through the general intelligent agent, counterfactual reasoning of the result effect is performed based on the successor task sequence using a counterfactual reasoning prompt template, the output of each successor task in the successor task sequence is used as the input of the next successor task, and the result effect sequence corresponding to the successor task sequence, the execution result and potential impact of the last successor task in the successor task sequence are output.
8. A task processing device based on causal agent collaboration, characterized in that: include: A first processing module is used to construct a dual-agent architecture including a general agent and a causal agent, and determine a chain solution consisting of multiple ordered subtasks corresponding to a task to be processed through the general agent; A second processing module is used to perform intervention type analysis, intervention effect analysis and chain causal reasoning analysis on the chain solution through the causal agent to determine whether the chain solution matches the task to be processed, and if not, update the chain solution through the general agent until it matches; The third processing module is used to generate a thinking chain of each subtask in the chain solution through the general intelligent agent, verify the process logic rationality of each thinking chain through the causal intelligent agent, and update the thinking chain that fails the verification through the general intelligent agent until it passes the verification; The fourth processing module is used to determine the successor task sequence of the current subtask in the chain solution through the causal agent, and to perform counterfactual reasoning of the result effect according to the successor task sequence through the general agent, and the result of the counterfactual reasoning is used to update the chain solution.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method, device and equipment for security verification of intelligent agent and storage medium
CN120805133A
Oil-gas exploration equipment defect root cause analysis method and system and storage medium
CN121094154A
Large model cooperative processing method and system based on cross-modal space semantic alignment
CN122491512A
A causal intervention multi-agent negotiation method and system for degrading an interview
CN122507830A