Multi-agent hallucination root cause attribution method and system based on pre-filled stage signal and double hallucination verification
Patent Information
- Application Number
- CN202611070420.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-18
- Publication Date
- 2026-10-23
AI Technical Summary
[0008]本发明旨在提供一种基于预填充阶段信号与双重幻觉验证的多智能体幻觉根因归因方法及系统,以解决多智能体系统中幻觉定位困难、症状识别不可靠、根因归因缺乏可解释性的问题
[0026]本发明通过预筛选阶段快速缩小搜索范围,通过精筛选阶段的双重幻觉验证确保症状集的准确性,通过候选回溯阶段建立症状与上游步骤的关联,通过根因诊断阶段实现精确的根因定位和排序。该方法适用于多智能体系统的自动化调试、幻觉检测、质量评估和可靠性优化场景。
Smart Images

Figure CN122963946A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence, multi-agent systems, large language model hallucination detection, fault attribution, knowledge graphs and natural language processing, and in particular to a multi-agent hallucination root cause attribution method and system based on pre-filled stage signals and dual hallucination verification. Background Technology
[0002] Multi-agent systems accomplish complex tasks by coordinating the actions of multiple agents and have been widely applied in fields such as automated decision-making, code review, scientific research reviews, financial risk control, and complex question answering. Each agent executes a specific sub-task, and agents share information through message passing and call external tools to obtain data. The entire execution process is recorded as an execution trajectory, including the reasoning steps of each agent, tool calls, and intermediate outputs.
[0003] However, multi-agent systems are prone to the illusion problem during task execution. Illusion refers to the situation where the content generated by agents appears coherent and grammatically correct, but contains information that is inconsistent with reality. Because the outputs of each agent in a multi-agent system are interdependent, an illusion generated by one agent can propagate to other agents through message passing and tool calls, causing the entire system to output incorrect results.
[0004] Multi-agent hallucination attribution aims to identify the initial hallucination step in the execution trajectory that leads to the final failure. This task faces the following difficulties: (1) The execution trajectory of a multi-agent agent usually contains a large number of steps, and manual inspection is extremely inefficient; (2) There is often a time delay between the initial position of the hallucination and the final erroneous performance, that is, the downstream effect of the early hallucination only becomes visible in subsequent steps; (3) There is no standard answer as a reference for the output of the intermediate steps of the multi-agent agent, and it is impossible to directly determine whether a certain step is correct; (4) Most existing hallucination detection methods are aimed at the output of a single agent, and the computational cost is too high when directly applied to a multi-agent system.
[0005] MASPrism is a lightweight fault attribution framework based on signals from the pre-filling stage of a small language model. This framework utilizes the negative log-likelihood of the pre-filling stage and attention weights to identify symptom steps and candidate root cause steps without requiring diagnostic text generation, replay, or task-specific training. However, MASPrism's symptom set construction is entirely dependent on... This statistical correlation indicator, when the steps are... A high level of sensitivity without hallucination can lead to false alarms; simultaneously, when the hallucination process... If the step rate is not significantly higher than normal, it will lead to false negatives. Therefore, relying solely on... Symptom identification methods are not reliable.
[0006] Drowzee proposes a fact-conflict illusion detection method based on metamorphic testing, which verifies the authenticity of large model outputs by constructing an external knowledge base and internal logical rules. This method converts the output text into knowledge graph triples, uses the external knowledge base for fact-conflict detection, and performs internal contradiction detection through logical programming. However, Drowzee focuses on single-agent output verification and does not consider the issues of illusion propagation and attribution across steps in multi-agent systems.
[0007] In summary, the existing technology has the following shortcomings: (1) it lacks a method specifically for attribution of hallucinations in multi-agent systems; (2) it is based on The reliability of symptom recognition is insufficient, and there is a lack of accurate verification of the hallucination content within the steps; (3) the external knowledge base verification and internal contradiction detection are not effectively combined with multi-agent trajectory analysis; (4) there is a lack of an interpretable attribution link from the symptom step to the root cause step. Summary of the Invention
[0008] This invention aims to provide a multi-agent hallucination root cause attribution method and system based on pre-filled stage signals and dual hallucination verification, in order to solve the problems of difficult hallucination localization, unreliable symptom identification, and lack of interpretability of root cause attribution in multi-agent systems.
[0009] In a first aspect, the present invention provides a multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification, comprising the following steps:
[0010] Trajectory acquisition phase: Acquire the full trajectory of the multi-agent task;
[0011] Pre-screening stage: The steps of the multi-agent task completion process are extracted, the small language model is pre-filled, and the pre-filling stage signals are extracted to construct a pre-symptom set;
[0012] Fine screening stage: The fine screening stage involves restoring the content of each step in the pre-symptom set, extracting triples from the step knowledge graph, and performing parallel double verification on the triples in the step knowledge graph to generate the formal symptom set; wherein, the parallel double verification includes external knowledge base verification and internal contradiction verification of logical programming.
[0013] Candidate backtracking phase: Calculate the attention weights between each step, evaluate the influence of each upstream step on the symptom steps in the formal symptom set, and obtain a candidate root cause set through screening;
[0014] Root cause diagnosis stage: The steps in the candidate root cause set are evaluated and ranked, and the final root cause attribution result is output.
[0015] Secondly, the present invention provides a multi-agent hallucination root cause attribution system based on pre-filled stage signals and dual hallucination verification, comprising:
[0016] The trajectory acquisition module is used to collect the full trajectory of a multi-agent task;
[0017] The pre-screening module is used to collect the full trajectory of multi-agent tasks, complete step interception, small language model pre-filling and pre-filling stage signal extraction, and construct a pre-symptom set.
[0018] The fine screening module is used in the fine screening stage to: restore the content of each step in the pre-symptom set, extract triples from the step knowledge graph, and perform parallel double verification on the triples in the step knowledge graph to generate the formal symptom set; wherein, the parallel double verification includes external knowledge base verification and internal contradiction verification of logical programming.
[0019] The candidate backtracking module is used to calculate the attention weights between each step, evaluate the influence of each upstream step on the symptom steps in the formal symptom set, and obtain a candidate root cause set through screening.
[0020] The root cause diagnosis module is used to evaluate and rank the steps in the candidate root cause set.
[0021] The external knowledge base management module is used to build and maintain external knowledge bases.
[0022] The knowledge graph construction module is used to convert natural language output into structured knowledge graph triples;
[0023] The logic programming engine module is used to perform internal contradiction detection;
[0024] The results output module is used to output the final root cause attribution results.
[0025] The present invention has the following beneficial effects:
[0026] This invention rapidly narrows the search scope through a pre-screening stage, ensures the accuracy of the symptom set through dual hallucination verification in the fine screening stage, establishes the correlation between symptoms and upstream steps through the candidate backtracking stage, and achieves precise root cause localization and ranking through the root cause diagnosis stage. This method is applicable to scenarios involving automated debugging, hallucination detection, quality assessment, and reliability optimization of multi-agent systems. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0028] Figure 1 This is a diagram illustrating the overall architecture of a multi-agent hallucination root cause attribution system based on pre-filled stage signals and dual hallucination verification, as provided in an embodiment of the present invention.
[0029] Figure 2 This is an overall flowchart of the multi-agent hallucination root cause attribution method provided in an embodiment of the present invention;
[0030] Figure 3 This is a schematic diagram of the pre-screening stage provided in an embodiment of the present invention;
[0031] Figure 4 A flowchart of the parallel dual verification process for the fine screening stage provided in this embodiment of the invention;
[0032] Figure 5 This is a schematic diagram of the external knowledge base verification sub-process provided in an embodiment of the present invention;
[0033] Figure 6 This is a schematic diagram of the logic programming internal contradiction verification sub-process provided in an embodiment of the present invention;
[0034] Figure 7 This is a schematic diagram of the candidate backtracking and root cause diagnosis stage provided in an embodiment of the present invention. Detailed Implementation
[0035] The present invention will now be described in detail with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the scope of protection of the present invention.
[0036] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0037] Example 1: Method Example
[0038] like Figure 2 As shown, this invention provides a multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification, comprising the following steps:
[0039] Step S1: Collect complete trajectory data of multi-agent task execution, including user input task, task decomposition results, agent role configuration, message flow between agents, intermediate inference output of each agent, final output of each agent, retrieval results, tool call input and return results, generation time, rounds, and upstream and downstream dependencies.
[0040] Step S2: Pre-screening stage
[0041] Furthermore, such as Figure 3As shown, the purpose of the pre-screening stage in this embodiment is to quickly filter out steps that may contain anomalies from a large number of trajectory steps, thus narrowing the search scope for subsequent hallucination verification. This stage includes the following steps:
[0042] Step S21: Trajectory Step Extraction
[0043] Furthermore, establish multi-agent execution trajectories. Include The steps are as follows:
[0044]
[0045] in, Indicates the first One step.
[0046] Furthermore, this embodiment is based on the context window size of the small language model. Number of trajectory steps Calculate the token budget allocated for each step. For each step , retain its former The content of each token is truncated, with any excess parts replaced by ellipses [...], resulting in the truncated steps. And combine all the truncated steps into a truncated trajectory:
[0047]
[0048] In this embodiment, a system prompt word is added before the trajectory step to inform the model that each step has been truncated. The omission mark [...] indicates the omitted content, in order to help the model correctly process the truncated sequence.
[0049] Step S22: Pre-filling and signal extraction
[0050] Furthermore, this embodiment will truncate the trajectory. The input small language model is pre-filled. During the pre-filling process, the entire input sequence is read and the internal state is calculated. The pre-filling stage signals are extracted using the following two methods:
[0051] (1) Negative log-likelihood For the truncation step Each token in Its negative log-likelihood is defined as
[0052]
[0053] in, Represents token All previous tokens. Among them, step-level. Defined as all token levels within this step Average value:
[0054]
[0055] in, yes The set of tokens in the data.
[0056] (2) Inter-step attention: For truncation steps token in and cut-off steps token in Its attention weight is defined as
[0057]
[0058] in, is token The query vector, is token The key vector, It is the vector dimension, where. Steps For steps Attention is defined as:
[0059]
[0060] Step S23: Generation of Presymptomatic Sets
[0061] Furthermore, this embodiment is based on step level All steps are sorted in descending order. In this embodiment, The higher the value, the lower the probability of this step occurring under the given context; that is, the more likely this step is to be an anomalous step. Further selection... The highest value These steps constitute a set of presymptom symptoms. ,in, The value ranges from 10% to 30%, and the specific value can be adjusted according to the trajectory length and model characteristics.
[0062] Furthermore, this embodiment optimizes the post-processing of the steps: if a step contains explicit error markers, such as keywords like "error," "exception," or "failure," its priority is increased. By combining internal model signals and observable lexical evidence, the coverage of the presymptom set is improved.
[0063] Step S3: Fine Screening Stage
[0064] The fine screening stage is the core innovative aspect of this application. Its purpose is to accurately verify the hallucinations of the steps in the pre-symptom set, filtering out non-hallucination steps and retaining those that truly involve hallucinations. For example... Figure 4 As shown, this stage employs a parallel dual verification mechanism, comprising two parallel sub-processes: external knowledge base verification and internal contradiction verification of the logic programming. This stage includes the following steps:
[0065] Step S31: Restore the steps
[0066] Furthermore, this embodiment will include a pre-symptom set. The truncated content of each step is restored to its complete form. The restored steps retain the complete reasoning text, tool call results, and intermediate outputs, providing a sufficient information basis for subsequent hallucination verification.
[0067] Step S32: Knowledge Graph Triple Extraction
[0068] Furthermore, in this embodiment, the knowledge graph triples are extracted from the content of each recovered step using the OpenIE tool. Each triple is represented as (subject, relation, object), where the subject is the entity described in the step content, the relation is the semantic relationship between entities, and the object is the value of the relation or the target entity.
[0069] For propositions containing numerical values, dates, amounts, ratios, and thresholds, unit conversion and format normalization are performed; for propositions containing conditions, the condition set is extracted. All triples are normalized and then stored in the corresponding step knowledge graph.
[0070] Step 33: Parallel double illusion verification
[0071] Parallel dual verification is performed on the set of triples in the step knowledge graph, including two parallel sub-processes: external knowledge base verification and internal contradiction verification of logical programming.
[0072] (A) such as Figure 5 As shown, the external knowledge base verification sub-process is as follows:
[0073] Step S331: Construction of the external knowledge base. The external knowledge base is constructed using a multi-source fusion strategy, including three sources: (a) using the Wikipedia knowledge graph to construct a general offline knowledge graph, covering common-sense knowledge; (b) using the Serper API to perform online knowledge queries and obtain the latest information related to the current task; and (c) using a large language model to call background knowledge related to the problem online to supplement domain-specific knowledge.
[0074] Step S332: Knowledge Base Expansion. Referring to the rule-based reasoning method in Drowzee, the external knowledge base is expanded. For each triple in the knowledge base, a new implicit triple is generated according to predefined reasoning rules. These reasoning rules include transitivity rules, symmetry rules, and inverse rules, etc.
[0075] Step S333: Triple Matching and Fact Conflict Detection. Each triple in the knowledge graph is matched with triples in the external knowledge base. The matching process involves two levels: entity matching and relation matching.
[0076] Entity matching: If the entities in two triples are the same word or synonyms, it is considered an entity match. For non-exact matches, Phrase-BERT is used to calculate the vector similarity of the entity phrases. If the similarity is greater than a first threshold, it is considered an entity match.
[0077] Relational matching: If the relation between two triples is the same word or a synonym, it is considered a relational match. For inaccurate matches, Phrase-BERT is also used to calculate the vector similarity of the relational phrases. If the similarity is greater than the second threshold, it is considered a relational match.
[0078] Fact Conflict Determination: If the triplet in step 1 and the triplet in the external knowledge base provide inconsistent object values based on entity matching and relation matching, then the triplet in step 1 is determined to have a fact conflict. Steps with fact conflicts are marked as illusory steps.
[0079] (B) such as Figure 6 As shown, the internal contradiction verification sub-process of the logic programming is as follows:
[0080] Step S334: Internal Knowledge Graph Construction. Perform semantic analysis on the triples in the knowledge graph to identify sets of triples with the same subject and relation.
[0081] Step S335: Semantic rule definition. Define the following contradiction detection rules: (a) Numerical contradiction rule—the same subject has mutually exclusive numerical attributes in the same relation; (b) Category contradiction rule—the same subject belongs to mutually exclusive categories at the same time; (c) Temporal contradiction rule—the same subject forms a logical loop in a temporal relation; (d) Spatial contradiction rule—the same subject cannot coexist in a spatial relation.
[0082] Step S336: Logical Reasoning and Contradiction Detection. Contradiction detection is performed using a logic programming engine. Triples from the step knowledge graph and predefined semantic rules are input into the engine, which automatically infers whether contradictory triples exist. For example, if a step contains both "(New York, has a population of over 5 million)" and "(New York, has a population of 2 million)," a numerical contradiction rule is triggered, determining that the step contains an internal contradiction.
[0083] Step S337: Contradiction Marking. Steps where the logic programming engine detects internal contradictions are marked as illusory steps.
[0084] Step S338: Formal Symptom Set Generation. Based on the combined results of external knowledge base verification and internal contradiction verification in the logical programming, steps marked as hallucinations in at least one verification process are included in the formal symptom set. Every step in the formal symptom set undergoes double verification, compared to relying solely on... The presymptom set has higher reliability.
[0085] Step S4: Candidate Backtracking Phase
[0086] Furthermore, the purpose of the candidate backtracking stage in this embodiment is to start from the symptom steps in the formal symptom set, use attention weights to backtrack upstream steps, and identify candidate root cause steps that may lead to hallucinations. This stage includes the following steps:
[0087] Step S41: Attention Weight Calculation
[0088] Inter-step attention weights calculated based on the pre-screening stage Assess the impact of each upstream step on the symptom step. For each symptom step... and each upstream step Calculate attention value .
[0089] Step S42: Generation of candidate root cause set
[0090] Furthermore, for each upstream step Calculate the global candidate score :
[0091]
[0092] This score measures the upstream steps. The sum of the attention paid to all symptom steps. The higher the value, the more symptom steps the upstream step is associated with, and the more likely it is to be the root cause of the hallucination.
[0093] Furthermore, this embodiment selects The highest value The % upstream steps constitute the candidate root cause set , The value ranges from 5% to 15%, and the specific value can be adjusted according to the trajectory characteristics and task complexity.
[0094] Step S5: Root Cause Diagnosis Phase
[0095] like Figure 7 As shown, the root cause diagnosis stage accurately evaluates and ranks the steps in the candidate root cause set, and outputs the final root cause attribution result. This stage includes the following steps:
[0096] Step S51: Cue word reconstruction
[0097] Construct new diagnostic cue words and formal symptom set Steps and candidate root cause sets The steps listed should be retained in their entirety, while the remaining steps should be replaced with shorter prefixes and ellipses [...]. A helpful note should be inserted before the earliest symptom step: "Subsequent steps indicate abnormal behavior; please trace back to the root cause step that led to the abnormality."
[0098] Step S52: Signal recalculation
[0099] Furthermore, the reconstructed prompts are input into the small language model for a second pre-filling, and the step level is recalculated. And attention between steps. Because the symptom step and candidate step retain complete content, the recalculated signal contains richer diagnostic information than the pre-screening stage.
[0100] Step S53: Scoring candidate root causes
[0101] Furthermore, for each symptom step and each candidate root cause step , Calculate candidate root factor scores :
[0102]
[0103] in, Steps For steps attention, Steps Average attention across all upstream steps Steps of value, Steps of Value; this score combines attention weights and Comparing two dimensions; attention item The steps were measured Compared to other upstream steps, the steps are affected by the steps. The degree of attention; Comparison items It provides positive reinforcement when the symptom step is more abnormal than the candidate step, following the expected causal pattern from the less abnormal early step to the more abnormal downstream symptom.
[0104] Step S54: Multi-symptom consensus aggregation
[0105] Furthermore, for each candidate root cause step Calculate its basic aggregation score That is, the sum of the scores of the candidate step on all symptoms.
[0106] To further prioritize the identification of candidate steps commonly pointed to by multiple symptoms, a consensus factor is applied:
[0107]
[0108] in, This is the step The set of symptoms in its top five upstream steps, It is a consensus weight constant. This mechanism rewards high-frequency candidate steps that are consistently identified by multiple symptoms, rather than candidate steps that are only identified by a single symptom.
[0109] This embodiment is based on Sort all candidate root cause steps in descending order and select the top one with the highest score. The steps are used as the final attribution result. .
[0110] Step S55: Symptom-Root Cause Association Output
[0111] Furthermore, this embodiment outputs the final root cause attribution result, including: (1) a sorted list of candidate root cause steps; (2) a mapping relationship between each candidate root cause step and its associated symptom steps; and (3) the attribution score and consensus degree of each candidate root cause step. This mapping relationship provides an interpretable path from visible symptoms to upstream root causes, helping developers understand the propagation chain of hallucinations.
[0112] To clearly illustrate the present invention, the following detailed description is provided in conjunction with specific embodiments.
[0113] Example 2: Multi-robot collaboration scenario in warehousing and logistics.
[0114] Furthermore, the multi-agent system in this embodiment includes an environment-aware agent, a path-planning agent, a grasping decision-making agent, and a task-scheduling agent. After the user inputs a mixed shelf picking task, each agent executes a sub-task based on its role and responsibility.
[0115] The environmental sensing agent visually scans the target shelf and outputs the perception result: "The label on the left side of the third shelf of the target shelf is identified as a red packaging box, approximately 20 centimeters square in size, with no obstructions in front, and can be directly grasped."
[0116] The path planning agent plans the robotic arm's trajectory based on perception results: "The target location is 30 centimeters to the left and in front of the current position of the robotic arm. A straight-line trajectory is planned, with the end effector aligned with the center point of the location, ensuring a safe and collision-free journey."
[0117] The grasping decision-making agent formulates a grasping strategy based on perception and path information: "The target object is a red packaging box. It will be grasped laterally using parallel grippers with a medium gripping force. Success is expected in one grasp."
[0118] The task scheduling agent summarizes the outputs of all agents and generates execution instructions: "All subsystems are ready. Confirm execution of the mixed shelf picking task. Target object: red packaged box. Grab according to the planned trajectory."
[0119] Furthermore, in this embodiment, after the robot performs the grasping action, the gripper does not make contact with the actual object. The system retraces the execution trajectory for analysis. After a pre-screening phase, the system identifies the environmental perception step and the grasping decision step. The value is relatively high, so it is included in the pre-symptom set.
[0120] Furthermore, during the fine screening phase, the system performs parallel double verification on the steps in the pre-symptom set. External knowledge base verification reveals that the location label information output by the environmental perception agent does not match the actual shelf labels; the visual recognition system misidentifies a blue packaging box in an adjacent location as a red packaging box; and the actual location allocation record for that shelf in the external knowledge base differs from the perception output. Therefore, this step is determined to have a factual conflict. Internal contradiction verification in the logic programming reveals that the path planning agent's output contains both statements: "the target is 30 centimeters to the left and front" and "the end point is aligned with the center of the location." However, the actual location calculated using the perception coordinates has a spatial offset from the planned endpoint, meaning both statements cannot be true simultaneously, triggering a spatial contradiction rule.
[0121] Both verification processes confirmed the presence of hallucinations in the environmental perception and path planning steps, and these were included in the formal symptom set.
[0122] During the candidate backtracking phase, the system calculates attention weights and finds that the output of the grasping decision agent has a high attention value to the path planning step and the environmental perception step, while the path planning step in turn has a high attention value to the environmental perception step. Based on this, a candidate root cause set is generated, with the environmental perception step ranked first.
[0123] During the root cause diagnosis phase, the system recalculates the entire process. Attention and other factors were used to score candidate root cause steps. The final attribution results showed that the environmental perception step was the primary root cause, with its erroneous visual label recognition being the source of the entire hallucination chain; the path planning step was the secondary root cause, as its motion trajectory generated based on erroneous perceptual coordinates further solidified the downstream propagation of the hallucination. The attribution score of the primary root cause was significantly higher than that of the secondary root cause, indicating that visual perception errors were the starting point for the entire task's failure.
[0124] The system outputs an attribution report, showing the complete illusion propagation chain from the environmental perception step to the path planning step to the grasping decision step. It recommends that developers check the recognition accuracy of the visual recognition model of the environmental perception agent in the mixed-color shelf scene, optimize the handling of lighting changes and occlusion interference, and enhance the verification mechanism of the path planning agent for perception uncertainty.
[0125] Example 3: System Example
[0126] like Figure 1 As shown, this application also provides a multi-agent hallucination root cause attribution system based on pre-filled stage signals and dual hallucination verification, including the following modules:
[0127] The trajectory acquisition module is used to collect complete trajectory data of multi-agent tasks, including user input, agent output, message flow, tool calls, search results, and evidence citations.
[0128] The pre-screening module is used to extract the trajectory steps into segments, calculate the negative log-likelihood value through pre-filling with a small language model, and generate a pre-symptom set;
[0129] The fine screening module is used to perform parallel dual illusion verification on the steps in the pre-symptom set, including an external knowledge base verification submodule and a logic programming internal contradiction verification submodule, and outputs the formal symptom set;
[0130] The candidate backtracking module is used to calculate the attention weights between steps, evaluate the influence of upstream steps on symptom steps, and generate a candidate root cause set.
[0131] The root cause diagnosis module is used to recalculate the negative log-likelihood value and attention weight of the complete step based on the candidate root cause set, score and aggregate the candidate root cause steps, and output the final root cause attribution result.
[0132] The external knowledge base management module is used to build and maintain external knowledge bases, including offline knowledge graph construction, online query interface, and large model background knowledge invocation;
[0133] The knowledge graph construction module is used to convert natural language output into structured knowledge graph triples, supporting OpenIE extraction and triple normalization;
[0134] The logic programming engine module is used to perform internal contradiction detection, including a rule definition library and a logic reasoning engine;
[0135] The results output module is used to output a root cause attribution report, including a sorted list of root cause steps, symptom-root cause association links, and attribution scores.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification, characterized in that, Includes the following steps: Trajectory acquisition phase: Acquire the full trajectory of the multi-agent task; Pre-screening stage: The steps of the multi-agent task completion process are extracted, the small language model is pre-filled, and the pre-filling stage signals are extracted to construct a pre-symptom set; Fine screening stage: Restore the content of each step in the pre-symptom set, extract triples from the step knowledge graph, and perform parallel double verification on the triples in the step knowledge graph to generate the formal symptom set; wherein, the parallel double verification includes external knowledge base verification and internal contradiction verification of logical programming; Candidate backtracking phase: Calculate the attention weights between each step, evaluate the influence of each upstream step on the symptom steps in the formal symptom set, and obtain a candidate root cause set through screening; Root cause diagnosis stage: The steps in the candidate root cause set are evaluated and ranked, and the final root cause attribution result is output.
2. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 1, characterized in that, The pre-filling stage signal is extracted using step-level negative log-likelihood and inter-step attention, wherein: The step-level negative log-likelihood is the average of the negative log-likelihoods of all tokens within the truncated step; The inter-step attention is the average of the attention weights between all tokens within the truncated step.
3. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 1 or 2, characterized in that, In the pre-screening stage, post-processing optimization is performed on the steps: if a step contains explicit error markers, the priority of that step is increased.
4. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 3, characterized in that, The external knowledge base verification includes the following steps: Building an external knowledge base: An external knowledge base is built using a multi-source fusion strategy; Expanding the external knowledge base: Generate new implicit triples for each triple in the knowledge base based on predefined inference rules; Triple matching and fact conflict detection: Match each triple in the step knowledge graph with triples in the external knowledge base and determine fact conflicts.
5. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 4, characterized in that, The external knowledge base includes: A general offline knowledge graph was built using the Wikipedia knowledge graph, covering common-sense knowledge; Use the Serper API to perform online knowledge queries and obtain the latest information related to the current task; Use a large language model to call up relevant background knowledge online, supplementing domain-specific knowledge.
6. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 4 or 5, characterized in that, When performing the triple matching and fact conflict detection, the triple matching includes entity matching and relation matching, wherein: Entity matching: If the entities of two triples are the same word or synonym, or the similarity of the entity phrase vectors calculated by Phrase-BERT is greater than the first threshold, it is considered entity matching; The relation matching is defined as follows: when the relation between two triples is the same word, a synonym, or the similarity of the relation phrase vectors calculated by Phrase-BERT is greater than the second threshold, the relation is considered to be matched. If the triples in the step knowledge graph match the triples in the external knowledge base in terms of entity and relation, but the object values are inconsistent, it is determined that there is a factual conflict, and the corresponding step is marked as an illusion step.
7. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 1, characterized in that, The internal contradiction verification of the logic programming includes: Internal knowledge graph construction: Semantic analysis is performed on the triples in the step knowledge graph to identify sets of triples with the same subject and relation; Semantic rule definition: Define contradiction detection rules, including numerical, categorical, temporal, and spatial contradiction rules; Logical reasoning and contradiction detection: Input the triples and defined semantic rules from the step knowledge graph into the logic programming engine to deduce whether there are contradictory triples; Contradiction marking: Mark steps that the logic programming engine detects as having internal contradictions as phantom steps; Formal symptom set generation: Based on the results of external knowledge base verification and internal contradiction verification in logical programming, steps marked as hallucinations in at least one verification process are included in the formal symptom set.
8. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 1 or 7, characterized in that, The root cause diagnosis phase includes: Cue word reconstruction: Retain the complete steps of the formal symptom set and candidate root cause set, replace the remaining steps with short prefixes and ellipsis marks, and insert cue descriptions before the earliest symptom step; Signal recalculation: The reconstructed prompt words are input into the small language model for secondary pre-filling; Candidate root cause scoring: Calculate candidate root cause scores for each symptom step and each candidate root cause step; Multi-symptom consensus aggregation: Calculate the basic aggregation score for each candidate root cause step, introduce consensus factors and sort them in descending order to obtain the final attribution result; Symptom-Root Cause Association Output: Outputs the final root cause attribution result.
9. The multi-agent hallucination root cause attribution method based on pre-filled stage signals and dual hallucination verification according to claim 8, characterized in that, The final root cause attribution results include: a sorted list of candidate root cause steps, a mapping relationship between each candidate root cause step and its associated symptom steps, and an attribution score and consensus level for each candidate root cause step.
10. A multi-agent hallucination root cause attribution system based on pre-filled stage signals and dual hallucination verification, characterized in that, include: The trajectory acquisition module is used to collect the full trajectory of a multi-agent task; The pre-screening module is used to collect the full trajectory of multi-agent tasks, complete step interception, small language model pre-filling and pre-filling stage signal extraction, and construct a pre-symptom set. The fine screening module is used in the fine screening stage to: restore the content of each step in the pre-symptom set, extract triples from the step knowledge graph, and perform parallel double verification on the triples in the step knowledge graph to generate the formal symptom set; wherein, the parallel double verification includes external knowledge base verification and internal contradiction verification of logical programming. The candidate backtracking module is used to calculate the attention weights between each step, evaluate the influence of each upstream step on the symptom steps in the formal symptom set, and obtain a candidate root cause set through screening. The root cause diagnosis module is used to evaluate and rank the steps in the candidate root cause set. The external knowledge base management module is used to build and maintain external knowledge bases. The knowledge graph construction module is used to convert natural language output into structured knowledge graph triples; The logic programming engine module is used to perform internal contradiction detection; The results output module is used to output the final root cause attribution results.