Intelligent reasoning method and system based on adversarial thinking chain and dynamic traceability, electronic device and storage medium
Patent Information
- Application Number
- CN202610818303.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-08
- Publication Date
- 2026-09-18
AI Technical Summary
[0008]本发明的目的在于提供一种基于对抗性思维链与动态溯源的智能推理方法、系统、电子设备及存储介质,以解决现有技术中存在的推理错位、检索谄媚、合成幻觉和静态流水线等问题
提升推理准确性:通过引入对抗性思维链机制,实现了在生成过程中的实时推理验证,有效解决了推理错位问题,确保生成内容的逻辑严密性;
Smart Images

Figure CN122779262A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to an intelligent reasoning method, system, electronic device and storage medium based on adversarial thinking chain and dynamic tracing, and particularly to a reasoning verification and dynamic tracing technology applied to a retrieval-augmented generation (RAG) system. Background Technology
[0002] With the widespread application of Large Language Models (LLMs) in various fields, the accuracy and factual consistency of model-generated content have become critical issues. In existing technologies, Retrieval Augmentation (RAG) improves the reliability of model responses by introducing external knowledge bases, but the following technical problems still exist: 1. Reasoning Misalignment Problem: Standard RAG processes often fail to ensure that the model's reasoning is consistent with the retrieved evidence, resulting in a "reasoning misalignment" phenomenon, where the model deviates from the retrieved evidence during the generation process.
[0003] 2. Search flattery problem: Existing search engines often exhibit "search flattery", that is, they tend to search for evidence that supports the user's premise, even if the user's premise is wrong, and lack the initiative to search for contradictory evidence.
[0004] 3. Synthetic illusion problem: The model is prone to piecing together multiple real-fact errors to generate content that seems reasonable but is actually wrong. Traditional fragment-level citations cannot effectively identify this synthetic illusion.
[0005] 4. Static pipeline problem: Most existing RAGs adopt a linear "retrieval -> reading -> writing" process, lacking the ability to dynamically adjust and self-evolve.
[0006] To address these issues, existing technologies have proposed several improvements. For example, the RAG+CoT method incorporates thought chain reasoning, but verification is only performed after generation, failing to guarantee consistency in the reasoning process. The AlignRAG framework introduces a critical alignment mechanism, but it remains a test-time optimization and cannot prevent erroneous reasoning in real time during generation. FVA-RAG mitigates the illusion of flattery through proof by contradiction, but it primarily focuses on post-generation verification, lacking dynamic adjustments to the reasoning process.
[0007] Therefore, an intelligent reasoning method is needed that can achieve real-time reasoning verification, dynamic source tracing and annotation, and self-evolution to solve the above-mentioned problems in existing technologies. Summary of the Invention
[0008] The purpose of this invention is to provide an intelligent reasoning method, system, electronic device, and storage medium based on adversarial thinking chain and dynamic tracing, so as to solve the problems of reasoning misalignment, retrieval flattery, synthetic illusion and static pipeline in the prior art.
[0009] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of this invention discloses an intelligent reasoning method based on adversarial thought chain and dynamic tracing, comprising the following steps: Step 1: Obtain the query request input by the user, and generate initial inference hypotheses based on the query request; Step 2: Perform multi-source evidence retrieval to obtain multiple evidence fragments related to the initial inference hypothesis, including supporting evidence and counter-evidence; Step 3: The reasoning path is iteratively verified using an adversarial thinking chain mechanism. The iterative verification includes a construction phase, a challenge phase, and a correction phase, and the construction phase, challenge phase, and correction phase form an alternating cycle. (1) During the construction phase, a preliminary reasoning path is generated based on the evidence fragments; (2) In the challenge phase, based on the evidence fragments, a falsification attack is performed on the preliminary reasoning path to identify logical loopholes or counterexamples; (3) In the correction phase, if no logical flaws, conflicting evidence or counterexamples are found in the challenge phase that are sufficient to overturn the initial reasoning path, the corresponding reasoning node is confirmed; Step 4: Evaluate the credibility of the revised reasoning path; When the credibility meets the preset credibility threshold, the final answer is generated based on the evaluated search results and confirmed inference nodes; during or after the generation of the final answer, the corresponding dynamic source information is automatically marked. When the credibility does not meet the preset credibility threshold, a strategic forgetting is performed, the current inference cache is cleared, a reverse retrieval query is generated based on the identified cognitive bias features, and the process returns to step two to re-execute evidence retrieval and inference verification.
[0010] Furthermore, the annotation of the dynamic source information includes: During the process of generating text fragments, a semantic similarity model is used to calculate the semantic coupling degree between the generated text fragments and each source document being retrieved; Based on the semantic coupling degree, weighted reference identifiers are assigned to the generated text fragments in real time. The weighted reference identifiers represent the weight combination of each source document, where the weights are positively correlated with the semantic coupling degree. When it is detected that the generated content is composed of information fragments from at least two different source documents through logical deduction, a synthetic evidence chain is generated. The synthetic evidence chain records the intermediate steps in the reasoning process and their corresponding source document identifiers.
[0011] Furthermore, the strategic forgetting includes the following sub-steps: Identify cognitive bias features in the current reasoning path, wherein the cognitive bias features include at least one of confirmation bias, availability bias, or logical jump; Based on the aforementioned cognitive bias characteristics, a reverse retrieval query is generated through templated queries or based on prompts from a large language model. The reverse retrieval query is used to actively search for counter-evidence or counterexamples in the knowledge base that can correct the bias.
[0012] Furthermore, after generating the dynamic citation source information, the method further includes: generating a knowledge reorganization heatmap, which graphically displays the association weights between the semantic fragments of the generated text and different source documents, as well as the degree of contribution of each source document to the final answer content.
[0013] A second aspect of the present invention also provides an intelligent reasoning system based on adversarial thought chain and dynamic tracing, comprising: User interface module 1 is used to receive query requests input by users and return the final answer content; Assumption generation module 2, connected to the user interface module 1, is used to generate initial inference hypotheses based on query requests; Evidence retrieval module 3, connected to hypothesis generation module 2, is used to perform multi-source evidence retrieval and obtain multiple evidence fragments; The adversarial verification module 4 is connected to the evidence retrieval module 3 and is used to verify the reasoning path using an adversarial thought chain mechanism. Content generation module 5, connected to the adversarial verification module 4, is used to generate the final answer content based on the verified inference nodes; The source tracing and annotation module 6 is connected to the content generation module 5 and is used to automatically annotate the corresponding dynamic source information during or after the generation of the final answer content. The forgetting and evolution module 7, connected to the adversarial verification module 4, is used to perform strategic forgetting and generate a reverse retrieval query when the reasoning path does not meet the preset threshold. The forgetting and evolution module 7 and the evidence retrieval module 3 form a closed-loop feedback connection to re-execute the evidence retrieval based on the reverse retrieval query.
[0014] Furthermore, the adversarial verification module 4 includes: Construction unit 41 is used to generate a preliminary reasoning path based on the evidence fragments obtained from the retrieval; Challenge unit 42 is used to perform a falsification attack on the preliminary reasoning path based on evidence fragments and to identify logical loopholes or counterexamples; The correction unit 43 is used to correct the inference path based on the verification results of the challenge unit 42, and to confirm the inference node when no overturning vulnerability is found.
[0015] A third aspect of the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements any of the methods disclosed in the first aspect of the present invention.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods disclosed in the first aspect of the present invention.
[0017] Compared with the prior art, the present invention has the following advantages: Improve reasoning accuracy: By introducing an adversarial thinking chain mechanism, real-time reasoning verification is achieved during the generation process, effectively solving the problem of reasoning misalignment and ensuring the logical rigor of the generated content; Reduce synthetic illusions: Employing a dynamic reference annotation algorithm based on semantic weights, it can accurately identify and annotate content synthesized from multi-source information, effectively solving the problem of synthetic illusions; Enhanced system robustness: Through the "builder-challenger" adversarial mechanism, the system can internally discover and correct potential logical loopholes, improving the reliability and consistency of the answers; Achieving self-evolution: Introducing a meta-retrieval mechanism based on cognitive bias, enabling the system to "learn from its mistakes" and dynamically optimize retrieval strategies based on historical errors; Provides visual traceability: Generates knowledge reorganization heatmaps, providing users with intuitive traceability information and enhancing the system's transparency and credibility; Closed-loop feedback optimization: Through the closed-loop feedback connection between the forgetting and evolution module and the evidence retrieval module, the retrieval strategy can be continuously self-optimized. Attached Figure Description
[0018] Figure 1 This is a flowchart of the intelligent reasoning method in an embodiment of the present invention; Figure 2 This is a schematic diagram of the architecture of the intelligent reasoning system in an embodiment of the present invention.
[0019] In the diagram: 1. User interface module; 2. Hypothesis generation module; 3. Evidence retrieval module; 4. Adversarial verification module; 41. Construction unit; 42. Challenge unit; 43. Correction unit; 5. Content generation module; 6. Source tracing and annotation module; 7. Forgetting and evolution module. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Example
[0021] The present invention provides an intelligent reasoning system based on adversarial thinking chain and dynamic tracing, comprising the following modules: User interface module 1 is used to receive query requests input by users and return the final answer; this module is the interaction entry point between the system and external users.
[0022] Assumption generation module 2, connected to user interface module 1, is used to generate initial inference hypotheses based on query requests. This module can use a large language model to generate initial hypotheses. For example, given the query "Does drug X cause high blood pressure?", the initial hypothesis "Drug X causes high blood pressure" is generated.
[0023] Evidence retrieval module 3, connected to hypothesis generation module 2, is used to perform multi-source evidence retrieval and obtain multiple evidence fragments. This module supports a combination of support vector retrieval (such as FAISS) and key retrieval (such as BM25) to retrieve relevant document fragments from the knowledge base and actively retrieve supporting and opposing evidence.
[0024] The adversarial verification module 4, connected to the evidence retrieval module 3, is used to verify the reasoning path using an adversarial thinking chain mechanism. This module includes a construction unit 41, a challenge unit 42, and a correction unit 43, which form an alternating cycle of "construction-challenge-correction".
[0025] Content generation module 5, connected to adversarial verification module 4, is used to generate the final answer content based on the verified inference nodes.
[0026] The source tracing and annotation module 6, connected to the content generation module 5, is used to automatically annotate the corresponding dynamic source information during or after the generation of the final answer content.
[0027] The Forgetting and Evolution Module 7, connected to the Adversarial Verification Module 4, is used to perform strategic forgetting and generate a reverse retrieval query when the reasoning path does not meet the preset threshold. This module forms a closed-loop feedback connection with the Evidence Retrieval Module 3 to re-execute the evidence retrieval based on the reverse retrieval query.
[0028] Among them, the adversarial verification module 4 includes: Construction unit 41 is used to generate a preliminary reasoning path based on the evidence fragments obtained from the retrieval; Challenge Unit 42 is used to perform falsification attacks on the initial reasoning path based on evidence fragments and to identify logical vulnerabilities or counterexamples; The correction unit 43 is used to correct the inference path based on the verification results of the challenge unit 42, and to confirm the inference node when no overturning vulnerability is found.
[0029] Module connection relationship description (see) Figure 2 ): After a user inputs a query, it flows sequentially through the user interface module 1, hypothesis generation module 2, evidence retrieval module 3, and adversarial verification module 4. After the adversarial verification module 4 verifies the query, it sends the confirmed inference node to the content generation module 5, and then the source tracing and annotation module 6 adds a reference annotation. If the adversarial verification module 4 determines that the inference path does not meet the preset threshold, it triggers the forgetting and evolution module 7, which generates a reverse retrieval query and feeds it back to the evidence retrieval module 3, forming a closed-loop optimization circuit. Example
[0030] See Figure 1 An intelligent reasoning method based on adversarial thinking chains and dynamic tracing includes the following steps: Step 1: Hypothesis Generation The system receives natural language queries from users, preprocesses the queries (including word segmentation, entity recognition, and intent analysis), generates standardized initial retrieval queries, and generates initial inference hypotheses based on these queries. For example, if a user queries "What is the main source of revenue for Company A in 2025?", the initial inference hypothesis could be "Company A's main source of revenue in 2025 is mobile phone sales".
[0031] Step 2: Multi-source evidence retrieval Based on the initial inference assumptions, a combination of vector retrieval (such as FAISS) and key retrieval (such as BM25) is used to retrieve relevant document fragments from the knowledge base. The obtained evidence fragments include supporting and counter-evidence. The retrieval process employs a multi-granularity strategy (paragraph level and sentence level) and actively searches for counter-evidence. For example, in addition to retrieving documents supporting "mobile phones are the main source of revenue," evidence that may refute the assumption, such as "the proportion of service business is increasing," is also retrieved.
[0032] Step 3: Verification of the adversarial mind chain An adversarial thinking chain mechanism is used to iteratively verify the reasoning path. The iterative verification includes a construction phase, a challenge phase, and a correction phase, and the construction phase, challenge phase, and correction phase form an alternating cycle. Construction Phase: The problem is broken down into sub-problems, and the retrieved document fragments are anchored to nodes in the thought chain to generate an initial reasoning path. For example, for the revenue source problem, the reasoning path is "Mobile revenue accounts for X% → Service revenue accounts for Y% → Compare to determine the main source".
[0033] Challenge phase: Based on evidence fragments, perform falsification attacks on the initial reasoning path to identify logical loopholes, conflicting evidence, or counterexamples.
[0034] Correction Phase: If no logical flaws, conflicting evidence, or counterexamples are found in the challenge phase that are sufficient to overturn the initial reasoning path, the corresponding reasoning node is confirmed; otherwise, the reasoning path is corrected based on the challenge feedback, and the next cycle begins.
[0035] Step 4: Credibility Assessment The credibility of the revised inference path is evaluated. In this embodiment, the credibility evaluation comprehensively considers the following indicators: (1) Consistency score of evidence: Calculate the ratio and strength of evidence supporting the final conclusion and evidence refuting it.
[0036] (2) Logical integrity score: Check whether there are unresolved contradictions or jumps in the reasoning path.
[0037] (3) Evidence authority score: calculated by weighting the reliability of the source (such as journal level and timeliness).
[0038] The overall score is calculated as a*consistency + b*completeness + c*authority, where a+b+c=1. The preset credibility threshold can be set to 0.75.
[0039] When the overall credibility score is greater than or equal to the preset credibility threshold, the final answer is generated based on the evaluated search results and confirmed inference nodes. During or after the generation of the final answer, corresponding dynamic citation source information is automatically annotated. The specific dynamic citation annotation method is as follows: (1) In the process of generating text fragments, semantic similarity models (such as SBERT, RoBERTa, etc.) are used to calculate the semantic coupling degree between the generated text fragments and each source document being retrieved; for example, cosine_similarity(embedding(T), embedding(D)) is used to obtain the similarity score in the range of [0,1].
[0040] Based on semantic coupling, weighted reference identifiers are assigned in real time to the generated text fragments. The weighted reference identifier represents the weight combination of each source document, where the weights are positively correlated with the semantic coupling and the normalized sum is 1. For example, for the generated fragment "Mobile phone sales are still the main pillar, but service business is growing rapidly", if the coupling degree with document D1 is 0.7 and the coupling degree with document D2 is 0.3, then the reference identifier is [D1:0.7,D2:0.3].
[0041] When it is detected that the generated content is composed of information fragments from at least two different source documents through logical deduction (for example, "mobile phone revenue is 50 billion" from document D1 and "service revenue is 48 billion" from document D2, and "mobile phone revenue is slightly higher than service industry revenue"), a synthetic evidence chain is generated. The synthetic evidence chain records the intermediate steps in the reasoning process and their corresponding source document identifiers.
[0042] (2) After generating dynamic citation source information, the system generates a knowledge reorganization heatmap. The knowledge reorganization heatmap graphically displays the association weights between semantic fragments of the generated text and different source documents, as well as the contribution of each source document to the final answer. The heatmap can be in the form of a color matrix or a Sankey diagram. Users can click on the heatmap area in the interactive interface to view the specific source.
[0043] When the overall credibility score is less than the preset credibility threshold, a strategic forgetting is performed, the current inference cache is cleared, a reverse retrieval query is generated based on the identified cognitive bias features, and the process returns to step two to re-execute evidence retrieval and inference verification. The specific steps are as follows: (1) Clear the reasoning cache: Delete the current state data and intermediate results of the thought chain.
[0044] (2) Identification of cognitive bias characteristics: Analyzing the characteristics of failed reasoning paths, including but not limited to: Confirmation bias: Reasoning relies too heavily on evidence that supports the initial hypothesis and ignores opposing evidence.
[0045] Availability bias: Evidence that is easily retrieved but not representative is used.
[0046] Logical leaps: The reasoning steps lack necessary intermediate evidence.
[0047] The identification method can use an LLM-based bias classifier, which takes the inference path text as input and outputs the bias type label and confidence level.
[0048] (3) Reverse retrieval query generation: Based on the identified cognitive bias features, reverse retrieval queries are generated through templated queries or based on large language model prompts. For example: If confirmation bias is detected, generate either "evidence refuting the null hypothesis" or "counterexamples to the null hypothesis".
[0049] If a logical jump is detected, generate "information related to 'missing intermediate evidence'".
[0050] (4) Re-retrieval: The reverse retrieval query is sent to the evidence retrieval module to actively search for evidence that can correct the bias, and then jumps to step two to re-execute the evidence retrieval and reasoning verification. The forgetting and evolution module and the evidence retrieval module form a closed-loop feedback until the credibility reaches the standard or the maximum number of retries is reached. Example
[0051] The present invention also provides an electronic device, including a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements any one or more steps in the above method embodiments. The processor may be a central processing unit (CPU), a graphics processing unit (GPU), or an application-specific integrated circuit (ASIC). The memory may be a read-only memory (ROM), random access memory (RAM), flash memory, or a hard disk, etc. Example
[0052] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one or more steps in the above method embodiments. The storage medium can be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory, random access memory, magnetic disk, or optical disk.
[0053] This invention can be applied to fields requiring the generation of highly credible information, such as intelligent question-answering systems, chatbots, medical auxiliary diagnosis, and legal document analysis. It can effectively improve the accuracy and traceability of the generated content and has broad prospects for industrial applications.
[0054] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art can make various improvements and modifications without departing from the spirit and principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An intelligent reasoning method based on adversarial thinking chains and dynamic tracing, characterized in that, Includes the following steps: Step 1: Obtain the query request input by the user, and generate initial inference hypotheses based on the query request; Step 2: Perform multi-source evidence retrieval to obtain multiple evidence fragments related to the initial inference hypothesis, including supporting evidence and counter-evidence; Step 3: The reasoning path is iteratively verified using an adversarial thinking chain mechanism. The iterative verification includes a construction phase, a challenge phase, and a correction phase, and the construction phase, challenge phase, and correction phase form an alternating cycle. (1) During the construction phase, a preliminary reasoning path is generated based on the evidence fragments; (2) In the challenge phase, based on the evidence fragments, a falsification attack is performed on the preliminary reasoning path to identify logical loopholes or counterexamples; (3) In the correction phase, if no logical flaws, conflicting evidence or counterexamples are found in the challenge phase that are sufficient to overturn the initial reasoning path, the corresponding reasoning node is confirmed; Step 4: Evaluate the credibility of the revised reasoning path; When the credibility meets the preset credibility threshold, the final answer is generated based on the evaluated search results and confirmed inference nodes; during or after the generation of the final answer, the corresponding dynamic source information is automatically marked. When the credibility does not meet the preset credibility threshold, a strategic forgetting is performed, the current inference cache is cleared, a reverse retrieval query is generated based on the identified cognitive bias features, and the process returns to step two to re-execute evidence retrieval and inference verification.
2. The method according to claim 1, characterized in that, The annotation of the dynamic source information includes: During the process of generating text fragments, a semantic similarity model is used to calculate the semantic coupling degree between the generated text fragments and each source document being retrieved; Based on the semantic coupling degree, weighted reference identifiers are assigned to the generated text fragments in real time. The weighted reference identifiers represent the weight combination of each source document, where the weights are positively correlated with the semantic coupling degree. When it is detected that the generated content is composed of information fragments from at least two different source documents through logical deduction, a synthetic evidence chain is generated. The synthetic evidence chain records the intermediate steps in the reasoning process and their corresponding source document identifiers.
3. The method according to claim 1, characterized in that, The strategic forgetting includes the following sub-steps: Identify cognitive bias features in the current reasoning path, wherein the cognitive bias features include at least one of confirmation bias, availability bias, or logical jump; Based on the aforementioned cognitive bias characteristics, a reverse retrieval query is generated through templated queries or based on prompts from a large language model. The reverse retrieval query is used to actively search for counter-evidence or counterexamples in the knowledge base that can correct the bias.
4. The method according to claim 1, characterized in that, After generating dynamic citation source information, the method further includes: generating a knowledge reorganization heatmap, which graphically displays the association weights between semantic fragments of the generated text and different source documents, as well as the degree of contribution of each source document to the final answer content.
5. An intelligent reasoning system based on adversarial thinking chain and dynamic tracing, characterized in that, include: The user interface module (1) is used to receive query requests input by users and return the final answer content; The hypothesis generation module (2) is connected to the user interface module (1) and is used to generate initial inference hypotheses based on query requests; The evidence retrieval module (3) is connected to the hypothesis generation module (2) and is used to perform multi-source evidence retrieval and obtain multiple evidence fragments; The adversarial verification module (4) is connected to the evidence retrieval module (3) and is used to verify the reasoning path using an adversarial thinking chain mechanism; The content generation module (5) is connected to the adversarial verification module (4) and is used to generate the final answer content based on the inference node that has passed the verification. The source tracing and annotation module (6) is connected to the content generation module (5) and is used to automatically annotate the corresponding dynamic source information during the generation of the final answer content or after the content is generated. The forgetting and evolution module (7) is connected to the adversarial verification module (4) and is used to perform strategic forgetting and generate a reverse retrieval query when the reasoning path does not meet the preset threshold. The forgetting and evolution module (7) and the evidence retrieval module (3) form a closed-loop feedback connection to re-execute the evidence retrieval based on the reverse retrieval query.
6. The system according to claim 5, characterized in that, The adversarial verification module (4) includes: Construction unit (41) is used to generate a preliminary reasoning path based on the evidence fragments obtained from the retrieval; The challenge unit (42) is used to perform a falsification attack on the preliminary reasoning path based on evidence fragments and to identify logical vulnerabilities or counterexamples; The correction unit (43) is used to correct the reasoning path based on the verification results of the challenge unit (42) and confirm the reasoning node when no overturning vulnerability is found.
7. An electronic device comprising a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements the method of any one of claims 1-4.
8. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any one of claims 1-4.