A multi-hop question-answering method based on structured planning and reflective reasoning

CN121480651BActive Publication Date: 2026-10-23ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511626780.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-10-23
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

[0005]为了克服现有学科知识问答系统在推理路径可控性不足、推理结果一致性较差以及对教材知识结构化理解不充分等问题,针对学科知识体系中存在的逻辑层次复杂、概念关联紧密等特点,本发明提出了一种基于结构化规划与反思推理的学科知识多跳问答方法

Benefits of technology

[0016]本发明的技术构思:在学科知识问答中,充分挖掘学科问题中蕴含的逻辑层次与知识依赖关系,利用结构化规划模块对复杂问题进行分解与子任务建模,生成符合学科知识体系的多阶段推理路径。同时,引入反思推理机制,对中间推理结果进行一致性分析与自适应修正,结合结构化学科知识上下文实现对教材内容的深层理解,从而提升问答系统的逻辑推理能力与知识融合能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121480651B_ABST
    Figure CN121480651B_ABST
Patent Text Reader

Abstract

The application discloses a multi-hop question and answer method for subject knowledge based on structured planning and reflective reasoning, which comprises the following steps: firstly, aiming at an input subject question, a structured planning module is used to decompose a complex question and model a subtask, so that a multi-stage reasoning path conforming to a subject knowledge system is generated; secondly, relevant knowledge contents are dynamically searched from teaching materials and a subject knowledge base, and a structured subject knowledge context in the form of a triple is constructed by combining a thinking chain driven information extraction technology; finally, a reflective reasoning module is introduced to analyze the consistency of an intermediate reasoning result and to adaptively correct the intermediate reasoning result, so that accurate subject knowledge question and answer are realized. The application realizes the controllability of a reasoning process in subject knowledge question and answer through structured planning, improves the correctness and robustness of a reasoning chain through reflective reasoning, and improves the understanding depth of teaching material knowledge and the question and answer performance in combination with a structured knowledge context, and is suitable for intelligent teaching guidance and automatic learning evaluation scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and knowledge question answering, and in particular to a multi-hop question answering method for subject knowledge based on structured planning and reflective reasoning. Background Technology

[0002] With the rapid development of artificial intelligence and natural language processing technologies, intelligent question-answering systems have been widely applied in education, tutoring, and automated assessment. Through understanding and reasoning about subject knowledge, question-answering systems can assist students in mastering key points in textbooks, analyzing complex problems, and providing intelligent learning support. However, as subject knowledge systems become increasingly complex and the logical layers of problems increase, existing question-answering methods often struggle to obtain accurate answers when faced with subject problems requiring the integration of multiple knowledge points or multi-step logical reasoning. This is especially true in subjects with rigorous logical structures such as mathematics, physics, and chemistry, where problem-solving often involves the connection and derivation of multiple knowledge links, making it difficult for traditional question-answering systems to effectively handle such multi-stage reasoning tasks.

[0003] Existing question-answering methods largely rely on semantic matching or end-to-end generation models, retrieving relevant fragments from textbooks or knowledge bases to generate answers. However, these methods often lack the ability to model reasoning paths when dealing with complex questions that span chapters and concepts, making it difficult to reflect the hierarchical logical relationships between subject knowledge. Furthermore, existing models lack explicit structured control mechanisms during reasoning, leading to jumps or deviations in the reasoning chain, affecting the accuracy and interpretability of the final answer. On the other hand, current question-answering systems have weak self-correction capabilities in the intermediate reasoning stages. When a model produces local errors during reasoning, it often cannot be corrected through subsequent steps, causing errors to accumulate and ultimately generating answers that do not conform to textbook knowledge or are logically inconsistent.

[0004] Therefore, how to introduce structured programming mechanisms into subject-specific question-and-answer systems to achieve controllability in the reasoning process, and how to combine reflective reasoning strategies to improve the correctness and robustness of intermediate reasoning results, has become a key issue that current intelligent educational question-and-answer technologies urgently need to address. This is of great significance for improving the depth of knowledge understanding, the completeness of reasoning logic, and the ability to cover textbook content in question-and-answer systems. Summary of the Invention

[0005] To overcome the shortcomings of existing subject-specific question-answering systems, such as insufficient controllability of reasoning paths, poor consistency of reasoning results, and inadequate understanding of the structured knowledge in textbooks, this invention proposes a multi-hop question-answering method based on structured planning and reflective reasoning, specifically addressing the complex logical levels and close conceptual connections inherent in subject-specific knowledge systems. This method decomposes complex subject-specific problems and models sub-tasks using a structured planning module, generating multi-stage reasoning paths that conform to the subject's logical system. Furthermore, it incorporates a reflective reasoning mechanism to perform consistency analysis and adaptive correction on intermediate reasoning results, thereby improving the accuracy, robustness, and interpretability of the question-answering system's reasoning in subject-specific knowledge scenarios.

[0006] The technical solution adopted by this invention to solve the technical problem is: A multi-hop question-answering method for subject knowledge based on structured planning and reflective reasoning is proposed. First, for the input subject question, a structured planning module is used to decompose the complex problem and model sub-tasks, generating a multi-stage reasoning path that conforms to the subject knowledge system. Second, relevant knowledge content is dynamically retrieved from textbooks and subject knowledge bases, and combined with information extraction technology driven by thought chains, to construct a structured subject knowledge context represented in the form of triples. Finally, a reflective reasoning module is introduced to perform consistency analysis and adaptive correction on intermediate reasoning results, thereby achieving accurate subject knowledge question answering.

[0007] Furthermore, the method includes the following steps: Step 1: Introduce a subject-specific knowledge corpus, constructing an initial document set based on textbooks, supplementary materials, and question banks; perform semantic segmentation on this set to ensure that each text block is relatively complete in terms of semantics and knowledge scope, providing more reliable knowledge units for subsequent retrieval and reasoning; the initial corpus consists of a series of document sets. The document is segmented into a sequence of sentences using a sentence segmenter, and a vector embedding model is used. Calculate the embedding vector for each sentence and the cosine similarity between adjacent sentences; when the similarity exceeds a preset threshold... When the similarity is below a threshold, adjacent sentences are grouped into the same semantic block; when the similarity is below a threshold, a semantic break is considered to have occurred, and new semantic blocks are created. Finally, a vector embedding model is used to analyze each semantic block. Encode it to obtain its dense semantic vector representation: ; The set of embeddings of all text blocks constitutes the semantic vector knowledge base of the corpus: .

[0008] Step 2: Randomly sample several complex subject-specific knowledge question-and-answer pairs from the question bank. ,in This represents a multi-hop problem involving the i-th complex subject. Supporting evidence related to this issue, The final answer. Utilizing a large language model. The designed prompt template is used to generate a structured plan for each question-answer pair. : ; Structured planning It contains several sub-problems and their corresponding reasoning templates: ; in Let j represent the j-th subproblem. This is the corresponding triplet-form reasoning template. The unknown answers (entities) in the subproblems and reasoning templates are represented by placeholders consisting of entity types and special symbols (e.g., ...). ).

[0009] Furthermore, the method also includes the following steps: Step 3: Parse structured programming using regular expressions Extract all sub-questions and templates. Then, provide supporting evidence. As context, the language model infers the answers to each sub-question step by step: ; After obtaining the answer to each subproblem, use Replace the corresponding placeholders in the template. The answer to the last sub-question is the final answer. ; Step 4: Filter all samples that failed to extract structured programming results or had incorrect final answers, retaining only the samples with correct predictions to form the programming training set: ; Step 5: In the training set Based on this, LoRA is fine-tuned on a small language model, using next word prediction as the training objective to minimize cross-entropy loss: ; in, For model parameters, The target term is structured planning.

[0010] Furthermore, the method also includes the following steps: Step 6: Fine-tune the low-rank weights obtained from LoRA. With small language model parameters To merge: ; in The scaling factor is used to define the core reasoning unit of the structured planning module after the model is fused.

[0011] Step 7: When a new subject knowledge question q is input, the structured programming module... Generate the corresponding structured program: All subproblems and templates are extracted using regular expressions and pushed onto a stack in sequence. S : .

[0012] Furthermore, the method also includes the following steps: Step 8: Pop a subproblem from the stack. Its template ,Will After inputting the encoding model, a vector representation is obtained. And retrieve the top K most similar text blocks from the corpus using Approximate Nearest Neighbor (ANN) search: ; in, Represents vector similarity (such as cosine similarity).

[0013] Step 9: Use thought chain prompts to guide the language model based on sub-problems. and Top-K text block set Extract all structured triples: , where h is the central entity (sub-problem subject), r is the relation, and t is the tail entity, thus forming a structured context; Step 10: Based on the structured context, the language model... Deduce the answer to the current subproblem: ; and use Replace the corresponding placeholder in the structured plan; Step 11: Input all executed subproblems, structured context, subproblem answers, and the next subproblem to be executed into the reflection module. : ; The reflection module verifies the correctness and rationality of the reasoning chain. If an error is detected, a corrected answer or a new reasoning plan is regenerated based on the structured triples.

[0014] Step 12: If the reflection module generates a new reasoning path planning description Then, the structured planning module generates a new subsequent path based on the new inference path planning specification. :

[0015] And use it to replace the remaining subproblems in the stack; Step 13: Repeat steps 8 through 12 until stack S is empty. The answer to the last subproblem is the final answer to the multi-hop problem. .

[0016] The technical concept of this invention is as follows: In subject-specific question-and-answer systems, the logical hierarchy and knowledge dependencies inherent in subject-specific questions are fully explored. A structured planning module is used to decompose complex problems and model sub-tasks, generating multi-stage reasoning paths that conform to the subject's knowledge system. Simultaneously, a reflective reasoning mechanism is introduced to perform consistency analysis and adaptive correction on intermediate reasoning results. Combined with the structured subject knowledge context, a deeper understanding of the textbook content is achieved, thereby enhancing the logical reasoning and knowledge integration capabilities of the question-and-answer system.

[0017] The beneficial effects of this invention are: it can effectively handle multi-level logical connections in subject-specific problems, comprehensively consider the structured knowledge characteristics and reasoning consistency of problems, improve the controllability, stability and accuracy of subject-specific question and answer, and enhance the applicability and reliability of the system in scenarios such as intelligent teaching and tutoring and automated learning assessment. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating a multi-step question-and-answer method for subject knowledge based on structured planning and reflective reasoning. Detailed Implementation

[0019] The invention will be further described below with reference to the accompanying drawings.

[0020] Reference Figure 1 A multi-hop question-answering method for subject knowledge based on structured planning and reflective reasoning includes the following steps: Step 1: Introduce a subject-specific knowledge corpus, constructing an initial document set based on textbooks, supplementary materials, and question banks. Semantic segmentation is then performed on this set to ensure that each text block is relatively complete in terms of semantics and knowledge scope, providing more reliable knowledge units for subsequent retrieval and reasoning. The initial corpus consists of a series of document sets. The document is segmented into a sequence of sentences using a sentence segmenter, and a vector embedding model is used. Calculate the embedding vector for each sentence and the cosine similarity between adjacent sentences. When the similarity exceeds a preset threshold... When the similarity is below a threshold, adjacent sentences are grouped into the same semantic block; when the similarity is below a threshold, a semantic break is considered to have occurred, and new semantic blocks are created. Finally, a vector embedding model is used to analyze each semantic block. Encode it to obtain its dense semantic vector representation: ; The set of embeddings of all text blocks constitutes the semantic vector set of the corpus: ; In this embodiment, preprocessed subject knowledge corpus (including textbooks, supplementary teaching materials, and question bank content) is used as the text corpus. NLTK is used as the sentence segmenter to segment the corpus content into a series of sentences. Subsequently, the e5-base-v2 vector embedding model is used to calculate the semantic vector of each sentence, and the vector similarity between adjacent sentences is calculated. When the similarity is higher than a threshold of 0.7, adjacent sentences are divided into the same semantic block; otherwise, they are divided into new semantic blocks. Finally, the e5-base-v2 model is used to encode each semantic block, obtaining its dense semantic vector representation, which constitutes the semantic vector set of the subject knowledge corpus.

[0021] Step 2: Randomly sample several complex subject-specific knowledge questions and answers from the question bank. ,in This represents a multi-hop problem involving the i-th complex subject. Supporting evidence related to this issue, The final answer. Utilizing a large language model. (e.g., Qwen-plus), combined with the designed prompt template, generates a structured program for each question-answer pair. : ; Structured planning It contains several sub-problems and their corresponding reasoning templates: ; in Let j represent the j-th subproblem. This is the corresponding triplet-form reasoning template. The unknown answers (entities) in the subproblems and reasoning templates are represented by placeholders consisting of entity types and special symbols (e.g., ...). ); In this embodiment, 8,000 data points were randomly sampled from the subject knowledge question bank, and the Qwen-plus model was used to generate a structured program.

[0022] Step 3: Parse structured programming using regular expressions Extract all sub-questions and templates. Then, provide supporting evidence. As context, the language model infers the answers to each sub-question step by step: ; After obtaining the answer to each subproblem, use Replace the corresponding placeholders in the template. The answer to the last sub-question is the final answer. .

[0023] Step 4: Filter all structured programming samples that failed or had incorrect final answers, retaining only the correctly predicted samples to form the training set: ; In this embodiment, after screening and verification, a total of 6080 correctly predicted structured programming samples were obtained.

[0024] Step 5: In the training set Based on this, LoRA is fine-tuned on a small language model, using next word prediction as the training objective to minimize cross-entropy loss: ; in, For model parameters, The target term is structured planning; In this embodiment, LoRA fine-tuning injects low-rank adaptation weights into the q_proj and v_proj layers, using a rank r=8 and a scaling factor. =16, learning rate set to 5e-5, using cosine annealing scheduling and preheating for 20 steps.

[0025] Step 6: Fine-tune the low-rank weights obtained from LoRA. With small language model parameters To merge: ; in The scaling factor is used to define the core reasoning unit of the structured planning module after the model is fused.

[0026] Step 7: When a new subject knowledge question q is input, the structured programming module... Generate the corresponding structured program: All subproblems and templates are extracted using regular expressions and pushed onto a stack in sequence. S : ; In this embodiment, taking the typical multi-hop problem in the subject area, "Which chemical reaction produces a gas that can turn clear limewater cloudy?" as an example, the structured programming generated by the system is as follows: Sub-question 1: Which gas can turn clear limewater cloudy? Reasoning Template 1: <[Step1: Gas: ??]; Acts on; [Step1: Solution: Clear limewater]> Sub-question 2: Which chemical reaction will produce [Step 1: gas: ??]? Reasoning Template 2: <[Step2: Chemical Reaction: ??]; Gas Generation; [Step1: Gas: ??]>.

[0027] Step 8: Pop a subproblem from the stack. Its template ,Will After inputting the encoding model, a vector representation is obtained. And retrieve the top K most similar text blocks from the knowledge base using Approximate Nearest Neighbor (ANN) search: ; in, Represents vector similarity (such as cosine similarity).

[0028] In this embodiment, the encoding model also samples the e5-base-v2 model to retrieve the top-3 relevant text blocks.

[0029] Step 9: Use thought chain prompts to guide the language model based on sub-problems. and Top-K text block set Extract all structured triples: Here, h is the central entity (sub-problem subject), r is the relation, and t is the tail entity, thus forming a structured context.

[0030] Step 10: Based on the structured context, the language model... Deduce the answer to the current subproblem: ; and use Replace the corresponding placeholder in the structured plan.

[0031] Step 11: Input all executed subproblems, structured context, subproblem answers, and the next subproblem to be executed into the reflection module. : ; The reflection module verifies the correctness and rationality of the reasoning chain. If an error is detected, a corrected answer or a new reasoning plan is regenerated based on the structured triples.

[0032] Step 12: If the reflection module generates a new reasoning path planning description Then, the structured planning module generates a new subsequent path based on the new inference path planning specification. : ; And use it to replace the remaining subproblems in the stack.

[0033] Step 13: Repeat steps 8 through 12 until stack S is empty. The answer to the last subproblem is the final answer to the multi-hop problem. .

[0034] In this embodiment, for the multi-hop problem "Which chemical reaction produces a gas that can turn clear limewater cloudy?", the generated structured programming includes sub-problems such as "Which gas can turn clear limewater cloudy?" and "Which chemical reaction produces [Step 1: Gas: ??]?". During the reasoning process, the system first retrieves the most relevant knowledge fragments from the corpus for each sub-problem; then, through the information extraction module driven by the thought chain, the retrieved content is transformed into a structured knowledge context in the form of "entity-relationship-attribute", realizing the association and fusion of cross-document knowledge. Each sub-problem is solved sequentially based on the structured context, and the intermediate answers obtained are "carbonate reacts with acid" and "carbon dioxide", respectively, and the final output answer is "carbon dioxide produced by the reaction of carbonate with acid can turn clear limewater cloudy".

[0035] The embodiments described in this specification are merely examples of implementations of the inventive concept and are for illustrative purposes only. The scope of protection of this invention should not be considered limited to the specific forms described in these embodiments; rather, it extends to equivalent technical means conceived by those skilled in the art based on the inventive concept.

Claims

1. A multi-hop question-and-answer method for subject knowledge based on structured programming and reflective reasoning, characterized in that, First, for the input subject-specific questions, a structured planning module is used to decompose complex problems and model sub-tasks, generating multi-stage reasoning paths that conform to the subject knowledge system. Second, by dynamically retrieving relevant knowledge content from textbooks and subject knowledge bases, and combining it with information extraction technology driven by thought chains, a structured subject knowledge context represented in the form of triplets is constructed. Finally, a reflective reasoning module is introduced to perform consistency analysis and adaptive correction on intermediate reasoning results, thereby achieving accurate subject knowledge Q&A. The method includes the following steps: Step 1: Introduce a subject-specific knowledge corpus, constructing an initial document set based on textbooks, supplementary materials, and question banks; perform semantic segmentation on this set to ensure that each text block is relatively complete in terms of semantics and knowledge scope, providing more reliable knowledge units for subsequent retrieval and reasoning; the initial corpus consists of a series of document sets. The document is segmented into a sequence of sentences using a sentence segmenter, and a vector embedding model is used. Calculate the embedding vector for each sentence and the cosine similarity between adjacent sentences; when the similarity exceeds a preset threshold... When the similarity is below a threshold, adjacent sentences are grouped into the same semantic block; when the similarity is below a threshold, a semantic break is considered to have occurred, and new semantic blocks are created. Finally, a vector embedding model is used to analyze each semantic block. Encode it to obtain its dense semantic vector: ; The set of embeddings of all text blocks constitutes the semantic vector set of the corpus. ; Step 2: Randomly sample several complex subject-specific knowledge question-and-answer pairs from the question bank. ,in This represents a multi-hop problem involving the i-th complex subject. Supporting evidence related to this issue, For the final answer, a large language model is used. The designed prompt template, Prompt, is used to generate a structured program for each question-answer pair. : ; Structured planning It contains several sub-problems and their corresponding reasoning templates: ; The unknown answers in sub-problems and reasoning templates, i.e., entities represented by placeholders consisting of entity type and special symbols, are used to represent these answers. ; Step 3: Parse structured programming using regular expressions Extract all sub-questions and templates, and then provide supporting evidence. As context, the language model infers the answers to each sub-question step by step: ; After obtaining the answer to each subproblem, use Replace the corresponding placeholders in the template, and the answer to the last sub-question is the final answer. ; Step 4: Filter all structured programming samples that failed or had incorrect final answers, retaining only the correctly predicted samples to form the training set: ; Step 5: In the training set Based on this, LoRA is fine-tuned on a small language model, using next word prediction as the training objective to minimize cross-entropy loss: ; Step 6: Fine-tune the low-rank weights obtained from LoRA. With small language model parameters To merge: ; The fused model constitutes the core reasoning unit of the structured planning module; Step 7: When a new subject knowledge question q is input, the structured programming module... Generate the corresponding structured program: Then, all subproblems and templates are extracted using regular expressions and pushed onto a stack in sequence. S : ; Step 8: Pop a subproblem from the stack. Its template ,Will After inputting the encoding model, a vector representation is obtained. And retrieve the top K most similar text blocks from the corpus using an Approximate Nearest Neighbor (ANN) search: ; Step 9: Use thought chain prompts to guide the language model based on sub-problems. and Top-K text block set Extract all structured triples: Where h is the subject of the subproblem, r is the relation, and t is the tail entity, thus forming a structured context; Step 10: Based on the structured context, the language model... Deduce the answer to the current subproblem: ; and use Replace the corresponding placeholder in the structured plan; Step 11: Input all executed subproblems, structured context, subproblem answers, and the next subproblem to be executed into the reflection module. , ; The reflection module verifies the correctness and rationality of the reasoning chain. If an error is detected, a corrected answer or a new reasoning plan is regenerated based on the structured triples. Step 12: If the reflection module generates a new reasoning path planning description Then, the structured planning module generates a new subsequent path based on the new inference path planning specification. : ; And use it to replace the remaining subproblems in the stack; Step 13: Repeat steps 8 to 12 until stack S is empty. The answer to the last subproblem is the answer to the final multi-hop problem.

Citation Information

Patent Citations

  • Multi-agent collaborative question and answer enhancement method and system based on heterogeneous data knowledge

    CN120705277A

  • RAG multi-hop question and answer method, device and system and storage medium

    CN120723869A