A retrieval enhancement generation method and system based on multi-dimensional reordering

By constructing a hybrid retrieval and multi-level re-ranking mechanism, combined with iterative generation and closed-loop evaluation, the problems of low information matching accuracy and uncontrollable answer generation quality in existing technologies are solved, achieving efficient and accurate answer generation and improving the performance of intelligent question answering systems.

CN121681787BActive Publication Date: 2026-05-08KEXUN JIALIAN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KEXUN JIALIAN INFORMATION TECH CO LTD
Filing Date
2026-02-11
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing retrieval enhancement generation methods suffer from low recall accuracy and insufficient contextual understanding when faced with large-scale, long-text knowledge bases and complex, fuzzy user queries, resulting in low answer quality. Furthermore, they lack self-examination and iterative optimization of the answer generation process.

Method used

By constructing a hybrid retrieval and multi-level re-ranking mechanism, combined with iterative generation and closed-loop evaluation, and using an improved DistilBERT model and the Qwen large model, a hybrid retrieval with semantic and keyword dual-path indexing is performed. User queries are decomposed into sub-questions for multi-dimensional evaluation and iterative generation, and finally, multi-dimensional evaluation and correction are carried out.

Benefits of technology

It significantly improves the accuracy and reliability of answers in complex question-and-answer scenarios, ensuring the logical rigor and factual accuracy of the answers, and providing an efficient and accurate intelligent question-and-answer solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121681787B_ABST
    Figure CN121681787B_ABST
Patent Text Reader

Abstract

The application discloses a retrieval enhancement generation method and system based on multi-dimensional reordering, relates to the technical field of information retrieval, and comprises the following steps: S1, constructing a tensor index, a keyword index and a compressed abstract; S2, driving a Qwen large model to perform query expansion and hypothetical answer generation through a double-task query processing template; S3, performing mixed retrieval through a semantic and keyword double-path index, and performing two-stage reordering by using an improved DistilBERT model and the Qwen large model; S4, performing multi-dimensional evaluation through sub-problem decomposition; S5, iteratively generating sub-problem answers according to the sub-problem order; and S6, performing multi-dimensional evaluation correction to generate a final answer. The application overcomes the limitations of traditional retrieval enhancement generation technology in information matching accuracy, context relevance evaluation and answer generation quality, and provides an efficient and accurate solution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information retrieval technology, and in particular to a retrieval enhancement generation method and system based on multi-dimensional reordering. Background Technology

[0002] With the rapid development of artificial intelligence and big data technologies, intelligent question-answering systems have become a core carrier for information acquisition and human-computer interaction. In knowledge-intensive fields such as professional consulting, scientific research assistance, and enterprise knowledge management, the system's ability to generate accurate and reliable answers based on massive and complex knowledge bases directly determines its application value and user experience. However, existing retrieval-enhanced generation methods face severe challenges in terms of information retrieval recall accuracy, contextual understanding depth, and the quality of the final answer generation when dealing with large-scale, long-text knowledge bases and complex, fuzzy user queries.

[0003] The main limitations of traditional retrieval enhancement methods lie in their superficial information matching and blind construction of context. Most existing methods rely on single semantic or keyword searches, lacking a deep understanding of user query intent, resulting in insufficient relevance of the retrieved information fragments. Furthermore, when constructing context, they often only sort and truncate search fragments based on simple similarity scores, lacking a comprehensive evaluation of the logical relationships between fragments, information complementarity, and coverage of the core query question. When the knowledge base content is highly specialized and the documents are lengthy, this superficial matching and blind construction approach easily introduces noise or omits key information, leading to factual biases, logical breaks, or content gaps in the generated answers, severely impacting the accuracy and credibility of the responses.

[0004] Furthermore, traditional methods often employ a "one-time generation" model in the answer generation stage, lacking a self-examination and iterative optimization mechanism for answer quality. Existing technologies typically input the retrieved context directly into the Qwen large-scale model for single-round generation, failing to provide structured guidance for the generation process and lacking critical evaluation and correction of the generated results. This makes it difficult for the system to guarantee the logical coherence and factual accuracy of the answer when facing complex problems requiring multi-step reasoning and integration of multiple information sources. Even if some methods introduce reordering or iterative mechanisms, they fail to effectively integrate multi-dimensional information such as query intent, content quality, and answer credibility for closed-loop optimization, making it difficult to achieve efficient, accurate, and reliable high-quality answer generation.

[0005] Therefore, how to provide a retrieval enhancement generation method and system based on multi-dimensional reordering is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] This invention proposes a retrieval enhancement generation method and system based on multi-dimensional re-ranking. By constructing a hybrid retrieval and multi-level re-ranking mechanism, combined with iterative generation and closed-loop evaluation, it significantly improves the accuracy and reliability of answers in complex question-answering scenarios. The method involves constructing a tensor and keyword dual-path index for the original document and generating a compressed summary; deepening the understanding of user intent through query expansion and hypothetical answer generation; performing two-level re-ranking using an improved DistilBERT model and a large model to accurately filter candidate segments; constructing an optimal context based on multi-dimensional evaluation; and ensuring the logical rigor and factual accuracy of the final answer through iterative answer generation and multi-dimensional evaluation correction. This invention overcomes the limitations of traditional retrieval enhancement generation techniques, such as low information matching accuracy, blind context construction, and uncontrollable answer generation quality. It provides an efficient and accurate solution for intelligent question-answering systems that require handling complex queries, long document knowledge bases, and high-precision answer generation.

[0007] A retrieval enhancement generation method based on multi-dimensional reordering according to an embodiment of the present invention includes the following steps:

[0008] S1. The original document is segmented, a tensor index and a keyword index are built for each text segment, and a lightweight language model is used to extract information from each text segment to generate a corresponding compressed summary.

[0009] S2. By defining roles, task descriptions, and input / output formats through a dual-task query processing template, the Qwen large model is driven to perform query expansion and hypothetical answer generation, transforming the user's original query into an optimized query and a hypothetical perfect answer.

[0010] S3. Using optimized queries and hypothetical perfect answers, an initial candidate set is generated through a hybrid retrieval of semantic and keyword dual-path indexes. Then, a two-level re-ranking is performed using an improved DistilBERT model and a Qwen large model to extract a finely ranked candidate fragment set.

[0011] S4. Input the user's original query, the set of candidate fragments for fine ranking, and the corresponding compressed summary of each fragment in the set of candidate fragments for fine ranking into the Qwen big model, decompose the user's original query into several sub-problems, perform multi-dimensional evaluation based on the sub-problems, output a structured score, and generate the final context according to the structured score.

[0012] S5. Iterate according to the order of sub-problems, input the current problem, historical answers and final context into the Qwen big model, and gradually generate answers until all sub-problems are answered, and integrate all sub-problem answers into the first draft of the final answer;

[0013] S6. Use the Qwen large model to evaluate and revise the initial draft of the final answer from multiple dimensions, and generate the final answer, the corresponding confidence score, and the revision log.

[0014] Optionally, S1 includes:

[0015] S11. The original document is segmented using LangChain's recursive character text segmenter according to the preset block size and context overlap length to obtain text fragments, and each text fragment is assigned a globally unique fragment ID.

[0016] S12. For each text segment, perform semantic embedding using the pre-trained all-MiniLM-L6-v2 model to generate a sentence tensor of a preset dimension; store the sentence tensor and the corresponding segment ID together in the FAISS index library to form a tensor index.

[0017] S13. For each text segment, perform word segmentation and stop word removal. Based on the processed word units, use the BM25 algorithm to calculate the weight of each word unit, and build an inverted index according to the segment ID of the corresponding text segment to form a keyword index.

[0018] S14. For each text segment, process it using the T5-Small model that has been fine-tuned on the summary task dataset, specify the maximum generation length and generate a compressed summary, and store the compressed summary with the corresponding segment ID.

[0019] S15. For each text segment, the segment ID, original text content, compressed summary, and citation information in the tensor index and keyword index are associated and stored using the segment ID as the primary key to construct a unified data record and store it in the database.

[0020] Optionally, the dual-task query processing template includes role definition, task description, and input / output format requirements; the role definition is an information retrieval expert; the task description includes a query optimization task and a hypothetical answer generation task; the query optimization task includes expanding synonyms, supplementing context, and mining potential intents; the hypothetical answer generation task includes generating paragraphs containing core facts and logical structures based on the optimized query; the input / output format is JSON format; the process of converting the user's original query into an optimized query and a hypothetical perfect answer includes: retrieving a synonym list based on word vector similarity; using referential resolution combined with historical queries to fill in contextual information; retrieving intent-guiding words through entity recognition and intent tree matching; fusing synonyms, contextual information, and intent-guiding words to generate optimized query text; and inputting the optimized query text into the Qwen large-scale model for inference to generate a hypothetical perfect paragraph.

[0021] Optionally, S3 specifically includes:

[0022] S31. Extract query text from the optimized query, use the all-MiniLM-L6-v2 model to perform semantic embedding on the query text, and generate a 384-dimensional query tensor; input the query tensor into the FAISS index, calculate the cosine similarity between the query tensor and all sentence tensors in the FAISS index, and obtain the sentence tensor index with the highest preset number of similarities; retrieve the corresponding original text fragments from the database based on the sentence tensor index to form the first candidate set;

[0023] S32. Perform word segmentation and stop word removal on the hypothetical perfect answer to obtain a keyword list; iterate through each keyword in the keyword list and use the keyword to search in the inverted index to obtain the text fragment ID containing each keyword; merge all the text fragment IDs returned by the keywords and count the keyword frequency of each ID, and sort the text fragment IDs according to the keyword frequency; select the top-ranked preset number of text fragment IDs; retrieve the corresponding original text fragments from the database according to the text fragment IDs to form the second candidate set;

[0024] S33. Merge the first candidate set and the second candidate set to form the initial candidate set; input each text fragment in the initial candidate set and the optimized query into the improved DistilBERT model, and output the relevance probability score.

[0025] S34. Sort the initial candidate set according to the relevance probability score, select the segment with the highest score of a preset number to form an elite segment set; input the elite segment set and the corresponding compressed summary of each segment into the Qwen large model to generate a fine-ranked relevance probability score; sort the elite segment set according to the fine-ranked relevance probability score, select the segment with the highest score of a preset number to form a fine-ranked candidate segment set.

[0026] Optionally, the improved DistilBERT model includes a feature encoding layer, a late interactive encoding layer, a dynamic feature extraction layer, a convolutional recurrent enhancement layer, a gated adaptive fusion layer, and a relevance classification output layer.

[0027] The feature encoding layer includes a pre-trained DistilBERT encoder, which receives the optimized query and each text fragment in the initial candidate set, and generates a query token tensor matrix and a document token tensor matrix.

[0028] The post-interaction coding layer is used to generate an initial interaction score by calculating the cosine similarity between each tensor in the query token tensor matrix and all tensors in the document token tensor matrix, taking the maximum value and summing them.

[0029] The dynamic feature extraction layer is used to receive the query token tensor matrix and the document token tensor matrix, and perform average pooling on them respectively to generate the query average tensor and the document average tensor; the document token tensor matrix is ​​input into the attention pooling layer with the query average tensor as the query for weighted aggregation to generate the dynamic aggregate tensor.

[0030] The convolutional recurrent enhancement layer is used to input the dynamic aggregation tensor into a one-dimensional convolutional neural network layer for local feature extraction and output a convolutional feature tensor; the convolutional feature tensor is input into a bidirectional LSTM layer for sequence dependency modeling and outputs a recurrent enhancement tensor.

[0031] The gated adaptive fusion layer is used to concatenate the query average tensor and the document average tensor, and then process them through a sigmoid-activated gated network to output a fused weight tensor. The fused weight tensor is then multiplied element-wise with the cyclic augmentation tensor to generate the final fused representation tensor.

[0032] The correlation classification output layer is used to concatenate the initial interaction score with the final fused representation tensor, input it into a linear layer for feature transformation, and use the Sigmoid activation function for non-linear processing to output the final correlation probability score.

[0033] Optionally, S4 specifically includes:

[0034] S41. Construct a context reordering instruction template, including role definition, task description, input content, evaluation dimensions, and output format requirements; the role is defined as a senior information analyst; the task description is to decompose a user query into sub-questions and evaluate and rank candidate fragments based on the sub-questions in multiple dimensions; the input content is the user's original query, a list of candidate fragments, and corresponding compressed summaries; the evaluation dimensions include coverage of each sub-question, answer quality for the sub-questions, and information novelty; the output format is a JSON array, where each element contains a fragment ID, coverage score, answer quality score, and structured score.

[0035] S42. Combine the user's original query, the set of candidate fragments for fine sorting, and the corresponding compressed summary according to the format requirements of the context reordering instruction template to generate reordering prompt words;

[0036] S43. Input the reordering prompts into the Qwen big model, which will perform sub-problem decomposition and multi-dimensional evaluation, and output a JSON array that meets the output format requirements.

[0037] S44. Parse the JSON array, extract the structured score of each candidate fragment for ranking, sort the candidate fragments in descending order according to the structured score, and select the fragments with the highest preset number of scores to form the final context.

[0038] Optionally, S5 specifically includes:

[0039] S51. Construct an iterative answer generation instruction template, including role definition, task description, input content, output format, and constraints; the role is defined as an expert researcher; the task description is to answer sub-questions step by step based on context and historical dialogue; the input content includes the current sub-question, the answered sub-questions and their corresponding answers, and the final context; the output format is structured JSON, including the answer to the current sub-question and whether it is the last sub-question; the constraints include that the answer must be strictly based on the provided final context and refer to the logic of the already answered answers;

[0040] S52. Initialize an empty list of solved answers, and take the first subproblem from the subproblem list as the current subproblem;

[0041] S53. According to the format requirements of the iterative answer generation instruction template, combine the current sub-question, the list of solved answers, and the final context into a generation prompt word;

[0042] S54. Input the generated prompt words into the Qwen large model and obtain the output JSON; parse the JSON, extract the answer to the current sub-question, and append it to the list of solved answers;

[0043] S55. Determine if the current subproblem is the last problem in the subproblem list. If not, take the next subproblem from the subproblem list as the new current subproblem and return to S53 to continue iterating.

[0044] S56. Input the list of solved answers into the Qwen large model, and integrate them into the final draft of the answer according to the logical and temporal relationship.

[0045] Optionally, S6 specifically includes:

[0046] S61. Construct a multi-dimensional evaluation and correction instruction template, including role definition, task description, evaluation dimensions, output format, and correction requirements; the role is defined as a senior fact checker and a logic analyst; the task description is to critically evaluate and correct the initial draft of the answer and quantify its confidence level; the evaluation dimensions include factual accuracy, logical coherence, and content completeness; the output format is structured JSON, including the corrected final answer, a list of confidence scores, and a correction log; the correction requirements include clearly pointing out errors, providing the basis for correction, and explaining the reasons for correction;

[0047] S62. Combine the final draft of the answer and the corresponding final context according to the format requirements of the multi-dimensional evaluation and correction instruction template to generate evaluation prompt words;

[0048] S63. Input the evaluation prompts into the Qwen large model, perform fact checking, logic checking and completeness evaluation, and output JSON that meets the output format requirements;

[0049] S64. Parse the JSON output by the Qwen large model, extract and output the corrected final answer, confidence score and correction log.

[0050] According to an embodiment of the present invention, a retrieval enhancement generation system based on multi-dimensional reordering includes the following modules:

[0051] The knowledge base construction module is used to segment the original document, build tensor indexes and keyword indexes for each text segment, and use a lightweight language model to extract information from each text segment to generate corresponding compressed summaries.

[0052] The query understanding module is used to define roles, task descriptions, and input / output formats through a dual-task query processing template, driving the Qwen large model to perform query expansion and hypothetical answer generation, transforming the user's original query into an optimized query and a hypothetical perfect answer;

[0053] The information retrieval module is used to generate an initial candidate set by using optimized queries and hypothetical perfect answers through a hybrid retrieval of semantic and keyword dual-path indexes, and to perform two-level re-ranking using an improved DistilBERT model and a Qwen large model to extract finely ranked candidate fragments.

[0054] The context optimization module is used to input the user's original query, the set of candidate fragments for fine ranking, and the corresponding compressed summary into the Qwen big model, perform multi-dimensional evaluation through sub-problem decomposition, output a structured score, and generate the final context based on the structured score ranking.

[0055] The answer synthesis module is used to iterate according to the order of sub-questions, inputting the current question, historical answers and final context into the Qwen big model, gradually generating answers until all sub-questions are answered, and integrating all sub-question answers into the first draft of the final answer;

[0056] The results quality control module is used to evaluate and correct the initial draft of the answer from multiple dimensions using the Qwen large model, and to generate the final answer, the corresponding confidence score, and the correction log.

[0057] The beneficial effects of this invention are:

[0058] (1) This invention significantly improves the ability of question-answering systems to understand users' true intentions and filter highly relevant information fragments by constructing a dual-task query processing and two-level re-ranking mechanism. Traditional retrieval enhancement generation methods often recall a large amount of irrelevant information due to insufficient query expansion when dealing with fuzzy or complex user queries, resulting in excessive contextual noise. To solve this problem, this invention innovatively introduces a dual-task query processing template, driving the large model to simultaneously generate optimized queries and hypothetical perfect answers, deepening the understanding of query intentions from both semantic and answer dimensions. At the same time, by combining the improved DistilBERT model with the Qwen large model to perform two-level re-ranking, the initial candidate set is accurately filtered through post-interaction and dynamic feature extraction, thereby significantly improving the relevance and information density of the final context, laying a solid foundation for generating high-quality answers.

[0059] (2) This invention effectively solves the technical problems of uncontrollable answer generation and unstable quality in traditional question-and-answer methods through iterative answer generation and closed-loop evaluation mechanisms. Traditional methods usually adopt a single-round "black box" generation mode, which lacks structured guidance and self-examination of the answer's logic and factual accuracy, and is prone to factual errors or logical jumps. This invention decomposes the complex answer generation task into multiple controllable iterative steps through sub-problem decomposition, and combines multi-dimensional evaluation and correction to critically examine and optimize the initial draft of the answer. This method breaks through the limitations of the traditional one-time generation mode, enabling the model to actively correct errors and supplement omissions, ensuring the logical rigor and factual accuracy of the final answer, and providing an effective solution for intelligent question-and-answer applications that require high reliability and high accuracy.

[0060] (3) This invention overcomes the bottleneck of information matching accuracy in traditional reordering models by designing a dedicated improved DistilBERT model. Traditional reordering models, such as standard DistilBERT or simple vector similarity calculation, often only capture the overall semantic similarity between the query and the document, while ignoring the fine-grained, token-based interaction relationship between them, resulting in insufficient sensitivity to the matching of key information. To solve this problem, this invention constructs a multi-level, deeply integrated improved DistilBERT model. This model achieves precise alignment between the query and the document at the token level through a late interactive encoding layer, achieves query-oriented document information focusing through a dynamic feature extraction layer, and integrates local key patterns and long-distance sequence dependencies through a convolutional recurrent enhancement layer. Finally, it intelligently integrates multi-dimensional features through a gated adaptive fusion layer. This design deepens the model from "macro-semantic understanding" to "micro-interaction insight," enabling it to accurately identify the core information fragments truly needed to answer the query, greatly improving the accuracy and robustness of reordering, and providing key technical guarantees for the efficient operation of the entire system. Attached Figure Description

[0061] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0062] Figure 1 This is an overall flowchart of a retrieval enhancement generation method based on multi-dimensional reordering proposed in this invention;

[0063] Figure 2 This is a flowchart illustrating the working principle of the improved DistilBERT model, which is based on a multi-dimensional reordering-based retrieval enhancement generation method proposed in this invention.

[0064] Figure 3 This is a schematic diagram of the structure of a retrieval enhancement generation system based on multi-dimensional reordering proposed in this invention. Detailed Implementation

[0065] The invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0066] refer to Figure 1 and Figure 2 A retrieval enhancement generation method based on multi-dimensional reordering includes the following steps:

[0067] S1. The original document is segmented, a tensor index and a keyword index are built for each text segment, and a lightweight language model is used to extract information from each text segment to generate a corresponding compressed summary.

[0068] S2. By defining roles, task descriptions, and input / output formats through a dual-task query processing template, the Qwen large model is driven to perform query expansion and hypothetical answer generation, transforming the user's original query into an optimized query and a hypothetical perfect answer.

[0069] S3. Using optimized queries and hypothetical perfect answers, an initial candidate set is generated through a hybrid retrieval of semantic and keyword dual-path indexes. Then, a two-level re-ranking is performed using an improved DistilBERT model and a Qwen large model to extract a finely ranked candidate fragment set.

[0070] S4. Input the user's original query, the set of candidate fragments for fine ranking, and the corresponding compressed summary of each fragment in the set of candidate fragments for fine ranking into the Qwen big model, decompose the user's original query into several sub-problems, perform multi-dimensional evaluation based on the sub-problems, output a structured score, and generate the final context according to the structured score.

[0071] S5. Iterate according to the order of sub-problems, input the current problem, historical answers and final context into the Qwen big model, and gradually generate answers until all sub-problems are answered, and integrate all sub-problem answers into the first draft of the final answer;

[0072] S6. Use the Qwen large model to evaluate and revise the initial draft of the final answer from multiple dimensions, and generate the final answer, the corresponding confidence score, and the revision log.

[0073] In this embodiment, S1 includes:

[0074] S11. The original document is segmented using LangChain's recursive character text segmenter according to the preset block size and context overlap length to obtain text fragments, and each text fragment is assigned a globally unique fragment ID.

[0075] S12. For each text segment, perform semantic embedding using the pre-trained all-MiniLM-L6-v2 model to generate a sentence tensor of a preset dimension; store the sentence tensor and the corresponding segment ID together in the FAISS index library to form a tensor index.

[0076] S13. For each text segment, perform word segmentation and stop word removal. Based on the processed word units, use the BM25 algorithm to calculate the weight of each word unit, and build an inverted index according to the segment ID of the corresponding text segment to form a keyword index.

[0077] S14. For each text segment, process it using the T5-Small model that has been fine-tuned on the summary task dataset, specify the maximum generation length and generate a compressed summary, and store the compressed summary with the corresponding segment ID.

[0078] S15. For each text segment, the segment ID, original text content, compressed summary, and citation information in the tensor index and keyword index are associated and stored using the segment ID as the primary key to construct a unified data record and store it in the database.

[0079] This step achieves structured storage and in-depth analysis of documents by constructing a multi-dimensional hybrid index and generative summaries, laying the foundation for efficient and accurate retrieval. The original documents are fragmented and assigned unique IDs to achieve fine-grained document segmentation; a semantic model is used to generate sentence tensors and construct a FAISS tensor index to support efficient semantic retrieval; a keyword inverted index is built using word segmentation and the BM25 algorithm to achieve accurate keyword matching; a finely tuned T5 model is used to generate compressed summaries to extract core information; finally, all information is linked and stored to construct a unified knowledge base.

[0080] In this embodiment, the dual-task query processing template includes role definition, task description, and input / output format requirements; the role definition is an information retrieval expert; the task description includes a query optimization task and a hypothetical answer generation task; the query optimization task includes expanding synonyms, supplementing context, and mining potential intents; the hypothetical answer generation task includes generating paragraphs containing core facts and logical structures based on the optimized query; the input / output format is JSON format; the process of converting the user's original query into an optimized query and a hypothetical perfect answer includes reading the user's original query text, mapping the text into high-dimensional semantic vectors using a pre-trained word vector model, and retrieving the top-k synonyms and near-synonyms that are semantically closest to the core entities and keywords from a pre-set synonym dictionary by calculating the cosine similarity between vectors; and obtaining the dialogue history... The previous query text is used to identify pronouns and omitted components in the current query using a pronoun-resolving algorithm. Based on the entity attributes of the previous query, missing information is filled into the current query to construct a context-enhanced complete query text. Named entity recognition technology is used to extract entity types from the complete query. The entity types are matched with a preset intent classification tree. The nodes of the classification tree are traversed to determine whether the user intent belongs to the information query, data analysis, or instruction execution category. Based on the determined user intent, the corresponding intent guide words are retrieved. The synonym list, the context-enhanced complete query text, and the intent guide words are logically concatenated and deduplicated to generate a structured optimized query text. The optimized query text is input into the Qwen big model, and the reasoning mechanism of the Qwen big model is used to generate a hypothetical perfect paragraph containing specific factual values, entity relationship descriptions, and logical derivation processes.

[0081] This step guides the large model to deepen its query understanding through structured prompting engineering, generating high-quality optimized queries and hypothetical answers. The dual-task query processing template includes role definitions, task descriptions, and input / output format requirements to standardize model behavior. The role is defined as an information retrieval expert to guide the model to adopt a professional perspective. The task description includes query optimization and hypothetical answer generation tasks to achieve dual objectives. Query optimization tasks include expanding synonyms, supplementing context, and mining latent intent to enrich the semantic dimension of the query. Hypothetical answer generation tasks include generating paragraphs containing core facts and logical structures based on the optimized query to clarify the expected answer. The input / output format is JSON to ensure standardized and automated data processing.

[0082] In this embodiment, S3 specifically includes:

[0083] S31. Extract query text from the optimized query, use the all-MiniLM-L6-v2 model to perform semantic embedding on the query text, and generate a 384-dimensional query tensor; input the query tensor into the FAISS index, calculate the cosine similarity between the query tensor and all sentence tensors in the FAISS index, and obtain the sentence tensor index with the highest preset number of similarities; retrieve the corresponding original text fragments from the database based on the sentence tensor index to form the first candidate set;

[0084] S32. Perform word segmentation and stop word removal on the hypothetical perfect answer to obtain a keyword list; iterate through each keyword in the keyword list and use the keyword to search in the inverted index to obtain the text fragment ID containing each keyword; merge all the text fragment IDs returned by the keywords and count the keyword frequency of each ID, and sort the text fragment IDs according to the keyword frequency; select the top-ranked preset number of text fragment IDs; retrieve the corresponding original text fragments from the database according to the text fragment IDs to form the second candidate set;

[0085] S33. Merge the first candidate set and the second candidate set to form the initial candidate set; input each text fragment in the initial candidate set and the optimized query into the improved DistilBERT model, and output the relevance probability score.

[0086] S34. Sort the initial candidate set according to the relevance probability score, select the segment with the highest score of a preset number to form an elite segment set; input the elite segment set and the corresponding compressed summary of each segment into the Qwen large model to generate a fine-ranked relevance probability score; sort the elite segment set according to the fine-ranked relevance probability score, select the segment with the highest score of a preset number to form a fine-ranked candidate segment set.

[0087] This step achieves precise selection of candidate segments through a hybrid semantic and keyword retrieval approach combined with two-level re-ranking. Text is extracted from the optimized query to generate a query tensor, which is then input into the FAISS index for semantic retrieval, forming the first candidate set to capture deep semantic relationships. Hypothetical answers are segmented and retrieved using keywords in the inverted index, forming the second candidate set for accurate keyword matching. The two candidate sets are merged to form an initial candidate set, and an improved DistilBERT model is used for a first-level re-ranking to initially filter highly relevant segments. The selected elite segment set is then combined with its compressed summary and input into a larger model for a second-level re-ranking to achieve the final precise ranking, forming a refined candidate segment set.

[0088] Optionally, the improved DistilBERT model includes a feature encoding layer, a late interactive encoding layer, a dynamic feature extraction layer, a convolutional recurrent enhancement layer, a gated adaptive fusion layer, and a relevance classification output layer.

[0089] The feature encoding layer includes a pre-trained DistilBERT encoder, which receives the optimized query and each text fragment in the initial candidate set, and generates a query token tensor matrix and a document token tensor matrix.

[0090] The post-interaction coding layer is used to generate an initial interaction score by calculating the cosine similarity between each tensor in the query token tensor matrix and all tensors in the document token tensor matrix, taking the maximum value and summing them.

[0091] The dynamic feature extraction layer is used to receive the query token tensor matrix and the document token tensor matrix, and perform average pooling on them respectively to generate the query average tensor and the document average tensor; the document token tensor matrix is ​​input into the attention pooling layer with the query average tensor as the query for weighted aggregation to generate the dynamic aggregate tensor.

[0092] The convolutional recurrent enhancement layer is used to input the dynamic aggregation tensor into a one-dimensional convolutional neural network layer for local feature extraction and output a convolutional feature tensor; the convolutional feature tensor is input into a bidirectional LSTM layer for sequence dependency modeling and outputs a recurrent enhancement tensor.

[0093] The gated adaptive fusion layer is used to concatenate the query average tensor and the document average tensor, and then process them through a sigmoid-activated gated network to output a fused weight tensor. The fused weight tensor is then multiplied element-wise with the cyclic augmentation tensor to generate the final fused representation tensor.

[0094] The correlation classification output layer is used to concatenate the initial interaction score with the final fused representation tensor, input it into a linear layer for feature transformation, and use the Sigmoid activation function for non-linear processing to output the final correlation probability score.

[0095] This step constructs a deeply fused multi-layer neural network architecture to achieve accurate quantitative evaluation of the relevance between queries and text fragments. The feature encoding layer includes a pre-trained DistilBERT encoder, which receives the optimized query and each text fragment in the initial candidate set, generating query token tensor matrices and document token tensor matrices to capture deep contextual semantic information. The post-interaction encoding layer calculates the cosine similarity between each tensor in the query token tensor matrix and all tensors in the document token tensor matrix, takes the maximum value, and sums them to generate an initial interaction score, thus establishing fast, coarse-grained global matching. The dynamic feature extraction layer receives the query token tensor matrix and the document token tensor matrix, performs average pooling on them respectively, generating a query average tensor and a document average tensor; the document token tensor matrix is ​​then input into an attention pooling layer using the query average tensor as the query for weighted aggregation, generating a dynamic aggregate tensor to achieve query-oriented focusing on document content. The convolutional recurrent enhancement layer is used to input the dynamically aggregated tensor into a one-dimensional convolutional neural network layer for local feature extraction, outputting a convolutional feature tensor. The convolutional feature tensor is then input into a bidirectional LSTM layer for sequence dependency modeling, outputting a recurrent enhancement tensor to fuse local n-gram features with long-distance sequence dependencies. The gated adaptive fusion layer concatenates the query average tensor and the document average tensor, processes them through a sigmoid-activated gated network, and outputs a fused weight tensor. The fused weight tensor is then multiplied element-wise with the recurrent enhancement tensor to generate the final fused representation tensor, adaptively controlling information flow to achieve optimal feature fusion. The relevance classification output layer concatenates the initial interaction score with the final fused representation tensor, inputs it into a linear layer for feature transformation, and uses a sigmoid activation function for non-linear processing, outputting the final relevance probability score to comprehensively analyze global matching and deep interaction features for accurate relevance judgment.

[0096] In this embodiment, S4 specifically includes:

[0097] S41. Construct a context reordering instruction template, including role definition, task description, input content, evaluation dimensions, and output format requirements; the role is defined as a senior information analyst; the task description is to decompose a user query into sub-questions and evaluate and rank candidate fragments based on the sub-questions in multiple dimensions; the input content is the user's original query, a list of candidate fragments, and corresponding compressed summaries; the evaluation dimensions include coverage of each sub-question, answer quality for the sub-questions, and information novelty; the output format is a JSON array, where each element contains a fragment ID, coverage score, answer quality score, and structured score.

[0098] S42. Combine the user's original query, the set of candidate fragments for fine sorting, and the corresponding compressed summary according to the format requirements of the context reordering instruction template to generate reordering prompt words;

[0099] S43. Input the reordering prompts into the Qwen big model, which will perform sub-problem decomposition and multi-dimensional evaluation, and output a JSON array that meets the output format requirements.

[0100] S44. Parse the JSON array, extract the structured score of each candidate fragment for ranking, sort the candidate fragments in descending order according to the structured score, and select the fragments with the highest preset number of scores to form the final context.

[0101] This step guides the large model to perform sub-question-driven context reordering by constructing multi-dimensional evaluation instructions, in order to filter out the high-quality information that best meets the user's deep needs. A context reordering instruction template is constructed, including role definitions, task descriptions, input content, evaluation dimensions, and output format requirements, to structurally guide the model's evaluation behavior. The user's original query, the set of refined candidate fragments, and the corresponding compressed summary are combined according to the format requirements of the context reordering instruction template to generate reordering prompts, providing structured input. These reordering prompts are input into the Qwen large model, which performs sub-question decomposition and multi-dimensional evaluation, outputting a JSON array that meets the output format requirements, enabling in-depth, multi-faceted quantitative evaluation of the fragments. The JSON array is parsed to extract the structured score of each refined candidate fragment. The refined candidate fragments are sorted in descending order based on their structured scores, and the fragments with the highest preset number of scores are selected to form the final context, ensuring that the final context provided to the generation module has the highest information value and relevance.

[0102] In this embodiment, S5 specifically includes:

[0103] S51. Construct an iterative answer generation instruction template, including role definition, task description, input content, output format, and constraints; the role is defined as an expert researcher; the task description is to answer sub-questions step by step based on context and historical dialogue; the input content includes the current sub-question, the answered sub-questions and their corresponding answers, and the final context; the output format is structured JSON, including the answer to the current sub-question and whether it is the last sub-question; the constraints include that the answer must be strictly based on the provided final context and refer to the logic of the already answered answers;

[0104] S52. Initialize an empty list of solved answers, and take the first subproblem from the subproblem list as the current subproblem;

[0105] S53. According to the format requirements of the iterative answer generation instruction template, combine the current sub-question, the list of solved answers, and the final context into a generation prompt word;

[0106] S54. Input the generated prompt words into the Qwen large model and obtain the output JSON; parse the JSON, extract the answer to the current sub-question, and append it to the list of solved answers;

[0107] S55. Determine if the current subproblem is the last problem in the subproblem list. If not, take the next subproblem from the subproblem list as the new current subproblem and return to S53 to continue iterating.

[0108] S56. Input the list of solved answers into the Qwen large model, and integrate them into the final draft of the answer according to the logical and temporal relationship.

[0109] This step utilizes a sub-problem-driven iterative generation mechanism to ensure the logical coherence and factual accuracy of the final answer. An iterative answer generation instruction template is constructed, including role definitions, task descriptions, input content, output format, and constraints, to standardize the model's generation behavior. An empty list of solved answers is initialized, and the first sub-problem from the sub-problem list is selected as the current sub-problem to initiate the iteration process. Following the format requirements of the iterative answer generation instruction template, the current sub-problem, the list of solved answers, and the final context are combined into a generation prompt to provide structured input. The generation prompt is input into the Qwen main model, the output JSON is obtained, the JSON is parsed, the answer to the current sub-problem is extracted, and appended to the list of solved answers to progressively build the answer. It is determined whether the current sub-problem is the last question in the sub-problem list; if not, the next sub-problem is selected as the new current sub-problem, and the iteration continues to ensure all sub-problems are solved. The list of solved answers is input into the Qwen main model, and according to logical and temporal relationships, it is integrated into a draft of the final answer to form a structured and logically clear complete answer.

[0110] In this embodiment, S6 specifically includes:

[0111] S61. Construct a multi-dimensional evaluation and correction instruction template, including role definition, task description, evaluation dimensions, output format, and correction requirements; the role is defined as a senior fact checker and a logic analyst; the task description is to critically evaluate and correct the initial draft of the answer and quantify its confidence level; the evaluation dimensions include factual accuracy, logical coherence, and content completeness; the output format is structured JSON, including the corrected final answer, a list of confidence scores, and a correction log; the correction requirements include clearly pointing out errors, providing the basis for correction, and explaining the reasons for correction;

[0112] S62. Combine the final draft of the answer and the corresponding final context according to the format requirements of the multi-dimensional evaluation and correction instruction template to generate evaluation prompt words;

[0113] S63. Input the evaluation prompts into the Qwen large model, perform fact checking, logic checking and completeness evaluation, and output JSON that meets the output format requirements;

[0114] S64. Parse the JSON output by the Qwen large model, extract and output the corrected final answer, confidence score and correction log.

[0115] This step establishes a multi-dimensional evaluation and correction mechanism to critically review and optimize the initial draft answer, ensuring high reliability and quality of the final output. A multi-dimensional evaluation and correction instruction template is constructed, including role definitions, task descriptions, evaluation dimensions, output format, and correction requirements, to guide the model in professional and rigorous self-review. The final draft answer and its corresponding context are combined according to the format requirements of the multi-dimensional evaluation and correction instruction template to generate evaluation prompts, providing structured review input. These prompts are input into the Qwen large-scale model to perform fact-checking, logic checks, and completeness assessments, outputting JSON that conforms to the specified output format requirements for comprehensive and automated evaluation of the answer. The JSON output from the Qwen large-scale model is parsed to extract and output the corrected final answer, confidence score, and correction log, providing a credible, transparent, and traceable final result.

[0116] refer to Figure 3 A retrieval enhancement generation system based on multi-dimensional reordering includes the following modules:

[0117] The knowledge base construction module is used to segment the original document, build tensor indexes and keyword indexes for each text segment, and use a lightweight language model to extract information from each text segment to generate corresponding compressed summaries.

[0118] The query understanding module is used to define roles, task descriptions, and input / output formats through a dual-task query processing template, driving the Qwen large model to perform query expansion and hypothetical answer generation, transforming the user's original query into an optimized query and a hypothetical perfect answer;

[0119] The information retrieval module is used to generate an initial candidate set by using optimized queries and hypothetical perfect answers through a hybrid retrieval of semantic and keyword dual-path indexes, and to perform two-level re-ranking using an improved DistilBERT model and a Qwen large model to extract finely ranked candidate fragments.

[0120] The context optimization module is used to input the user's original query, the set of candidate fragments for fine ranking, and the corresponding compressed summary into the Qwen big model, perform multi-dimensional evaluation through sub-problem decomposition, output a structured score, and generate the final context based on the structured score ranking.

[0121] The answer synthesis module is used to iterate according to the order of sub-questions, inputting the current question, historical answers and final context into the Qwen big model, gradually generating answers until all sub-questions are answered, and integrating all sub-question answers into the first draft of the final answer;

[0122] The results quality control module is used to evaluate and correct the initial draft of the answer from multiple dimensions using the Qwen large model, and to generate the final answer, the corresponding confidence score, and the correction log.

[0123] Example 1:

[0124] To verify the effectiveness of this invention in the field of intelligent question answering, it was applied to a large-scale enterprise-level intelligent customer service system (hereinafter referred to as "Platform K"). Traditional enterprise customer service question answering systems typically use keyword-based retrieval or simple end-to-end generation models to answer user questions. These methods not only struggle to understand complex query intents but also easily produce factual errors or logical inconsistencies when generating answers, leading to poor user experience and low customer service efficiency. To address these issues, Platform K decided to adopt the retrieval enhancement generation method and system based on multi-dimensional re-ranking proposed in this invention.

[0125] During implementation, Platform K first utilized its knowledge base management system to integrate product manuals, technical documents, historical work orders, and a FAQ database. Through data cleaning, text segmentation, and multi-dimensional indexing, a structured knowledge foundation was formed. Simultaneously, Platform K captured users' original queries in real time by connecting to a user dialogue interface, providing data input for accurate answers.

[0126] Platform K employs a dual-task query processing template to drive a large model to simultaneously generate optimized queries and hypothetical perfect answers, deepening the understanding of users' true intentions from both semantic and answer dimensions. Subsequently, a hybrid recall strategy combining semantic and keyword retrieval is used, along with a two-level re-ranking process utilizing an improved DistilBERT model and the Qwen large model, to accurately filter elite contexts highly relevant to the query. Finally, an iterative answer generation driven by sub-questions and a multi-dimensional evaluation and correction mechanism ensure the logical rigor, factual accuracy, and content completeness of the final answer.

[0127] During implementation, the technical team at Platform K discovered that, compared to traditional keyword matching and single-round generation methods, the method of this invention significantly improved the accuracy of question answering and user satisfaction. Traditional methods cannot handle fuzzy queries and lack self-correction capabilities, while the method of this invention, through structured query processing and closed-loop generation and evaluation, effectively achieves a deep understanding of complex questions and provides high-quality answers.

[0128] To further verify the actual performance of the method of the present invention, platform K conducted a detailed comparative test between the method of the present invention and the traditional method. The specific performance data is shown in Table 1:

[0129] Table 1 Performance Comparison of Platform K's Intelligent Customer Service Q&A System

[0130]

[0131] As shown in Table 1, the performance of the intelligent customer service system was comprehensively improved after applying the method of this invention. The accuracy rate of question answers increased from 72.5% with traditional methods to 93.8%, and the factual error rate decreased significantly from 15.2% to 3.1%, significantly improving the reliability of answers. The average response time was shortened from 5.8 seconds to 3.2 seconds, and the user problem resolution rate and satisfaction rating also achieved significant increases of over 30%. The manual transfer rate decreased from 25.0% to 8.5%, effectively reducing the cost of manual customer service. At the same time, the system's knowledge base coverage and the average daily number of work orders processed were also significantly improved, demonstrating stronger service capabilities and efficiency.

[0132] The above description is only 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 of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A retrieval enhancement generation method based on multi-dimensional reordering, characterized in that, Includes the following steps: S1. The original document is segmented, a tensor index and a keyword index are built for each text segment, and a lightweight language model is used to extract information from each text segment to generate a corresponding compressed summary. S2. By defining roles, task descriptions, and input / output formats through a dual-task query processing template, the Qwen large model is driven to perform query expansion and hypothetical answer generation, transforming the user's original query into an optimized query and a hypothetical perfect answer. S3. Using optimized queries and hypothetical perfect answers, an initial candidate set is generated through a hybrid retrieval of semantic and keyword dual-path indexes. Then, a two-level re-ranking is performed using an improved DistilBERT model and a Qwen large model to extract a finely ranked candidate fragment set. S4. Input the user's original query, the set of candidate fragments for fine ranking, and the corresponding compressed summary of each fragment in the set of candidate fragments for fine ranking into the Qwen big model, decompose the user's original query into several sub-problems, perform multi-dimensional evaluation based on the sub-problems, output a structured score, and generate the final context according to the structured score. S5. Iterate according to the order of sub-problems, input the current problem, historical answers and final context into the Qwen big model, and gradually generate answers until all sub-problems are answered, and integrate all sub-problem answers into the first draft of the final answer; S6. Use the Qwen large model to evaluate and revise the initial draft of the final answer from multiple dimensions, and generate the final answer, the corresponding confidence score, and the revision log; The improved DistilBERT model includes a feature encoding layer, a late interactive encoding layer, a dynamic feature extraction layer, a convolutional recurrent enhancement layer, a gated adaptive fusion layer, and a relevance classification output layer. The feature encoding layer is used to receive optimized queries and text fragments, and generate query token tensor matrices and document token tensor matrices through the DistilBERT encoder; The post-interaction coding layer is used to generate an initial interaction score by calculating the cosine similarity between each tensor in the query token tensor matrix and all tensors in the document token tensor matrix, taking the maximum value and summing them. The dynamic feature extraction layer is used to receive the query token tensor matrix and the document token tensor matrix, and perform average pooling on them respectively to generate the query average tensor and the document average tensor; the document token tensor matrix is ​​input into the attention pooling layer with the query average tensor as the query for weighted aggregation to generate the dynamic aggregate tensor. The convolutional recurrent enhancement layer is used to extract local features through one-dimensional convolution and to model sequence dependencies using bidirectional LSTM, outputting a recurrent enhancement tensor; The gated adaptive fusion layer is used to concatenate the query average tensor and the document average tensor, generate weights through a Sigmoid gated network, and perform element-wise weighting on the cyclic augmentation tensor to generate the final fused representation tensor. The correlation classification output layer is used to concatenate the initial interaction score and the final fused representation tensor, and after linear transformation and Sigmoid activation, outputs the correlation probability score.

2. The retrieval enhancement generation method based on multi-dimensional reordering according to claim 1, characterized in that, S1 includes: S11. The original document is segmented using LangChain's recursive character text segmenter according to the preset block size and context overlap length to obtain text fragments, and each text fragment is assigned a globally unique fragment ID. S12. For each text segment, perform semantic embedding using the pre-trained all-MiniLM-L6-v2 model to generate a sentence tensor of a preset dimension; store the sentence tensor and the corresponding segment ID together in the FAISS index library to form a tensor index. S13. For each text segment, perform word segmentation and stop word removal. Based on the processed word units, use the BM25 algorithm to calculate the weight of each word unit, and build an inverted index according to the segment ID of the corresponding text segment to form a keyword index. S14. For each text segment, process it using the T5-Small model that has been fine-tuned on the summary task dataset, specify the maximum generation length and generate a compressed summary, and store the compressed summary with the corresponding segment ID. S15. For each text segment, the segment ID, original text content, compressed summary, and citation information in the tensor index and keyword index are associated and stored using the segment ID as the primary key to construct a unified data record and store it in the database.

3. The retrieval enhancement generation method based on multi-dimensional reordering according to claim 1, characterized in that, The dual-task query processing template includes role definition, task description, and input / output format requirements; The role is defined as an information retrieval expert; the task description includes query optimization tasks and hypothetical answer generation tasks. The query optimization tasks include expanding synonyms, supplementing context, and mining potential intents; The hypothetical answer generation task includes generating paragraphs containing core facts and logical structures based on optimized queries; the input and output format is JSON; the process of converting the user's original query into an optimized query and a hypothetical perfect answer includes retrieving a list of synonyms based on word vector similarity; using referential resolution combined with historical queries to fill in contextual information; retrieving intent-guided words through entity recognition and intent tree matching; and fusing synonyms, contextual information, and intent-guided words to generate optimized query text. The Qwen large model inference will optimize the input query text to generate hypothetical perfect paragraphs.

4. The retrieval enhancement generation method based on multi-dimensional reordering according to claim 1, characterized in that, S3 specifically includes: S31. Extract query text from the optimized query, use the all-MiniLM-L6-v2 model to perform semantic embedding on the query text, and generate a 384-dimensional query tensor; input the query tensor into the FAISS index, calculate the cosine similarity between the query tensor and all sentence tensors in the FAISS index, and obtain the sentence tensor index with the highest preset number of similarities; retrieve the corresponding original text fragments from the database based on the sentence tensor index to form the first candidate set; S32. Perform word segmentation and stop word removal on the hypothetical perfect answer to obtain a keyword list; iterate through each keyword in the keyword list and use the keyword to search in the inverted index to obtain the text fragment ID containing each keyword; merge all the text fragment IDs returned by the keywords and count the keyword frequency of each ID, and sort the text fragment IDs according to the keyword frequency; select the top-ranked preset number of text fragment IDs; retrieve the corresponding original text fragments from the database according to the text fragment IDs to form the second candidate set; S33. Merge the first candidate set and the second candidate set to form the initial candidate set; input each text fragment in the initial candidate set and the optimized query into the improved DistilBERT model, and output the relevance probability score. S34. Sort the initial candidate set according to the relevance probability score, select the segment with the highest score of a preset number to form an elite segment set; input the elite segment set and the corresponding compressed summary of each segment into the Qwen large model to generate a fine-ranked relevance probability score; sort the elite segment set according to the fine-ranked relevance probability score, select the segment with the highest score of a preset number to form a fine-ranked candidate segment set.

5. The retrieval enhancement generation method based on multi-dimensional reordering according to claim 1, characterized in that, S4 specifically includes: S41. Construct a context reordering instruction template, including role definition, task description, input content, evaluation dimensions, and output format requirements; the role is defined as a senior information analyst; the task description is to decompose a user query into sub-questions and evaluate and rank candidate fragments based on the sub-questions in multiple dimensions; the input content is the user's original query, a list of candidate fragments, and corresponding compressed summaries; the evaluation dimensions include coverage of each sub-question, answer quality for the sub-questions, and information novelty; the output format is a JSON array, where each element contains a fragment ID, coverage score, answer quality score, and structured score. S42. Combine the user's original query, the refined ranking candidate fragment set, and the corresponding compressed summary of each fragment in the refined ranking candidate fragment set according to the format requirements of the context reordering instruction template to generate reordering prompt words. S43. Input the reordering prompts into the Qwen big model, which will perform sub-problem decomposition and multi-dimensional evaluation, and output a JSON array that meets the output format requirements. S44. Parse the JSON array, extract the structured score of each candidate fragment for ranking, sort the candidate fragments in descending order according to the structured score, and select the fragments with the highest preset number of scores to form the final context.

6. The retrieval enhancement generation method based on multi-dimensional reordering according to claim 1, characterized in that, S5 specifically includes: S51. Construct an iterative answer generation instruction template, including role definition, task description, input content, output format, and constraints; the role is defined as an expert researcher; the task description is to answer sub-questions step by step based on context and historical dialogue; the input content includes the current sub-question, the answered sub-questions and their corresponding answers, and the final context; the output format is structured JSON, including the answer to the current sub-question and whether it is the last sub-question; the constraints include that the answer must be strictly based on the provided final context and refer to the logic of the already answered answers; S52. Initialize an empty list of solved answers, and take the first subproblem from the list of subproblems as the current subproblem; S53. According to the format requirements of the iterative answer generation instruction template, combine the current sub-question, the list of solved answers, and the final context into a generation prompt word; S54. Input the generated prompt words into the Qwen large model and obtain the output JSON; parse the JSON, extract the answer to the current sub-question, and append it to the list of solved answers; S55. Determine if the current subproblem is the last problem in the subproblem list. If not, take the next subproblem from the subproblem list as the new current subproblem and return to S53 to continue iterating. S56. Input the list of solved answers into the Qwen large model, and integrate them into the final draft of the answer according to the logical and temporal relationship.

7. The retrieval enhancement generation method based on multi-dimensional reordering according to claim 1, characterized in that, S6 specifically includes: S61. Construct a multi-dimensional evaluation and correction instruction template, including role definition, task description, evaluation dimensions, output format, and correction requirements; the role is defined as a senior fact checker and a logic analyst; the task description is to critically evaluate, correct, and quantify the confidence level of the initial draft of the final answer; the evaluation dimensions include factual accuracy, logical coherence, and content completeness; the output format is structured JSON, including the corrected final answer, a list of confidence scores, and a correction log; the correction requirements include clearly pointing out errors, providing the basis for correction, and explaining the reasons for correction. S62. Combine the final draft of the answer and the corresponding final context according to the format requirements of the multi-dimensional evaluation and correction instruction template to generate evaluation prompt words; S63. Input the evaluation prompts into the Qwen large model, perform fact checking, logic checking and completeness evaluation, and output JSON that meets the output format requirements; S64. Parse the JSON output by the Qwen large model, extract and output the corrected final answer, confidence score and correction log.

8. A retrieval enhancement generation system based on multi-dimensional reordering, comprising executing the retrieval enhancement generation method based on multi-dimensional reordering as described in any one of claims 1 to 7, characterized in that, Includes the following modules: The knowledge base construction module is used to segment the original document, build tensor indexes and keyword indexes for each text segment, and use a lightweight language model to extract information from each text segment to generate corresponding compressed summaries. The query understanding module is used to define roles, task descriptions, and input / output formats through a dual-task query processing template, driving the Qwen large model to perform query expansion and hypothetical answer generation, transforming the user's original query into an optimized query and a hypothetical perfect answer; The information retrieval module is used to generate an initial candidate set by using optimized queries and hypothetical perfect answers through a hybrid retrieval of semantic and keyword dual-path indexes, and to perform two-level re-ranking using an improved DistilBERT model and a Qwen large model to extract a finely ranked candidate fragment set. The context optimization module is used to input the user's original query, the set of candidate fragments for fine ranking, and the compressed summary corresponding to each fragment in the set of candidate fragments for fine ranking into the Qwen big model. It decomposes the user's original query into several sub-questions, performs multi-dimensional evaluation based on the sub-questions, outputs a structured score, and generates the final context based on the structured score. The answer synthesis module is used to iterate according to the order of sub-questions, inputting the current question, historical answers and final context into the Qwen big model, gradually generating answers until all sub-questions are answered, and integrating all sub-question answers into the first draft of the final answer; The results quality control module is used to evaluate and correct the initial draft of the final answer from multiple dimensions using the Qwen large model, and to generate the final answer, the corresponding confidence score, and the correction log.

Citation Information

Patent Citations

  • Intelligent automobile question and answer method and system based on large model and retrieval enhancement generation and application

    CN120123468A

  • Household appliance knowledge question-answering method and system based on retrieval enhancement generation

    CN121255987A