Multi-step retrieval enhancement generation system optimization method based on inference chain evolution mechanism
By introducing a multi-step RAG system with an evolutionary reasoning chain mechanism, the problems of information loss and logical inconsistency in traditional large language models in complex reasoning tasks are solved. This achieves an efficient and accurate multi-step reasoning process, improving the reasoning accuracy and interpretability of cross-document question answering and knowledge-intensive tasks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN UNIV
- Filing Date
- 2026-01-09
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional large language models suffer from information gaps and logical inconsistencies when faced with problems that are highly factual, timely, or complex across documents. Existing RAG systems struggle to handle complex multi-hop reasoning tasks and suffer from problems such as a lack of global control over reasoning and information redundancy leading to reasoning drift.
A multi-step RAG system based on the inference chain evolution mechanism is introduced. Through structured modeling, global inference control and dynamic node optimization, a dynamically evolving inference chain is constructed to achieve global modeling and structured control of the inference process. It can proactively identify key nodes that hinder problem solving and perform targeted retrieval and optimization.
It significantly improves the accuracy of multi-hop reasoning, suppresses error accumulation and reasoning drift, enhances interpretability and traceability, and improves the targeting and computational efficiency of retrieval.
Smart Images

Figure CN122021880A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, and in particular relates to an optimization method for a multi-step retrieval enhancement generation system based on inference chain evolution. Background Technology
[0002] With the rapid development of large language models, they have demonstrated powerful language understanding and expression capabilities in tasks such as text generation, question answering systems, and knowledge extraction. However, traditional large language models rely on internal parameters to store knowledge, and when faced with problems that are highly factual, time-sensitive, or have complex cross-document relationships, they often experience information gaps and "illusion generation" phenomena, leading to inaccurate results or logical inconsistencies.
[0003] To address this issue, RAG technology introduces an external knowledge retrieval module during the generation process, enabling the model to access external knowledge bases in real time, thereby improving the accuracy and interpretability of the generated content. Existing RAG systems perform well in tasks such as open-domain question answering, information extraction, and knowledge-assisted decision-making, but most employ single-step retrieval and generation strategies, making it difficult to handle complex multi-hop reasoning tasks and unable to establish logical connections between multiple documents or dynamically correct reasoning errors.
[0004] To enhance reasoning capabilities, researchers have proposed multi-step adaptive retrieval and reasoning methods, which decompose and solve complex problems by progressively generating new retrieval queries and updating the context. However, these methods still suffer from problems such as a lack of global control over reasoning, difficulty in tracing the reasoning chain, and reasoning drift caused by information redundancy. Summary of the Invention
[0005] To address the aforementioned shortcomings, this invention proposes a multi-step RAG system based on an evolutionary reasoning chain mechanism. Through structured modeling, global reasoning control, and dynamic node optimization, it effectively overcomes the short-sighted decision-making, error accumulation, and logical inconsistency inherent in general multi-step RAGs, providing a more robust, efficient, and interpretable solution for complex reasoning tasks.
[0006] This invention proposes an optimization scheme for a multi-step retrieval-augmented generation (RAG) system based on a chain of reasoning (CoR) evolution mechanism, aiming to improve the reasoning accuracy of RAG systems in complex multi-hop reasoning, cross-document question answering, and knowledge-intensive tasks. This invention constructs a dynamically evolving "reasoning chain" to achieve global modeling and structured control of the reasoning process, enabling the system to proactively identify key nodes hindering problem-solving and perform targeted retrieval and optimization during multi-step reasoning. Through this method, the model can continuously focus on unsolved sub-problems during reasoning, avoiding the error accumulation and problem-solving focus shift issues present in traditional step-by-step reasoning methods, thereby significantly improving reasoning efficiency and result accuracy.
[0007] The core innovation of this invention lies in proposing a "reasoning chain evolutionary" retrieval enhancement generation method, which overcomes the limitations of traditional single-step RAGs and the disadvantages of general multi-step RAGs. This method introduces a structured global reasoning chain management mechanism, enabling the system to possess self-diagnosis, self-correction, and self-optimization capabilities during multi-step retrieval and generation processes. This invention is illustrated by the following technical solution: A method for optimizing a multi-step retrieval-enhanced generation system based on an inference chain evolution mechanism, characterized by comprising the following steps: (1) Reasoning chain construction and initialization: Generate an initial reasoning chain based on the input question and initialize the question as an unverified node; (2) Global key node identification: In each iteration, a global analysis of the reasoning chain is performed to identify unverified nodes that hinder the overall reasoning progress; (3) Targeted retrieval and information integration: Based on unverified nodes, corresponding retrieval queries are generated, and evidence documents related to these unverified nodes are obtained from external knowledge bases through a sparse and dense mixed retrieval mechanism; (4) Evolution and update of reasoning chain: Input relevant evidence documents and the current reasoning chain into the large language model for fusion reasoning, generate a new reasoning chain, and verify and update the node status; (5) Termination of reasoning and generation of answer: When all nodes are verified or the preset number of iterations is reached, the system outputs the final reasoning result.
[0008] Furthermore, the initialization of the inference chain is represented as follows: Construct an initial inference chain based on the input question. ,in: The question entered by the user is a string. For strings This indicates that the node is initialized as an unverified node.
[0009] Furthermore, the inference chain Structural representation: ,in Denotes the reasoning chain at step t. This represents the j-th inference node at step t, and is a string. This represents the state of the j-th node at step t. For enumerated string types, it has and Two states, where state is The nodes are those that have been verified as facts by the large language model, and the states are... The nodes are unverified nodes determined by the large language model.
[0010] Furthermore, step 3, which involves generating a corresponding retrieval query based on the unverified node using a large language model, and then retrieving evidence documents related to the node from an external knowledge base using a sparse and dense hybrid retrieval mechanism, includes: Will The state of the node in the inference chain is Unverified nodes are identified one by one. Based on the user's original question and the context nodes of that node, a retrieval query is heuristically generated using a large language model. Relevant evidence documents are then retrieved using a hybrid sparse and dense retrieval mechanism, denoted as . ; Utilizing large language models, it is made to base its analysis on relevant evidence documents. Heuristically Transform into the next inference chain Among them, the large language model generates The state labels of all nodes in the language model are determined by the large language model based on relevant evidence documents. and The node information is generated one by one.
[0011] The beneficial effects of this invention are : 1. Improve the accuracy of multi-hop reasoning: Improve the final answer accuracy of cross-document evidence aggregation and multi-step reasoning through structured reasoning chains and iterative retrieval-verification-update processes.
[0012] 2. Suppressing error accumulation and inference drift: Introducing global control and drift constraints significantly reduces the risk of early errors spreading to subsequent steps.
[0013] 3. Enhance interpretability and traceability: Explicitly present intermediate conclusions as nodes and record supporting evidence and confidence levels to facilitate auditing, debugging, and explaining the source of the reasoning path to users.
[0014] 4. Improve search targeting and computational efficiency: Target key unverified nodes to reduce the introduction of irrelevant information and redundant iterations, thereby improving evidence utilization and saving unnecessary computational overhead. Attached Figure Description
[0015] Figure 1 The system architecture diagram of this solution is shown below, and will be described in detail in the next section on specific implementation methods. Detailed Implementation
[0016] like Figure 1 As shown, this invention provides an optimization scheme for a multi-step retrieval enhancement generation system based on an inference chain evolution mechanism, comprising the following steps: (1) A structured representation of the “reasoning chain” is proposed to record and manage the intermediate conclusions and logical relationships in the reasoning process, and to initialize the input problem as a reasoning chain with an unverified node; (2) In each step of reasoning, the key unverified nodes that hinder the overall reasoning progress are identified based on the global reasoning chain structure, and a new retrieval query is generated for the node to obtain relevant evidence documents from the external knowledge base; (3) Use the retrieved external knowledge to verify, correct or decompose the node state in the reasoning chain, and dynamically update the reasoning chain structure so that it gradually evolves into a logically complete and globally consistent reasoning path in multi-step iteration. (4) Through a global control mechanism, continuously monitor the structural changes of the reasoning chain during the multi-step reasoning process, dynamically adjust the reasoning direction, and prevent logical deviations caused by local short-sighted decisions and the accumulation of errors; (5) When all key nodes in the inference chain have been verified or the confidence conditions are met, the answer to the question is generated based on the final inference chain to ensure the logical accuracy and interpretability of the generated result. This invention improves the accuracy of RAG systems in handling multi-hop problems based on the evolutionary mechanism of inference chains, and includes the following steps: 1. CoR initialization: Note ,in Denotes the reasoning chain at step t. This represents the j-th inference node at step t, which is of text type. Represents the state of the j-th node at step t, which is an enumeration type with... ( )and ( There are two types, where the state is The node is the one whose fact has been verified, and the state is... The node is the node to be verified. middle, For the user's multi-hop problem, for .
[0017] 2. CoR iteration: The state of the middle node is Each node is identified sequentially, and based on the user's original question and the nodes preceding and following that node, a query is heuristically generated using a large language model (detailed hints can be found in the hypo2query_template section of the EvoChain framework in the attached diagram of the manual). The corresponding external documents are then retrieved using a search engine. Let the set of documents retrieved in the t-th step of the mixed sparse and dense search be denoted as [the set of documents retrieved in the t-th step]. Using large language models, based on heuristically Convert to (For detailed prompts, please refer to the analyze_template section of the EvoChain framework in the attached diagram of the instruction manual.) Comparison There are fewer nodes to be verified, and the information on inference nodes is more complete.
[0018] 3. Final Answer Generation: When the maximum number of iterations is reached or the state of all inference nodes in CoR is... At that time, the final CoR can be used to assist the large language model in answering the user's original question, so as to obtain a more accurate answer.
[0019] like Figure 1 The detailed process is as follows: 1. First, the issue of multiple hops in user input: such as... Figure 1 As shown in step 0, the user inputs a multi-hop question: "The ocean into which the rivers flowing out of Lake Victoria eventually flow, and to which continent does its northern shore primarily belong?" 2. Initialize the inference chain CoR: As shown in step 0 of the figure, the inference chain is initialized. The rivers flowing out of Lake Victoria eventually empty into which continent does its northern shore primarily belong? )},in This indicates an unverified node.
[0020] 3. External document retrieval based on unverified nodes in the inference chain: such as... Figure 1 As shown in step 1, according to For unverified nodes, retrieve and recall several relevant documents, denoted as... For example, "The only outlet of Lake Victoria is the Victoria Nile...".
[0021] 4. Iterate the inference chain based on the previous inference chain and related retrieved documents: such as... Figure 1 As shown in step 1, combined and related search and recall documents The large language model believes The unverified nodes were too complex, so they were split into several logically related nodes to facilitate subsequent targeted solutions.
[0022] 5. Inference Chain Node Solving State Marking: As shown in step 1, in order to facilitate the subsequent targeted solving of unverified nodes, the large language model generates node solving state markings based on the content of the inference chain nodes and the recalled text information. Subsequent external evidence document retrieval and iterative inference of the inference chain are only for unverified nodes in the inference chain.
[0023] 6. Iterate the above steps until all nodes in the inference chain have been verified or the maximum number of iterations has been reached, then generate the answer: As shown in step 3 of the figure, this is the process of iteratively solving the unverified nodes in the inference chain until all nodes have been verified or the maximum number of iterations has been reached. As shown in step 4 of the figure, the final answer is generated and returned to the user.
[0024] This invention relates to the pseudocode of the EvoChain algorithm flow, as shown below: Pseudocode description: Lines 01 to 04: Structured representation and initialization of the inference chain (corresponding to step (1) of claim 1). Line 01 defines the node solution label set for structured management of node states; Line 02 represents the inference chain CoR using a sequence of node tuples [text, label], and initializes the input question q as a starting node with a solution label of UNVERIFIED; Line 03 initializes patience (a mapping where the key is the node text and the value is the stall count, used to record that a node has not been verified for multiple consecutive rounds); Line 04 initializes the answer variable ans. Where <- indicates assignment.
[0025] Lines 05 to 10: Identify unverified nodes based on node labels and generate search queries and evidence retrieval (corresponding to step (2) of claim 1). Line 5 enters the iteration loop; Line 6 uses the set comprehension { node.text | ...} to filter all nodes with label=UNVERIFIED from CoR and extracts their text to form a set U ("|" is read as "satisfies the condition", indicating the filtering rule); Line 7 calls LLM.GENERATE_SUBQUERIES(q, CoR, U) to let LLM generate several subqueries subQ based on the original question, the current inference chain, and the content of unverified nodes; Line 8 uses UNION (union of sets) to merge subQ, the original question set {q}, and the unverified node set U into a retrieval query set Qset (union will remove duplicates); Line 9 calls Retriever.RETRIEVE(KB, Qset) to perform a retrieval on the external knowledge base KB for the query in Qset and returns a set of candidate evidence documents; Line 10 RRF_FUSE_AND_TOPK(docs, top_k) performs RRF fusion sorting on the multi-way retrieval results and truncates the top_k evidence documents as docs.
[0026] Lines 11 and 17: Input “example prompt words + current inference chain + external knowledge” to drive LLM to solve / correct / decompose nodes and update the inference chain structure (corresponding to step (3) of claim 1). Line 11 calls LLM.ANALYSE_AND_UPDATE_CHAIN(q, CoR, docs) to input the original question q, the current inference chain CoR and the evidence document docs into LLM for fusion inference; where ANALYSE_AND_UPDATE_CHAIN implicitly contains the constraint that “the prompt word template contains several examples”, which is used to guide LLM to output the “updated inference chain” in a specified format or directly output the answer. If LLM outputs an inference chain, then line 17 PARSE_CHAIN(out.chain) means parsing the chain text output by LLM into a list of node text nodes; here “parsing” includes splitting by line, cleaning, deduplication, etc., so that nodes reflect the results of LLM’s solution, correction or decomposition of the original nodes, thereby realizing the dynamic update of the inference chain structure.
[0027] Lines 12 to 16: LLM directly provides the early termination branch of the answer (belonging to the termination / output part of step (5) of claim 1). Line 12 IF ... THEN indicates a conditional branch; when out.type = ANSWER, line 13 assigns the answer to ans; line 14 sets the answer as the final chain CoR<- [[ans, ANSWER]] (which can also be understood as "using an ANSWER node to record the final conclusion"); line 15 BREAK indicates jumping out of the FOR loop and ending the iteration early; line 16 ENDIF ends the conditional block.
[0028] Lines 18 to 21: Based on external knowledge, the updated nodes are judged and updated in state (corresponding to step (4) of claim 1). Line 18 Verifier.VERIFY(nodes, docs) means inputting the "updated node text nodes" and "external evidence docs" into the verification module (which can be implemented as LLM discrimination, rule discrimination or a combination of both), and outputting the solution state labels labels of each node; Line 19 ZIP(nodes, labels) means "pairing by position" to package the node text and labels into a new node sequence, thereby reconstructing the structured reasoning chain CoR; Line 20 UPDATE_PATIENCE(patience,CoR) means traversing the current CoR, incrementing the count of UNVERIFIED nodes by 1, and clearing or resetting the count of VERIFIED nodes; Line 21 FREEZE_STALE_UNVERIFIED(CoR, patience, PATIENCE_LIMIT) means that if the stall count of a certain UNVERIFIED node exceeds the threshold PATIENCE_LIMIT, its label is set to UNDECIDED (frozen), thereby avoiding repeated searching and generation around unsolvable nodes; note that freezing here is a control strategy, which does not change the core discrimination logic of "finally determined as VERIFIED / UNVERIFIED" in step (4) of claim 1, but only removes long-term unverified nodes from the "progressable unverified" set.
[0029] Lines 22 to 24: Control decision on whether to continue iteration (corresponding to the termination condition part of step (5) in claim 1). Line 22 Controller.SHOULD_ITERATE(CoR, patience, PATIENCE_LIMIT) indicates that the controller decides whether to continue iteration based on the current inference chain state: for example, there are still "progressible unverified nodes" (not frozen and unverified), and the convergence / confidence condition has not been met; Line 23 IF NOT ... THEN indicates that if the continuation condition is not met, the iteration will terminate; Line 24 BREAK exits the loop.
[0030] Lines 26 to 34: Answer generation after reaching the maximum number of iterations or being unable to continue (corresponding to step (5) of claim 1). Line 26 IF ans = "" THEN indicates that if a direct answer has not yet been obtained; Line 27 checks if CoR is empty (is not empty means not empty); Line 28 LLM.DIRECT_ANSWER(q, CoR) indicates that if iterations are no longer continued, the final answer is generated based on the final inference chain CoR (i.e., "using the final inference chain as interpretable support"); Lines 30–31 LLM.RAG_ANSWER(q, TOPK(docs, top_k)) indicates that when the inference chain is empty or unavailable, it degenerates into regular RAG: first retrieve the documents and then let LLM answer based on the documents, where TOPK means taking the top_k documents; Line 34 RETURNans, CoR indicates returning the final answer and the final inference chain (RETURN is a function return statement). This invention proposes a multi-step retrieval enhancement generation system and method based on a reasoning chain evolution mechanism. By introducing a structured reasoning chain representation and dynamic evolution mechanism into the generation process of a large language model, it achieves end-to-end optimization from overall question retrieval to step-by-step reasoning verification. The method is based on the core idea of "evidence-driven reasoning chain update," automatically identifying key nodes based on external documents, generating new sub-questions, and performing targeted verification at each step of the reasoning process. This effectively avoids the error accumulation and logical drift caused by single-step retrieval or static question decomposition in traditional RAG systems.
[0031] In practical implementation, this invention can automatically recall relevant external knowledge based on the original question, and dynamically construct and update the reasoning chain based on the retrieval results. This enables the system to possess self-decomposition, self-verification, and globally consistent control capabilities in multi-hop reasoning, cross-document question answering, and knowledge-intensive scenarios. Experiments and examples show that the reasoning results generated by this method have higher accuracy and interpretability, and can significantly improve the quality and reliability of solving complex problems.
[0032] In summary, this invention provides an efficient, robust, and traceable reasoning scheme for retrieval enhancement generation technology by proposing an evolvable reasoning chain modeling framework. It can be widely applied in various artificial intelligence application fields such as intelligent question answering, knowledge retrieval, academic literature analysis, and decision support, and has significant theoretical value and engineering application prospects.
Claims
1. A method for optimizing a multi-step retrieval-enhanced generation system based on an inference chain evolution mechanism, characterized in that, Includes the following steps: (1) Reasoning chain construction and initialization: Generate an initial reasoning chain based on the input question and initialize the question as an unverified node; (2) Global key node identification: In each iteration, a global analysis of the reasoning chain is performed to identify unverified nodes that hinder the overall reasoning progress; (3) Targeted retrieval and information integration: Generate corresponding retrieval queries based on unverified nodes, and obtain evidence documents related to these unverified nodes from external knowledge bases through a sparse and dense mixed retrieval mechanism; (4) Evolution and update of reasoning chain: Input relevant evidence documents and the current reasoning chain into the large language model for fusion reasoning, generate a new reasoning chain, and verify and update the node status; (5) Termination of reasoning and generation of answer: When all nodes are verified or the preset number of iterations is reached, the system outputs the final reasoning result.
2. The optimization method for a multi-step retrieval enhancement generation system based on an inference chain evolution mechanism according to claim 1, characterized in that, The initialization representation of the inference chain is as follows: Construct an initial inference chain based on the input question. ,in: The question entered by the user is a string. For string This indicates that the node is initialized as an unverified node.
3. The optimization method for a multi-step retrieval enhancement generation system based on an inference chain evolution mechanism according to claim 2, characterized in that, The reasoning chain Structural representation: ,in Denotes the reasoning chain at step t. This represents the j-th inference node at step t, and is a string. This represents the state of the j-th node at step t. For enumerated string types, it has and Two states, where state is The node is a fact node verified by the large language model, and the state is The nodes are unverified nodes determined by the large language model.
4. The optimization method for a multi-step retrieval enhancement generation system based on an inference chain evolution mechanism according to claim 3, characterized in that, Step 3, which involves generating a corresponding retrieval query based on an unverified node using a large language model, and then retrieving evidence documents related to the node from an external knowledge base using a sparse and dense hybrid retrieval mechanism, includes: Will The state of the node in the inference chain is Unverified nodes are identified one by one. Based on the user's original question and the context nodes of that node, a retrieval query is heuristically generated using a large language model. Relevant evidence documents are then retrieved using a hybrid sparse and dense retrieval mechanism, denoted as . ; Utilizing large language models, it is made to base its analysis on relevant evidence documents. Heuristically Transform into the next inference chain Among them, the large language model generates The state labels of all nodes in the language model are determined by the large language model based on relevant evidence documents. and The node information is generated one by one.