Structured reasoning path driven multi-hop RAG optimization method, device and equipment
By using a multi-hop RAG optimization method driven by structured reasoning paths, the problems of ambiguous reasoning paths, insufficient semantic focus, and dynamic controllability in multi-hop question answering tasks of large language models are solved, thereby improving the accuracy of answers and resource efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-04-03
AI Technical Summary
Existing large language models suffer from problems such as ambiguous reasoning paths, insufficient semantic focus, and lack of dynamic controllability and consistency in multi-hop question answering tasks, resulting in inaccurate answer generation and waste of computational resources.
A multi-hop RAG optimization method driven by structured reasoning paths is adopted. Key evidence is screened by a discriminative document compressor, complex questions are broken down by a zero-shot question decomposer, a triple graph is constructed and the dual-view reasoning path is extended to generate the answer.
It improves the accuracy and controllability of answer generation in multi-hop question-answering tasks, reduces computational resource consumption, increases the F1 score by 3.7%, and reduces the overhead of basic text processing units.
Smart Images

Figure CN121787555A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to the field of inference paths, specifically to a multi-hop RAG optimization method, apparatus, and device driven by structured inference paths. Background Technology
[0002] Large Language Models (LLMs), trained on diverse and complex datasets, are naturally suited for various natural language processing tasks, especially under limited-sample conditions. Through cue-based learning and Chain-of-Thought (CoT) strategies, they have made progress in complex reasoning tasks. However, due to the closed and static nature of their internal knowledge, LLMs often face problems such as illusion generation, reasoning jumps, and fact mismatches when handling multi-hop question-answering tasks that require cross-document evidence integration. In retrieval scenarios with fixed context length, increasing the number of retrieved documents leads to a performance degradation of up to 10%. To enhance the external knowledge support capabilities of LLMs, the Retrieval-Augmented Generation (RAG) framework has emerged, linking retrieval and generation, and has been widely applied in open-domain question answering and knowledge reasoning tasks. Especially in multi-hop question answering, RAG can dispatch evidence across documents, supporting complex reasoning, and combined with the generative capabilities of LLMs, improving the accuracy and interpretability of answers.
[0003] While current RAG methods have achieved some success in improving retrieval coverage and generating factual information, in multi-hop question answering tasks, the quality of the reasoning path, which serves as the information bridge connecting questions and answers, directly determines the coherence of the reasoning and the consistency of the answer. Existing methods still face three key challenges in terms of the quality of reasoning path construction:
[0004] First, the path structure is ambiguous. While implicit reasoning methods can simulate multi-step reasoning processes, the generation process heavily relies on LLMs (Large Language Models) associations. When only prompted, large language models hardly consider intermediate steps; they may rely solely on experience rather than rigorous step-by-step reasoning. Therefore, the model may arrive at the correct answer through chance or shortcut reasoning, making the reasoning process difficult to trace and verify.
[0005] Second, semantic focus is insufficient. The path construction process is susceptible to interference from redundant or noisy information, especially in multi-document concatenation scenarios, where irrelevant documents significantly reduce the inference performance of large language models. Research shows that in the HotpotQA (multi-hop question answering dataset), approximately 70% of the candidate knowledge sentences are "real distractors," meaning they not only fail to provide effective inference support but also cause the model to generate completely wrong answers (F1 score = 0).
[0006] Third, dynamic controllability and consistency are lacking. Although graph-based methods (such as knowledge graphs) provide structured organization capabilities, they rely heavily on static graphs and predefined path templates, making it difficult to dynamically adapt to the semantics of the problem, resulting in path fragmentation and conflicting perspectives. Summary of the Invention
[0007] The summary section of this application is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0008] Some embodiments of this application propose a structured inference path-driven multi-hop RAG optimization method, apparatus, computer device, and computer-readable storage medium to solve one or more of the technical problems mentioned in the background section above.
[0009] In a first aspect, some embodiments of this application provide a structured reasoning path-driven multi-hop RAG optimization method, which includes: inputting the acquired question document information into a pre-trained discriminative document compressor to obtain document compression information; inputting the question document information into a zero-shot question decomposer to obtain a sub-question information sequence; constructing a triplet graph based on the document compression information; expanding a dual-view reasoning path based on the triplet graph and the sub-question information sequence; and generating target answer information corresponding to the question document information based on the dual-view reasoning path.
[0010] Secondly, some embodiments of this application provide a structured reasoning path-driven multi-hop RAG optimization device, comprising: a first input unit configured to input acquired question document information into a pre-trained discriminative document compressor to obtain document compression information; a second input unit configured to input the aforementioned question document information into a zero-shot question decomposer to obtain a sequence of sub-question information; a construction unit configured to construct a triplet graph based on the aforementioned document compression information; an expansion unit configured to expand a dual-view reasoning path based on the aforementioned triplet graph and the aforementioned sub-question information sequence; and a generation unit configured to generate target answer information corresponding to the aforementioned question document information based on the aforementioned dual-view reasoning path.
[0011] Thirdly, this application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the method described in any implementation of the first aspect above.
[0012] Fourthly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the method described in any implementation of the first aspect above.
[0013] The above embodiments of this application have the following beneficial effects: Through the multi-hop RAG optimization method driven by the structured reasoning path of some embodiments of this application, PathWeaver is proposed—a multi-stage retrieval enhancement generation framework with structured reasoning path as its core. It solves the problems of information redundancy and path fragmentation through a dynamic path construction mechanism. A context-aware compression mechanism and a zero-shot question decomposition strategy are designed to filter key content and clarify intermediate reasoning goals, respectively, thereby providing a refined information foundation for path construction. A dual-perspective path aggregation method guided by triple graph is introduced to improve semantic consistency and generation controllability through parallel expansion and path fusion of reasoning chains at the main / secondary question level. The superiority of the framework (up to 3.7% improvement in F1) and low resource characteristics (average token (basic unit of text processing) cost of 162) are systematically verified on multiple multi-hop question answering datasets. Attached Figure Description
[0014] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0015] Figure 1 This is a flowchart of some embodiments of the structured reasoning path-driven multi-hop RAG optimization method according to this application;
[0016] Figure 2 This is a framework diagram of the multi-hop RAG optimization method driven by the structured reasoning path according to this application;
[0017] Figure 3 This is a flowchart illustrating a discriminative document compressor based on a structured reasoning path-driven multi-hop RAG optimization method according to this application.
[0018] Figure 4 This is a schematic diagram of the zero-shot problem decomposer of the multi-hop RAG optimization method driven by the structured reasoning path according to this application;
[0019] Figure 5 These are schematic diagrams of some embodiments of the structured reasoning path-driven multi-hop RAG optimization device according to this application;
[0020] Figure 6This is a schematic diagram of the structure of a computer device suitable for implementing some embodiments of this application;
[0021] Figure 7 This is a comparison chart of the overall performance of PathWeaver and the baseline on the multi-hop QA dataset test set;
[0022] Figure 8 This is a comparison chart showing the impact of ablation on model performance for each module;
[0023] Figure 9 This is a schematic diagram of the row-normalized confusion matrix for classification performance under different training data conditions;
[0024] Figure 10 This is a diagram illustrating the classification performance of 2WikiMultiHopQA with (left) and without (right) contextual information, using a row-normalized confusion matrix comparison.
[0025] Figure 11 This is a schematic diagram showing the changing trends of sentence compression performance and information retention rate under different compression thresholds in the 2WikiMultiHopQA development set;
[0026] Figure 12 This is a diagram illustrating how the EM, F1 values, and the number of tokens change as the threshold τ is adjusted.
[0027] Figure 13 This is a diagram illustrating the document compression effects and supporting evidence retention on the MuSiQue, 2WikiMultiHopQA, and HotpotQA development sets;
[0028] Figure 14 This is a diagram showing the time comparison for constructing triples for each problem before and after compression;
[0029] Figure 15 This is an example diagram of problem decomposition (QD) generated by PathWeaver and GenDec;
[0030] Figure 16 These are example diagrams generated by PathWeaver for different problems (including 2-hop, 3-hop, and 4-hop problems);
[0031] Figure 17 This is a diagram illustrating the performance comparison of the model under different parameter configurations;
[0032] Figure 18 This is a heatmap of the EM and F1 performance distributions in the parameter space of the main chain and sub-chain structures on the 2WikiMultiHopQA development set.
[0033] Figure 19This is a schematic diagram illustrating the changing trends of EM and F1 scores under different configurations of the number of main paths (m) and the number of sub-paths (n);
[0034] Figure 20 This is a schematic diagram illustrating the impact of the number of tokens on the performance of the EM and F1 models;
[0035] Figure 21 This is a schematic diagram illustrating the distribution of the number of sub-problems in a structured reasoning sample;
[0036] Figure 22 This is a schematic diagram of a case study based on the 2WikiMultiHopQA dataset. Detailed Implementation
[0037] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0038] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0039] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0040] It should be noted that the terms "a" and "a plurality of" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0041] The names of the messages or information exchanged between multiple devices in the embodiments of this application are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0042] The present application will now be described in detail with reference to the accompanying drawings and embodiments.
[0043] Figure 1 A flowchart 100 is shown, illustrating some embodiments of a structured inference path-driven multi-hop RAG optimization method according to this application. This structured inference path-driven multi-hop RAG optimization method includes the following steps:
[0044] Step 101: Input the obtained problem document information into the pre-trained discriminative document compressor to obtain document compression information.
[0045] In some embodiments, the execution entity of the structured reasoning path-driven multi-hop RAG optimization method can input the acquired question document information into a pre-trained discriminative document compressor to obtain document compression information. The question document information may include question information and document information. The document information may include at least one sub-document information. Here, the question document information may be a representation of the user-proposed question and multiple related document information obtained from the user terminal. The framework diagram of the structured reasoning path-driven multi-hop RAG optimization method is shown below. Figure 2 As shown. Figure 2 In this diagram, "Compressor" represents a discriminative document compressor, "Compressed" represents compression, "Knowledge Graph Generation" represents knowledge graph generation, "Documents" represents documents (document information included in question documents), "Question" represents questions (question information included in question documents), "Decomposer" represents a zero-shot question decomposer, "Subquestions" represents a sequence of subquestion information, "Knowiedge Graph" represents a knowledge graph (triple graph), "dual-perspective reasoning path" represents a dual-perspective reasoning path, "path aggregation" represents path aggregation, and "answer" represents the target answer information. A flowchart of the discriminative document compressor is shown below. Figure 3 As shown. Figure 3 Step 1: Sentence-Level Decomposition refers to the first step of sentence-level decomposition. Document (with multiple paragraphs) refers to a document (containing multiple paragraphs), paragraphs refers to paragraphs, and split into sentences refers to splitting into sentences. Step 2: Context-Aware Relevance Classification refers to the second step of context-aware relevance classification. Query refers to a query, compressor refers to a compressor, Relevance Score refers to the relevance score (label probability), Threshold refers to the threshold (preset probability threshold), and Compressed Document refers to a compressed document (document compression information).
[0046] Optionally, prior to step 101, the aforementioned execution entity may also perform the following steps:
[0047] The first step is to obtain a compressed training sample set. This set includes compressed training samples containing: sample question document information and sample compression tags.
[0048] The second step is to determine the initial discriminative document compressor. This initial discriminative document compressor includes: an initial sentence compressor, an initial paragraph compressor, and an initial classifier.
[0049] The initial sentence compressor can be a model that takes sample question document information as input and outputs an initial compressed information sequence. For example, the initial sentence compressor can be the PunktSentenceTokenizer (sentence segmenter).
[0050] The initial paragraph compressor can be a model that takes sample question document information as input and outputs an initial compressed information sequence. For example, the initial paragraph compressor can be BERT (a pre-trained language model).
[0051] The initial classifier can be a model that takes an initial compressed information sequence and sample question document information as input and an initial raw score set as output. For example, the initial classifier can be a QLoRA (parameter-efficient fine-tuning technique) fine-tuning architecture based on Gemma-2B-IT (large language model).
[0052] The third step is to select target compressed training samples from the compressed training sample set. In practice, the aforementioned execution entity can randomly select target compressed training samples from the compressed training sample set.
[0053] The fourth step involves inputting the sample question document information into the initial sentence compressor to obtain the initial compressed information sequence, in response to the determination that the selected target compressed training samples contain sample question document information that meets the first preset data condition. The first preset data condition can be that the sample question document information is data from the 2WikiMultiHopQA (Wikipedia multi-hop question answering dataset) or HotpotQA (multi-hop question answering dataset).
[0054] Fifth, in response to the determination that the sample question document information included in the selected target compressed training samples meets the second preset data condition, the sample question document information is input into the initial paragraph compressor to obtain the initial compressed information sequence. The second preset data condition can be that the sample question document information is data from the MuSiQue (Multi-Step Question Synthesis Queue) dataset.
[0055] The sixth step is to input the initial compressed information sequence and the sample question document information included in the selected target compressed training samples into the initial classifier to obtain the initial raw score set.
[0056] Step 7: Based on the preset matching function and the initial raw score set, determine the label probability corresponding to each piece of initial compressed information in the initial compressed information sequence, thus obtaining the label probability set. The preset matching function can be:
[0057] ,
[0058] in, Indicates the label probability. Indicates whether to retain, This indicates the problem information included in the problem document. This indicates the initial compression information. This indicates the document information included in the problem document, including the sub-document information. , Represents the initial raw score generated by the initial classifier ( , Let Y and NO represent the probabilities of the labels, respectively. The larger the value, the more the model tends to judge it as "yes," and The larger the value, the more the model tends to judge it as "no");
[0059] Step 8: Determine the initial document compression information based on the probability of each tag that is greater than a preset probability threshold and the corresponding initial compression information. For example, the preset probability threshold can be 0.1.
[0060] Step 9: Based on a preset compression loss function, determine the compression difference between the initial document compression information and the compression labels of the selected target compression training samples. The preset compression loss function can be:
[0061] ,
[0062] in, This indicates the compression difference value. This indicates the sample compression label.
[0063] Step 10: In response to the determination that the compression difference value is greater than or equal to a preset compression difference value, adjust the network parameters of the initial discriminative document compressor. For example, the difference between the compression difference value and the preset compression difference value can be calculated. Based on this, the parameters of the initial discriminative document compressor are adjusted using methods such as backpropagation and gradient descent. For example, the preset compression difference value can be 0.1.
[0064] Optionally, the aforementioned execution entity may also determine the initial discriminative document compressor as the trained discriminative document compressor in response to determining that the compression difference value is less than a preset compression difference value.
[0065] In practice, for the initial sentence compressor, the initial classifier employs a three-level supervised sample strategy: positive samples, difficult negative samples, and random negative samples. Positive samples: manually annotated supporting sentences / paragraphs. Difficult negative samples: semantically relevant fragments but lacking key information. Random negative samples: random fragments unrelated to the current query. For the initial paragraph compressor, the initial classifier uses positive and negative binary labeling, matching the granularity of its semantic units for supervision. This enhances the ability to discriminate against highly confusing (semantically relevant but non-supporting evidence) sentences.
[0066] Therefore, to suppress path deviations caused by redundant information in multi-hop question-and-answer processes, this application designs a discriminative document compressor that dynamically filters key evidence based on the principle of maximizing information in the question document. This mechanism is compatible with multi-granularity information at the sentence and paragraph levels.
[0067] Step 102: Input the problem document information into the zero-sample problem decomposer to obtain the sub-problem information sequence.
[0068] In some embodiments, the aforementioned execution entity can input the problem document information into a zero-shot problem decomposer to obtain a sequence of sub-problem information. For example, a schematic diagram of the zero-shot problem decomposer is shown below. Figure 4 As shown. Figure 4 In this context, "question" represents the problem (including question information within the question documentation), "documents" represents the documents (including document information within the question documentation), "instruction" represents the instruction, "sub1" represents sub-question 1, "sub2" represents sub-question 2, "sub3" represents sub-question 3, and "You are a precise question-answering solver. Decomposes multi-hop questions into single-hop sub-questions using only the provided context." means "You are a precise question-answering solver. Decomposes multi-hop questions into single-hop sub-questions using only the provided context." In practice, the above execution entity can obtain the sub-question information sequence using the following formula:
[0069] ,
[0070] in, Represents a sequence of sub-problem information. , This represents the sub-problem information in the sub-problem information sequence. This indicates the problem information included in the problem document. This indicates the document information included in the problem document information. This represents a zero-sample problem decomposer.
[0071] here, This represents a prompt-driven subproblem generation module that ensures the quality of subproblem generation through triple constraints, thus decomposing complex problems. This process can be formalized as follows:
[0072] (1) Single Fact Focus: Force each sub-problem to involve only a single fact (entity / relationship) to avoid logical confusion (e.g., decompose the problem of "the factors that affect A to B" into "the characteristics of A" and "the corresponding aspects of B").
[0073] (2) Semantic alignment: Ensure that the subproblem must be strictly consistent with the intent of the original problem q;
[0074] (3) Redundancy control: maximize the mutual exclusion of information between subproblems and suppress repeated expressions.
[0075] Therefore, to address the reasoning jump problem caused by implicit associations between multiple entities and events in compressed contexts, this application designs a zero-shot question decomposer. The zero-shot question decomposer breaks down questions without relying on the answer, providing verifiable semantic support for subsequent path construction.
[0076] Step 103: Construct a triplet graph based on the document compression information.
[0077] In some embodiments, the execution entity described above can construct a triplet graph based on the document compression information described above. The triplet graph can be constructed using the following formula:
[0078] ,
[0079] in, Represents a triple. Indicates the serial number. Indicates the first document ( The process involves compressing the text and then rearranging the remaining sentences or paragraphs in the original order of the document to form a new compressed text. For example, in a dataset, an original question might have 10-20 documents. After compressing sentences or paragraphs in each document, the remaining sentences or paragraphs are then rearranged in order to form a new document. Some documents may be completely empty after compression, resulting in a reduction in the amount of information in the compressed document. This indicates document compression information. This refers to a dynamic prompting engine (a dynamic prompting engine can be a pre-defined prompting word. A dynamic prompting engine can utilize a large model's prompt (prompt) to guide the large model in extracting triples). This indicates the use of LLM for dynamic prompts. Under the guidance of the document Extract structured knowledge (triplets) from the middle. This indicates that the results extracted from each document are combined (removing duplicates and merging all triples).
[0080] In practice, the core process of constructing a triplet graph can be:
[0081] The first step is triple pattern extraction: the entity relationship is expressed by the <head entity, relation, tail entity> triple to ensure semantic verifiability.
[0082] The second step is hierarchical document processing: for each document... Extraction is performed independently to avoid cross-document noise interference.
[0083] The third step is a dynamic example truncation mechanism: the number of examples in the prompts is adjusted adaptively based on the document length to solve the context overflow problem of long documents.
[0084] The fourth step is title semantic guidance: inject the document title into the prompt template to enhance entity disambiguation capabilities.
[0085] Therefore, this application aims to establish a traceable reasoning foundation based on compressed context. Generate structured knowledge representations. Abandon the predefined constraints of traditional static graphs and propose an instruction-driven dynamic graph construction framework.
[0086] Step 104: Based on the triplet graph and the sub-problem information sequence, expand the dual-perspective reasoning path.
[0087] In some embodiments, the aforementioned execution entity may extend the dual-perspective reasoning path based on the aforementioned triplet graph and the aforementioned sub-problem information sequence.
[0088] In practice, based on the aforementioned triplet graph and the aforementioned sub-problem information sequence, the aforementioned executing entity can extend the dual-perspective reasoning path through the following steps:
[0089] The first step involves encoding the aforementioned triplet graph, the sequence of sub-problems, and the problem information included in the problem document information to generate an encoded vector set. In practice, the executing entity can use a preset encoding algorithm to encode the aforementioned triplet graph, the sequence of sub-problems, and the problem information included in the problem document information to generate an encoded vector set. For example, the preset encoding algorithm could be a semantic vectorization encoding algorithm based on the E5 model (semantic embedding model).
[0090] The second step involves performing the following processing steps for each sub-problem information in the above sub-problem information sequence:
[0091] The first sub-step involves determining the extended inference path chain corresponding to the sub-question information based on the aforementioned encoded vector set. In practice, the executing entity determines the extended inference path chain corresponding to the sub-question information using a preset path algorithm based on the aforementioned encoded vector set. For example, the preset path algorithm could be: expanding the inference path round by round using an autoregressive approach for the sub-question information. In practice, firstly, a query vector can be calculated (by concatenating the current path with the question to calculate the query vector), and the top 20 relevant triples can be retrieved using semantic similarity as a candidate triple set. Secondly, LLMs (Large Language Models) are guided to select the optimal extended or terminated path expansion from the candidate triples. Finally, the inference path is expanded round by round using an autoregressive approach until the model terminates path expansion, resulting in a complete path.
[0092] As an example, the first step is the current path. If empty, calculate the similarity between the problem and all triples in the graph, identify the Top-20 relevant triples as candidate triples, and then guide the Llama 3.1-8B-Instruct large model (multilingual large model) to select the optimal extension term from the candidate triples or determine whether to terminate path expansion. The second step is to select the optimal extension term and insert it into the current path. , is the first triplet of the path. Then, concatenating the problem and the current path, we get its vector representation as: Next, the similarity with the remaining triples in the graph is calculated again. The top-20 relevant triples are identified as candidate triples, and then the Llama 3.1-8B-Instruct large model is guided to select the optimal expansion term from the candidate triples or determine whether to terminate path expansion. In the third step, the inference path is expanded round by round using the above autoregressive method until the model terminates path expansion and obtains the complete path. In addition, to balance the diversity and accuracy of paths, Beam Search is introduced. Candidate paths are sorted by cumulative score, and the highest-scoring paths are retained for the next round of expansion until the path terminates or reaches the maximum length.
[0093] The second sub-step involves determining the path score set corresponding to the extended inference path chain based on a preset path scoring function. The extended paths included in the extended inference path chain can correspond to path scores within the path score set. The preset path scoring function can be:
[0094] ,
[0095] in, Represents path score. This indicates the current path (including the extended inference paths included in the extended inference path chain). Indicates the length of the reasoning path (i.e., the number of triples). This indicates the triplets included in the triplet map. express, This indicates that LLM is used to calculate the selection of triples in the current state. The logarithm of the probability, This represents the weight hyperparameters, used to adjust the weights of the inference chain generation probability term and the semantic similarity term, for example... Set it to 0.1. Indicates the current path The corresponding encoding vector, Represents the question vector (the encoding vector corresponding to the current question). express and The similarity.
[0096] The third sub-step involves identifying the path scores that satisfy the preset path conditions within the aforementioned path score set, along with their corresponding extended inference paths, as the target extended inference path chain. The preset path conditions can be: the five path scores that are the highest.
[0097] The third step is to determine the main extended inference path chain corresponding to the problem information included in the aforementioned problem document information. The specific implementation method and resulting technical effects of determining the main extended inference path chain corresponding to the problem information included in the aforementioned problem document information can be found in step 104 of the above embodiments, and will not be repeated here.
[0098] The fourth step involves jointly processing the determined extended reasoning path chains for each target and the aforementioned main extended reasoning path chain to generate an extended dual-perspective reasoning path. This extended dual-perspective reasoning path can be generated using the following formula:
[0099] ,
[0100] in, This indicates an extended dual-perspective reasoning path. , Indicates the serial number. , , This indicates the first question in the main question (the question information included in the question document). One reasoning path, Indicates the first The first sub-problem (the first in the sub-problem information sequence) The information corresponding to the sub-problem) One reasoning path, Indicates the number of subproblems. Indicate the preceding part of the main question One reasoning path, The first part of the subproblem There are several reasoning paths. This allows for the aggregation of dual-perspective paths, merging the reasoning paths of the main problem and the subproblems, and removing duplicate triples from the path set to achieve a complementary effect.
[0101] Therefore, this application proposes a dual-perspective path expansion and aggregation framework to overcome the path fragmentation defect of static graphs. Based on a dynamic triplet graph G, it coordinates semantic retrieval and LLMs guidance mechanisms to generate logically consistent reasoning chains.
[0102] Step 105: Based on the dual-perspective reasoning path, generate the target answer information corresponding to the question document information.
[0103] In some embodiments, the aforementioned executing entity can generate target answer information corresponding to the aforementioned question document information based on the aforementioned dual-perspective reasoning path. In practice, the aforementioned executing entity can generate target answer information corresponding to the aforementioned question document information using the Llama3.1-8B-Instruct large model (multilingual large model) based on the aforementioned dual-perspective reasoning path. Thus, based on generative reasoning, the Llama3.1-8B-Instruct large model can be invoked to reason and answer based on the question and structured reasoning path, providing the answer.
[0104] Thus, three optimizations were achieved. First, traceability: the generated answer can be traced back to the specific path node in Z, enhancing the interpretability of the reasoning process. Second, illusion suppression: the model is constrained to be generated only based on Z, effectively avoiding false information and improving the factual consistency of the generated results. Third, robustness enhancement: by limiting the generation dependency through the structured path set Z, the F1 score is improved by an average of 14% compared to directly using all documents to answer.
[0105] The above embodiments of this application have the following beneficial effects: Through the multi-hop RAG optimization method driven by the structured reasoning path of some embodiments of this application, PathWeaver is proposed—a multi-stage retrieval enhancement generation framework with structured reasoning path as its core. It solves the problems of information redundancy and path fragmentation through a dynamic path construction mechanism. A context-aware compression mechanism and a zero-shot question decomposition strategy are designed to filter key content and clarify intermediate reasoning goals, respectively, thereby providing a refined information foundation for path construction. A dual-view path aggregation method guided by triple graph is introduced to improve semantic consistency and generation controllability through parallel expansion and path fusion of reasoning chains at the main / secondary question level. The superiority of the framework (up to 3.7% improvement in F1) and low resource characteristics (average token cost of 162) are systematically verified on multiple multi-hop question answering datasets.
[0106] Further reference Figure 5As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a structured inference path-driven multi-hop RAG optimization device. These embodiments of the structured inference path-driven multi-hop RAG optimization device are similar to... Figure 1 Corresponding to the method embodiments shown, this structured inference path-driven multi-hop RAG optimization device can be specifically applied to various electronic devices.
[0107] like Figure 5 As shown, a multi-hop RAG optimization device 500 driven by structured reasoning path in some embodiments includes: a first input unit 501 configured to input the acquired question document information into a pre-trained discriminative document compressor to obtain document compression information; a second input unit 502 configured to input the question document information into a zero-shot question decomposer to obtain a sequence of sub-question information; a construction unit 503 configured to construct a triplet graph based on the document compression information; an expansion unit 504 configured to expand a dual-view reasoning path based on the triplet graph and the sub-question information sequence; and a generation unit 505 configured to generate target answer information corresponding to the question document information based on the dual-view reasoning path.
[0108] It is understandable that the units described in the structured reasoning path-driven multi-hop RAG optimization device 500 are related to the reference... Figure 1 The steps described in the method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the structured inference path-driven multi-hop RAG optimization device 500 and the units contained therein, and will not be repeated here.
[0109] This application also provides a computer device 600. For example... Figure 6 As shown, computer device 600 includes: bus 601, processor 602, memory 603, and communication interface 604. Processor 602, memory 603, and communication interface 604 communicate via bus 601. Computer device 600 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computer device 600.
[0110] Bus 601 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 6The bus 601 is represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 601 may include a path for transmitting information between various components of the computer device 600 (e.g., memory 603, processor 602, communication interface 604).
[0111] Processor 602 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0112] Memory 603 may include volatile memory, such as random access memory (RAM). Memory 603 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0113] The memory 603 stores executable program code, which the processor 602 executes to implement the functions of the aforementioned first input unit, second input unit, construction unit, expansion unit, and generation unit, thereby realizing the structured inference path-driven multi-hop RAG optimization method. That is, the memory 603 stores instructions for executing the structured inference path-driven multi-hop RAG optimization method.
[0114] The communication interface 604 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the computer device 600 and other devices or communication networks.
[0115] This application also provides a chip, which includes a processor and a data interface. The processor reads instructions stored in the memory through the data interface to execute the above-described structured inference path-driven multi-hop RAG optimization method.
[0116] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the structured inference path-driven multi-hop RAG optimization method described above.
[0117] To systematically verify the reasoning efficiency and generalization of this application, the proposed method was evaluated on three classic multi-hop question-answering datasets: HotpotQA (multi-hop question-answering dataset): focusing on fact-verification reasoning; 2WikiMultiHopQA (wiki multi-hop question-answering dataset): emphasizing cross-entity relation reasoning; and MuSiQue (multi-step question synthesis queue): oriented towards deep logical jumps (2-4 jumps) in specialized domains. All three datasets examine the ability to perform cross-document multi-hop reasoning, typically requiring 2-4 logical jumps per question to arrive at the correct answer. HotpotQA and 2WikiMultiHopQA provide 10 Wikipedia documents per question, while MuSiQue provides 20. All corpora in the datasets are from Wikipedia. A development set of 500 questions was randomly sampled (ablation experiments), and a test set of 1000 questions was used (main evaluation). To comprehensively evaluate the effectiveness of this application in multi-hop question answering tasks, the following four representative comparison methods were selected: No-document input (w / o documents): using only the question as input without introducing any retrieved documents, evaluating the language model's answering ability without external knowledge support; Naive RAG (RAG with all documents): directly concatenating all retrieved documents and sending them to the reader, forming a standard single-step RAG process; HippoRAG2 (Hippocampal Enhanced Retrieval Generation Framework 2.0): a graph-structured retrieval method based on Personalized PageRank, constructing a triple graph from compressed documents and performing multi-hop path diffusion, representing one of the important current structured RAGs; Trace (Path-based Reasoning-based Retrieval Enhancement Generation Framework): utilizing a large language model to construct a knowledge graph and generate reasoning chains, enhancing retrieval and answer generation through path guidance. Furthermore, all comparison methods used the same reader model for answer generation. To evaluate QA (Quality Assurance) performance, EM (ExactMatch) and F1 (F1 score) were used as evaluation metrics. The text compression retention threshold τ was tuned on the validation set, with a default setting of 0.1. The compressor was optimized using Gemma-2B-it (a lightweight open-source large model) for efficient parallel processing. The reader model uniformly adopted LLaMA3-8B-Instruct (a large language model), generating answers based on the final path under a zero-shot setting. Experiments were conducted on a single A800-80GB GPU.
[0118] like Figure 7 As shown, Figure 7The overall performance (%) of PathWeaver and baseline on the multi-hop QA dataset test set is shown, where "# Tok" is the average number of tokens in the document / inference chain used as context, Model represents the model, and w.all documents represents the Naive RAG. The best performance for each metric for each dataset is marked in bold. Figure 7 This paper presents a performance comparison between PathWeaver (this application) and baseline methods on three multi-hop question answering datasets. Experimental results show that PathWeaver exhibits comprehensive performance advantages in multi-hop question answering tasks. On the HotPotQA dataset, PathWeaver significantly outperforms all baseline models with an EM of 54.7% and an F1 score of 70.2%: compared to the naive RAG (46.4% EM, 61.8% F1), it improves by 8.3% EM and 8.4% F1; compared to the Trace model (53.7% EM, 68.3% F1), it improves by 1.0% EM and 1.9% F1.
[0119] In terms of computational efficiency, PathWeaver also performs exceptionally well. Its token (basic unit of text processing) consumption (152) is only 10.6% of that of the naive RAG method (1429), 3.2% lower than the Trace model (157), and 66.5% lower than HippoRAG2 (454). This efficiency is even more evident on the 2WikiMultiHopQA dataset, where PathWeaver achieves 49.0% EM and 59.9% F1 performance using only 156 tokens, with computational costs of 14.6% of naive RAG (1067), 98.7% of Trace (158), and 28.2% of HippoRAG2 (553), respectively. This result verifies the effectiveness of the structured reasoning path, showing that PathWeaver can significantly reduce computational costs without losing key information.
[0120] Notably, on the most challenging MuSiQue professional-domain dataset, PathWeaver outperformed Trace across the board with scores of 37.6% EM and 44.2% F1: 1.6% EM and 0.5% F1, compared to Trace (36.0% EM, 43.7% F1); and a significant improvement of 17.2% EM and 15.0% F1 over HippoRAG2 (20.4% EM, 29.2% F1). These results clearly demonstrate PathWeaver's dual advantages in inference capability and computational efficiency.
[0121] Ablation experiments were conducted to evaluate the contribution of each PathWeaver module to the model performance. The experiments employed a progressive design, sequentially building three comparative models: the baseline, an intermediate version containing only the discriminative document compressor (w.Compressor), and the full PathWeaver. It is important to note that since the subproblem decomposer is primarily responsible for generating subproblems and does not directly construct the inference chain, its performance metrics were not tested separately.
[0122] like Figure 8 As shown, Figure 8 The impact (%) of ablation on model performance for each module is shown. Average chain count represents the average number of inference chains required per question; Baseline represents the basic question-answering framework without structured optimization; w.Compressor represents Baseline plus a discriminative document compressor; PathWeaver represents the complete architecture including a discriminative document compressor, subquestion decomposer, and path aggregator; all experiments were performed on the same hardware configuration. The introduction of the document compression module significantly improved model performance: on the 2WikiMultiHopQA dataset, the EM metric improved from 68.4 to 69.4 (Δ=1.0), and the F1 score improved from 76.4 to 77.1 (Δ=0.7); on the MuSiQue dataset, improvements of 0.8 EM and 1.2 F1 were achieved, respectively. This improvement is mainly attributed to the filtering of redundant information by the discriminative document compressor.
[0123] The PathWeaver architecture significantly optimizes inference efficiency: the average number of inference chains is reduced from 5 to 3.172 (2WikiMultiHopQA) and 3.154 (MuSiQue), respectively, representing a reduction of 36.6%-36.9%. Meanwhile, model performance is further improved: on 2WikiMultiHopQA, EM improves from 69.4 to 72.4 (Δ=3.0), and F1 improves from 77.1 to 79.7 (Δ=2.6); on MuSiQue, improvements of 1.6 EM and 1.3 F1 are achieved, respectively.
[0124] The PathWeaver architecture demonstrates significant advantages over the baseline, achieving improvements of 4.0 EM and 3.3 F1 on 2WikiMultiHopQA, and 2.4 EM and 2.5 F1 on MuSiQue. These results not only validate the effectiveness of each module but also demonstrate PathWeaver's comprehensive advantage in optimizing inference efficiency (reducing inference chains by 36.6%-36.9%) while simultaneously improving answer quality (up to 4.0 EM improvement).
[0125] To improve the relevance discrimination ability of the document compressor, the impact of training data composition and contextual information on classifier performance was also examined:
[0126] First, the impact of training data composition on classification performance:
[0127] like Figure 9 As shown, Figure 9 The diagram shows row-normalized confusion matrices under three different training data configurations. Each matrix compares the predicted ("Yes" / "No") labels with the actual labels to compare the classifier's performance under different settings. The three configurations are: Pos+H-Neg+Neg: positive samples + hard negative samples + random negative samples (the method used in this application); Pos+H-Neg: positive samples + hard negative samples; Pos+Neg: positive samples + random negative samples. Ours represents this application, Actual represents the actual value, and Predicted represents the predicted value.
[0128] In the Pos+H-Neg+Neg configuration, the classifier demonstrates good recognition ability for both "relevant" (Yes) and "irrelevant" (No) sentences, with an average recall of 0.875 for both categories, showing a high degree of balance. However, in configurations that exclude one type of negative sample (i.e., Pos+H-Neg or Pos+Neg), the overall robustness of the model decreases. For example, the Pos+Neg configuration performs reasonably well in recognizing "relevant" sentences, but it misclassifies a large number of "irrelevant" sentences (recall drops from 0.83 to 0.58), showing a significant class imbalance.
[0129] Secondly, the impact of contextual information on classification performance:
[0130] like Figure 10 As shown, Figure 10 The diagram shows a comparison of the classification performance of 2WikiMultiHopQA with (left) and without (right) context information using row-normalized confusion matrices. 2Wiki represents 2WikiMultiHopQA, with Context indicates contextual information, and w / o Context indicates no contextual information. The introduction of context improves the model's ability to accurately distinguish between relevant ("yes") and irrelevant ("no") sentences. After introducing contextual information, the model's recall for both "relevant" and "irrelevant" sentences exceeds 80%, and the false positive rates for "YES" and "NO" categories decrease to 0.08 and 0.17, respectively, both superior to the performance without context (0.13 and 0.25). This result demonstrates that contextual information provides crucial semantic support for sentence-level discrimination, effectively enhancing the model's ability to distinguish between sentences with ambiguous boundaries and potential interference, thus improving overall compression accuracy.
[0131] In summary, the experimental results verify the synergistic effect between training data construction and context guidance: by introducing difficult negative samples and semantic context, the contextual understanding and discrimination accuracy of the classifier can be significantly enhanced.
[0132] To systematically evaluate the impact of the threshold τ (preset probability threshold) on the compression effect and downstream performance in a discriminative document compressor, this paper conducts a comprehensive comparison of different configurations within the range of τ∈[0.1, 0.9].
[0133] First, the trade-off between compression effectiveness and semantic preservation: such as Figure 11 As shown, Figure 11 The results show the sentence compression performance and the trend of information retention rate under different compression thresholds in the 2WikiMultiHopQA development set. Figure 11 (a) shows the changes in the amount of original sentence preserved and compressed under different compression thresholds; Figure 11 (b) in the figure shows the change in the number of supporting evidence sentences retained during the compression process. Figure 11 Figure (c) shows the trend of the number of supporting evidence sentences retained and the support rate as the threshold changes. As τ increases from 0.1 to 0.9, the number of sentences retained continuously decreases (11482→2675), while the compression rate increases from 44% to 87%. Despite the increase in compression intensity, the model can still robustly retain key information: when τ≤0.7, the retention rate of supporting sentences is always above 90%, and even under aggressive compression (τ=0.9), 76.99% of the core evidence is still retained.
[0134] Secondly, the impact on downstream question-answering performance: such as Figure 12 As shown, Figure 12 The performance variations of the compressor at different τ values on 2WikiMultiHopQA are shown. Overall performance is stable, with τ=0.1 achieving the optimal balance: the highest EM (69.6) and F1 (77.4) with the fewest tokens (148). Although τ=0.3 is slightly higher in EM (70.2), it does not offer an advantage in F1 and token cost; while τ=0.9, although significantly compressing the input (140.8 tokens), leads to a significant performance drop (68.6 EM / 74.37 F1), indicating that excessive compression can destroy the evidentiary information required for reasoning.
[0135] In summary, τ=0.1 provides the most comprehensive performance advantages while maintaining the lowest token cost, making it the optimal choice that balances compression efficiency and question-answering quality.
[0136] Based on the above analysis, τ=0.1 was established as the default compression threshold for PathWeaver, and its generalization ability on the MuSiQue, HotpotQA, and 2WikiMultiHopQA datasets was verified. Figure 13As shown, Figure 13 The document compression results and the retention of supporting evidence are shown on MuSiQue, 2WikiMultiHopQA, and HotpotQA development sets. The left graph compares the number of paragraphs or sentences before and after compression; the right graph shows the ratio of retained to discarded supporting evidence after compression. Figure 13 This demonstrates that the configuration exhibits robust performance across different data characteristics and annotation granularities: achieving a compression rate of 44.1% and a supporting sentence retention rate of 97.95% on 2WikiMultiHopQA, and a retention rate of 98.68% on HotpotQA. Particularly noteworthy is its performance on the MuSiQue dataset, where the paragraph-level annotation characteristics increase the difficulty of identifying key information, resulting in a slight decrease in the supporting evidence retention rate to 95.3%, but this figure remains within a high performance range. Figure 14 As shown, Figure 14 The comparison of triple construction time for each question before and after compression is shown. The compression mechanism with a threshold of 0.1 is applicable to different datasets and significantly reduces the time consumption of downstream tasks. Tests were conducted on triple extraction time before and after compression on different datasets, showing a 4.1% reduction in processing time per question on 2WikiMultiHopQA and a decrease from 25.41s to 22.71s on MuSiQue. This demonstrates that document compression reduces the latency of structured information extraction, fully highlighting the performance advantages of this mechanism. This result indicates that moderate compression not only does not affect semantic integrity but also improves the overall system efficiency. Considering the compression effect, question-answering performance, and cross-task adaptability, τ=0.1 significantly improves system efficiency while ensuring semantic integrity and can be considered a recommended configuration for practical deployment.
[0137] To evaluate the generation quality and structural rationality of the subproblems generated by PathWeaver, such as Figure 15 As shown, Figure 15 This example shows a question decomposition (QD) generated by PathWeaver and GenDec, targeting the question: "Are Random HouseTower and 888 7th Avenue both used for real estate?", where Sub-question 1 represents sub-question 1 and Sub-question 2 represents sub-question 2. Figure 15 The performance of PathWeaver was compared with that of GenDec (a generative problem decomposition method for multi-hop reasoning problems (MHQA)) in sample cases. The results show that PathWeaver can more accurately understand the semantics of the original problem and generate a well-structured sequence of sub-problems, thus effectively supporting subsequent multi-hop reasoning. Figure 15Taking the problem as an example, this problem involves two entities and their parallel judgments regarding their real estate uses. Direct processing could easily lead to ambiguity. PathWeaver first identifies the parallel entities "Random House Tower" and "888 7thAvenue" and generates two independent sub-problems accordingly, each corresponding to its respective judgment objective. This decomposition method not only preserves the judgment logic of the original problem but also allows each sub-problem to be solved independently, exhibiting good parallelism. In contrast, while the sub-problems generated by GenDec are logically sound, the phrase "used also for" in its second sub-problem deviates from the core semantics of the original problem. This semantic ambiguity leads to inaccurate queries, reflecting the shortcomings of this method in generating structured sub-problems.
[0138] To evaluate the PathWeaver model's ability to handle multi-hop problems of varying complexity, experiments were conducted using representative 2-4 hop problems from the development set as test samples. For example... Figure 16 As shown, Figure 16 This demonstrates PathWeaver's generalization capabilities, showcasing examples generated by PathWeaver for different questions (including 2-hop, 3-hop, and 4-hop questions). 2 HOP QUESTION represents a 2-hop question, 3 HOP QUESTION represents a 3-hop question, 4 HOP QUESTION represents a 4-hop question, and OriginalQuestion represents the original question. Figure 16 This demonstrates PathWeaver's adaptability to multi-hop problems. Specifically, in 2-hop problems, the model accurately identifies core entities (such as "Scott Derrickson" and "Ed Wood") and their associated attributes (nationality), generating semantically independent atomic question pairs. For 3-hop problems, it successfully constructs a hierarchical, progressive sequence of sub-questions (such as "location location → geographic region mapping → policy information extraction"). Even in the most challenging 4-hop scenario, it effectively handles difficulties such as nested entity referencing and complex geographic boundary reasoning. In summary, PathWeaver exhibits excellent generalization ability under zero-shot conditions, generating high-quality sub-question sequences without requiring specific templates.
[0139] To verify the enhancing effect of subproblem reasoning chains on multi-hop reasoning, this application evaluated the synergistic effect between subproblem reasoning chains (n) and the main problem chain (m): Baseline model: using a standard configuration without subproblem reasoning chains (m=5, n=0), EM=69.6 / F1=77.4. Control group: comprehensively testing 25 combinations of the number of subproblem reasoning chains n∈[1,5] and the number of main problem reasoning chains m∈[1,5].
[0140] like Figure 17 As shown, Figure 17 This figure shows a comparison of model performance under different parameter configurations. It illustrates the impact of parameter m on the EM (top row) and F1 (bottom row) metrics when n = 1-5. The red solid line represents the baseline model performance (EM = 68.4, F1 = 76.38), and the colored solid lines represent the results of different experimental configurations. Experimental results show that all configurations significantly outperform the baseline. The experiments were conducted on an A800-80GB GPU and evaluated using the 2WikiMultiHopQA development set. Figure 17 The results show that the collaborative reasoning architecture of the main / sub-problem reasoning chain significantly improves model performance. On the EM metric, all configurations outperform the baseline by 1.6–2.8% (highest 72.4 vs. baseline 69.6); the F1 metric is improved by 1.47–3.0% (highest 80.4 vs. baseline 77.4). In particular, the concise configuration with n=1 and m=1 achieves the best F1 (80.4) and EM (72.4). This performance improvement stems from the collaborative work of the two: the main problem reasoning chain maintains the global reasoning objective, while the sub-problem reasoning chain provides precise local evidence support through fine-grained sub-problems. This complementary information structure significantly enhances the accuracy of multi-hop reasoning.
[0141] Further analysis shows that increasing the number of subproblem reasoning chains leads to a decrease in EM (72.4 to 70.6 when n=1→5), while appropriately increasing the number of main problem reasoning chains (such as m=1→3 when n=3) can improve F1 by 0.75 points, indicating that it is necessary to balance the accuracy of subchains and the stability of main chains.
[0142] This application uses multidimensional visualization analysis to reveal the quantitative relationship between model performance and parameters (m, n).
[0143] like Figure 18 As shown, Figure 18 The following is a heatmap showing the EM and F1 performance distribution of the main chain and sub-chain structure parameter space on the 2WikiMultiHopQA development set. The horizontal axis represents the number of sub-chains (n), and the vertical axis represents the length of the main chain (m); the color gradient represents the score, and the color scale on the right marks the key values; the optimal region (m≤3 and n≤2) contains the peak point (m=1 / n=1, F1=80.4). Figure 18 This indicates that there are obvious performance partitioning characteristics in the parameter space: the optimal performance region is concentrated in the configuration range of n≤2 and m≤3, where the combination of n=1 and m=1 reaches the peak F1 score of 80.4; the performance stable region appears in the range of n∈[2,3] and m∈[2,3], where the F1 score is maintained between 79.5 and 80.2; while when n or m≥4, it enters the performance decay region, where the F1 score is generally lower than 79.5, confirming that excessively long subproblem inference chains will significantly reduce model performance.
[0144] Further experiments revealed that when the length of the main problem reasoning chain (m) is fixed, the EM index shows a monotonically decreasing trend with the increase of the number of subproblem reasoning chains n. However, when the number of subproblem reasoning chains (n) is fixed, the EM exhibits a non-linear characteristic with the change of the length m of the main problem reasoning chain, reaching a local optimum near m=3. Figure 19 Computational efficiency analysis is as follows: Figure 20 The results show that the m=1, n=1 configuration achieves an EM value of 72.4 with a computational cost of 144.78 tokens, which is significantly better than other parameter combinations. Figure 19 The trends of EM and F1 scores are shown under different configurations of the number of main paths (m) and the number of sub-paths (n). Figure 19 In the text, (a) represents the change in EM score with the number of main paths (m) (with a fixed number of sub-paths n); Figure 19 In the diagram, (b) represents the change in F1 score with the number of main paths (m) (with a fixed number of sub-paths n); Figure 19 In the diagram, (c) represents the change in EM score with the number of sub-paths (n) (with a fixed number of main paths m); Figure 19 In the figure, (d) represents the change of F1 score with the number of sub-paths (n) (with a fixed number of main paths m). Figure 20 The diagram illustrates the impact of token quantity on the performance of the EM and F1 models. The figures compare the performance-cost trade-offs of the models under different main-subchain combinations (m, n). The horizontal axis represents computational cost (Tokens), and the vertical axes of the left and right graphs correspond to the EM (%) and F1 (%) indicators, respectively. The (m=1, n=1) combination achieves balanced performance (EM 72.4%, F1 80.4%) with the lowest token consumption (144.8), and its large, dark bubble in the upper left corner indicates that this is the optimal deployment scheme.
[0145] Considering the trade-off between overall performance metrics and computational overhead, it is recommended to uniformly adopt m=1, n=1 as the optimal configuration scheme. This configuration achieves the highest computational efficiency while maintaining the best model performance.
[0146] To verify the actual effectiveness of PathWeaver's structured reasoning, an in-depth analysis was conducted on two dimensions: the number of reasoning paths and the quality of reasoning path construction.
[0147] First, the number of inference paths is optimized: a strategy of "retaining one path with the highest confidence for both the main question and sub-questions" is adopted, achieving a good balance between computational efficiency and response performance. For example... Figure 21 As shown, Figure 21The distribution of the number of subproblems in the structured reasoning samples is shown. The cumulative distribution of the number of subproblems across the two development sets (2-hop to 4-hop) shows that over 90% of the samples have ≤2 subproblems, indicating that most problems require only 3 or fewer paths to complete the reasoning. In the MuSiQue development set, approximately 90.6% of the samples (908 / 1002) require only 3 or fewer paths to complete the reasoning, with only 0.6% of the complex problems requiring more than 5 paths. Compared to the baseline setting of 5 fixed paths, this strategy reduces the average number of paths by 44%.
[0148] Secondly, reasoning path quality assessment: case analysis combining real-world examples from 2WikiMultiHopQA (see...) Figure 22 This paper delves into the inference path structure generated by PathWeaver. The problem involves multiple entity jumps and cross-segment inference requirements. While the main question path provides some answer information, it is insufficient to support a complete solution. However, the accompanying sub-question paths supplement the core missing information, and the two work together to form the final inference path. This process not only demonstrates the information complementarity between paths but also provides a clear and interpretable support chain for the model's generated answer, enhancing the system's transparency and credibility.
[0149] In summary, the structured path system built by PathWeaver ensures high-quality inference output while controlling inference costs, verifying its practical application potential in multi-hop question answering tasks.
[0150] In summary, the PathWeaver framework proposed in this application significantly improves multi-hop question answering performance through structured reasoning paths. First, a discriminative document compressor is used to retain information highly relevant to the question; second, a zero-shot sub-question decomposer clarifies intermediate reasoning goals; then, a path aggregator based on triple graphs integrates the reasoning chains that expand in parallel for main / sub-questions; finally, a traceable set of reasoning paths is generated to support answer generation.
[0151] Experiments on three multi-hop question answering benchmark datasets demonstrate that PathWeaver significantly outperforms existing methods across various metrics, achieving a 3.7% improvement in F1 score on 2WikiMultiHopQA. Furthermore, PathWeaver exhibits excellent generalization ability, generating high-quality sub-questions for problems of varying complexity (2-4 hops) and reducing the average number of paths by 44% without sacrificing answer quality, thus validating the effectiveness of the proposed method.
[0152] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.
Claims
1. A structured reasoning path-driven multi-hop RAG optimization method, characterized in that, include: The obtained problem document information is input into a pre-trained discriminative document compressor to obtain document compression information; The problem document information is input into the zero-shot problem decomposer to obtain a sequence of sub-problem information; Based on the document compression information, a triplet graph is constructed; Based on the triplet graph and the sub-problem information sequence, the dual-perspective reasoning path is expanded; Based on the dual-perspective reasoning path, the target answer information corresponding to the question document information is generated.
2. The multi-hop RAG optimization method driven by structured reasoning path according to claim 1, characterized in that, Before inputting the acquired problem document information into a pre-trained discriminative document compressor to obtain document compression information, the method further includes: Obtain a compressed training sample set, wherein the compressed training samples in the compressed training sample set include: sample problem document information and sample compression tags; Determine an initial discriminative document compressor, which includes: an initial sentence compressor, an initial paragraph compressor, and an initial classifier; Select target compressed training samples from the compressed training sample set; In response to the determination that the sample question document information included in the selected target compressed training samples meets the first preset data conditions, the sample question document information is input into the initial sentence compressor to obtain the initial compressed information sequence; In response to the determination that the sample problem document information included in the selected target compressed training samples meets the second preset data condition, the sample problem document information is input into the initial paragraph compressor to obtain the initial compressed information sequence; The initial compressed information sequence and the sample question document information included in the selected target compressed training samples are input into the initial classifier to obtain the initial raw score set; Based on the preset matching function and the initial original score set, the label probability corresponding to each initial compressed information in the initial compressed information sequence is determined, and the label probability set is obtained. The initial document compression information is determined by the probability of each tag that is greater than a preset probability threshold in the tag probability set and the corresponding initial compression information. Based on the preset compression loss function, the compression difference value between the initial document compression information and the sample compression labels included in the selected target compression training samples is determined; In response to determining that the compression difference value is greater than or equal to the preset compression difference value, the network parameters of the initial discriminative document compressor are adjusted.
3. The multi-hop RAG optimization method driven by structured reasoning path according to claim 2, characterized in that, The preset matching function is: , in, Indicates the label probability. Indicates whether to retain, This indicates the problem information included in the problem document. This indicates the initial compression information. This indicates the document information included in the problem document, including the sub-document information. , This represents the initial raw score generated by the initial classifier; The preset compression loss function is: , in, This indicates the compression difference value. This indicates the sample compression label.
4. The multi-hop RAG optimization method driven by structured reasoning path according to claim 2, characterized in that, The method further includes: In response to determining that the compression difference value is less than the preset compression difference value, the initial discriminative document compressor is determined as the trained discriminative document compressor.
5. The multi-hop RAG optimization method driven by structured reasoning path according to claim 1, characterized in that, The triplet map is constructed using the following formula: , in, Represents a triple. Indicates the serial number. Indicates the first This document This indicates document compression information. This indicates a dynamic suggestion engine. This indicates the use of LLM for dynamic prompts. Under the guidance of the document Extract structured knowledge (triplets) from the middle. This indicates that the results extracted from each document are combined (removing duplicates and merging all triples).
6. The multi-hop RAG optimization method driven by structured reasoning path according to claim 1, characterized in that, The extension of the dual-perspective reasoning path based on the triplet graph and the sub-problem information sequence includes: The triplet graph, the sub-problem information sequence, and the problem information included in the problem document information are encoded to generate an encoded vector set; For each sub-problem information in the sub-problem information sequence, perform the following processing steps: Based on the encoded vector set, determine the extended reasoning path chain corresponding to the sub-problem information; Based on a preset path scoring function, a path score set corresponding to the extended inference path chain is determined, wherein the extended inference path chain includes path scores in the path score set corresponding to the extended paths, and the preset path scoring function is: , in, Represents path score. This indicates the current path (including the extended inference paths included in the extended inference path chain). Indicates the length of the reasoning path. This indicates the triplets included in the triplet map. express, This indicates that LLM is used to calculate the selection of triples in the current state. The logarithm of the probability, This represents the weight hyperparameter. Indicates the current path The corresponding encoding vector, Represents the question vector (the encoding vector corresponding to the current question). express and Similarity; Each path score in the path score set that satisfies the preset path conditions, and each corresponding extended reasoning path, are determined as the target extended reasoning path chain. Determine the main extended reasoning path chain corresponding to the problem information included in the problem document information; The determined target extended inference path chains and the main extended inference path chain are jointly processed to generate an extended dual-view inference path, wherein the extended dual-view inference path is generated by the following formula: , in, This indicates an extended dual-perspective reasoning path. , Indicates the serial number. , , The first part of the main problem One reasoning path, Indicates the first The first sub-problem corresponds to the One reasoning path, Indicates the number of subproblems. Indicate the preceding part of the main question One reasoning path, The first part of the subproblem A reasoning path.
7. A structured reasoning path-driven multi-hop RAG optimization device, characterized in that, include: The first input unit is configured to input the acquired problem document information into a pre-trained discriminative document compressor to obtain document compression information; The second input unit is configured to input the problem document information into a zero-shot problem decomposer to obtain a sequence of sub-problem information; The construction unit is configured to construct a triplet graph based on the document compression information; The extension unit is configured to extend the dual-view reasoning path based on the triplet graph and the sub-problem information sequence; The generation unit is configured to generate target answer information corresponding to the question document information based on the dual-perspective reasoning path.
8. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.