Multi-agent system-oriented dual-view causal failure attribution method and device
By combining a global causal attribution module and a local counterfactual enhancement module, the decisive errors in the multi-agent intelligent assistant system are accurately located, solving the problem of error identification in long texts by existing methods and improving the accuracy and stability of the system's analysis results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN UNIV
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-09
AI Technical Summary
Existing intelligent assistant multi-agent systems struggle to accurately identify and locate the decisive errors that lead to system-level failures during failure handling and self-repair processes after task failures. This is especially true during long and complex natural language interactions, where existing methods are unable to effectively identify and correct critical errors, resulting in system outputs that deviate significantly from user needs.
A dual-perspective causal failure attribution method is adopted. A structured causal graph is constructed through a global causal attribution module, and a local counterfactual enhancement module is used for counterfactual evaluation and bidirectional greedy search to accurately locate decisive errors.
It significantly improves the accuracy and reliability of analysis results in intelligent assistant multi-agent systems, reduces the computational and time overhead of invalid network retrieval requests and redundant inference, and enhances the stability and engineering usability of the system.
Smart Images

Figure CN122174993A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to intelligent assistant multi-agent systems, and more particularly to a dual-perspective causal failure attribution method and apparatus for multi-agent systems. Background Technology
[0002] In recent years, multi-agent systems based on large language models have become a new paradigm for intelligent assistants. [1] In practical applications, users often present highly complex information needs, such as: "Comprehensively analyze the research hotspots, core institutions, key controversies, and potential risks of a certain emerging technology over the past five years, and provide a credible conclusion." Such tasks typically involve multi-source heterogeneous information retrieval, cross-page information integration, and multi-step reasoning, which a single agent cannot efficiently complete. Therefore, multi-agent systems based on large language models are often employed. These systems demonstrate strong autonomous collaboration capabilities through natural language interaction, task decomposition, and tool invocation among agents, helping users search for information online, analyze data, and solve complex problems. However, these multi-agent systems still have inherent vulnerabilities; agents are prone to errors during reasoning and collaboration, such as misunderstandings of logical information, improper use of online search tools, or distorted information transmission. These errors propagate through the system, leading to cascading reasoning and inductive errors, ultimately causing system failure and preventing the fulfillment of user requirements. [2] .
[0003] Such critical errors often occur in upstream stages such as task understanding, task decomposition, or information filtering. The consequences are not simply single-step failures, but rather the continuous operation of the entire multi-agent system within an incorrect target space. For example, incorrect task decomposition may cause multiple agents to continuously retrieve and analyze information that does not match the user's actual needs; erroneous intermediate conclusions may be repeatedly reused and written into system memory or structured files, thus being reinforced in subsequent analysis and summarization. Even if the execution process of each agent in its respective subtask is logical and correctly formatted, the system will still ultimately output a complete result, but with conclusions severely deviating from the user's needs, causing an irrecoverable system-level failure. Furthermore, existing software system failure localization methods mainly rely on runtime signals or structured execution logs, which are difficult to apply to multi-agent systems centered on natural language interaction. Because the system's decision-making and collaboration processes exist in unstructured text form, the decisive errors leading to failure are often hidden in long chains of natural language interactions, separated from the final error manifestation by multiple reasoning steps, making it difficult for traditional methods to effectively locate them.
[0004] Existing failure attribution methods are mainly divided into two paradigms: fine-tuning-based and instruction-based. However, they both face two major challenges: 1) Existing methods often only capture minor biases, such as incomplete retrieval or formatting errors. These biases can usually be corrected by downstream validation mechanisms and are not the root cause of system failure. [3-5] The truly decisive errors are often deeper-level reasoning or coordination errors, which existing methods struggle to accurately identify; 2) As the trajectory length of multi-agent systems increases, the ability of large language models to process and understand long, unstructured texts rapidly declines, leading to a sharp deterioration in their reasoning ability and attribution accuracy, especially when facing long-range dependencies. [6] .
[0005] Therefore, in practical applications of multi-agent intelligent assistant systems, there is an urgent need for a failure attribution method that can structurally model long and complex natural language system trajectories and accurately identify decisive errors that lead to system-level failures through causal reasoning, so as to avoid the continuous propagation and amplification of errors in the process of multi-agent collaboration, thereby improving the reliability and engineering usability of the system.
[0006] References
[0007] [1]Yujia Chen. 2025. AutoReview: An LLM-based Multi-Agent System forSecurity Issue-Oriented Code Review. In Proceedings of the 33rd ACMInternational Conference on the Foundations of Software Engineering. 1022–1024.
[0008] [2]Mert Cemri, Melissa Z Pan, Shuyi Yang, Lakshya A Agrawal, BhavyaChopra, Rishabh Tiwari, Kurt Keutzer, Aditya Parameswaran, Dan Klein, KannanRamchandran, et al. 2025. Why Do Multi-Agent LLM Systems Fail? arXiv preprintarXiv:2503.13657 (2025).
[0009] [3]Adam Fourney, Gagan Bansal, Hussein Mozannar, Cheng Tan, EduardoSalinas, Friederike Niedtner, Grace Proebsting, Griffin Bassman, JackGerrits, Jacob Alber, et al. 2024. Magentic-one: A generalist multi-agentsystem for solving complex tasks. arXiv preprint arXiv:2411.04468 (2024).
[0010] [4]Chi Wang, Qingyun Wu, and the AG2 Community. 2024. AG2: Open-Source AgentOS for AI Agents. https: / / github.com / ag2ai / ag2 Available athttps: / / docs.ag2.ai / .
[0011] [5]Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang.2025. Demystifying llm-based software engineering agents. Proceedings of theACM on Software Engineering 2, FSE (2025), 801–824.
[0012] [6]Shaokun Zhang, Ming Yin, Jieyu Zhang, Jiale Liu, Zhiguang Han,Jingyang Zhang, Beibin Li, Chi Wang, Huazheng Wang, Yiran Chen, et al. 2025.Which Agent Causes Task Failures and When? On Automated Failure Attributionof LLM Multi-Agent Systems. arXiv preprint arXiv:2505.00212 (2025). Summary of the Invention
[0014] This invention addresses key technical problems in the failure handling and self-repair process of existing intelligent assistant multi-agent systems after task failure. It proposes a dual-perspective causal failure attribution method and apparatus for multi-agent systems. This invention provides a training-independent dual-perspective causal failure attribution framework. This framework introduces a global causal attribution module to perform structured causal modeling of the complete interaction trajectory of the intelligent assistant multi-agent system, identifying key interaction steps that have a causal impact on the task outcome in terms of both timing and logic. Simultaneously, a local counterfactual causal enhancement module performs counterfactual correction and effect evaluation on candidate key steps to determine whether the correction of a single step or a few steps is causally sufficient to change the system execution result from failure to success, reducing invalid network retrieval requests.
[0015] Firstly, a dual-perspective causal failure attribution method for multi-agent systems is provided, the method comprising:
[0016] Receive failed system trajectory The failure system trajectory is used as input for failure attribution. This refers to the complete sequence of interactions generated by the system during the task completion process.
[0017] The global causal attribution module identifies minor biases, transforms the failure system trajectory into a structured representation, and constructs a causal graph through temporal, necessity, and sufficiency considerations. Initial hypotheses are generated by combining minor biases and causal graphs. ;
[0018] The local counterfactual enhancement module defines a counterfactual evaluation function, which constructs a counterfactual trajectory. And calculate the marginal correction effect To quantify the corrective effect of the interaction steps on the final result; based on the initial assumptions of the global causal attribution module. Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighborhood steps and pinpoint the decisive error. .
[0019] The complete interaction sequence includes: multi-turn dialogue content, internal reasoning, tool calls, and unstructured information from environmental feedback.
[0020] The global causal attribution module is based on the constructed causal graph. and secondary deviation set Perform hypothesis generation The process involves proposing the initial decisive error hypothesis. :
[0021]
[0022] in, These are ground truth results. It is a decisive error in the assumption, and The corresponding reasoning is that the step of transforming recoverable deviations into irreversible errors is taken as... .
[0023] The above describes the construction of counterfactual trajectories. And calculate the marginal correction effect The effect of the corrective interaction steps on the final result can be quantified as follows:
[0024] Counterfactual trajectory for:
[0025]
[0026] in, This refers to the (i+1)th interaction step in the original system log; This is the last step in the original system log; For the revised interaction steps .
[0027] Counterfactual trajectory The input is fed into a large language model for simulation, and the simulation results are obtained. :
[0028]
[0029] in, This is a simulation function implemented based on a large language model, used for simulation. The final output result ;
[0030] Using pre-trained encoders Similarity to cosine Calculation simulation results ground truth semantic alignment score :
[0031]
[0032] Marginal correction effect :
[0033]
[0034] Indicates only the correction steps This resulted in a measurable incremental change to the final result.
[0035] The initial assumptions of the global causal attribution module Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighborhood steps and pinpoint the decisive error. for:
[0036] Forward search: from the current center point Begin searching for all successors. ,choose The biggest successor :
[0037]
[0038] in, To correct the steps This resulted in a measurable increment to the final result. In a causal graph, with As the set of all downstream interaction steps corresponding to the cause node. For any of the candidate interaction steps, "If" indicates that in the first place... The maximum increment is selected in the next iteration. Interaction steps,
[0039] if Then Add to forward candidate set And continue the search;
[0040] Backward search: from the current center point Begin by searching all its predecessors. That is, in a causal diagram, with The set of all upstream interaction steps corresponding to the result node, selected from among them. Largest front-wheel drive :
[0041]
[0042] if Then Add backward candidate set And continue the search; For any of the candidate interaction steps;
[0043] Decisive error in decision-making: The local counterfactual enhancement module merges all steps with positive marginal correction effects into a final candidate set. :
[0044]
[0045] in, ;
[0046] The local counterfactual enhancement module will select the candidate set. The input is fed into the decision error decision function, and the final decision error is... :
[0047]
[0048] in, The expected output of the task executed by the system. This is the final diagnostic function, used to determine the decisive steps for system failure.
[0049] A dual-perspective causal failure attribution device for multi-agent systems, the device comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to cause the device to execute any of the methods described herein.
[0050] A computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform any of the methods described above.
[0051] The beneficial effects of the technical solution provided by this invention are:
[0052] 1) This invention can accurately identify historical interaction steps that have a causal effect on the task result during the failure analysis process of intelligent assistant multi-agent systems, avoid misjudging highly relevant but non-causal steps such as insufficient search coverage and abnormal output format as the root cause of failure, thereby preventing the system from repeatedly retrying on the error repair path, and instead providing a reference for targeted repair; significantly reducing the computation and time overhead caused by invalid network search requests and redundant reasoning.
[0053] 2) By modeling the natural language interaction trajectory between multiple agents of an intelligent assistant into a structured causal graph that satisfies the constraints of temporality, necessity, and sufficiency, this invention can effectively suppress false causal relationships introduced by factors such as repeated citation of intermediate conclusions and amplification of consistency, and avoid erroneous intermediate analysis conclusions being mistakenly regarded as reliable consensus and propagated to the final structured analysis report, thereby improving the accuracy and credibility of information analysis results.
[0054] 3) By introducing a causal contribution quantification mechanism based on counterfactual correction, this invention can assess whether minimal semantic correction to a single historical decision step is sufficient to turn the system output from failure to success. This avoids the problem of only making superficial corrections to the output layer while ignoring upstream task understanding or range setting errors. This enables the intelligent assistant system to perform targeted repairs to the root causes that lead to the overall deviation of the analysis conclusions, thereby improving the stability and engineering usability of the output results in complex information analysis tasks. Attached Figure Description
[0055] Figure 1 A flowchart of a dual-perspective causal failure attribution method for multi-agent systems;
[0056] Figure 2 This is a network structure diagram for a dual-perspective causal failure attribution method for multi-agent systems. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below.
[0058] Given that existing multi-agent intelligent assistant systems based on large language models are prone to system-level failures when handling highly complex information needs due to task comprehension biases, improper task decomposition, or incorrect information filtering, and that these errors are often propagated and amplified during multi-agent natural language interaction and collaboration, ultimately leading to output results that, even with complete content, still significantly deviate from the user's actual needs and result in an increase in invalid network search requests, existing failure localization and attribution methods are insufficient to effectively address such problems.
[0059] On the one hand, existing failure attribution methods mainly rely on runtime signals, structured execution logs, or correlation-based bias detection mechanisms, which are difficult to apply to multi-agent intelligent assistant systems with natural language interaction at their core. On the other hand, as the length of system interaction trajectories and the depth of reasoning increase, the key decision information contained in unstructured text exhibits long-range dependency characteristics, causing existing attribution methods based on fine-tuning or instructions to significantly decrease in accuracy and stability, making it difficult to identify key historical errors that play a decisive role in the final system failure.
[0060] To address the aforementioned issues, this invention provides a dual-perspective causal failure attribution method and apparatus for multi-agent systems. Through structured causal analysis and quantitative counterfactual enhancement, it accurately identifies decisive errors in multi-agent systems based on large language models. This invention proposes a training-free dual-perspective causal attribution (DCFA) framework that combines global causal attribution (global causal attribution module) with local counterfactual causal enhancement (local counterfactual enhancement module).
[0061] Example 1
[0062] A dual-perspective causal failure attribution method for multi-agent systems, see [link to relevant documentation]. Figure 1 The method includes:
[0063] Receive failed system trajectory This is used as input for failure attribution. The system trajectory is the complete interaction sequence generated by the system during task completion, including unstructured information such as multi-turn dialogue content, internal reasoning, tool calls, and environmental feedback. After being input into this attribution method, it is used for diagnosis through the global causal attribution module and the local counterfactual enhancement module. Finally, based on the local causal relationships obtained from the diagnosis, the decisive error is determined. The specific module functions are as follows:
[0064] Global causal attribution module: Identifies minor biases, transforms unstructured trajectories into structured representations, and constructs causal graphs based on strict temporal, necessity, and sufficiency conditions. To ensure the accuracy of causal relationships, initial hypotheses are generated by combining minor biases and causal diagrams. ;
[0065] Local Counterfactual Enhancement Module: Defines a counterfactual evaluation function and constructs a counterfactual trajectory. And calculate the marginal correction effect This is used to quantify the corrective effect of the interaction steps on the final result. This evaluation function is used with the initial assumptions of the global causal attribution module as a basis. Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighboring steps, thereby accurately pinpointing the decisive error. .
[0066] Global causal attribution uses a complete causal graph to identify an initial hypothesis (which step is the decisive error). However, LLM's ability to locate errors in long texts is limited. Therefore, it's necessary to focus on the local causal relationships of the hypothesis for further optimization, identifying a more accurate decision-making error step. Subsequently, based on this hypothesis, a search is performed on the local causal graph, allowing LLM to make more precise judgments on the local causal structure.
[0067] Example 2
[0068] The scheme in Example 1 will be further described below with reference to the specific calculation steps:
[0069] 1. Overall Framework
[0070] The framework adopts a coarse-grained to fine-grained strategy. First, it constructs a causal scaffold from a global perspective through a global causal attribution module, and then performs quantitative verification in a local neighborhood through a local counterfactual enhancement module.
[0071] 2. Global Causal Attribution Module
[0072] The Global Causal Attribution Module aims to overcome the secondary bias attribution problem that large language models are prone to when dealing with unstructured trajectories, and enhances the reasoning ability of large language models by constructing structured causal graphs.
[0073] 2.1) Secondary Bias Identification and Cause-Effect Graph Construction
[0074] Given the system interaction trajectory: in Indicates the first Step-by-step interaction. The global causal attribution module first utilizes a powerful large language model (such as a business large language model) to perform secondary bias identification. :
[0075]
[0076] in, It is the set of candidate minor biases. This is the corresponding natural language interpretation.
[0077] Subsequently, the global causal attribution module constructs a structured directed causal graph. Among them, the edge It is added only if the following three causal conditions are met:
[0078] Temporality:
[0079]
[0080] That is, the cause Must be in the result This happened before.
[0081] Necessity:
[0082]
[0083] in, It is a conditional function used to evaluate if Removed or corrected Will it happen again? A result of "No" indicates... yes The necessary conditions for its occurrence.
[0084] Sufficiency:
[0085]
[0086] in, Determine in the given context, Is the occurrence sufficient to cause The occurrence of.
[0087] The formal criterion added to the cause-effect diagram is: only when all three conditions are met simultaneously is a condition added to the cause-effect diagram. Add edges :
[0088]
[0089] This conservative principle ensures the causal graph It only includes causal relationships with strong temporal, necessity, and sufficiency support, thereby minimizing spurious associations.
[0090] 2.2) Initial Hypothesis Generation
[0091] Based on the constructed causal graph and secondary deviation set The global causal attribution module performs hypothesis generation. The process of formulating an initial, decisive, erroneous hypothesis. :
[0092]
[0093] in, These are ground truth results. It is a decisive error in the assumption, and This corresponds to the reasoning behind the inference. The global causal attribution module tends to consider the step immediately following a minor deviation in the causal chain, and that transforms a recoverable deviation into an irreversible error (such as fabricating information), as the cause. .
[0094] 3. Local Counterfactual Causal Enhancement Module
[0095] The local counterfactual enhancement module aims to address the context degradation problem in long trajectories by quantifying the causal contribution of each step and refining the initial assumptions of the global causal attribution module.
[0096] 3.1) Counterfactual evaluation function
[0097] The core of the local counterfactual enhancement module is to define a counterfactual evaluation function to quantify and correct any interaction step. The effect of correction on the final result.
[0098] Step 3.1.1: Generate the fully corrected trajectory
[0099] First, the local counterfactual enhancement module performs corrections using a large language model (such as a locally deployed open-source large language model). The process generates a fully corrected trajectory. :
[0100]
[0101] in yes The revised version.
[0102] Step 3.1.2: Constructing the counterfactual trajectory
[0103] For any interaction step Construct a counterfactual trajectory The trajectory simulates "if the previous A scenario where "each step is corrected, but subsequent steps retain the original error":
[0104]
[0105] Step 3.1.3: Simulation and semantic alignment score
[0106] Counterfactual trajectory Input into a large language model for simulation The simulation results were obtained. :
[0107]
[0108] Then, using the pre-trained encoder Similarity to cosine Calculation simulation results ground truth semantic alignment score :
[0109]
[0110] Step 3.1.4: Calculate the marginal correction effect
[0111] To isolate the steps The independent contribution of the local counterfactual enhancement module is used to calculate its marginal correction effect. :
[0112]
[0113] A positive value Indicates only the correction steps This resulted in a measurable incremental improvement to the final result, namely It has a causal contribution. Specifically, the formula... Marginal correction effect As a counterfactual evaluation function.
[0114] 3.2) Bidirectional Greedy Search
[0115] The local counterfactual enhancement module uses the initial assumptions of the global causal attribution module. Centered on the cause-and-effect diagram A bidirectional greedy search is performed to identify the neighborhood step with the highest positive marginal correction effect.
[0116] Forward search:
[0117] From the current center point Begin by searching for all its successors. Choose one The biggest successor :
[0118]
[0119] if Then Add to forward candidate set And continue the search.
[0120] Backward search:
[0121] From the current center point Begin by searching all its predecessors. Choose one Largest front-wheel drive :
[0122]
[0123] if Then Add backward candidate set And continue the search.
[0124] 3.3) Decisive erroneous decision-making
[0125] After the search is completed, the local counterfactual enhancement module merges all steps with positive marginal correction effects into a final candidate set. :
[0126]
[0127] Finally, the local counterfactual enhancement module will set the candidate set. Input to decisive wrong decision Within the function, leveraging the semantic-level reasoning capabilities of a large language model, and combining contextual coherence and causal structure, the interaction step with the highest causal contribution is ultimately determined as the decisive error. :
[0128]
[0129] Example 3
[0130] To verify the effectiveness of the dual-perspective causal attribution method (DCFA) proposed in this invention, it was experimentally compared with three other methods: All-at-Once, Step-by-Step, and Binary-Search. Experiments were conducted on both algorithm-generated and manually constructed intelligent assistant system trajectories. The evaluation metric was step-level accuracy, i.e., whether the interaction steps decisively responsible for system failure could be accurately located. The experimental results are shown in Table 1.
[0131] The overall experimental results show that the DCFA method proposed in this invention achieves optimal performance under all experimental settings. On the algorithm-generated trajectory dataset, DCFA achieves an average step-level accuracy of 40.87%; on the manually constructed trajectory dataset, its average step-level accuracy reaches 20.40%. Compared to the best-performing comparative method on each dataset, DCFA achieves average accuracy improvements of 10.85% and 6.61%, respectively, indicating that this invention has a significant advantage in accurately locating critical steps in system failure.
[0132] Further analysis of the performance of the comparative methods reveals that, among the three baseline methods, the stepwise analysis method outperforms the global analysis method and the binary search method on both datasets, while the binary search method lags behind. This phenomenon is mainly due to the lower overall performance of the baseline methods, with their average step-level accuracy generally below 30%, causing the models to tend to identify superficial and obvious erroneous steps. These types of errors can often be directly identified through local interaction information; therefore, the stepwise analysis method, without relying on global context, outperforms the global analysis method, which attempts to process long sequence trajectories holistically.
[0133] Furthermore, large language models are prone to context degradation when processing long sequences and unstructured text; excessive contextual information may actually reduce inference accuracy. This problem is particularly pronounced in artificially constructed datasets with more complex structures and longer trajectories, where the stepwise analysis method achieves significantly higher accuracy than the holistic analysis method (13.46% vs. 3.74%), further illustrating that relying solely on global text input is insufficient for consistently completing failure attribution tasks.
[0134] In contrast, the DCFA method proposed in this invention fundamentally overcomes the aforementioned limitations. On one hand, DCFA also analyzes the complete system trajectory, but instead of directly inputting unstructured text into the model, it transforms the system trajectory into a structured causal graph representation through a global causal attribution module, thereby providing the model with clear and interpretable causal dependencies. On the other hand, the local counterfactual causal enhancement module, constrained by the causal graph structure, quantitatively verifies and locally searches for candidate erroneous steps, enabling the system to efficiently and stably locate the key steps that have the greatest causal contribution to the final failure outcome.
[0135] Experimental results show that DCFA improves the accuracy of algorithm-generated datasets from 20.77% to 40.87% and artificially constructed datasets from 3.74% to 20.40% compared to the overall analysis method. This fully verifies the significant effect of combining causal modeling, structured representation and counterfactual reasoning on improving the accuracy and robustness of failure attribution in intelligent assistant multi-agent systems.
[0136] Table 1
[0137]
[0138] Example 4
[0139] A dual-perspective causal failure attribution device for multi-agent systems includes a processor and a memory. The memory stores program instructions, and the processor invokes the program instructions stored in the memory to cause the device to execute the following method steps in Embodiment 1:
[0140] Receive failed system trajectory Failure attribution is used as input, and the failure system trajectory is analyzed. This refers to the complete sequence of interactions generated by the system during the task completion process.
[0141] The global causal attribution module identifies minor biases, transforms the failure system trajectory into a structured representation, and constructs a causal graph through temporal, necessity, and sufficiency considerations. Initial hypotheses are generated by combining minor biases and causal graphs. ;
[0142] The local counterfactual enhancement module defines a counterfactual evaluation function, which constructs a counterfactual trajectory. And calculate the marginal correction effect To quantify the corrective effect of the interaction steps on the final result; based on the initial assumptions of the global causal attribution module. Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighborhood steps and pinpoint the decisive error. .
[0143] The complete interaction sequence includes: multi-turn dialogue content, internal reasoning, tool calls, and unstructured information from environmental feedback.
[0144] The global causal attribution module is based on the constructed causal graph. and secondary deviation set Perform hypothesis generation The process involves proposing the initial decisive error hypothesis. :
[0145]
[0146] in, These are ground truth results. It is a decisive error in the assumption, and The corresponding reasoning is that the step of transforming recoverable deviations into irreversible errors is taken as... .
[0147] By constructing counterfactual trajectories And calculate the marginal correction effect The effect of the corrective interaction steps on the final result can be quantified as follows:
[0148] Counterfactual trajectory for:
[0149]
[0150] in, This refers to the (i+1)th interaction step in the original system log; This is the last step in the original system log; For the revised interaction steps .
[0151] Counterfactual trajectory The input is fed into a large language model for simulation, and the simulation results are obtained. :
[0152]
[0153] in, This is a simulation function implemented based on a large language model, used for simulation. The final output result .
[0154] Using pre-trained encoders Similarity to cosine Calculation simulation results ground truth semantic alignment score :
[0155]
[0156] Marginal correction effect :
[0157]
[0158] Indicates only the correction steps This resulted in a measurable incremental change to the final result.
[0159] The initial assumptions of the global causal attribution module Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighborhood steps and pinpoint the decisive error. for:
[0160] Forward search: from the current center point Begin searching for all successors. ,choose The biggest successor :
[0161]
[0162] in, To correct the steps This resulted in a measurable increment to the final result. In a causal graph, with As the set of all downstream interaction steps corresponding to the cause node. For any of the candidate interaction steps, "If" indicates that in the first place... The maximum increment is selected in the next iteration. The interactive steps.
[0163] if Then Add to forward candidate set And continue the search;
[0164] Backward search: from the current center point Begin by searching all its predecessors. That is, in a causal diagram, with The set of all upstream interaction steps corresponding to the result node, selected from among them. Largest front-wheel drive :
[0165]
[0166] if Then Add backward candidate set And continue the search; ;
[0167] Decisive error in decision-making: The local counterfactual enhancement module merges all steps with positive marginal correction effects into a final candidate set. :
[0168]
[0169] in, To obtain the decisive error hypothesis The corresponding step number, For any sequence number Interaction steps, This is the forward candidate set.
[0170] The local counterfactual enhancement module will select the candidate set. The input is fed into the decision error decision function, and the final decision error is... :
[0171]
[0172] in, The expected output of the task executed by the system. This is the final diagnostic function, used to determine the decisive steps for system failure.
[0173] It should be noted that the device descriptions in the above embodiments correspond to the method descriptions in the embodiments, and the embodiments of the present invention will not be repeated here.
[0174] The execution entities of the aforementioned processor and memory can be devices with computing functions such as computers, microcontrollers, and single-chip microcomputers. In specific implementations, the embodiments of the present invention do not limit the execution entities and can select them according to the needs of actual applications.
[0175] Data signals are transmitted between the memory and the processor via a bus, which will not be elaborated upon in this embodiment of the invention.
[0176] It should be noted that the device descriptions in the above embodiments correspond to the method descriptions in the embodiments, and the embodiments of the present invention will not be repeated here.
[0177] The execution entities of the aforementioned processor and memory can be devices with computing functions such as computers, microcontrollers, and single-chip microcomputers. In specific implementations, the embodiments of the present invention do not limit the execution entities and can select them according to the needs of actual applications.
[0178] Data signals are transmitted between the memory and the processor via a bus, which will not be elaborated upon in this embodiment of the invention.
[0179] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium, the storage medium including a stored program, which, when the program is running, controls the device where the storage medium is located to execute the method steps in the above embodiments.
[0180] The computer-readable storage medium includes, but is not limited to, flash memory, hard disk, solid-state drive, etc.
[0181] It should be noted that the description of the readable storage medium in the above embodiments corresponds to the description of the method in the embodiments, and the embodiments of the present invention will not be repeated here.
[0182] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated.
[0183] A computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in or transmitted through a computer-readable storage medium. A computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic or semiconductor, etc.
[0184] Unless otherwise specified, the model numbers of the various devices in this embodiment of the invention are not limited, and any device that can perform the above functions is acceptable.
[0185] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0186] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A dual-perspective causal failure attribution method for multi-agent systems, characterized in that, The method includes: Receive failed system trajectory The failure system trajectory is used as input for failure attribution. This refers to the complete sequence of interactions generated by the system during the task completion process. The global causal attribution module identifies minor biases, transforms the failure system trajectory into a structured representation, and constructs a causal graph through temporal, necessity, and sufficiency considerations. Initial hypotheses are generated by combining minor biases and causal graphs. ; The local counterfactual enhancement module defines a counterfactual evaluation function, which constructs a counterfactual trajectory. And calculate the marginal correction effect To quantify the corrective effect of the interaction steps on the final result; based on the initial assumptions of the global causal attribution module. Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighborhood steps and pinpoint the decisive error. The decisive mistake Used for web retrieval.
2. The dual-perspective causal failure attribution method for multi-agent systems according to claim 1, characterized in that, The complete interaction sequence includes: multi-turn dialogue content, internal reasoning, tool calls, and unstructured information from environmental feedback.
3. The dual-perspective causal failure attribution method for multi-agent systems according to claim 1, characterized in that, The global causal attribution module is based on the constructed causal graph. and secondary deviation set Perform hypothesis generation The process involves proposing the initial decisive error hypothesis. : in, These are ground truth results. It is a decisive error in the assumption, and The corresponding reasoning is that the step of transforming recoverable deviations into irreversible errors is taken as... .
4. The dual-perspective causal failure attribution method for multi-agent systems according to claim 1, characterized in that, The above describes the construction of counterfactual trajectories. And calculate the marginal correction effect The effect of the corrective interaction steps on the final result can be quantified as follows: Counterfactual trajectory for: in, The first one in the original system log One interactive step; This is the last step in the original system log; For the revised interaction steps ; Counterfactual trajectory The input is fed into a large language model for simulation, and the simulation results are obtained. : in, This is a simulation function implemented based on a large language model, used for simulation. The final output result ; Using pre-trained encoders Similarity to cosine Calculation simulation results ground truth semantic alignment score : Marginal correction effect : Indicates only the correction steps This resulted in a measurable increment to the final result.
5. The dual-perspective causal failure attribution method for multi-agent systems according to claim 1, characterized in that, The initial assumptions of the global causal attribution module Centered on the causal graph, a bidirectional greedy search is performed based on the marginal correction effect to select neighborhood steps and pinpoint the decisive error. for: Forward search: from the current center point Begin by searching for all subsequent steps along the causal graph, denoted as . ,choose The biggest successor : in, To correct the steps This resulted in a measurable increment to the final result. In a causal graph, with As the set of all downstream interaction steps corresponding to the cause node. For any of the candidate interaction steps, "If" indicates that in the first place... The maximum increment is selected in the next iteration. The interactive steps; if Then Add to forward candidate set And continue the search; Backward search: from the current center point Begin by searching all its predecessors. That is, in a causal diagram, with The set of all upstream interaction steps corresponding to the result node, selected from among them. Largest front-wheel drive : if Then Add backward candidate set And continue the search; For any of the candidate interaction steps; Decisive error in decision-making: The local counterfactual enhancement module merges all steps with positive marginal correction effects into a final candidate set. : in, For the decisive error hypothesis The corresponding step number, For any sequence number Interaction steps, Forward candidate set; The local counterfactual enhancement module will select the candidate set. The input is fed into the decision error decision function, and the final decision error is... : in, The expected output of the task executed by the system. This is the final diagnostic function, used to determine the decisive steps for system failure.
6. A dual-perspective causal failure attribution device for multi-agent systems, characterized in that, The device includes a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to cause the device to perform the method according to any one of claims 1-7.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1-7.