Search enhancement generation illusion detection and repair method and system based on explanatory evidence subgraph and multi-source confidence fusion

CN123014238APending Publication Date: 2026-10-30HANGZHOU JUNTONG FUTURE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611212472.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

单一验证方式难以同时覆盖结构关系、概念语义和原始文本证据,且部分知识图谱构建方法将抽取关系直接作为确定事实,或者直接删除低置信度关系,容易因结构化抽取误差造成错误判定

Benefits of technology

[0031]本发明的有益效果:通过构建解释性证据子图,将实体关系、抽取置信度和原文来源索引关联存储,并对低置信度关系边进行保留和标记,使结构验证过程能够利用带有不确定性的证据,减少因直接删除低置信度关系而造成的证据缺失,同时支持对验证依据进行追溯;分别从关系路径结构、概念语义和原始文本蕴含三个维度获得结构支持度、语义一致性评分和文本支持置信度,并通过语义熔断与对数域加权融合生成综合一致性评分,避免较高的结构评分或文本评分掩盖生成断言中的明显语义漂移;根据各分项评分的组合关系确定冲突类型,分别执行关系边添加、置信度调整、关系边降权或剪枝、分布外概念替换、扩大检索范围或者生成拒绝回答指令,使修复操作能够与证据缺失、错误关系、概念偏离及证据不足等不同冲突原因相对应;将证据子图的更新范围限定于当前会话周期,记录更新前后的关系边属性及所依据的原文来源索引,并保持逻辑规则库不变,能够防止单次会话中的抽取误差污染全局规则或影响其他会话;在完成证据子图更新后重新执行结构验证、语义验证、文本验证和融合判定,使检测、修复与再次验证形成闭环,并使更新后的综合一致性评分与当前证据状态相对应。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014238A_ABST
    Figure CN123014238A_ABST
Patent Text Reader

Abstract

The application discloses a search enhancement hallucination detection and repair method and system based on explanatory evidence subgraph and multi-source confidence fusion. Reference documents related to a user query are obtained, preprocessed and entity normalized to form text evidence and a document concept set; entity relationships are extracted to construct an explanatory evidence subgraph with associated extraction confidence and original source index; based on a logic rule library that remains unchanged, structural support is generated, semantic consistency scores and text support confidence are calculated; comprehensive consistency scores are obtained through semantic fusing and multi-source score fusion; conflict types are determined according to each score, and relationship edges are added to the evidence subgraph of the current session, confidence is adjusted, weight is reduced or pruned, or distributed external concepts are replaced, the search range is expanded or a refusal answer instruction is generated, and verification and fusion are performed again. The application is suitable for hallucination detection and repair of search enhancement generation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing, and in particular to a method and system for detecting and repairing illusions generated by retrieval enhancement based on the fusion of interpretive evidence subgraphs and multi-source confidence. Background Technology

[0002] Retrieval-enhanced generation techniques retrieve relevant reference documents from external knowledge bases or corpora and provide the retrieval results to a large language model to generate responses, thereby enhancing the knowledge basis of the generated content. However, due to insufficient reference document retrieval, inconsistent entity representations, omissions or errors in structured relation extraction, and semantic drift in the generation model, the generated results may still contain content that is inconsistent with the reference documents, lacks supporting evidence, or is conceptually confusing.

[0003] Existing hallucination detection schemes typically employ one of the following methods to verify generated content: semantic similarity, textual implication, or knowledge graph reasoning. A single verification method struggles to simultaneously cover structural relationships, conceptual semantics, and original textual evidence. Furthermore, some knowledge graph construction methods directly treat extracted relationships as established facts or directly delete low-confidence relationships, making them susceptible to erroneous judgments due to errors in structured extraction. Simple weighted fusion may also allow a higher score to mask significant semantic deviations, making it difficult to accurately identify conflicts between different pieces of evidence.

[0004] Furthermore, existing solutions typically only uniformly correct or regenerate the generated text after detecting hallucinations, failing to address situations such as missing evidence, erroneous relationships, conceptual deviations, and insufficient evidence based on the cause of the conflict. Directly writing the repair results into the global knowledge graph or logical rule base may also cause extraction errors from a single session to propagate to other sessions. Therefore, a hallucination detection and repair scheme is needed that can preserve the uncertainty of evidence, integrate multi-source verification results, distinguish conflict types, and limit the scope of repair. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for detecting and repairing illusions through retrieval enhancement based on the fusion of interpretive evidence subgraphs and multi-source confidence, thereby overcoming the aforementioned deficiencies in existing technologies.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A retrieval enhancement-based method for generating hallucination detection and repair, based on the fusion of interpretive evidence subgraphs and multi-source confidence, includes:

[0008] The evidence processing steps include obtaining reference documents related to the user's query, preprocessing and normalizing the reference documents to obtain text evidence and a set of document concepts.

[0009] The subgraph construction steps involve extracting entity relationships from textual evidence and building an interpretive evidence subgraph, as well as extracting confidence scores and original source indexes for each relationship edge association.

[0010] The structural verification step determines the candidate paths corresponding to the generated assertions based on a pre-set and unchanging logical rule base, and generates structural support based on the extraction confidence of relation edges within the candidate paths and the rule confidence.

[0011] The semantic verification step calculates the semantic similarity between the assertion concepts in the generated assertions and the document concept set to obtain a semantic consistency score.

[0012] The text verification step converts the generated assertions into natural language propositions, identifies the text fragments in the text evidence that correspond to the natural language propositions, and obtains the text support confidence.

[0013] The fusion judgment step compares the semantic consistency score with the semantic circuit breaking threshold, and merges the structural support, semantic consistency score and text support confidence of the generation assertion that did not trigger semantic circuit breaking to obtain a comprehensive consistency score.

[0014] The conflict resolution steps involve determining the conflict type based on the overall consistency score and the combination relationship of each sub-item score, and updating the explanatory evidence subgraph of the current session or adjusting the generated assertions according to the conflict type.

[0015] Preferably, the fusion determination step includes: first comparing the semantic consistency score with a preset semantic circuit breaker threshold; when the semantic consistency score is lower than the preset semantic circuit breaker threshold, setting the overall consistency score to a preset minimum value and recording the semantic conflict type; when the semantic consistency score is not lower than the preset semantic circuit breaker threshold, performing numerical smoothing on the structural support, semantic consistency score, and text support confidence respectively, converting the processed three sub-scores to the logarithmic domain, combining them according to the corresponding preset weights, and converting the combination result into an overall consistency score.

[0016] Preferably, the conflict resolution step includes: when the text support confidence score is higher than a first text threshold and the structural support score is lower than a first structural threshold, checking whether there is a relation edge in the interpretive evidence subgraph corresponding to the generated assertion; when the relation edge does not exist, adding the corresponding relation edge in the interpretive evidence subgraph of the current session according to the text fragment; when the relation edge exists and its extraction confidence score is lower than a preset confidence threshold, adjusting the confidence score of the relation edge according to the text support confidence score; when the text support confidence score is lower than a second text threshold and the structural support score is higher than a second structural threshold, performing weight reduction or pruning on the relation edges in the candidate path; when the semantic consistency score is lower than the semantic circuit breaking threshold, selecting a document concept adjacent to the out-of-distribution concept from the document concept set to replace the out-of-distribution concept; when the structural support score, semantic consistency score, and text support confidence score are all lower than their respective corresponding thresholds, expanding the retrieval scope of the reference documents or generating a rejection instruction.

[0017] Preferably, when performing relation edge addition, confidence adjustment, relation edge weight reduction, or relation edge pruning on the explanatory evidence subgraph, the effective scope of the corresponding update operation is limited to the current session period, and the relation edge attributes before the update, the relation edge attributes after the update, and the source index of the text fragment on which the update is based are recorded; the update operation is not written into the logical rule base; after the explanatory evidence subgraph is updated, the structural verification step, semantic verification step, text verification step, and fusion judgment step are re-executed to obtain the updated comprehensive consistency score.

[0018] Preferably, the evidence processing step and the subgraph construction step include: cleaning and segmenting the reference document, identifying entity candidates in each text segment, and mapping entity candidates that express different meanings but point to the same concept to standard concepts; extracting relation information consisting of head entities, relation types, and tail entities from the text evidence that has been normalized, setting the head entities and tail entities as graph nodes, setting the relation types as relation edges, and writing the extraction confidence and the source index of the corresponding text segment into the relation edge attribute; for relation edges with an extraction confidence lower than a preset retention threshold, retaining the relation edges and writing a low confidence marker.

[0019] Preferably, the structural verification step includes: determining the head entity, assertion relation, and tail entity from the generated assertions; searching for candidate paths in the interpretive evidence subgraph that connect the head entity and tail entity and whose relation sequence matches the relation combination rule according to the relation combination rule in the logical rule base; multiplying the extraction confidence of each relation edge in the candidate path by the rule confidence of the matched relation combination rule to obtain the path strength of the corresponding candidate path; aggregating the path strengths of multiple candidate paths according to noise or logic to obtain the structural support; and keeping the relation combination rule and rule confidence in the logical rule base unchanged during the candidate path search and path strength aggregation.

[0020] Preferably, the semantic verification step includes: generating vector representations of assertion concepts and document concepts respectively; calculating the semantic similarity between each assertion concept and each document concept in the document concept set; scaling and normalizing each semantic similarity using a temperature coefficient; determining the maximum concept matching value from the normalization results; using the maximum concept matching value as the semantic consistency score of the corresponding assertion concept; comparing the semantic consistency score with a preset semantic circuit breaking threshold; and writing out-of-distribution concept tags for assertion concepts that are lower than the preset semantic circuit breaking threshold.

[0021] Preferably, the text verification step includes: converting the generated assertion containing the head entity, assertion relation, and tail entity into a natural language proposition according to the natural language template corresponding to the assertion relation; selecting the text segment corresponding to the natural language proposition based on the term matching degree between the natural language proposition and each text segment in the text evidence; setting the selected text segment as the premise text, setting the natural language proposition as the text to be verified, performing text entailment inference, obtaining the text support confidence, and establishing the correspondence between the text support confidence, the natural language proposition, and the source index of the selected text segment.

[0022] A retrieval-enhanced generative hallucination detection and repair system based on interpretive evidence subgraphs and multi-source confidence fusion includes:

[0023] The evidence processing module is configured to acquire reference documents related to the user's query, and to preprocess and normalize the reference documents.

[0024] The subgraph building module is configured to extract entity relations from textual evidence and build an interpretive evidence subgraph that includes extraction confidence and original source index.

[0025] The structure verification module is configured to determine the candidate paths corresponding to the generated assertions and generate structure support based on an invariant logical rule base.

[0026] The semantic verification module is configured to generate a semantic consistency score based on the semantic similarity between asserted concepts and the document concept set.

[0027] The text validation module is configured to convert generated assertions into natural language propositions and generate text support confidence scores based on the corresponding text fragments.

[0028] The fusion judgment module is configured to perform semantic circuit breaking judgment and fuse the three categories of sub-scores that have not triggered semantic circuit breaking;

[0029] The conflict resolution module is configured to update the explanatory evidence subgraph of the current session or adjust the generated assertions based on the combination relationship of the three categories of sub-scores.

[0030] Preferably, the system also includes a rule storage unit and a session subgraph storage unit. The rule storage unit stores the logical rule base and provides the relation combination rules and rule confidence to the structure verification module. The session subgraph storage unit stores the explanatory evidence subgraph, relation edge attributes, and original source index according to the session identifier. The conflict resolution module writes the results of relation edge addition, confidence adjustment, relation edge weight reduction, or relation edge pruning into the session subgraph storage unit, while keeping the logical rule base in the rule storage unit unchanged. The fusion judgment module associates the three types of sub-item scores and the overall consistency score with the same generated assertion identifier and sends the conflict type to the conflict resolution module.

[0031] The beneficial effects of this invention are as follows: By constructing an interpretive evidence subgraph, entity relationships, extraction confidence, and original source index are associated and stored, and low-confidence relationship edges are retained and marked, enabling the structural verification process to utilize evidence with uncertainty, reducing evidence loss caused by directly deleting low-confidence relationships, and supporting the tracing of verification basis; structural support, semantic consistency score, and text support confidence are obtained from three dimensions: relational path structure, conceptual semantics, and original text implication, respectively, and a comprehensive consistency score is generated through semantic circuit breaking and logarithmic domain weighted fusion, avoiding high structural or text scores from masking obvious semantic drift in the generated assertions; conflict types are determined according to the combination relationship of each sub-score, respectively. The system performs actions such as adding relation edges, adjusting confidence levels, reducing or pruning relation edges, replacing out-of-distribution concepts, expanding the search scope, or generating rejection instructions. This ensures that the repair operations correspond to different conflicting reasons, such as missing evidence, erroneous relations, conceptual deviations, and insufficient evidence. The update scope of the evidence subgraph is limited to the current session period. The system records the relation edge attributes before and after the update, as well as the original source index on which they are based, while keeping the logical rule base unchanged. This prevents extraction errors in a single session from polluting global rules or affecting other sessions. After the evidence subgraph is updated, structural verification, semantic verification, text verification, and fusion judgment are re-executed to form a closed loop of detection, repair, and re-verification. The updated comprehensive consistency score corresponds to the current evidence status. Attached Figure Description

[0032] Figure 1 This is the overall detection and repair flowchart of the present invention;

[0033] Figure 2 This is a flowchart of the explanatory evidence subgraph construction process of the present invention;

[0034] Figure 3 This is a flowchart of the multi-source verification and fusion determination process of the present invention;

[0035] Figure 4 This is a flowchart of the conflict classification and repair closed-loop process of the present invention;

[0036] Figure 5This is a flowchart of the system modules and storage interaction of the present invention. Detailed Implementation

[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] It should be noted that when a component is described as "fixed to" another component, it can be directly on the other component or may have a component in between. When a component is considered "connected to" another component, it can be directly connected to the other component or may have a component in between. When a component is considered "set on" another component, it can be directly set on the other component or may have a component in between. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0040] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings:

[0041] like Figures 1 to 5 As shown, the above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments, and all technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.

[0042] To make the technical solution and beneficial effects of the present invention clearer, the following describes in further detail the method and system for detecting and repairing retrieval enhancement generation illusions based on the fusion of interpretive evidence subgraphs and multi-source confidence, with reference to specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the scope of protection of the present invention. In retrieval enhancement generation scenarios, when responding to user queries, the system typically needs to first retrieve relevant content from external knowledge sources and then combine it with a large language model to generate the final response. If the entities, relations, or values ​​in the generated results do not match the retrieved content, it constitutes an illusion. To solve this problem, the method provided by the present invention includes evidence processing steps, subgraph construction steps, structural verification steps, semantic verification steps, text verification steps, fusion judgment steps, and conflict repair steps, forming a complete closed loop from evidence acquisition to result repair.

[0043] In the evidence processing step, the system obtains reference documents related to the user's query, preprocesses and normalizes the reference documents to obtain textual evidence and a document concept set. Reference documents refer to the set of original documents related to the query topic retrieved by the retrieval system from external knowledge bases or corpora based on the user's query. Textual evidence refers to the text content obtained after cleaning and segmenting the reference documents, which can be used for subsequent processing. Specifically, the evidence processing step and subgraph construction step include: cleaning and segmenting the reference documents, identifying entity candidates in each text segment, and mapping entity candidates with different expressions but pointing to the same concept to standard concepts. Entity normalization here is used to eliminate the expression differences of the same concept in different text segments. For example, if the reference document contains different expressions such as "vomiting after taking medication" and "gastrointestinal discomfort after taking medication," although the wording is different, they point to the same concept. After entity normalization, they are uniformly mapped to the same standard concept and written into the document concept set. The document concept set is the set of all standard concepts obtained after normalization in the reference documents, used as the similarity comparison benchmark in the subsequent semantic verification step.

[0044] In the subgraph construction step, the system extracts entity relationships from textual evidence and establishes an interpretive evidence subgraph, associating each relationship edge with an extraction confidence level and a source index from the original text. Specifically, it extracts relationship information consisting of a head entity, relationship type, and tail entity from the textual evidence that has undergone entity normalization. The head entity and tail entity are set as graph nodes, and the relationship type is set as a relationship edge. The extraction confidence level and the source index of the corresponding text fragment are written into the relationship edge attributes. For relationship edges with an extraction confidence level lower than a preset retention threshold, the relationship edge is retained and a low confidence level marker is written. The interpretive evidence subgraph referred to here is different from the traditional knowledge graph approach of treating the extraction result as an absolute truth value. This invention treats the output of the structured extraction model as a hypothetical proposition with uncertainty. Each relationship edge in the graph not only records the relationship type itself, but also records an extraction confidence level value reflecting the certainty of extraction, as well as a source index pointing to the original text fragment position. This allows the subgraph to retain the uncertainty information on the evidence chain, rather than being directly deleted due to a low confidence level on a single side. For example, when a structured extraction model extracts a relation edge from a text fragment containing modal expressions such as "possible" or "maybe", the extraction confidence of that relation edge is usually lower than that of a relation edge extracted from a deterministic expression. However, the system does not discard the relation edge because of this; instead, it retains the edge and writes a low-confidence label for use in the soft judgment in the subsequent structure verification step, thereby avoiding misjudgment due to the extraction model's omission or underestimation of implicit relations.

[0045] In the structural verification step, the system determines candidate paths corresponding to the generated assertions based on a pre-built and immutable logical rule base. It then generates structural support based on the extraction confidence of relation edges within the candidate paths and the rule confidence. Here, a generated assertion refers to a structured statement generated by the large language model during a user query response, whose veracity is to be verified. It is typically represented as a triple consisting of an assertion head entity, an assertion relation, and an assertion tail entity. The logical rule base refers to a pre-built set of relation combination rules that remain statically unchanged during inference. Each rule records the logical implication relationship between sequences of specific relation types and the corresponding rule confidence. For example, a certain type of adverse reaction relation can be deduced by sequentially combining a certain type of component relation and a certain type of causal relation. Specifically, the structural verification step includes: determining the head entity, assertion relation, and tail entity from the generated assertions; searching for candidate paths in the interpretative evidence subgraph that connect the head entity and tail entity and whose relation sequence matches the relation combination rule according to the relation combination rule in the logical rule base; multiplying the extraction confidence of each relation edge in the candidate path by the rule confidence of the matched relation combination rule to obtain the path strength of the corresponding candidate path; aggregating the path strengths of multiple candidate paths according to noise or logic to obtain the structural support; and maintaining the relation combination rule and rule confidence in the logical rule base unchanged during the candidate path search and path strength aggregation. The above path strength calculation can be expressed as the following formula:

[0046] ;

[0047] In the formula, The first part of the explanatory evidence subgraph connects the head entity and the tail entity that generate the assertion. Candidate paths, This indicates the rule confidence level corresponding to the relationship combination rule matched by the candidate path. , Indicate candidate path A relation edge on, This represents the extraction confidence level of the relation edge written in the subgraph construction step. This represents the product of the extraction confidence scores of each relation edge on the candidate path. After obtaining the path strength of each candidate path, the system aggregates multiple candidate paths according to noise or logic to obtain the final structural support, which can be expressed as:

[0048] ;

[0049] In the formula, Indicates structural support. This indicates that the corresponding terms of all candidate paths are multiplied sequentially. The meaning of noise or logical aggregation is that as long as any candidate path has high path strength, the aggregated structural support increases accordingly. This allows the structural verification step to still provide a non-zero structural support even when the interpretive evidence subgraph has sparsity or local extraction omissions, avoiding misjudging correct content as an illusion due to the absence of a single path. It should be noted that the above search and aggregation process only uses existing relation combination rules and rule confidences in the logical rule base for calculation, without modifying the logical rule base itself, thus ensuring that the judgment criteria used in the structural verification step remain stable.

[0050] In the semantic verification step, the system calculates the semantic similarity between the assertion concepts in the generated assertions and the document concept set to obtain a semantic consistency score. Specifically, the semantic verification step includes: generating vector representations of assertion concepts and document concepts respectively; calculating the semantic similarity between each assertion concept and each document concept in the document concept set; scaling and normalizing each semantic similarity using a temperature coefficient; determining the maximum concept matching value from the normalization results; using the maximum concept matching value as the semantic consistency score of the corresponding assertion concept; comparing the semantic consistency score with a preset semantic circuit breaker threshold; and writing out-of-distribution concept tags for assertion concepts that are below the preset semantic circuit breaker threshold. The calculation of the above semantic consistency score can be expressed as the following formula:

[0051] ;

[0052] In the formula, This represents the concept of assertion in generative assertions. Represents a collection of document concepts. This refers to a specific document concept within a set of document concepts. Representing the concept of assertion With document concept Semantic similarity between them The temperature coefficient is used to scale the similarity distribution; the denominator contains... This represents the document concepts and assertion concepts in the document concept set. The exponential values ​​of the similarity between the pairs are summed to normalize the similarity into a distribution form. The maximum value among the normalized results is used as the assertion concept. Semantic consistency score. Temperature coefficient. The smaller the value, the more concentrated the normalized distribution is on the document concepts with the highest similarity. This means that only assertion concepts that highly match the document concepts can obtain high semantic consistency scores, while assertion concepts that only have a vague association with the document concepts will be judged as out-of-distribution concepts and written into the out-of-distribution concept tag to identify semantically drifting illusory content. Out-of-distribution concepts, that is, assertion concepts with semantic consistency scores below the preset semantic circuit breaker threshold, mean that the concept fails to form a sufficient match with the existing concepts in the reference document in the vector space, and may be fabricated or confusing concepts generated during the large language model generation process.

[0053] In the text verification step, the system converts generated assertions into natural language propositions, identifies the text fragments in the text evidence corresponding to the natural language propositions, and obtains text support confidence. Specifically, the text verification step includes: converting generated assertions containing head entities, assertion relations, and tail entities into natural language propositions according to the natural language template corresponding to the assertion relations; selecting the text fragments corresponding to the natural language propositions based on the term matching degree between the natural language propositions and each text fragment in the text evidence; setting the selected text fragments as premise texts, setting the natural language propositions as texts to be verified, performing text entailment inference, obtaining text support confidence, and establishing a correspondence between text support confidence, natural language propositions, and the source indexes of the selected text fragments. The natural language proposition conversion process here involves concatenating generated assertions in the form of structured triples into declarative sentences that conform to natural language habits according to the expression template corresponding to the assertion relations. For example, a generated assertion composed of a head entity, a pathogenic relation, and a tail entity is converted into a natural language expression such as "the head entity may cause the tail entity" according to the corresponding template. The text support confidence score can be calculated using the following formula:

[0054] ;

[0055] In the formula, This represents the natural language proposition obtained from the aforementioned transformation, i.e., the text to be verified. This refers to the text fragments selected from the textual evidence based on term matching, that correspond to the natural language proposition; i.e., the premise text. This represents a textual entailment inference function used to determine the implications of the given text. The text to be verified under the condition that it is true The probability of its validity is the text support confidence score. The text verification step, as a supplement to the structure verification step, is used to handle implicit relationships that the structured extraction model failed to extract but that do exist in the original text fragments, thus avoiding the misjudgment of actual, verifiable content as illusions due to the limitations of structured extraction.

[0056] After obtaining the three sub-scores—structural support, semantic consistency score, and text support confidence score—the system executes a fusion determination step. This step compares the semantic consistency score with a semantic circuit breaker threshold. For assertions that do not trigger semantic circuit breaker, the system fuses the structural support, semantic consistency score, and text support confidence score to obtain a comprehensive consistency score. Specifically, the fusion determination step includes: first, comparing the semantic consistency score with a preset semantic circuit breaker threshold; if the semantic consistency score is lower than the preset threshold, setting the comprehensive consistency score to a preset minimum value and recording the semantic conflict type; if the semantic consistency score is not lower than the preset threshold, performing numerical smoothing on the structural support, semantic consistency score, and text support confidence score respectively, converting the processed three sub-scores to the logarithmic domain, combining them according to corresponding preset weights, and converting the combined result into a comprehensive consistency score. The numerical smoothing here refers to adding a small, positive constant to each sub-score before taking the logarithm of each sub-score to avoid the problem of logarithmic calculation failing when a sub-score is zero, thereby ensuring the numerical stability of the fusion process. The above weighted combination of logarithmic fields can be expressed as the following formula:

[0057] ;

[0058] In the formula, Indicates the overall consistency score , , These represent the preset weights of structural support, semantic consistency score, and text support confidence in the logarithmic domain weighted combination, respectively. This refers to the tiny constant added in the aforementioned numerical smoothing process. By using the semantic consistency score as a precondition and setting a separate semantic circuit breaker threshold, a circuit breaker effect can be generated on the overall consistency score when any sub-source of evidence has extremely low confidence. That is, when the semantic consistency score is lower than the semantic circuit breaker threshold, the overall consistency score is directly set to the preset minimum value and the weighted combination operation is no longer performed, thereby preventing the high values ​​of structural support or text support confidence from masking obvious semantic drift problems.

[0059] After obtaining the overall consistency score, the system executes a conflict resolution step. Based on the combination of the overall consistency score and the scores of each sub-item, the conflict type is determined, and the explanatory evidence subgraph of the current session is updated or the generated assertion is adjusted according to the conflict type. Specifically, the conflict resolution step includes: when the text support confidence is higher than a first text threshold and the structural support is lower than a first structural threshold, checking whether there is a relation edge in the explanatory evidence subgraph corresponding to the generated assertion; if the relation edge does not exist, adding the corresponding relation edge to the explanatory evidence subgraph of the current session based on the text fragment; if the relation edge exists and its extraction confidence is lower than a preset confidence threshold, adjusting the confidence of the relation edge based on the text support confidence; when the text support confidence is lower than a second text threshold and the structural support is higher than a second structural threshold, performing weight reduction or pruning on the relation edges in the candidate paths; when the semantic consistency score is lower than a semantic circuit breaker threshold, selecting a document concept adjacent to the out-of-distribution concept from the document concept set to replace the out-of-distribution concept; when the structural support, semantic consistency score, and text support confidence are all lower than their respective thresholds, expanding the retrieval scope of the reference documents or generating a rejection instruction. The four processing methods described above correspond to four different types of conflict: The first type of conflict manifests as high textual support confidence but low structural support. This is usually caused by omissions in the extraction of implicit relations from textual evidence by the structured extraction model. In this case, the evidence reflected by the textual support confidence should be taken as the standard, and the explanatory evidence subgraph should be partially completed. The second type of conflict manifests as low textual support confidence but high structural support. This is usually caused by the presence of incorrectly extracted relation edges in the explanatory evidence subgraph, leading the structure verification step to derive higher structural support based on erroneous evidence. In this case, the corresponding relation edges should be... To prevent inferences from being self-consistent with erroneous evidence, the following measures should be taken: First, reduce the weight of the generated assertion or prune the data to avoid inferences from being self-consistent with erroneous evidence. Second, the third type of conflict manifests as a semantic consistency score below the semantic circuit breaker threshold. This is usually caused by a fabrication or serious deviation between the concept in the generated assertion and an existing concept in the reference document. In this case, a concept adjacent to the off-distribution concept in the document's concept set should be used to replace it. Third, the fourth type of conflict manifests as all three sub-item scores being at a low level, indicating that the current reference document is insufficient to support or refute the generated assertion. In this case, the search scope should be expanded to obtain new reference documents, or a rejection instruction should be generated directly to avoid making misjudgments due to insufficient evidence.

[0060] Furthermore, when performing edge addition, confidence adjustment, edge weight reduction, or edge pruning on the explanatory evidence subgraph, the effective scope of the corresponding update operation is limited to the current session period, and the edge attributes before the update, the edge attributes after the update, and the source index of the text fragment on which the update is based are recorded; the update operation is not written to the logical rule base; after completing the explanatory evidence subgraph update, the structural verification step, semantic verification step, text verification step, and fusion judgment step are re-executed to obtain the updated comprehensive consistency score. Limiting the effective scope of the subgraph update operation to the current session period means that the above-mentioned operations such as adding edge, adjusting confidence, weight reduction, or pruning only affect the explanatory evidence subgraph constructed in the current session, and will not be written to the logical rule base and affect other sessions or subsequent queries, thereby avoiding the spread of extraction errors in a certain generated content to the global judgment standard through rule base updates, thus forming rule pollution. At the same time, the recording of edge attributes and source indexes before and after the update makes each adjustment performed in the conflict repair step traceable, which is convenient for subsequent review of the judgment results. After completing the subgraph update, the four steps of structural verification, semantic verification, text verification, and fusion judgment are re-executed. This enables the generation of a comprehensive consistency score that matches the current evidence state even when local changes occur in the evidence, thus forming a closed-loop processing flow for detection and repair.

[0061] Corresponding to the above method, the present invention also provides a retrieval enhancement generation illusion detection and repair system based on the fusion of interpretive evidence subgraphs and multi-source confidence scores. The system comprises: an evidence processing module configured to acquire reference documents related to the user query, preprocess the reference documents, and perform entity normalization; a subgraph construction module configured to extract entity relationships from textual evidence and establish an interpretive evidence subgraph containing extraction confidence scores and original source indexes; a structure verification module configured to determine candidate paths corresponding to the generated assertions based on an unchanging logical rule base and generate structural support scores; a semantic verification module configured to generate semantic consistency scores based on the semantic similarity between the assertion concept and the document concept set; a text verification module configured to convert the generated assertions into natural language propositions and generate text support confidence scores based on the corresponding text fragments; a fusion judgment module configured to perform semantic circuit breaking judgment and fuse the three categories of sub-scores that have not triggered semantic circuit breaking; and a conflict repair module configured to update the interpretive evidence subgraph of the current session or adjust the generated assertions based on the combination relationship of the three categories of sub-scores. The seven modules mentioned above correspond to the aforementioned method steps in terms of data flow: the evidence processing module passes the acquired textual evidence and document concept set to the subgraph construction module; the subgraph construction module passes the established interpretive evidence subgraph to the structure verification module, semantic verification module, and text verification module respectively, and the three modules execute their respective verification processes in parallel; the structure verification module, semantic verification module, and text verification module each pass the obtained structural support, semantic consistency score, and text support confidence score to the fusion judgment module; after generating the comprehensive consistency score, the fusion judgment module passes the conflict type to the conflict repair module, which performs the corresponding update or adjustment and feeds back the update result to the interpretive evidence subgraph maintained by the subgraph construction module, forming a closed loop.

[0062] Furthermore, the system also includes a rule storage unit and a session subgraph storage unit. The rule storage unit stores the logical rule base and provides relation combination rules and rule confidence to the structure verification module. The session subgraph storage unit stores explanatory evidence subgraphs, relation edge attributes, and original source indexes according to session identifiers. The conflict resolution module writes the results of relation edge addition, confidence adjustment, relation edge weight reduction, or relation edge pruning into the session subgraph storage unit, while keeping the logical rule base in the rule storage unit unchanged. The fusion judgment module associates the three types of sub-item scores and the overall consistency score with the same generated assertion identifier and sends the conflict type to the conflict resolution module. The separate setting of the rule storage unit and the session subgraph storage unit allows the logical rule base to be maintained independently of specific sessions, while the explanatory evidence subgraphs corresponding to each session are stored separately according to session identifiers without interference. This achieves the technical effect emphasized in the aforementioned conflict resolution steps—limiting the update scope to the current session cycle and not writing to the logical rule base—at the system level. The three categories of sub-item scores and the overall consistency score are associated with the generated assertion identifier for storage. This facilitates the subsequent tracing and querying of historical judgment results for the same generated assertion, and also makes it easier to accurately locate the corresponding generated assertion when recalculating the overall consistency score after the subgraph is updated.

[0063] Through the collaborative work of the aforementioned evidence processing, subgraph construction, structural verification, semantic verification, text verification, fusion judgment, and conflict repair steps or modules, this invention achieves multi-source cross-validation of generated assertions while preserving the uncertainty information in the interpretive evidence subgraph. When evidence conflicts are detected, dynamic repair limited to the current session is performed according to the conflict type, avoiding the impact of the repair process on the global judgment criteria. Thus, while improving the retrieval enhancement generation system's ability to accommodate unstructured evidence, the logical rigor of the hallucination detection and repair process is ensured.

[0064] The above description is merely a specific 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.

[0065] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A retrieval enhancement-based generation hallucination detection and repair method based on the fusion of interpretive evidence subgraphs and multi-source confidence, characterized in that, include: The evidence processing steps include obtaining reference documents related to the user's query, preprocessing and normalizing the reference documents to obtain text evidence and a set of document concepts. The subgraph construction steps involve extracting entity relationships from textual evidence and building an interpretive evidence subgraph, as well as extracting confidence scores and original source indexes for each relationship edge. The structural verification step determines the candidate paths corresponding to the generated assertions based on a pre-set and unchanging logical rule base, and generates structural support based on the extraction confidence of relation edges within the candidate paths and the rule confidence. The semantic verification step calculates the semantic similarity between the assertion concepts in the generated assertions and the document concept set to obtain a semantic consistency score. The text verification step converts the generated assertions into natural language propositions, identifies the text fragments in the text evidence that correspond to the natural language propositions, and obtains the text support confidence score. The fusion judgment step compares the semantic consistency score with the semantic circuit breaking threshold, and merges the structural support, semantic consistency score and text support confidence of the generation assertion that did not trigger semantic circuit breaking to obtain a comprehensive consistency score. The conflict resolution steps involve determining the conflict type based on the overall consistency score and the combination relationship of each sub-item score, and updating the explanatory evidence subgraph of the current session or adjusting the generated assertions according to the conflict type.

2. The method for detecting and repairing illusions based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 1, characterized in that, The fusion determination step includes: first, comparing the semantic consistency score with a preset semantic circuit breaker threshold; when the semantic consistency score is lower than the preset semantic circuit breaker threshold, setting the overall consistency score to a preset minimum value and recording the semantic conflict type; when the semantic consistency score is not lower than the preset semantic circuit breaker threshold, performing numerical smoothing on the structural support, semantic consistency score, and text support confidence respectively, converting the three sub-scores after processing to the logarithmic domain, combining them according to the corresponding preset weights, and converting the combination result into an overall consistency score.

3. The method for detecting and repairing hallucinations based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 2, characterized in that, The conflict resolution steps include: when the text support confidence score is higher than a first text threshold and the structural support score is lower than a first structural threshold, checking whether there is a relation edge in the explanatory evidence subgraph corresponding to the generated assertion; when the relation edge does not exist, adding the corresponding relation edge in the explanatory evidence subgraph of the current session according to the text fragment; when the relation edge exists and its extraction confidence score is lower than a preset confidence threshold, adjusting the confidence score of the relation edge according to the text support confidence score; when the text support confidence score is lower than a second text threshold and the structural support score is higher than a second structural threshold, performing weight reduction or pruning on the relation edges in the candidate path; when the semantic consistency score is lower than the semantic circuit breaking threshold, selecting a document concept adjacent to the out-of-distribution concept from the document concept set to replace the out-of-distribution concept; when the structural support score, semantic consistency score, and text support confidence score are all lower than their respective corresponding thresholds, expanding the retrieval scope of the reference documents or generating a rejection instruction.

4. The method for detecting and repairing hallucinations based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 3, characterized in that, When performing relation edge addition, confidence adjustment, relation edge weight reduction, or relation edge pruning on the explanatory evidence subgraph, the effective scope of the corresponding update operation is limited to the current session period, and the relation edge attributes before the update, the relation edge attributes after the update, and the source index of the text fragment on which the update is based are recorded; the update operation is not written to the logical rule base; after the explanatory evidence subgraph is updated, the structural verification step, semantic verification step, text verification step, and fusion judgment step are re-executed to obtain the updated comprehensive consistency score.

5. The method for detecting and repairing illusions based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 1, characterized in that, The evidence processing steps and subgraph construction steps include: cleaning and segmenting the reference document, identifying entity candidates in each text segment, and mapping entity candidates that express different meanings but point to the same concept to standard concepts; extracting relation information consisting of head entities, relation types, and tail entities from the text evidence that has been normalized, setting the head entities and tail entities as graph nodes, setting the relation types as relation edges, and writing the extraction confidence and the source index of the corresponding text segment into the relation edge attributes; for relation edges with an extraction confidence lower than a preset retention threshold, retaining the relation edges and writing a low confidence marker.

6. The method for detecting and repairing illusions based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 5, characterized in that, The structural verification step includes: determining the head entity, assertion relation, and tail entity from the generated assertions; searching for candidate paths in the interpretive evidence subgraph that connect the head entity and tail entity and whose relation sequence matches the relation combination rule according to the relation combination rule in the logical rule base; multiplying the extraction confidence of each relation edge in the candidate path by the rule confidence of the matched relation combination rule to obtain the path strength of the corresponding candidate path; aggregating the path strengths of multiple candidate paths according to noise or logic to obtain the structural support; and keeping the relation combination rule and rule confidence in the logical rule base unchanged during the candidate path search and path strength aggregation.

7. The method for detecting and repairing illusions based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 1, characterized in that, The semantic verification step includes: generating vector representations of assertion concepts and document concepts respectively; calculating the semantic similarity between each assertion concept and each document concept in the document concept set; scaling and normalizing each semantic similarity using a temperature coefficient; determining the maximum concept matching value from the normalization results; using the maximum concept matching value as the semantic consistency score of the corresponding assertion concept; comparing the semantic consistency score with a preset semantic circuit breaking threshold; and writing out-of-distribution concept tags for assertion concepts that are lower than the preset semantic circuit breaking threshold.

8. The method for detecting and repairing illusions based on the fusion of interpretive evidence subgraphs and multi-source confidence as described in claim 1, characterized in that, The text verification steps include: converting generated assertions containing head entities, assertion relations, and tail entities into natural language propositions according to the natural language templates corresponding to assertion relations; selecting text segments corresponding to natural language propositions based on the term matching degree between natural language propositions and text segments in text evidence; setting the selected text segments as premise texts, setting the natural language propositions as texts to be verified, performing text implication reasoning, obtaining text support confidence, and establishing a correspondence between text support confidence, natural language propositions, and source indexes of the selected text segments.

9. A retrieval-enhanced generative hallucination detection and repair system based on the fusion of interpretive evidence subgraphs and multi-source confidence, characterized in that, include: The evidence processing module is configured to acquire reference documents related to the user's query, and to preprocess and normalize the reference documents. The subgraph building module is configured to extract entity relations from textual evidence and build an interpretive evidence subgraph that includes extraction confidence and original source index. The structure verification module is configured to determine the candidate paths corresponding to the generated assertions and generate structure support based on an invariant logical rule base. The semantic verification module is configured to generate a semantic consistency score based on the semantic similarity between asserted concepts and the document concept set. The text validation module is configured to convert generated assertions into natural language propositions and generate text support confidence scores based on the corresponding text fragments. The fusion judgment module is configured to perform semantic circuit breaking judgment and fuse the three categories of sub-scores that have not triggered semantic circuit breaking; The conflict resolution module is configured to update the explanatory evidence subgraph of the current session or adjust the generated assertions based on the combination relationship of the three categories of sub-scores.

10. The retrieval enhancement generation hallucination detection and repair system based on interpretive evidence subgraphs and multi-source confidence fusion according to claim 9, characterized in that, It also includes rule storage units and session subgraph storage units; The rule storage unit stores the logical rule base and provides the structure verification module with relation combination rules and rule confidence. The session subgraph storage unit stores the explanatory evidence subgraph, relation edge attributes and original source index according to the session identifier. The conflict resolution module writes the results of relation edge addition, confidence adjustment, relation edge weight reduction or relation edge pruning into the session subgraph storage unit, and keeps the logical rule base in the rule storage unit unchanged. The fusion judgment module associates the three categories of sub-item scores and the overall consistency score with the same generated assertion identifier, and sends the conflict type to the conflict repair module.