Multi-round reasoning question answering method and system based on query graph driving
Through the query graph-driven multi-round reasoning question-answering method, the sub-query inconsistency problem caused by independent module training in the RAG framework is solved, multi-module collaboration and explainable reasoning are achieved, the systematicness and resource utilization efficiency of complex problem processing are improved, and the logical consistency and explainability of the answers are ensured.
Patent Information
- Application Number
- CN202511213133.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-08-28
AI Technical Summary
The existing RAG framework system has independent module training in multi-round reasoning question answering, resulting in inconsistency between subquery decomposition and answer synthesis, lack of explicit intermediate reasoning structure, difficulty in explanation and auditing, and low resource utilization efficiency.
A query graph-driven multi-round reasoning question-answering method is adopted. By constructing query graphs, enhancing retrieval control, sub-answer generation, answer memory and synthesis modules, multi-module collaboration, dynamic retrieval judgment and explainable reasoning closed-loop question-answering are achieved. The static knowledge classification and dynamic entropy estimation joint judgment mechanism is used, combined with a structured reasoning representation framework and a module structure-aware loss function for training.
It achieves high efficiency, explainability and traceability of multi-round reasoning question and answer, improves the systematicness and resource utilization efficiency of complex problem handling, and ensures the logical consistency and explainability of the answers.
Smart Images

Figure CN120687579A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of reasoning question answering, and in particular relates to a query graph driven multi-round reasoning question answering method and system. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Large language models (LLMs) are widely used in scenarios such as open-domain question answering, dialogue systems, and knowledge reasoning. However, the knowledge in large language models is still mainly internalized in the form of static parameters, making them inflexible in responding to real-time changes in external information and complex multi-hop problems (such as insufficient factuality, incomplete answers, or logical incoherence). Therefore, they are not suitable for knowledge-intensive tasks.
[0004] To enhance the capabilities of large language models in knowledge-intensive tasks, the Retrieval-Augmented Generation (RAG) framework was proposed. By combining an external knowledge base with a retrieval module, it enables dynamic access to non-parameterized knowledge, improving the accuracy and verifiability of generated content. However, the RAG framework is a single-round pipeline. To meet the requirements of multi-hop reasoning and complex problem solving, submodules such as the query rewriting module, the retrieval control module, and the inference execution module are introduced to perform multiple rounds of decomposition and dynamic feedback on the input query, enhancing the flexibility and accuracy of the overall reasoning path.
[0005] However, the current RAG framework system, which introduces sub-modules such as the query rewriting module, retrieval control module, and reasoning execution module, still adopts a phased training strategy, resulting in independent training of sub-modules and a lack of collaborative optimization, making it difficult to achieve a closed-loop information flow between reasoning paths, which leads to inconsistencies between sub-query decomposition and answer synthesis, affecting the final output quality; this also leads to a lack of explicit intermediate reasoning structure expression, making the question-answering system difficult to interpret and audit, and making it impossible to perform path optimization and error backtracking, ultimately resulting in a lack of structural expression of the question-answering system's output content and untraceable reasoning process. Summary of the Invention
[0006] In order to solve the above technical problems, the present invention provides a query graph-driven multi-round reasoning question-answering method and system, which can realize closed-loop question-answering capabilities of multi-module collaboration, dynamic retrieval judgment and explainable reasoning, while ensuring the quality of question-answering output.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions: A first aspect of the present invention provides a query graph driven multi-round reasoning question answering method.
[0008] A query graph-driven multi-round reasoning question answering method, comprising: Receive original natural language questions; The original natural language question is processed using a multi-round reasoning question-answering model to obtain a final response answer; wherein the multi-round reasoning question-answering model includes: A query graph construction module, which is used to parse the original natural language question and construct a query graph; Enhanced retrieval control module, which is used to evaluate the static probability that each sub-query in the query graph requires the retrieval of external knowledge, and then combine it with the information entropy estimate output by the language model to determine whether to introduce external knowledge; The sub-answer generation module is used to generate sub-answers corresponding to each sub-query and record the reasoning path based on internal knowledge or the integration of external knowledge; The answer memory module is used to structuredly store the corresponding sub-answers and reasoning paths of each round of sub-queries; A new query generation module is used to dynamically evaluate the semantic coverage, logical consistency, and information closure of the reasoning paths of existing sub-answers to determine whether additional sub-queries are needed; The answer synthesis module is used to read all sub-answers and reasoning paths stored in structured form, perform structured comprehensive reasoning in the order of the query graph, and generate the final response answer.
[0009] As an implementation method, the process of constructing a query graph is as follows: Decompose the original natural language question into several sub-questions, each of which is a local query node, i.e., a sub-query. Analyze the semantics and dependency relationships between each subquery, and determine whether to add directed edges between any two subqueries based on the dependency relationships to determine the order of reasoning, forming a directed acyclic graph, which is the query graph.
[0010] The advantage of the above technical solution is that the graph structure not only expresses the semantic organization of subqueries, but also has executable semantics, thereby providing a clear execution path for subsequent information retrieval and answer generation. During the reasoning process, subquery nodes are executed sequentially according to the topological structure of the graph, and the value of the placeholder reference is replaced according to the binding rules at each step, which can ensure the contextual coherence and logical consistency of the answer generation.
[0011] As an implementation method, the process of determining whether to introduce external knowledge is as follows: The static knowledge classification model is used to evaluate the static probability that each round of sub-queries requires the retrieval of external knowledge; The information entropy estimate is obtained by using the probability distribution of the language model's own output under limited answer conditions to reflect the subjective uncertainty of the language model. The static probability and the information entropy estimation value are weightedly calculated to generate a decision probability of whether to retrieve external knowledge, and the decision probability is compared with a preset threshold to determine whether to introduce external knowledge.
[0012] The advantage of the above technical solution is that it adopts a joint judgment mechanism of static knowledge classification and dynamic entropy estimation, which can effectively prevent the model from skipping necessary retrieval due to overconfidence or local errors, and can also skip redundant calls when the model has clear knowledge, thereby achieving overall dual guarantees for knowledge utilization efficiency and answer quality.
[0013] As an implementation method, when it is determined that the subquery does not need to introduce external knowledge, the subquery is used as input, and the language model performs self-consistent reasoning based on the internal knowledge base; when it is determined that the subquery needs to introduce external knowledge, the subquery and the retrieved external knowledge are spliced and used as input to guide the model to provide a fusion answer based on the context.
[0014] The advantage of the above technical solution is that it can achieve dual guarantees of knowledge utilization efficiency and answer quality by judging whether the language model has sufficient internal knowledge to directly answer a specific subquery, or whether it needs to use external knowledge resources for auxiliary retrieval.
[0015] As an implementation method, a structured reasoning representation framework is used to record the reasoning path; the reasoning path includes three stages: the language model's explicit expression of its understanding of the current problem and its intention to solve it; the operational strategy adopted; and the intermediate feedback content.
[0016] The advantage of the above technical solution is that the use of a structured reasoning representation framework to record the reasoning path can not only be used for subsequent answer fusion, error detection and reflection optimization, but also improve the transparency and robustness of the system in multi-hop problem scenarios.
[0017] As an implementation method, in each round of reasoning, results are generated based on the current query graph node status and the answer to determine whether there are subsequent sub-problems to be executed; if the current graph path has been completely traversed, the trigger process is terminated.
[0018] The advantage of the above technical solution is that it can ensure the reasoning convergence and execution efficiency of the system during actual operation.
[0019] As an implementation method, when the number of traversed nodes exceeds a preset maximum sub-query round number threshold, the current reasoning chain is forcibly terminated and the final answer synthesis phase is entered.
[0020] The advantage of the above technical solution is that it can prevent the model from continuously generating invalid sub-queries or falling into path loops during multiple rounds of thought decomposition, ensuring that the reasoning chain is naturally closed within a limited number of steps.
[0021] As an implementation method, the loss function during the training process of the multi-round reasoning question answering model is: ; in, Represents the loss function; N represents the number of modules contained in the sample; is the jth target token in the kth module; Indicates the number of target tokens; The set of structure fields specified for the kth module; It is a binary loss mask function that takes the value 1 only within the structure field range; represents the language model prediction probability under frozen backbone parameters θ and trainable role token embedding δ; represents the input of the kth module; Indicates the corresponding role token of the k-th module.
[0022] The advantage of the above technical solution is that by introducing a module structure-aware loss function, loss calculation is performed only on the tokens involved in prediction in the structure field, which can avoid invalid token interference and semantic confusion between modules, and ensure the quality of the reasoning question and answer results of the multi-round reasoning question and answer model.
[0023] A second aspect of the present invention provides a query graph driven multi-round reasoning question answering system.
[0024] A query graph-driven multi-round reasoning question answering system, comprising: A question receiving unit, configured to receive an original natural language question; A question-answering reasoning unit is configured to process the original natural language question using a multi-round reasoning question-answering model to obtain a final response answer; wherein the multi-round reasoning question-answering model includes: A query graph construction module, which is used to parse the original natural language question and construct a query graph; Enhanced retrieval control module, which is used to evaluate the static probability that each sub-query in the query graph requires the retrieval of external knowledge, and then combine it with the information entropy estimate output by the language model to determine whether to introduce external knowledge; The sub-answer generation module is used to generate sub-answers corresponding to each sub-query and record the reasoning path based on internal knowledge or the integration of external knowledge; The answer memory module is used to structuredly store the corresponding sub-answers and reasoning paths of each round of sub-queries; A new query generation module is used to dynamically evaluate the semantic coverage, logical consistency, and information closure of the reasoning paths of existing sub-answers to determine whether additional sub-queries are needed; The answer synthesis module is used to read all sub-answers and reasoning paths stored in structured form, perform structured comprehensive reasoning in the order of the query graph, and generate the final response answer.
[0025] A third aspect of the present invention provides an electronic device.
[0026] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the query graph-driven multi-round reasoning question-answering method described above are implemented.
[0027] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention parses the original natural language question and constructs a query graph, determines whether to retrieve external knowledge, generates sub-answers corresponding to each sub-query and records the reasoning path, and performs structured comprehensive reasoning on the semantic coverage, logical consistency and information closure of the reasoning path and the order of the query graph, forming a multi-stage question-answering process of "query decomposition - retrieval judgment - sub-answer generation - reasoning closure - final synthesis", which overcomes the limitations of traditional RAG methods in structural expression ability and path control, and significantly improves the systematicity and explainability of complex problem processing.
[0028] (2) The present invention adopts a joint judgment mechanism of static knowledge classification and dynamic entropy estimation, which can effectively prevent the model from skipping necessary retrieval due to overconfidence or local errors, and can also skip redundant calls when the model has clear knowledge. It significantly improves the system's balance between resource utilization efficiency and knowledge response capability, and achieves dual protection of knowledge utilization efficiency and answer quality.
[0029] (3) The present invention adopts a structured reasoning representation framework to record the reasoning path, recording the model's internal thinking process, operational behavior and external observation results in a structured manner, significantly improving the transparency and traceability of the generation process. Combined with the multi-round state recording mechanism, it not only supports reasoning path backtracking and behavior auditing, but also provides a unified and stable semantic basis for downstream new query generation and final answer synthesis.
[0030] (4) The present invention proposes a joint training method for multi-module structures, combining role token guidance with structure field-aware loss masking strategy. Under the premise of freezing the language model parameters, by introducing the module structure-aware loss function, loss calculation is performed only on the tokens involved in prediction in the structure field. This can avoid invalid token interference and semantic confusion between modules, achieve efficient customized capability migration, significantly reduce training resource consumption and deployment complexity, and maintain cross-module behavioral consistency and output style uniformity, thereby ensuring the quality of the reasoning question-answering results of the multi-round reasoning question-answering model. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0032] Figure 1 1 is a flowchart of a query graph driven multi-round reasoning question answering method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a query graph construction module according to an embodiment of the present invention; Figure 3 is a schematic diagram of an enhanced retrieval control module according to an embodiment of the present invention; Figure 4 is a schematic diagram of a sub-answer generation module according to an embodiment of the present invention; Figure 5 is a schematic diagram of a new query generation module according to an embodiment of the present invention; Figure 6 is a schematic diagram of an answer synthesis module according to an embodiment of the present invention; Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0034] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0036] In order to solve the problems existing in the RAG system in the prior art, such as loose coupling of modules, untraceable reasoning paths, inaccurate retrieval judgment, and redundant generation process, the present invention provides a query graph-driven multi-round reasoning question-answering method and system to achieve closed-loop question-answering capabilities of multi-module collaboration, dynamic retrieval judgment, and explainable reasoning.
[0037] Figure 1 FIG. 1 is a flow chart of a query graph driven multi-round reasoning question answering method according to an embodiment of the present invention. Figure 1The query graph driven multi-round reasoning question answering method in this embodiment may include the following steps, and the specific implementation process of each step is as follows: Step 1: Receive the original natural language question.
[0038] During the specific implementation process, the original natural language question can be set according to the actual situation. For example, the original natural language question can be set as: Were Li Bai and Du Fu born in the same dynasty? Step 2: Use a multi-round reasoning question-answering model to process the original natural language question and obtain the final response answer.
[0039] In the specific implementation process, the multi-round reasoning question-answering model includes the following modules: (1) Query graph construction module: The query graph construction module is used to parse the original natural language question and construct a query graph, which is used to represent the semantics and dependency relationships of each subquery. Figure 2 As shown, the process of constructing a query graph in the embodiment of the present invention is: Step a1: Decompose the original natural language question into several sub-questions, each of which is a local query node, i.e., a sub-query. Step a2: Analyze the semantics and dependency relationships between subqueries (for example, whether there is information transfer, variable sharing, context inheritance, etc.). Based on the dependency relationships, determine whether to add directed edges between any two subqueries to determine the order of reasoning, forming a directed acyclic graph, which is the query graph.
[0040] During the implementation of step a2, when it is detected that the expression or solution of a subquery depends on the result of another subquery, a directed edge is added to the graph from the former to the latter to clarify the order of reasoning. Furthermore, to support cross-node data references, a placeholder reference mechanism is introduced in subqueries, allowing subsequent nodes to dynamically reference the output value of the preceding node using formats such as Q1.answer or Q1.result. This graph structure not only expresses the semantic organization of subqueries but also provides executable semantics.
[0041] The graph structure of this embodiment not only expresses the semantic organization of subqueries, but also has executable semantics, thereby providing a clear execution path for subsequent information retrieval and answer generation. During the reasoning process, subquery nodes are executed sequentially according to the topological structure of the graph, and the placeholder references are replaced with values according to the binding rules at each step, which can ensure the contextual coherence and logical consistency of answer generation.
[0042] (2) Enhanced retrieval control module: The enhanced retrieval control module is used to evaluate the static probability that each round of sub-queries requires the retrieval of external knowledge, and then combines the information entropy estimation value output by the language model to determine whether to introduce external knowledge.
[0043] like Figure 3 As shown, in each round of reasoning, the enhanced retrieval control module uses the subquery output by the query graph construction module as input. Combining the current system state and historical answer records, it estimates the language model's confidence in that subquery. To improve the accuracy and stability of judgments, the system employs a combined static knowledge classification and dynamic entropy estimation mechanism.
[0044] In the specific implementation process, the process of determining whether to introduce external knowledge is as follows: Step b1: Use the static knowledge classification model to evaluate the static probability that each round of sub-queries requires retrieval of external knowledge; Step b2: Using the probability distribution of the language model's own output under limited answer conditions, an information entropy estimate is obtained to reflect the subjective uncertainty of the language model. Step b3: Perform weighted calculation on the static probability and the information entropy estimation value to generate a decision probability of whether to retrieve external knowledge, and compare it with a preset threshold to determine whether to introduce external knowledge.
[0045] This embodiment adopts a joint judgment mechanism of static knowledge classification and dynamic entropy estimation, which can effectively prevent the model from skipping necessary retrieval due to overconfidence or local errors, and can also skip redundant calls when the model has clear knowledge, thereby achieving overall dual guarantees for knowledge utilization efficiency and answer quality.
[0046] (3) Sub-answer generation module: The sub-answer generation module is used to perform reasoning based on internal knowledge or the integration of external knowledge, generate sub-answers corresponding to each sub-query and record the reasoning path.
[0047] The sub-answer generation module is a key module in the system used to execute specific sub-query solutions and construct reasoning trajectories. It undertakes the dual functions of knowledge generation and intermediate thinking construction.
[0048] like Figure 4 As shown in Figure 1, in each round of reasoning, this module receives local query tasks from the query graph construction module and, combined with the retrieval decision signals output by the "enhanced retrieval control module," selects an appropriate execution path to complete the knowledge-based answer and procedural expression of the sub-questions. When processing each sub-query, the module adopts the following two strategies, depending on whether external knowledge retrieval is triggered: When it's determined that a subquery doesn't require external knowledge, the language model uses the subquery as input to perform self-consistent reasoning based on the internal knowledge base. When it's determined that a subquery requires external knowledge, the subquery and the retrieved external knowledge are concatenated and used as input, guiding the model to deliver a fused answer based on the context. This ensures both efficient knowledge utilization and high-quality answers by determining whether the language model possesses sufficient internal knowledge to directly answer a specific subquery or requires supplementary retrieval from external knowledge resources.
[0049] To improve the interpretability and traceability of the generation process, the module introduces a structured reasoning representation framework: TAO (Thought–Action–Observation). This framework records the reasoning path and divides the model's reasoning process into three stages: the language model's understanding of the current problem and explicit expression of the solution intent; the action strategy adopted; and the intermediate feedback content.
[0050] This embodiment uses a structured TAO representation to record the reasoning process, improving the explainability and subsequent usability of the answer. The recorded reasoning process can not only be used for subsequent answer fusion, error detection and reflection optimization, but also improves transparency and robustness in multi-hop problem scenarios.
[0051] (4) Answer memory module: The answer memory module is used to structuredly store the corresponding sub-answers and their reasoning paths for each round of sub-queries.
[0052] It should be noted here that the structured stored information includes the query content, whether to call the search, the retrieved document summary, the generated sub-answers and the corresponding reasoning structure information, etc., and is stored in a structured JSON format to provide a unified semantic context for subsequent modules.
[0053] The answer memory module is responsible for storing and organizing the processing results of each sub-query in real time during multiple rounds of reasoning, forming a unified view of the intermediate knowledge state. This module continuously maintains all sub-answers generated in the reasoning path, their source information, and behavior trajectories in the form of structured data, providing a stable and reliable semantic foundation for subsequent new query generation and final answer synthesis.
[0054] The answer memory module automatically records the following content after each subquery execution: subquery text (Query), whether retrieval was triggered (Retrieved: true / false), retrieval result summary (Docs, optional), sub-answer content (Answer), reasoning structure information (TAO: Thought, Action, Observation), and the subquery's position and ID within the query graph. All records are stored uniformly in a structured dictionary format, supporting JSON reading and writing and modular references. Memory items use the subquery ID as the primary key to ensure traceability and consistent result binding. As a "shared semantic memory" throughout all stages, the answer memory module not only records factual results but also preserves behavioral paths and decision drivers, serving as a core support module for end-to-end explainability. By structured storage of each subquery's execution record and reasoning trajectory, the module enables traceability of results, restorability of paths, and interpretability of behaviors, providing native support for transparency, visualization, and behavioral auditing in reasoning question answering.
[0055] The answer memory module is maintained in real time in memory as a structured JSON dictionary, serving as a shared semantic state module during the multi-round reasoning process. Each record corresponds to a subquery execution unit and contains core fields such as the subquery text, whether to trigger a search, the generated sub-answer, the document summary used, the TAO reasoning structure, and its position in the query graph. All fields are indexed by the subquery ID, supporting efficient reading and updating between modules and can be exported as standard JSON on demand for debugging, replay, or evaluation.
[0056] To enhance the system's knowledge accumulation capabilities and historical information reuse efficiency in actual operation, after successfully completing the entire reasoning chain and generating the final answer, the system will input the entire reasoning process of this round, including the original question, each sub-query and its sub-answer, supporting documents, and the final answer into the embedding model E5 for semantic encoding, generate a vector representation and write it into the Milvus vector database as a recall candidate for subsequent similar queries or supplementary questions.
[0057] (5) New query generation module: The new query generation module is used to dynamically evaluate the semantic coverage, logical consistency and information closure of the reasoning path of the existing sub-answers, determine whether the sub-query needs to be supplemented and feed it back to the query graph for expansion until no sub-query needs to be supplemented.
[0058] The new query generation module is a key control module used to dynamically evaluate the integrity of the reasoning chain and initiate supplementary queries when necessary, aiming to ensure the coverage, coherence and information closure of the entire reasoning process. Figure 5As shown in the figure, the role of this module is to systematically review the existing intermediate answers after the first round of sub-queries are all executed to determine whether they can fully support the final answer to the original question. If it is found that key information is missing, a new supplementary sub-query is automatically generated and sent back to the query graph module to expand the reasoning path.
[0059] The core input of the new query generation module is the answer memory dictionary, which systematically records the content of each subquery, whether to perform a search, the document support obtained, the generated answer content, and the complete reasoning trajectory (such as the TAO structure). Based on this, a three-stage judgment logic is executed: Semantic coverage analysis: evaluates whether the current set of sub-answers has fully covered all the core semantic elements in the original question; Logical consistency check: Analyze whether there are jumps, omissions or causal breaks in the existing reasoning chain; Information gap identification and completion generation: If the system determines that there is a key reasoning gap, it will automatically construct a new and clear supplementary query based on the semantic features of the missing part and the contextual logical structure to complete the knowledge chain.
[0060] The evaluation results are output as structured JSON, supporting only two types of responses: If the existing sub-answers fully support the final answer, the module outputs a confirmation signal. If there is an information gap, the module outputs a new specific supplementary query.
[0061] To ensure process stability and controllability, the module outputs only one new query per round, avoiding reasoning oscillation or process crashes caused by continuous cascading generation. After being added to the query graph, the new query participates in the standard execution process in the subsequent round, providing a "self-diagnosis-self-completion" feedback loop.
[0062] (6) Answer synthesis module: The answer synthesis module is used to read all sub-answers and reasoning paths stored in structured form, perform structured comprehensive reasoning in the order of the query graph, and generate the final response answer.
[0063] The answer synthesis module is responsible for generating the final response to the original user query based on the intermediate information accumulated in the answer memory after all sub-queries have been executed.
[0064] like Figure 6 As shown in Figure 2, the module takes the original query Q and a structured answer memory dictionary as input, which contains the natural language content of each sub-query, whether to call retrieval, the generated sub-answers, the corresponding document summary and the complete TAO reasoning trajectory.
[0065] First, the sub-query results are sorted according to the topological structure of the query graph to establish a logical progression path. Then, all intermediate sub-answers and their semantic intents are organized into a unified context to guide the language model to perform structured comprehensive reasoning.
[0066] To enhance the interpretability and structural consistency of the output, the module injects recorded TAO expressions into the prompts, guiding the model to complete information integration according to the "think-act-observe" reasoning sequence. Furthermore, when generating answers, it retains references to subquery numbers, building a traceable reasoning chain to support subsequent answer auditing and path tracing.
[0067] As the final step in the reasoning process, the answer synthesis module takes the original query Q and the updated answer memory structure M as input to derive the final answer A. Thanks to the full retention of subquery content, corresponding sub-answers, and their supporting evidence in the answer memory, it is able to generate a well-founded and semantically closed response to the original question based on sufficient information fusion.
[0068] In order to ensure the reasoning convergence and execution efficiency of the system during actual operation, in each round of reasoning, the results are generated based on the current query graph node status and the answer, and it is determined whether there are subsequent sub-questions to be executed; if the current graph path has been completely traversed, the trigger process is terminated. For example, if the sub-query returns <finish>Or other no-operation markers to determine that the current graph path has been completely traversed.
[0069] To prevent the model from continuously generating invalid sub-queries or falling into path loops during multiple rounds of thought decomposition and to ensure that the reasoning chain is naturally closed within a limited number of steps, when the number of traversed nodes exceeds the preset maximum sub-query round number threshold (for example, set to 4 rounds), the current reasoning chain is forcibly terminated and the final answer synthesis stage is entered.
[0070] The training process of the multi-round reasoning question answering model is given below: To build a high-quality dataset that supports multi-module collaborative training during the training of a multi-round reasoning question-answering model, we first constructed an original question set based on multiple public, high-quality question-answering datasets, such as Natural Question (NQ), TriviaQA, StrategyQA, HotpotQA, and 2WikiMQA. We then used the QWQ-32B model to simulate the complete multi-stage question-answering process. To ensure the separability of input and output for each module, we designed structured prompt templates for each module. Prompt controls clearly define module roles, and the input, behavior, and output of each stage are explicitly recorded during the reasoning process.
[0071] The quality of the final answer is used as a proxy signal for the correct execution of the process. The specific method is: the final answer A generated by the expert model is compared with the golden answer provided in the original dataset. Perform comparisons and calculate automated evaluation indicators (Using the F1 score, only samples with a score s above a set threshold α are retained as high-quality data indicating "successful process execution," and intermediate process records are used as training samples for each module. This "result-reward" screening strategy effectively filters out invalid data caused by reasoning failures or model misjudgments, constructing a high-quality, weakly supervised module training set. Table 1 shows the scale of the collected data and the input and output formats of the training data for each module: Table 1 Input and output content of each module and the number of training samples;
[0072] This embodiment of the present invention proposes a language model training method for multi-module structured reasoning systems, combining a role token guidance mechanism with a module-structure-aware loss masking strategy. This method introduces a small number of module-specific control tokens to activate the language model's behavior for different tasks. It also computes supervisory signals only on key words related to structural fields in the output, achieving an efficient, decoupled, and structured training process.
[0073] Define role control tokens for each module of the multi-round reasoning question-answering model, such as<ROLE_QG> (query graph building block),<ROLE_RC> (Enhanced search judgment module),<ROLE_ANS> (Sub-answer generation module),<ROLE_RQ> (New query generation module),<ROLE_SYN> (Answer Synthesis Module), etc., and add these tokens to the language model vocabulary.
[0074] The token embedding vectors constitute a unique set of trainable parameters δ, of dimension n × d, where n is the number of character tokens and d is the embedding dimension (e.g., 4096). The language model backbone parameters θ remain frozen to avoid large-scale updates, thus enabling efficient parameter customization and training while preserving the model's original general capabilities.
[0075] The training samples are input from each module And the structured output S^{(k)} = [ , ..., The output clearly marks the structural semantic fields (such as Thought, Action, Observation, Answer, etc.), where each module corresponds to a set of independent supervised fields. To activate the task characteristics, each module is connected to its corresponding role token before input [ ], the final model input The format is: ; This input is fed into the frozen backbone language model, where the role tokens control the generation of module task behaviors. During output training, to avoid invalid token interference and semantic confusion between modules, this paper introduces a module structure-aware loss function, calculating the loss only on tokens involved in prediction in the structure field. The loss function used during training of the multi-round reasoning question-answering model is: ; in, Represents the loss function; N represents the number of modules contained in the sample; is the jth target token in the kth module; Indicates the number of target tokens; The set of structure fields specified for the kth module; It is a binary loss mask function that takes the value 1 only within the structure field range; represents the language model prediction probability under frozen backbone parameters θ and trainable character token embedding δ; represents the input of the kth module; Indicates the corresponding role token of the k-th module.
[0076] The structure fields used for loss mask calculation include: query graph construction module<ROLE_QG> Field Subquestion in the search judgment module<ROLE_RC> Fields Retrieval Need and Decision; Sub-answer generation module<ROLE_ANS> Fields Thought, Action, Observation, and Answer; new query generation module<ROLE_RQ> Reformulated Query and Reason fields in the answer synthesis module<ROLE_SYN> The fields FinalAnswer and Justification in .
[0077] Using a unified supervised fine-tuning (SFT) strategy, we jointly train five core modules based on a complete reasoning chain: the query graph construction module, the enhanced retrieval control module, the sub-answer generation module, the new query generation module, and the answer synthesis module. The following example uses the GLM-4 9B language model as the foundation, with each module driven by prompts. While maintaining a unified model parameter freeze, we insert control tokens and structured label prompts to achieve integrated modeling of multi-module capabilities.
[0078] Each training sample corresponds to a complete system execution process in the form of: ; Where q is the original natural language question, It is the input and output structure of the i-th module, including: module name, input field, output field, control token; During training, supervision loss is applied only to the structure fields in the module output; the remaining tokens are masked. All module samples are mixed into a unified training process. The language model parameters remain frozen, and only the embedding vector δ corresponding to each control token is updated.
[0079] The enhanced retrieval control module decides whether external knowledge retrieval is required for each round of sub-queries by combining static knowledge judgment and language model uncertainty estimation.
[0080] The design of the module integrates two signal sources: one is the "prior judgment" obtained by the static knowledge classification module, and the other is the uncertainty entropy estimation output by the language model itself. First, a lightweight static classification module is used to judge the input question q and output the probability of whether the question needs to be retrieved. This probability reflects the model's confidence in whether it has the answer to the question based on experience without further reasoning. Question q is then fed into the language model, prompting it to choose only "know" or "unknown" as the answer, to clearly test its subjective judgment boundaries. At the first output position, the system records the language model's softmax probability distribution for "know" and "unknown." ,in Indicates the probability that the model chooses "know", defined as: ; Indicates the probability of the model selecting "unknown"; and are the original logical outputs of the language model for "know" and "unknown". In order to evaluate the subjective uncertainty of the language model itself, the information entropy is calculated , expressed using softmax entropy: ; The larger the entropy value, the less certain the model is about the answer to the current question.
[0081] In order to map uncertainty to a unified probability scale, the entropy value is normalized using the Sigmoid function to obtain the dynamic path judgment probability. : ; in It is a Sigmoid function, which ensures that the output range is [0,1].
[0082] The static prior judgment and dynamic uncertainty estimation are weightedly fused to generate the joint probability of whether knowledge retrieval is needed, that is, the decision probability of whether to retrieve external knowledge. : ; The fusion weight It is an adjustable hyperparameter used to balance the influence of the two types of information sources. If the final fusion probability exceeds the preset fixed threshold , then the retrieval operation is triggered; otherwise, it is considered that the model can directly answer the current question. That is: .
[0083] In order to determine the optimal configuration of the above parameters, a parameter adjustment mechanism based on the complete reasoning chain behavior replay analysis was constructed. Compared with the traditional static verification set parameter adjustment method, this mechanism is more in line with the behavioral performance and resource call logic of the model during actual operation. 3,000 complete reasoning process samples were collected from the system's internal execution log to construct a verification set. Each sample record includes: multiple rounds of sub-query text, whether the retrieval operation was performed in each round, the corresponding final answer and the gold standard answer (used to calculate the F1 score), and the actual system generates the intermediate module output (for replay). This dataset is used to simulate the module behavior in the actual operating environment. The system is respectively 、 A grid search was performed within the parameter range. For each parameter combination, the inference process was replayed on the validation set, and the following four key evaluation metrics were recorded: Retrieval judgment consistency rate: whether the module output is consistent with the expert reference judgment; Answer retention rate (F1 ≥ 0.75): the proportion of samples whose final output answer reaches a reasonable accuracy; Average number of retrievals: the number of retrieval calls triggered in each inference chain; and Judgment volatility: whether the judgments in consecutive rounds are consistent, reflecting the stability of the module. The results are shown in Table 2. Table 2 Threshold determination;
[0084] As can be seen from the table, when the fusion weight is set to λ = 0.6 and the trigger threshold is set to θ = 0.52, the system performs well across all evaluation metrics. This parameter configuration was ultimately adopted based on a comprehensive analysis of the three aspects of judgment accuracy, answerability, and resource utilization efficiency.
[0085] In one or more embodiments, the query graph driven multi-round reasoning question answering system provided by the present invention can be implemented in software. The functions of each software module in the query graph driven multi-round reasoning question answering system are described below: A question receiving unit, configured to receive an original natural language question; The question-answering reasoning unit is used to process the original natural language question using a multi-round reasoning question-answering model to obtain a final response answer.
[0086] It should be noted here that the implementation process in the question receiving unit and the question-answering reasoning unit is the same as the specific implementation process of steps 1 and 2 in the above-mentioned query graph-driven multi-round reasoning question-answering, and will not be repeated here.
[0087] The multi-round reasoning question-answering model includes: A query graph construction module, which is used to parse the original natural language question and construct a query graph; Enhanced retrieval control module, which is used to evaluate the static probability that each sub-query in the query graph requires the retrieval of external knowledge, and then combine it with the information entropy estimate output by the language model to determine whether to introduce external knowledge; The sub-answer generation module is used to generate sub-answers corresponding to each sub-query and record the reasoning path based on internal knowledge or the integration of external knowledge; The answer memory module is used to structuredly store the corresponding sub-answers and reasoning paths of each round of sub-queries; A new query generation module is used to dynamically evaluate the semantic coverage, logical consistency, and information closure of the reasoning paths of existing sub-answers to determine whether additional sub-queries are needed; The answer synthesis module is used to read all sub-answers and reasoning paths stored in structured form, perform structured comprehensive reasoning in the order of the query graph, and generate the final response answer.
[0088] It should be noted here that the specific implementation process of each unit in the embodiment of the present invention is the same as that of each step in the above-mentioned query graph-driven multi-round reasoning question-answering method, and will not be repeated here.
[0089] The query graph-driven, multi-round reasoning question-answering system of this embodiment first uses the query graph construction module to parse the original question into multiple sub-queries with logical dependencies. These sub-queries are organized into a directed acyclic graph (DAG), clarifying the execution order and dependency structure between the sub-queries. Each sub-query is then determined by the enhanced retrieval control module to determine whether external knowledge support is required. This module integrates static classification with subjective entropy judgments from the language model to output a unified retrieval trigger probability. After entering the sub-answer generation module, the query graph-driven, multi-round reasoning question-answering system generates sub-answers based on whether a retrieval is required, using either internal knowledge from the language model or document enhancement. The generation process uses the TAO (Thought–Action–Observation) structure to model the reasoning path, enhancing process interpretability. All sub-answers and their process information are recorded in the answer memory module, forming a unified semantic state of the system. If the system detects incomplete information, the new query generation module analyzes the current memory content with the original question requirements to determine whether additional queries are needed, achieving closed-loop reasoning control. Finally, the answer synthesis module fuses the sub-answers based on the query graph structure to construct a coherent overall answer and outputs a structured reasoning chain to ensure accuracy and traceability.
[0090] This embodiment of the present invention addresses the shortcomings of existing intelligent question-answering systems in complex query processing, reasoning path transparency, and retrieval control accuracy. By proposing a query-graph-driven, multi-round reasoning question-answering system and its implementation method, the system significantly improves answer accuracy, process controllability, and interpretability for complex tasks through modular design, structured reasoning representation, and joint training strategies. This system provides an efficient and reliable solution for intelligent question-answering technology in multiple scenarios.
[0091] By introducing structured query graph modeling, a dynamic retrieval and judgment mechanism, explainable reasoning expression, and a module joint training strategy, the present invention significantly improves the expressiveness, controllability, and interpretability of intelligent question-answering systems in complex scenarios. Compared to traditional RAG systems, this invention offers significant advantages in reasoning path expression, resource mobilization efficiency, problem adaptability, and system maintainability, possessing broad application prospects and industrial potential.
[0092] The structure of the electronic device according to the embodiment of the present invention is described in detail below. Figure 7 The schematic diagram of the structure of the electronic device provided in the embodiment of the present invention can be understood as follows: Figure 7 Only exemplary structures of the electronic device are shown, not all structures. Part or all of the shown structures may be implemented as needed.
[0093] The electronic device provided in the embodiment of the present invention includes: at least one processor 701, a memory 702, a user interface 703 and at least one network interface 704. The various components in the query graph driven multi-round reasoning question answering system are coupled together via a bus system 705. It can be understood that the bus system 705 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 705 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 705.
[0094] The user interface 703 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.
[0095] It will be appreciated that the memory 702 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. The memory 702 in the embodiments of the present invention can store data to support the operation of the terminal. Examples of such data include any computer program used to operate on the terminal, such as an operating system and application programs. The operating system includes various system programs, such as a framework layer, a core library layer, and a driver layer, which are used to implement various basic services and handle hardware-based tasks. The application program may include various application programs.
[0096] In some embodiments, the query graph-driven multi-round reasoning question-answering system provided by the embodiments of the present invention can be implemented in a combination of software and hardware. As an example, the query graph-driven multi-round reasoning question-answering system provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the query graph-driven multi-round reasoning question-answering method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0097] As an example, the processor 701 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0098] As an example of hardware implementation of the query graph-driven multi-round reasoning question-answering system provided in an embodiment of the present invention, the device provided in an embodiment of the present invention can be directly executed by a processor 701 in the form of a hardware decoding processor. For example, one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components are used to implement the query graph-driven multi-round reasoning question-answering method provided in an embodiment of the present invention.
[0099] The memory 702 in the embodiment of the present invention is used to store various types of data to support the operation of the query graph driven multi-round reasoning question answering system, or to store data for executing Figure 1 Examples of such data include any executable instructions for operating on a query graph-driven multi-round reasoning question answering system, such as executable instructions. The program implementing the query graph-driven multi-round reasoning question answering method of an embodiment of the present invention may be included in the executable instructions.
[0100] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing Figure 1 In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion and / or installed from a removable medium. When the computer program is executed by the central processing unit, the various functions defined in the apparatus of the present application are performed.
[0101] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.< / finish>
Claims
1. A query graph driven multi-round reasoning question answering method, characterized in that: include: Receive original natural language questions; The original natural language question is processed using a multi-round reasoning question-answering model to obtain a final response answer; wherein the multi-round reasoning question-answering model includes: A query graph construction module, which is used to parse the original natural language question and construct a query graph; Enhanced retrieval control module, which is used to evaluate the static probability that each sub-query in the query graph requires the retrieval of external knowledge, and then combine it with the information entropy estimate output by the language model to determine whether to introduce external knowledge; The sub-answer generation module is used to generate sub-answers corresponding to each sub-query and record the reasoning path based on internal knowledge or the integration of external knowledge; The answer memory module is used to structuredly store the corresponding sub-answers and reasoning paths of each round of sub-queries; A new query generation module is used to dynamically evaluate the semantic coverage, logical consistency, and information closure of the reasoning paths of existing sub-answers to determine whether additional sub-queries are needed; The answer synthesis module is used to read all sub-answers and reasoning paths stored in structured form, perform structured comprehensive reasoning in the order of the query graph, and generate the final response answer.
2. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: The process of building a query graph is: Decompose the original natural language question into several sub-questions, each of which is a local query node, i.e., a sub-query. Analyze the semantics and dependency relationships between each subquery, and determine whether to add directed edges between any two subqueries based on the dependency relationships to determine the order of reasoning, forming a directed acyclic graph, which is the query graph.
3. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: The process of determining whether to introduce external knowledge is: The static knowledge classification model is used to evaluate the static probability that each round of sub-queries requires the retrieval of external knowledge; The information entropy estimate is obtained by using the probability distribution of the language model's own output under limited answer conditions; The static probability and the information entropy estimation value are weightedly calculated to generate a decision probability of whether to retrieve external knowledge, and the decision probability is compared with a preset threshold to determine whether to introduce external knowledge.
4. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: When it is determined that the subquery does not require the introduction of external knowledge, the subquery is used as input, and the language model performs self-consistent reasoning based on the internal knowledge base; when it is determined that the subquery requires the introduction of external knowledge, the subquery and the retrieved external knowledge are spliced together and used as input, guiding the model to provide a fusion answer based on the context.
5. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: A structured reasoning representation framework is used to record the reasoning path; the reasoning path includes three stages: the language model's understanding of the current problem and the explicit expression of the solution intention; the operational strategy adopted; and the intermediate feedback content.
6. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: In each round of reasoning, the results are generated based on the current query graph node status and the answer to determine whether there are subsequent sub-problems to be executed; if the current graph path has been completely traversed, the trigger process is terminated.
7. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: When the number of traversed nodes exceeds the preset maximum subquery round number threshold, the current reasoning chain is forcibly terminated and the final answer synthesis stage is entered.
8. The query graph driven multi-round reasoning question answering method according to claim 1, characterized in that: The loss function during the training process of the multi-round reasoning question answering model is: ; in, Represents the loss function; N represents the number of modules contained in the sample; is the jth target token in the kth module; Indicates the number of target tokens; The set of structure fields specified for the kth module; It is a binary loss mask function that takes the value 1 only within the structure field range; represents the language model prediction probability under frozen backbone parameters θ and trainable character token embedding δ; represents the input of the kth module; Indicates the corresponding role token of the k-th module.
9. A query graph driven multi-round reasoning question answering system, characterized in that: include: A question receiving unit, configured to receive an original natural language question; A question-answering reasoning unit is configured to process the original natural language question using a multi-round reasoning question-answering model to obtain a final response answer; wherein the multi-round reasoning question-answering model includes: A query graph construction module, which is used to parse the original natural language question and construct a query graph; Enhanced retrieval control module, which is used to evaluate the static probability that each sub-query in the query graph requires the retrieval of external knowledge, and then combine it with the information entropy estimate output by the language model to determine whether to introduce external knowledge; The sub-answer generation module is used to generate sub-answers corresponding to each sub-query and record the reasoning path based on internal knowledge or the integration of external knowledge; The answer memory module is used to structuredly store the corresponding sub-answers and reasoning paths of each round of sub-queries; A new query generation module is used to dynamically evaluate the semantic coverage, logical consistency, and information closure of the reasoning paths of existing sub-answers to determine whether additional sub-queries are needed; The answer synthesis module is used to read all sub-answers and reasoning paths stored in structured form, perform structured comprehensive reasoning in the order of the query graph, and generate the final response answer.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the query graph driven multi-round reasoning question answering method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Open domain natural language reasoning question-answering system and method driven by large language model
CN116932708A
Intelligent finance and tax question answering method based on artificial intelligence question answering system
CN119106122A
Online medical question and answer dynamic retrieval enhancement generation method
CN120045662A
Dynamic and static combined retrieval enhancement generation method and equipment
CN120179795A
Loyal question and answer system for knowledge graph
CN120181235A
Cited By
Medical question and answer method and system based on diverse retrieval and evidence-based reasoning
CN121278068A