Retrieval augmented generation method and system based on skeleton guidance and parallel inference
Patent Information
- Application Number
- CN202610959460.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-25
AI Technical Summary
传统RAG系统遵循"检索-拼接-生成"的串行执行范式,存在两个根本性缺陷:(一)串行执行导致高延迟:检索与生成步骤顺序执行,且大语言模型的自回归解码特性进一步放大了推理延迟,无法满足高并发、低延迟的实时应用需求
[0055](1)本发明通过将并行推理架构与批量生成机制协同,突破了串行延迟瓶颈,实现推理效率量级提升:
Smart Images

Figure CN122817432A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and large language model reasoning optimization technology, and in particular to a retrieval enhancement generation method, system, terminal device, computer-readable storage medium, and computer program product based on skeleton-guided parallel reasoning. Background Technology
[0002] Retrieval-Augmented Generation (RAG) effectively alleviates the illusion of fact problem in large language models by anchoring the generation process of large language models (LLMs) to external knowledge base evidence, and has become a standard solution for knowledge-intensive tasks. Traditional RAG systems follow a serial execution paradigm of "retrieval-assembly-generation", which has two fundamental defects: (1) Serial execution leads to high latency: The retrieval and generation steps are executed sequentially, and the autoregressive decoding characteristics of large language models further amplify the inference latency, which cannot meet the real-time application requirements of high concurrency and low latency. (2) Coarse-grained matching leads to insufficient factual accuracy: Global document retrieval for complete queries cannot cover multiple independent information needs in complex queries, and it is easy to miss key evidence, resulting in incomplete generated content or factual errors.
[0003] Existing improvement solutions can only partially address the above problems: (i) Self-RAG improves the factual accuracy of generated content through a self-reflection mechanism, but still retains the serial execution paradigm, and multiple reflection steps further exacerbate reasoning delays. (ii) Skeleton-of-Thought (SoT) improves generation speed through parallel decoding, but it relies entirely on the internal parameter knowledge of the large model, lacks external evidence verification, is prone to illusions, and simply splicing sub-answers can lead to inconsistent output logic and abrupt transitions.
[0004] Currently, there is no solution that can simultaneously address the latency bottleneck and factual accuracy issues of traditional RAG systems, breaking the inherent trade-off between "speed and quality". Summary of the Invention
[0005] In view of this, the present invention provides a retrieval enhancement generation method, system, terminal device, computer-readable storage medium, and computer program product based on skeleton-guided parallel reasoning.
[0006] The first objective of this invention is to provide a retrieval enhancement generation method based on skeleton-guided parallel reasoning.
[0007] The second objective of this invention is to provide a retrieval enhancement generation system based on skeleton-guided parallel reasoning.
[0008] The third objective of this invention is to provide a terminal device.
[0009] A fourth objective of this invention is to provide a computer-readable storage medium.
[0010] The fifth objective of this invention is to provide a computer program product.
[0011] The first objective of this invention can be achieved by adopting the following technical solution:
[0012] A retrieval enhancement generation method based on skeleton-guided parallel reasoning, the method comprising:
[0013] Standardize the received natural language queries;
[0014] The standardized natural language query is subjected to adaptive query decomposition to generate a set of sub-questions; the necessity of retrieval is judged for each sub-question in the set of sub-questions, and a corresponding retrieval tag is generated;
[0015] Perform self-reflective parallel retrieval on all sub-questions of the retrieval marker; while performing self-reflective parallel retrieval, construct a logical blueprint based on the set of sub-questions; self-reflective parallel retrieval includes parallel fine-grained retrieval on all sub-questions of the retrieval marker, and parallel self-reflective optimization on the results of fine-grained retrieval to obtain a refined context;
[0016] Based on the set of sub-problems, the refined context, and the logical blueprint, all sub-answers are generated in batches and in parallel; the sub-answers are then concatenated to form the final answer.
[0017] Preferably, the step of performing adaptive query decomposition on the standardized natural language query to generate a set of sub-questions includes:
[0018] The standardized natural language query is analyzed using a routing proxy, and the output includes routing tokens and confidence scores.
[0019] The decomposition operation is only performed if the routing token needs to be decomposed and the confidence score is greater than the preset decomposition threshold.
[0020] Based on the decomposition judgment, execute the query decomposition operation to generate a set of sub-problems.
[0021] Preferably, the step of performing a query decomposition operation based on the decomposition judgment to generate a set of sub-problems includes:
[0022] If a decomposition operation is performed, the standardized natural language query is decomposed into multiple semantically self-contained sub-questions using a routing proxy. The number of sub-questions is adaptively determined based on the query complexity, and each sub-question can be answered independently to avoid errors propagating across branches. Otherwise, the standardized natural language query is treated as a single sub-question to preserve the semantic integrity of tightly coupled queries.
[0023] The set of subproblems consists of all the subproblems.
[0024] Preferably, the step of determining the necessity of retrieval for each sub-problem in the sub-problem set and generating a corresponding retrieval tag includes:
[0025] For each sub-problem, the routing agent determines whether external evidence needs to be retrieved, and the output includes the retrieval token and retrieval confidence.
[0026] If the retrieval token is required and the retrieval confidence score is greater than the preset retrieval threshold, the labeled subquestion needs to retrieve the external context; otherwise, the labeled subquestion is answered using the internal parameter knowledge of the large model.
[0027] Preferably, fine-grained retrieval is performed, including:
[0028] The candidate text documents are converted into vector representations; the candidate text documents are provided by an external document corpus.
[0029] Based on vector representation, the inner product similarity between the sub-question of each retrieval tag and the candidate text document is calculated;
[0030] For each sub-question of a search tag, the top-k most relevant candidate text documents are retrieved based on inner product similarity; where k is a positive integer greater than 2.
[0031] Preferably, a self-reflective optimization is performed to obtain a refined context, including:
[0032] For each sub-question of the search tag, perform a relevance check:
[0033] If the relevance of the retrieved Top-k candidate text documents to the subproblem meets the requirements, then the inverse rank fusion algorithm is used to reorder the Top-k candidate text documents to obtain the refined context.
[0034] Otherwise, within the retry budget, based on the Top-k candidate text documents from the previous round of retrieval and the current sub-problem, rewrite the expression of the current sub-problem; perform fine-grained retrieval on the rewritten expression, and then perform a relevance check on the retrieval results;
[0035] If the retry budget is exhausted and the relevance of the retrieved Top-k candidate text documents to the subproblem still does not meet the requirements, an empty context is returned.
[0036] Preferably, the step of generating all sub-answers in batches and in parallel based on the set of sub-questions, the refined context, and the logical blueprint includes:
[0037] The sub-problems in the sub-problem set, the corresponding refined context, and the logic blueprint are combined into a triple as input, and all sub-answers are generated simultaneously in a single batch forward propagation.
[0038] Each sub-answer generation is subject to the following three constraints:
[0039] Sub-problems: To address the specific goals of a partial answer, clarify the specific problems that the sub-answers need to solve;
[0040] Refine the context: Provide specific evidence for sub-questions to ensure that the generated content is based on facts;
[0041] Logical blueprint: This is a global discourse structure that enables each sub-answer to have a global perspective when it is generated, allowing it to connect naturally with other sub-answers.
[0042] The second objective of this invention can be achieved by adopting the following technical solution:
[0043] A retrieval enhancement generation system based on skeleton-guided parallel reasoning, the system comprising:
[0044] The data acquisition module is used to standardize the received natural language queries;
[0045] The adaptive query decomposition and tagging module is used to perform adaptive query decomposition on the standardized natural language query to generate a set of sub-questions; and to determine the retrieval necessity of each sub-question in the set of sub-questions and generate corresponding retrieval tags.
[0046] The parallel retrieval and construction module is used to perform self-reflective parallel retrieval on all sub-questions of the retrieval tag; while performing self-reflective parallel retrieval, a logical blueprint is constructed based on the set of sub-questions; self-reflective parallel retrieval includes parallel fine-grained retrieval on all sub-questions of the retrieval tag, and parallel self-reflective optimization on the results of fine-grained retrieval to obtain a refined context;
[0047] The answer generation module is used to generate all sub-answers in batches and in parallel based on the set of sub-questions, the refined context, and the logic blueprint. Finally, the sub-answers are deterministically assembled into the final output answer according to the framework and order of the logic blueprint.
[0048] The third objective of this invention can be achieved by adopting the following technical solution:
[0049] A terminal device includes a processor and a memory for storing a processor-executable program. When the processor executes the program stored in the memory, it implements the above-described retrieval enhancement generation method based on skeleton-guided parallel reasoning.
[0050] The fourth objective of this invention can be achieved by adopting the following technical solution:
[0051] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described retrieval enhancement generation method based on skeleton-guided parallel reasoning.
[0052] The fifth objective of this invention can be achieved by adopting the following technical solution:
[0053] A computer program product includes a computer program that, when executed by a processor, implements the above-described retrieval enhancement generation method based on skeleton-guided parallel reasoning.
[0054] The present invention has the following advantages over the prior art:
[0055] (1) This invention overcomes the serial latency bottleneck and achieves an order-of-magnitude improvement in inference efficiency by coordinating parallel inference architecture with batch generation mechanism:
[0056] This invention reconstructs the traditional serial pipeline of RAG's "retrieval-assembly-generation" into a skeleton-guided parallel sub-problem inference architecture. Complex queries are broken down into multiple semantically independent subtasks, with the retrieval and generation processes of all subtasks executed in complete parallel. A batch generation mechanism is adopted to uniformly amortize fixed computational overhead such as model loading and KV cache initialization. This invention compresses the "cumulative latency of each step" to the "execution time of the longest single subtask," with a theoretical speedup that increases linearly with the number of sub-problems. In the HotpotQA multi-hop inference benchmark, the system throughput increases from 235 tokens / s in the traditional approach to 681 tokens / s, achieving a 2.9x inference speed improvement. In the Vicuna open generation task, the throughput reaches three times that of the baseline method, significantly enhancing batch processing capabilities and making it more suitable for high-concurrency industrial applications.
[0057] (2) This invention improves evidence coverage and enhances factual accuracy from the root by combining fine-grained parallel retrieval with a self-reflective verification mechanism:
[0058] This invention abandons the traditional RAG's global coarse-grained retrieval mode for complete queries, instead adopting a fine-grained parallel retrieval for each semantically independent sub-question, accurately matching the information needs of different sub-topics. A self-reflective mechanism is introduced for the retrieval results of each sub-question, automatically performing relevance checks and inverse rank fusion and reordering. This invention solves the problem of traditional global retrieval easily missing key information about single entities, improving evidence coverage under the same retrieval budget; and significantly reducing factual omissions and illusions during the generation process. By employing a self-reflective mechanism, irrelevant documents can be effectively filtered, invalid searches avoided, and high-quality supporting evidence obtained for each sub-question is ensured.
[0059] (3) This invention can solve the problem of output fragmentation in parallel generation by coordinating pre-generated logic blueprints with deterministic splicing:
[0060] This invention, while performing self-reflective parallel retrieval, pre-generates a logical blueprint as a shared structural constraint for all parallel generation branches. The logical blueprint is injected into the generation hints of each sub-question, enabling sub-answers to possess a global structural awareness during the generation stage. This allows for the parallel generation of coherent sub-answers, which are then deterministically assembled into the final output answer according to the framework and order of the logical blueprint, without introducing a secondary large-scale model synthesis step. This solves the problems of logical incoherence, abrupt transitions, and structural chaos caused by the simple assembly of sub-answers in the pure SoT method. On the Vicuna dataset, compared with pure SoT, the output coherence score improved from 8.15 to 8.75, and the completeness score improved from 8.20 to 9.14, significantly enhancing the naturalness and readability of the generated content. It avoids the secondary large-scale model synthesis step introduced in traditional parallel schemes to ensure coherence, eliminating both the additional latency caused by secondary synthesis and the potential new illusions introduced by secondary synthesis. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0062] Figure 1 This is a flowchart of the retrieval enhancement generation method based on skeleton-guided parallel reasoning in Embodiment 1 of the present invention.
[0063] Figure 2 This is a schematic diagram of the retrieval enhancement generation method based on skeleton-guided parallel reasoning according to Embodiment 1 of the present invention.
[0064] Figure 3This is a structural block diagram of the retrieval enhancement generation system based on skeleton-guided parallel reasoning according to Embodiment 2 of the present invention.
[0065] Figure 4 This is a structural block diagram of the terminal device according to Embodiment 3 of the present invention. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be understood that the specific embodiments described are merely used to explain this application and are not intended to limit this application.
[0067] Example 1:
[0068] like Figure 1 , 2 As shown, this embodiment provides a retrieval enhancement generation method based on skeleton-guided parallel reasoning, including the following steps:
[0069] S101, Receive the input natural language query.
[0070] The system receives natural language queries (Q) input by users through a user interface and standardizes them into a uniform text format.
[0071] S102. Perform adaptive query decomposition on the standardized natural language query to generate a set of sub-questions and corresponding search tags.
[0072] This step uses a lightweight large language model as a routing proxy, decomposing queries only when necessary to avoid semantic fragmentation caused by excessive decomposition. The routing proxy adopts the Qwen2.5-8B model, and all decision-making processes are completed in a single forward propagation.
[0073] Furthermore, step S102 specifically includes:
[0074] (1) Perform uncertainty-aware decomposition judgment on the standardized natural language query.
[0075] The routing agent analyzes the input query Q and outputs the following three results:
[0076] Routing token: <Needs to be decomposed> or <Does not need to be decomposed>
[0077] Confidence score: A value between 0 and 1 that indicates the routing agent's confidence in the decomposition decision;
[0078] Reasons for decomposition: Briefly explain the basis for whether decomposition is necessary.
[0079] The decomposition activation condition is:
[0080] Decomposition is only performed when the routing agent outputs a "needs to be decomposed" token and its corresponding confidence score is greater than the preset decomposition threshold.
[0081] In this embodiment, the decomposition threshold is set to 0.75, which can be adjusted within the range of 0.6 to 0.9 depending on the actual application scenario. The query decomposition operation is only performed when both of the above conditions are met simultaneously.
[0082] (2) Based on the decomposition judgment, perform the query decomposition operation to generate a set of sub-problems S.
[0083] When the decomposition condition is met, the routing agent decomposes the query Q into a semantically self-contained set of sub-questions S. The number of sub-questions n is adaptively determined according to the query complexity. Each sub-question can be answered independently, avoiding the propagation of errors across branches.
[0084] When the decomposition conditions are not met, the system directly treats the original query as a single sub-problem, preserving the semantic integrity of tightly coupled queries.
[0085] (3) Based on the set of sub-problems S, perform a search necessity judgment and generate the corresponding search tags.
[0086] For each sub-problem, the routing agent further determines whether external evidence needs to be retrieved and outputs the following three results:
[0087] Search token: <Search required> or <Search not required>
[0088] Retrieval confidence: A value between 0 and 1 that represents the degree of confidence the routing agent has in its retrieval decision;
[0089] Reason for search: Briefly explain the basis for whether a search is necessary.
[0090] The search activation conditions are:
[0091] A search is only performed when the routing agent outputs a "requested" token and the corresponding search confidence score is greater than the preset search threshold.
[0092] In this embodiment, the retrieval threshold is set to 0.7, which can be adjusted within the range of 0.6 to 0.85 depending on the actual application scenario. When the condition is met, the sub-question is marked as requiring retrieval of external context; otherwise, the sub-question is marked as being able to be answered directly using the internal parameter knowledge of the large model.
[0093] S103. Perform self-reflective parallel retrieval on the sub-questions of the retrieval tags to obtain a refined context; while performing self-reflective parallel retrieval, construct a logical blueprint.
[0094] This step simultaneously initiates two independent parallel processes: parallel retrieval and logical blueprint construction. The total time taken is the longer of the two processes, without generating additional delays.
[0095] Furthermore, step S103 specifically includes:
[0096] (1) Self-reflection and parallel retrieval.
[0097] For all sub-questions marked as requiring retrieval, a retrieval request is simultaneously sent to the vector database. All retrieval processes are executed independently and asynchronously, and the total retrieval delay is the delay of the slowest branch.
[0098] (1-1) Perform fine-grained retrieval on the sub-questions of the retrieval tags.
[0099] An external document corpus provides all candidate text documents, and the Contriever encoder is responsible for converting the text documents into vector representations. The Contriever encoder is used to calculate the inner product similarity between the sub-question and the document, retrieving the top-k documents most relevant to the sub-question, where k is the number of documents retrieved in a single branch.
[0100] In this embodiment, k is set to 4.
[0101] (1-2) Perform self-reflective optimization on the results of fine-grained retrieval to obtain refined context.
[0102] To improve search quality, a self-reflective mechanism is implemented for the fine-grained search (initial search) results of each sub-question:
[0103] Perform a relevance check to determine whether the retrieved documents are relevant to the sub-question;
[0104] If the inspection results determine that the relevance between the retrieved document and the sub-question meets the requirements, the inverse rank fusion algorithm is used to reorder the retrieval results to obtain a refined context.
[0105] If the check results indicate that the documents retrieved for the subquestion are insufficiently relevant to the subquestion, then: within the retry budget, the current subquestion is rewritten based on the documents retrieved in the previous round (low-relevance documents); fine-grained retrieval and relevance checks are performed on the rewritten subquestion; if the retry budget is exhausted and the retrieved documents are still insufficiently relevant to the subquestion, an empty context is returned. This process is only executed within the current subquestion branch, and different subquestions do not affect each other or other parallel tasks.
[0106] Specifically, based on the core semantics of the current sub-problem and combined with the documents retrieved in the previous round, the reasons for the retrieval mismatch are analyzed. Then, the expression of the current sub-problem is rewritten through entity completion, keyword expansion, semantic disambiguation, and other methods.
[0107] In this embodiment, the retry budget is limited to a maximum of 2 times. The analysis of retrieval mismatch causes uses a finely tuned lightweight self-reflective model, Qwen2.5-8B.
[0108] The retrieval and self-reflection processes for all subproblems are executed independently and asynchronously, with the total retrieval delay being the delay of the slowest branch.
[0109] (2) Construct a logical blueprint based on the set of sub-problems.
[0110] While performing parallel retrieval, the master generation model constructs a logical blueprint based on the decomposed set of subproblems. This logical blueprint encodes the global reasoning flow and discourse structure of the subproblems, providing a priori global structural constraints for the subsequent parallel generation process.
[0111] Specifically, the master generator model is a general model, and in this embodiment, GPT-4o is used.
[0112] S104. Generate all sub-answers in batches and in parallel based on the set of sub-questions, the refined context, and the logical blueprint.
[0113] Once the refined context and logic blueprint for all subproblems are prepared, the triples (subproblem, refined context, logic blueprint) are used as input to the main generation model to generate all sub-answers simultaneously in a single batch forward propagation. After all sub-answers are generated, they are deterministically assembled into the final output answer according to the framework and order of the logic blueprint.
[0114] The generation of each sub-answer is subject to three constraints:
[0115] Sub-problems: These sub-answers address specific goals, clarifying the particular problem they need to solve.
[0116] Refined Context: Sub-question-specific evidence ensures generated content is based on facts.
[0117] Logical Blueprint: A global discourse structure that enables each sub-answer to have a global perspective from the moment it is generated, allowing it to naturally connect with other sub-answers.
[0118] Unlike traditional post-processing synthesis or simple splicing, the method in this embodiment injects a pre-built logical blueprint as a global structural constraint into each parallel generation instance. This gives each sub-answer generation a global perspective, fully considering the overall logical flow and enabling a natural transition from one sub-problem to the next. Batch generation amortizes fixed costs such as model loading and KV cache initialization, while each branch uses only local evidence, effectively mitigating the "intermediate information loss" problem.
[0119] This embodiment combines a modular, pluggable architecture with uncertainty-aware adaptive triggering to balance architectural flexibility and scenario versatility. Core steps such as S102, S103, and S104 can be designed as independently replaceable modules, supporting flexible component replacement. Simultaneously, by introducing an uncertainty-aware triggering mechanism, query decomposition and external retrieval are only performed when the query complexity meets the threshold, achieving a significant speed improvement and avoiding over-processing of simple queries. Therefore, this embodiment is compatible with the existing RAG system's knowledge base, vector database, and retrieval infrastructure, seamlessly integrating into existing business systems. Core components (such as lightweight routing models, retrieval encoders, and generation models) can be flexibly replaced according to different application scenario requirements. The architecture possesses excellent scalability, easily extending to new scenarios such as multimodal retrieval enhancement and generation.
[0120] Table 1 Comparison of retrieval performance on the HotpotQA dataset under controlled document budget
[0121]
[0122] Note: Bold text indicates the best result for each column.
[0123] Table 2 Comparison of generation efficiency and quality on the HotpotQA dataset
[0124] A performance comparison experiment was conducted on the HotpotQA dataset to verify the impact of the sub-question decomposition strategy on retrieval results. As shown in Table 1, on the HotpotQA dataset, under the same document retrieval budget (average 4.1 documents per query, median 4 documents, standard deviation 0.72, minimum 4 documents, maximum 8 documents), the sub-question decomposition retrieval (Sub-Q) provided in this embodiment achieved significant improvements in multiple metrics compared to the original query retrieval (Orig): context recall increased from 0.091 to 0.111 (+22%), context hit rate increased from 0.652 to 0.693 (+6.3%), and supporting fact recall increased from 0.363 to 0.431 (+18.7%). The performance was particularly outstanding for complex queries requiring comparison of multiple entity attributes, with a 28.9% improvement in supporting fact recall for comparison-type queries (0.558→0.720), effectively solving the problem that traditional global retrieval easily misses key information about a certain entity. Meanwhile, as shown in Table 2, in terms of generation quality, the method provided in this embodiment (this method) improves the validity score from 1.24 to 4.10 (+2.86) and the sufficiency score from 2.78 to 4.42 (+1.64) compared with the original large language model baseline, significantly reducing the problems of fact omission and illusion.
[0125] This embodiment uses a self-reflection mechanism to verify the relevance of search results and reorder them, effectively filtering irrelevant documents and avoiding invalid searches. This ensures that each sub-question can obtain high-quality supporting evidence, thus providing technical support for the overall improvement of the search and generation quality.
[0126] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium.
[0127] It should be noted that although the method operations of the above embodiments are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the order of execution of the described steps may be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0128] Example 2:
[0129] like Figure 3 As shown, this embodiment provides a retrieval enhancement generation system based on skeleton-guided parallel reasoning. The system includes a data acquisition module 301, an adaptive query decomposition and labeling module 302, a parallel retrieval and construction module 303, and an answer generation module 304, wherein:
[0130] The data acquisition module 301 is used to standardize the received natural language queries;
[0131] The adaptive query decomposition and tagging module 302 is used to perform adaptive query decomposition on the standardized natural language query to generate a set of sub-questions; and to determine the retrieval necessity of each sub-question in the set of sub-questions and generate corresponding retrieval tags.
[0132] The parallel retrieval and construction module 303 is used to perform self-reflective parallel retrieval on all sub-questions of the retrieval marker; while performing self-reflective parallel retrieval, a logical blueprint is constructed based on the set of sub-questions; the self-reflective parallel retrieval includes performing fine-grained retrieval on all sub-questions of the retrieval marker in parallel, and performing self-reflective optimization on the results of the fine-grained retrieval in parallel to obtain a refined context;
[0133] The answer generation module 304 is used to generate all sub-answers in batches and in parallel based on the set of sub-questions, the refined context, and the logic blueprint; and to concatenate the sub-answers as the final answer.
[0134] The specific implementation of each module in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the system provided in this embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0135] Example 3:
[0136] This embodiment provides a terminal device, which can be a computer, such as... Figure 4 As shown, the processor 402, memory, input device 403, display 404, and network interface 405 are connected via system bus 401. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 406 and an internal memory 407. The non-volatile storage medium 406 stores the operating system, computer programs, and database. The internal memory 407 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the processor 402 executes the computer programs stored in the memory, it implements the skeleton-guided parallel reasoning-based retrieval enhancement generation method of Embodiment 1 described above.
[0137] Example 4:
[0138] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the retrieval enhancement generation method based on skeleton-guided parallel reasoning described in Embodiment 1 above.
[0139] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0140] Example 5:
[0141] This embodiment provides a computer program product, including a computer program that, when executed by a processor, implements the retrieval enhancement generation method based on skeleton-guided parallel reasoning described in Embodiment 1 above.
[0142] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A retrieval enhancement generation method based on skeleton-guided parallel reasoning, characterized in that, The method includes: Standardize the received natural language queries; The standardized natural language query is subjected to adaptive query decomposition to generate a set of sub-questions; the necessity of retrieval is judged for each sub-question in the set of sub-questions, and a corresponding retrieval tag is generated; Perform self-reflective parallel retrieval on all sub-questions of the retrieval marker; while performing self-reflective parallel retrieval, construct a logical blueprint based on the set of sub-questions; self-reflective parallel retrieval includes parallel fine-grained retrieval on all sub-questions of the retrieval marker, and parallel self-reflective optimization on the results of fine-grained retrieval to obtain a refined context; Based on the set of sub-problems, the refined context, and the logical blueprint, all sub-answers are generated in batches and in parallel; the sub-answers are then concatenated to form the final answer.
2. The retrieval enhancement generation method according to claim 1, characterized in that, The adaptive query decomposition of the standardized natural language query generates a set of sub-questions, including: The standardized natural language query is analyzed using a routing proxy, and the output includes routing tokens and confidence scores. The decomposition operation is only performed if the routing token needs to be decomposed and the confidence score is greater than the preset decomposition threshold. Based on the decomposition judgment, execute the query decomposition operation to generate a set of sub-problems.
3. The retrieval enhancement generation method according to claim 2, characterized in that, The step of performing a query decomposition operation based on the decomposition judgment to generate a set of sub-problems includes: If a decomposition operation is performed, the standardized natural language query is decomposed into multiple semantically self-contained sub-questions using a routing proxy. The number of sub-questions is adaptively determined based on the query complexity, and each sub-question can be answered independently to avoid errors propagating across branches. Otherwise, the standardized natural language query is treated as a single sub-question to preserve the semantic integrity of tightly coupled queries. The set of subproblems consists of all the subproblems.
4. The retrieval enhancement generation method according to claim 1, characterized in that, The necessity of searching for each sub-problem in the set of sub-problems is determined, and a corresponding search tag is generated, including: For each sub-problem, the routing agent determines whether external evidence needs to be retrieved, and the output includes the retrieval token and retrieval confidence. If the retrieval token is required and the retrieval confidence score is greater than the preset retrieval threshold, the labeled subquestion needs to retrieve the external context; otherwise, the labeled subquestion is answered using the internal parameter knowledge of the large model.
5. The retrieval enhancement generation method according to claim 1, characterized in that, Perform fine-grained retrieval, including: The candidate text documents are converted into vector representations; the candidate text documents are provided by an external document corpus. Based on vector representation, the inner product similarity between the sub-question of each retrieval tag and the candidate text document is calculated; For each sub-question of a search tag, the top-k most relevant candidate text documents are retrieved based on inner product similarity; where k is a positive integer greater than 2.
6. The retrieval enhancement generation method according to claim 5, characterized in that, Performing self-reflective optimization yields a refined context, including: For each sub-question of the search tag, perform a relevance check: If the relevance of the retrieved Top-k candidate text documents to the subproblem meets the requirements, then the inverse rank fusion algorithm is used to reorder the Top-k candidate text documents to obtain the refined context. Otherwise, within the retry budget, based on the Top-k candidate text documents from the previous round of retrieval and the current sub-problem, rewrite the expression of the current sub-problem; perform fine-grained retrieval on the rewritten expression, and then perform a relevance check on the retrieval results; If the retry budget is exhausted and the relevance of the retrieved Top-k candidate text documents to the subproblem still does not meet the requirements, an empty context is returned.
7. The retrieval enhancement generation method according to any one of claims 1 to 6, characterized in that, The process of generating all sub-answers in batches and in parallel based on the set of sub-questions, refined context, and logical blueprint includes: The sub-problems in the sub-problem set, the corresponding refined context, and the logic blueprint are combined into a triple as input, and all sub-answers are generated simultaneously in a single batch forward propagation. Each sub-answer generation is subject to the following three constraints: Sub-problems: To address the specific goals of a partial answer, clarify the specific problems that the sub-answers need to solve; Refine the context: Provide specific evidence for sub-questions to ensure that the generated content is based on facts; Logical blueprint: This is a global discourse structure that enables each sub-answer to have a global perspective when it is generated, allowing it to connect naturally with other sub-answers.
8. A retrieval enhancement generation system based on skeleton-guided parallel reasoning, characterized in that, The system includes: The data acquisition module is used to standardize the received natural language queries; The adaptive query decomposition and tagging module is used to perform adaptive query decomposition on the standardized natural language query to generate a set of sub-questions; and to determine the retrieval necessity of each sub-question in the set of sub-questions and generate corresponding retrieval tags. The parallel retrieval and construction module is used to perform self-reflective parallel retrieval on all sub-questions of the retrieval tag; while performing self-reflective parallel retrieval, a logical blueprint is constructed based on the set of sub-questions; self-reflective parallel retrieval includes parallel fine-grained retrieval on all sub-questions of the retrieval tag, and parallel self-reflective optimization on the results of fine-grained retrieval to obtain a refined context; The answer generation module is used to generate all sub-answers in batches and in parallel based on the set of sub-questions, the refined context, and the logic blueprint; the sub-answers are then concatenated to form the final answer.
9. A terminal device, comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the retrieval enhancement generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the retrieval enhancement generation method according to any one of claims 1 to 7.