An efficient self-reflection retrieval enhancement method based on a large model
By employing a self-reflective retrieval enhancement method based on a large model, and utilizing reflective decision-making and reference localization models for iterative judgment and content filtering, the method addresses the issues of misleading illusions and information opacity in question-answering scenarios using large language models. It achieves sentence-level autonomous reflection and decision-making, thereby improving the accuracy and reliability of question answering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-03-31
AI Technical Summary
Large language models suffer from problems such as misleading illusions, use of outdated information, and opaque reasoning processes in question-answering scenarios. Traditional retrieval techniques, with their semantic matching methods, result in overly coarse retrieval granularity, incomplete recall, and inaccurate semantic matching, all of which affect the quality of the generated answers.
We adopt a highly efficient self-reflective retrieval enhancement method based on a large model. Through iterative judgment using a reflective decision model, we dynamically retrieve or generate answers and use a reference location model to filter recalled content. This enables sentence-level autonomous reflection and decision-making, improving the flexibility and accuracy of the retrieval system.
It improves the performance of large models in question-answering scenarios, reduces the impact of noisy information, enhances logical reasoning ability and the reliability of answers, and improves user experience.
Smart Images

Figure CN120929558B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of computer processing, and particularly relates to an efficient self-reflection retrieval enhancement method based on a large model. BACKGROUND
[0002] The performance of a large language model in a question and answer scenario is often limited by the data used during pre-training and fine-tuning, and often exhibits misleading "hallucinations", uses outdated information, cannot trace the source of the information, and has an opaque reasoning process. Therefore, retrieval-augmented generation (RAG) technology has emerged, which retrieves relevant knowledge from an external knowledge base before generating text, and uses it as part of the input, thereby improving the accuracy and relevance of the generated text. In the question and answer scenario, retrieval-augmented generation generally first retrieves relevant content in a pre-established knowledge base based on a pre-processed user query, and then constructs the context by processing the content retrieved by the retrieval system, and inputs the context and the original query into the model to generate an answer using the context information.
[0003] In the use of retrieval-augmented generation, the traditional retrieval technology is based on the similarity of semantic vectors for matching search, and then the top k most similar fragments are selected by reordering. Such a method often has great limitations due to the limitations of the matching algorithm or the retrieval system, including too coarse retrieval granularity (e.g., only accurate to the fragment level, each fragment is about 500 words), incomplete recall, inaccurate semantic matching, and other problems, resulting in poor retrieval result quality, much noise interference information, and thus affecting the performance of the large model, ultimately causing the generated answer to be logically confused, and even "hallucinations" and factual errors. SUMMARY
[0004] To solve the above problems, the application provides a high-efficiency self-reflection retrieval enhancement method based on a large model, which iteratively and two-step uses the large model, dynamically performs the actions of continuing retrieval or generating answers according to the judgment of the reflection decision model on the current situation, when the reflection decision model judges that the current context information is insufficient and needs to continue retrieving related information, then continues to retrieve in the knowledge base with the sub-retrieval query given by the reflection decision model, and filters the recalled content by using the reference positioning model, adds the filtered effective fine-grained reference to the context of the reflection decision model, and makes the reflection decision model make a new round of judgment, when the reflection decision model judges that the current context information is sufficient to answer the user's question and generates the corresponding answer, then returns the final optimal answer given by the reflection decision model, therefore, the method can realize sentence-level fine-grained autonomous reflection and decision retrieval or generation, and perform the RAG scheme of effective content reference in the recall result, so as to solve the problem that the fixed retrieval strategy of the retrieval system cannot flexibly adapt to different situations, and can reduce the influence of noise information in the recall content on the answer of the large model, and overall improve the performance of the large model in the question and answer scene.
[0005] To achieve the above object, the application adopts the following technical scheme:
[0006] A high-efficiency self-reflection retrieval enhancement method based on a large model, comprising the following steps:
[0007] S1, generating a decision: inputting the user input, the historical question and answer and the context of this round of question and answer into the reflection decision model, and the reflection decision model outputs the optimal decision according to the input in sequence; wherein the decision includes a decision action and corresponding action content;
[0008] S2, judging the action: judging the next action according to the decision action output by the reflection decision model; if the decision action is to continue retrieving and generating a query, executing step S3; if the decision action is to stop retrieving and generate an answer, directly executing step S5;
[0009] S3, retrieving and recalling: when the action content output by the reflection decision model in step S1 is one or more sub-retrieval queries, inputting the sub-retrieval query into the retrieval system to perform content recall in the external knowledge base, and obtaining the recalled content;
[0010] S4, recalling and filtering: filtering the recalled content by using the reference positioning model, updating the context of this round of question and answer, and returning and executing step S1;
[0011] The specific process of step S4 is:
[0012] S41, finely dividing the recalled content, and adding position marks between the finely divided content;
[0013] S42. Input the recalled content with fine-grained location identifier and the sub-retrieval query corresponding to the recalled content into the reference positioning model. Output the location index of the fine-grained content that is truly effective for the sub-retrieval query through the reference positioning model, and extract the effective fine-grained content based on the location index.
[0014] S43. After constructing corresponding forms by combining effective fine-grained content with sub-retrieval queries, update the question-answering context for this round.
[0015] S44. Input the updated question-and-answer context, user input, and historical questions and answers back into the reflective decision-making model, and execute step S1.
[0016] S5. Output the answer: When the action content output by the reflective decision model in step S1 is the answer, output the answer and use the answer to answer the user's question.
[0017] Preferably, in step S41: if the granularity of the recalled content obtained from the external knowledge base is at the article level, the recalled content is further subdivided from the article level to the paragraph level; if the granularity of the recalled content obtained from the external knowledge base is at the fragment level, the recalled content is further subdivided from the fragment level to the sentence level.
[0018] Preferably, in step S1, the current user input, the user's historical questions and answers with the reflective decision-making model, and the context of this round of questions and answers are linked together using prompts and instructions to form a sequence for inputting into the reflective decision-making model; wherein, the user's historical questions and answers with the reflective decision-making model and the current user input are used to help the reflective decision-making model identify the user's current true intention and utilize information from historical questions and answers that may be useful for the current question and answer; the context of this round of questions and answers input into the reflective decision-making model is dynamically updated in several rounds of judgment actions, retrieval recall, and recall filtering.
[0019] Preferably, in step S1: the question-and-answer context for this round is empty before initial retrieval and recall; after at least one round of retrieval and recall, the sub-retrieval queries generated in each round and the fine-grained references to the corresponding recalled content are continuously accumulated, and the sub-retrieval queries of each round are added to the question-and-answer context for this round, calculated as: ∑ t ←∑ t-1 ∪( q t-1 , c t-1 ), where ∑ t Represents the context of round t in the reflective decision-making model; ← indicates assignment; ∑ t-1 This represents the context of round t-1 in the reflective decision-making model; (q) t-1 , c t-1 ) represents the query q generated in the (t-1)th round of the reflective decision-making model. t-1Compared to fine-grained citations retrieved and cleaned based on their retrieval, c t-1 Combinatorial representation with corresponding relationships; q t-1 c represents the query generated in the (t-1)th round of the model; t-1 This represents a fine-grained reference retrieved and cleaned based on the query generated in the (t-1)th round of the model.
[0020] Preferably, in step S1: when the reflective decision model determines that the current question-and-answer context is insufficient to answer the user's question and additional information is needed, the decision action output by the reflective decision model is to continue searching and generate a query, and the output action content is one or more sub-search queries; when the reflective decision model determines that the current question-and-answer context is sufficient to answer the user's question and satisfy the user's intent, the decision action output by the reflective decision model is to stop searching and generate an answer, and the output action content is the answer.
[0021] Preferably, the reflective decision-making mechanism in step S1, which outputs the optimal decision sequentially based on the input, is as follows:
[0022] S11. Thinking: The thinking instruction prompts the reflective decision-making model to perform preliminary decision-making and provide a thought process chain, yielding the thinking result. The calculation formula is: y draft = M(p think ||x), y draft y CoT ‖y desicion 0 , where y draft The output represents the thinking steps; M() represents the reflective decision-making model; p think Indicates a thinking instruction; || indicates a connection; x represents the input to the reflective decision-making model; y CoT Indicates the output of the thought chain content; y desicion 0 This indicates the output of preliminary decision-making information;
[0023] The process involves reflecting on user input, the user's historical question-and-answer sessions with the reflective decision-making model, and the context of the current question-and-answer session. This includes analyzing what relevant information is needed to fully answer the user's question, whether the current question-and-answer context or historical questions and answers contain all the necessary information, how to retrieve missing information, and how to integrate information to provide an answer to the user. The reflective decision-making model then provides a thought process chain to help identify errors and make preliminary decisions in the next reflective step, resulting in decision actions and corresponding action content.
[0024] S12. Reflection: The reflection instruction allows the reflection decision-making model to observe and reflect on the initial decision-making process and provide feedback suggestions, resulting in the reflection result. The calculation formula is: y feedback = M(preflect ||x||y draft ), where y feedback M represents the output of the reflection step; M() represents the reflection decision model; p reflect Indicates a reflective instruction; || indicates a connection; x represents the input to the reflective decision-making model; y draft This represents the output of the thought process;
[0025] Based on the thought process described in the previous step, reflect on the decision-making process and provide feedback and suggestions. Reflections on optimizing sub-queries include: whether special attention needs to be paid to certain requirements when retrieving specific information; whether there are additional points that need to be retrieved besides the given sub-queries; and whether synonyms can be searched when collecting information. Reflections on optimizing answers include: whether the obtained answers contain logical errors; whether they comprehensively answer the user's question; and whether the required details are sufficient. Reflections on optimizing decisions include: whether further sub-queries are redundant; whether the given answers are incomplete; and whether relevant information is lacking in the context of this round of question-and-answer interaction and requires further retrieval.
[0026] S13. Decision Making: The reflective decision-making model generates a final decision based on the results of thinking and reflection, or by making corrections, through decision-making instructions. The result of the decision is calculated using the formula: y desicion = M(p refine ||x||y draft ‖y feedback ), where y desicion M represents the final decision; M() represents the reflective decision-making model; p refine Indicates a decision instruction; || represents a connection; x represents the input to the reflective decision-making model; y draft Indicates the output of the thinking process; y feedback This represents the output of the reflection steps;
[0027] Based on the feedback and suggestions provided in the reflection steps, the preliminary decisions made in the thinking steps are optimized accordingly, so that the final query is more conducive to retrieving and collecting comprehensive and effective information, or the final answer is more accurate, reliable and in line with the user's intent, or the decision is more conducive to the generation of the final answer, and an optimized final decision is given.
[0028] S14. Output of the Reflective Decision-Making Model: The reflective decision-making model explicitly and progressively outputs the entire process of thinking, reflecting, and making decisions, using temporal language output for reinforcement learning during the progressive process: y = M(p‖x), y:y draft ‖y feedback ‖y desicionWhere y represents the output of the reflective decision-making model; M() represents the reflective decision-making model; p represents the complete prompt word of the reflective decision-making model; || represents a connection; x represents the input of the reflective decision-making model; y draft Indicates the output of the thinking process; y feedback Indicates the output of the reflection step; y desicion Indicates the final decision;
[0029] The output of the thinking step includes the preliminary decision made by the reflective decision-making model and the thought process involved in making that preliminary decision. The output of the reflection step includes evaluation and feedback suggestions on the preliminary decision made by the thinking step. The decision-making step will correct and optimize the preliminary decision based on the evaluation and feedback provided by the reflection step, outputting only the final decision from the reflective decision-making model. The complete prompts for the reflective decision-making model, in addition to the instructions for thinking, reflecting, and correcting, also include complete target instructions for processes, constraints, few-sample examples, and specific details. The formula for calculating the complete prompts for the reflective decision-making model is: p:p goal ||p think ||p reflect ||p refine Where p represents the complete cue word of the reflective decision-making model; || represents a connection; p goal Indicates a complete target instruction; p think Indicates a thought instruction; p reflect Indicates a reflection instruction; p refine Indicates decision-making instructions;
[0030] The final complete goal: y draft ‖y feedback ‖y desicion = M(p goal ||p think ||p reflect ||p refine ||x), where y draft Indicates the output of the thinking process; y feedback Indicates the output of the reflection step; y desicion Represents the final decision; || represents the connection; M() represents the reflective decision-making model; p goal Indicates a complete target instruction; p think Indicates a thought instruction; p reflect Indicates a reflection instruction; p refine 'x' represents the decision instruction; 'x' represents the input to the reflective decision-making model.
[0031] After obtaining the output of the reflective decision-making model, only the final decision y is considered. desicion To react and carry out the actions of the final decision.
[0032] By adopting the above technical solution, the present invention has the following beneficial effects:
[0033] 1. This invention uses a large model iteratively and in two steps. Based on the judgment made by the reflective decision-making model on the current situation, it dynamically performs actions to continue searching or generate answers. When the reflective decision-making model determines that the current context information is insufficient and that relevant information needs to be searched, it continues to use the sub-search query given by the reflective decision-making model to search and recall in the knowledge base. At the same time, it uses a reference positioning model to filter and clean the recalled content, adding the filtered effective fine-grained references to the context of the reflective decision-making model, and instructing the reflective decision-making model to make a new round of judgments. When the reflective decision-making model determines that the current context information is sufficient to answer the user's question and generate the corresponding answer, it returns the final optimal answer given by the reflective decision-making model. Therefore, this method can realize a RAG scheme that enables sentence-level fine-grained autonomous reflection and decision-making for retrieval or generation, while simultaneously incorporating effective content references in the recall results. This solves the problem that the fixed retrieval strategy of the retrieval system cannot flexibly adapt to different situations, and can reduce the impact of noise information in the recalled content on the large model's response, thereby improving the overall performance of the large model in question-answering scenarios.
[0034] 2. This invention utilizes a reflective decision-making model to autonomously analyze the user's true intent and iteratively update the context. This allows the model to determine information retrieval needs at different stages and under different conditions, flexibly customize corresponding search queries, and make dynamic decisions. This better adapts to both simple and complex user intents, while also eliminating the burden of developing complex search strategies. Furthermore, the context generated by the model itself, combining historical queries with the retrieved content, provides the model with its past behavior and corresponding external feedback. This allows the model to extract relevant experience from failed queries, serving as a self-reminder in future decision-making and planning, avoiding lingering on failed decisions and improving overall adaptability.
[0035] 3. This invention utilizes a reflective decision-making model to analyze and determine the information truly needed to answer user questions. During the iterative recall process, it dynamically customizes one or more sub-queries—more precise and conducive to retrieving strongly relevant target content—based on historical experience. This makes the recalled content more comprehensive and accurately matches the query, improving the accuracy and completeness of the recalled information. When using the reflective decision-making model to make decisions about retrieval queries or generate answers, the model progressively thinks, reflects, and self-corrects. While using external feedback, it provides detailed internal feedback, forcing the development and refinement of logical thinking, thus fully utilizing its inherent self-correcting ability. This significantly reduces errors in handling complex tasks, enhances its logical reasoning ability, and makes the final decision and answer more reliable and credible. Furthermore, explicitly outputting the model's thinking and reflection process in natural language helps observers track the model's behavior and gain a deeper understanding of its underlying reasoning logic.
[0036] 4. This invention utilizes a reference localization model to autonomously identify truly relevant content from the retrieved content and filter out useless noise. The context constructed solely from valid references offers a finer-grained advantage, resulting in more accurate and effective information. By having the reference localization model extract valid references from the complex retrieved content, it isolates the reflective decision-making model from a large amount of noise, reducing interference from noise or contradictory information, avoiding illusions, and alleviating the burden on the reflective decision-making model to sift through vast contexts while handling complex tasks. In RAG application question-answering systems, when citing knowledge content to answer questions, it is often necessary to indicate the source to the user. Compared to coarse-grained citations at the document or chapter level, fine-grained citations at the paragraph or sentence level offer higher transparency, making the model's answer more intuitive, the answer more credible, and improving the user experience. Attached Figure Description
[0037] Figure 1 This is a flowchart of the present invention;
[0038] Figure 2 This is a flowchart of the present invention;
[0039] Figure 3 This is a flowchart illustrating the thinking, reflection, and decision-making mechanism of the present invention.
[0040] Figure 4 This is a flowchart illustrating the fine-grained segmentation and addition of position markers according to the present invention.
[0041] Figure 5 This is a flowchart of the recall filtering process of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0043] like Figures 1 to 5 As shown, an efficient self-reflective retrieval enhancement method based on a large model includes the following steps:
[0044] S1. Decision Generation: Input user input, historical questions and answers, and the context of the current question and answer round into the reflective decision model. The reflective decision model outputs the optimal decision in sequence according to the input. The decision includes the decision action and the corresponding action content.
[0045] In step S1, the current user input, the user's historical questions and answers with the reflective decision-making model, and the context of this round of questions and answers are concatenated and arranged using prompts and instructions to form a sequence for inputting into the reflective decision-making model. The user's historical questions and answers with the reflective decision-making model and the current user input are used to help the reflective decision-making model identify the user's true intention and utilize information from historical questions and answers that may be useful for the current question and answer. The context of this round of questions and answers input into the reflective decision-making model is dynamically updated in several rounds of judgment actions, retrieval recall, and recall filtering.
[0046] In step S1: the question-answering context for this round is empty before initial retrieval and recall; after at least one round of retrieval and recall, the sub-retrieval queries generated in each round and the fine-grained references to the corresponding recalled content are continuously accumulated, and the sub-retrieval queries of each round are added to the question-answering context for this round. The calculation formula is: ∑ t ← ∑ t-1 ∪( q t-1 , c t-1 ), where ∑ t Represents the context of round t in the reflective decision-making model; ← indicates assignment; ∑ t-1 This represents the context of round t-1 in the reflective decision-making model; (q) t-1 , c t-1 ) represents the query q generated in the (t-1)th round of the reflective decision-making model. t-1 Compared to fine-grained citations retrieved and cleaned based on their retrieval, c t-1 Combinatorial representation with corresponding relationships; q t-1 c represents the query generated in the (t-1)th round of the model; t-1 This represents a fine-grained reference that has been retrieved and cleaned based on the query generated in the (t-1)th round of the model.
[0047] In step S1: When the reflective decision model determines that the current question-and-answer context is insufficient to answer the user's question and additional information is needed, the reflective decision model outputs the decision action of continuing the search and generating a query, and the output action content is one or more sub-search queries; when the reflective decision model determines that the current question-and-answer context is sufficient to answer the user's question and satisfy the user's intent, the reflective decision model outputs the decision action of stopping the search and generating an answer, and the output action content is the answer.
[0048] The reflective decision-making model described in step S1 outputs the optimal decision sequentially based on the inputs. The reflective decision-making mechanism is as follows:
[0049] S11. Thinking: The thinking instruction prompts the reflective decision-making model to perform preliminary decision-making and provide a thought process chain, yielding the thinking result. The calculation formula is: y draft = M(p think||x), y draft y CoT ‖y desicion 0 , where y draft The output represents the thinking steps; M() represents the reflective decision-making model; p think Indicates a thinking instruction; || indicates a connection; x represents the input to the reflective decision-making model; y CoT Indicates the output of the thought chain content; y desicion 0 This indicates the output of preliminary decision-making information;
[0050] The process involves reflecting on user input, the user's historical question-and-answer sessions with the reflective decision-making model, and the context of the current question-and-answer session. This includes analyzing what relevant information is needed to fully answer the user's question, whether the current question-and-answer context or historical questions and answers contain all the necessary information, how to retrieve missing information, and how to integrate information to provide an answer to the user. The reflective decision-making model then provides a thought process chain to help identify errors and make preliminary decisions in the next reflective step, resulting in decision actions and corresponding action content.
[0051] S12. Reflection: The reflection instruction allows the reflection decision-making model to observe and reflect on the initial decision-making process and provide feedback suggestions, resulting in the reflection result. The calculation formula is: y feedback = M(p reflect ||x||y draft ), where y feedback M represents the output of the reflection step; M() represents the reflection decision model; p reflect Indicates a reflective instruction; || indicates a connection; x represents the input to the reflective decision-making model; y draft This represents the output of the thought process;
[0052] Based on the thought process described in the previous step, reflect on the decision-making process and provide feedback and suggestions. Reflections on optimizing sub-queries include: whether special attention needs to be paid to certain requirements when retrieving specific information; whether there are additional points that need to be retrieved besides the given sub-queries; and whether synonyms can be searched when collecting information. Reflections on optimizing answers include: whether the obtained answers contain logical errors; whether they comprehensively answer the user's question; and whether the required details are sufficient. Reflections on optimizing decisions include: whether further sub-queries are redundant; whether the given answers are incomplete; and whether relevant information is lacking in the context of this round of question-and-answer interaction and requires further retrieval.
[0053] S13. Decision Making: The reflective decision-making model generates a final decision based on the results of thinking and reflection, or by making corrections, through decision-making instructions. The result of the decision is calculated using the formula: ydesicion = M(p refine ||x||y draft ‖y feedback ), where y desicion M represents the final decision; M() represents the reflective decision-making model; p refine Indicates a decision instruction; || represents a connection; x represents the input to the reflective decision-making model; y draft Indicates the output of the thinking process; y feedback This represents the output of the reflection steps;
[0054] Based on the feedback and suggestions provided in the reflection steps, the preliminary decisions made in the thinking steps are optimized accordingly, so that the final query is more conducive to retrieving and collecting comprehensive and effective information, or the final answer is more accurate, reliable and in line with the user's intent, or the decision is more conducive to the generation of the final answer, and an optimized final decision is given.
[0055] S14. Output of the Reflective Decision-Making Model: The reflective decision-making model explicitly and progressively outputs the entire process of thinking, reflecting, and making decisions, using temporal language output for reinforcement learning during the progressive process: y = M(p‖x), y:y draft ‖y feedback ‖y desicion Where y represents the output of the reflective decision-making model; M() represents the reflective decision-making model; p represents the complete prompt word of the reflective decision-making model; || represents a connection; x represents the input of the reflective decision-making model; y draft Indicates the output of the thinking process; y feedback Indicates the output of the reflection step; y desicion Indicates the final decision;
[0056] The output of the thinking step includes the preliminary decision made by the reflective decision-making model and the thought process involved in making that preliminary decision. The output of the reflection step includes evaluation and feedback suggestions on the preliminary decision made by the thinking step. The decision-making step will correct and optimize the preliminary decision based on the evaluation and feedback provided by the reflection step, outputting only the final decision from the reflective decision-making model. The complete prompts for the reflective decision-making model, in addition to the instructions for thinking, reflecting, and correcting, also include complete target instructions for processes, constraints, few-sample examples, and specific details. The formula for calculating the complete prompts for the reflective decision-making model is: p:p goal ||p think ||p reflect ||p refine Where p represents the complete cue word of the reflective decision-making model; || represents a connection; p goal Indicates a complete target instruction; p think Indicates a thought instruction; p reflect Indicates a reflection instruction; p refine Indicates decision-making instructions;
[0057] The final complete goal: y draft ‖y feedback ‖y desicion = M(p goal ||p think ||p reflect ||p refine ||x), where y draft Indicates the output of the thinking process; y feedback Indicates the output of the reflection step; y desicion Represents the final decision; || represents the connection; M() represents the reflective decision-making model; p goal Indicates a complete target instruction; p think Indicates a thought instruction; p reflect Indicates a reflection instruction; p refine 'x' represents the decision instruction; 'x' represents the input to the reflective decision-making model.
[0058] After obtaining the output of the reflective decision-making model, only the final decision y is considered. desicion To react and carry out the actions of the final decision;
[0059] S2. Determine the action: Based on the decision action output by the reflective decision model, determine the next action; if the decision action is to continue searching and generate a query, execute step S3; if the decision action is to stop searching and generate an answer, directly execute step S5.
[0060] S3. Retrieval Recall: When the action content output by the reflective decision model in step S1 is one or more sub-retrieval queries, the sub-retrieval queries are input into the retrieval system, and content recall is performed in the external knowledge base to obtain the recalled content.
[0061] S4. Recall Filtering: Filter the recalled content using the reference positioning model, update the question-and-answer context for this round, and then return to execute step S1.
[0062] The specific process of step S4 is as follows:
[0063] S41. Perform fine-grained segmentation of the recalled content and add location markers between the segmented fine-grained content;
[0064] In step S41: if the granularity of the recalled content obtained from the external knowledge base is at the article level, the recalled content is further segmented from the article level to the paragraph level; if the granularity of the recalled content obtained from the external knowledge base is at the fragment level, the recalled content is further segmented from the fragment level to the sentence level.
[0065] S42. Input the recalled content with fine-grained location identifier and the sub-retrieval query corresponding to the recalled content into the reference positioning model. Output the location index of the fine-grained content that is truly effective for the sub-retrieval query through the reference positioning model, and extract the effective fine-grained content based on the location index.
[0066] S43. After constructing corresponding forms by combining effective fine-grained content with sub-retrieval queries, update the question-answering context for this round.
[0067] S44. Input the updated question-and-answer context, user input, and historical questions and answers back into the reflective decision-making model, and execute step S1.
[0068] S5. Output the answer: When the action content output by the reflective decision model in step S1 is the answer, output the answer and use the answer to answer the user's question.
[0069] 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 variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An efficient self-reflection retrieval enhancement method based on a large model, characterized in that, The method comprises the following steps: S1, generating a decision: inputting user input, historical question and answer, and this round of question and answer context into a reflective decision model, and outputting an optimal decision in sequence according to the input; wherein the decision comprises a decision action and corresponding action content; In step S1: the question-answering context for this round is empty before initial retrieval and recall; after at least one round of retrieval and recall, the sub-retrieval queries generated in each round and the fine-grained references to the corresponding recalled content are continuously accumulated, and the sub-retrieval queries of each round are added to the question-answering context for this round. The calculation formula is: ∑ t ← ∑ t-1 ∪(q t-1 , c t-1 ), where ∑ t Represents the context of round t in the reflective decision-making model; ← indicates assignment; ∑ t-1 This represents the context of round t-1 in the reflective decision-making model; (q) t-1 , c t-1 ) represents the query q generated in the (t-1)th round of the reflective decision-making model. t-1 Compared to fine-grained citations retrieved and cleaned based on their retrieval, c t-1 Combinatorial representation with corresponding relationships; q t-1 c represents the query generated in the (t-1)th round of the model; t-1 This represents a fine-grained reference that has been retrieved and cleaned based on the query generated in the (t-1)th round of the model. S2, judging an action: judging a next action according to the decision action output by the reflective decision model; if the decision action is to continue searching and generating a query, executing step S3; if the decision action is to stop searching and generate an answer, directly executing step S5; S3, searching and recalling: when the action content output by the reflective decision model in step S1 is one or more sub-search queries, inputting the sub-search queries into a search system, and performing content recall in an external knowledge base to obtain recall content; S4, recall filtering: filtering the recall content by using a reference positioning model, and updating the this round of question and answer context, and then returning and executing step S1; The specific process of step S4 is as follows: S41, finely dividing the recall content, and adding position identifiers between the finely divided content; S42, inputting the recall content with fine-grained position identifiers and the corresponding sub-search queries into the reference positioning model, outputting the position index of the truly effective fine-grained content for the sub-search queries by the reference positioning model, and extracting the effective fine-grained content according to the position index; S43, constructing the effective fine-grained content and the sub-search queries into corresponding forms, and updating the this round of question and answer context; S44, inputting the updated this round of question and answer context, user input, and historical question and answer into the reflective decision model again, and executing step S1; S5, outputting an answer: when the action content output by the reflective decision model in step S1 is an answer, outputting the answer, and using the answer to answer the user's question.
2. The method of claim 1, wherein the method further comprises: In step S41: if the granularity of the recall content obtained from the external knowledge base is article level, the recall content is finely divided from article level to paragraph level; if the granularity of the recall content obtained from the external knowledge base is fragment level, the recall content is finely divided from fragment level to sentence level.
3. The method of claim 1, wherein the method further comprises: In step S1, the current user input, the historical question and answer between the user and the reflective decision model, and the this round of question and answer context are combined by a prompt word and an instruction to form a sequence input into the reflective decision model; wherein the historical question and answer between the user and the reflective decision model and the current user input are used to help the reflective decision model identify the user's current real intention and utilize the information in the historical question and answer that may be useful for the current question and answer; the this round of question and answer context input into the reflective decision model is dynamically updated in the judgment action, search and recall, and recall filtering.
4. The large model-based efficient self-reflection retrieval enhancement method of claim 1, wherein, In step S1, when the reflection decision model determines that the current round of question and answer context is insufficient to answer the user's question and additional information is needed, the decision action output by the reflection decision model is to continue searching and generating a query, and the action content output is one or more sub-search queries; when the reflection decision model determines that the current round of question and answer context is sufficient to answer the user's question and meets the user's intent, the decision action output by the reflection decision model is to stop searching and generate an answer, and the action content output is an answer.
5. The large model-based efficient self-reflection retrieval enhancement method of claim 1, wherein, The reflection decision model outputs the optimal decision in order according to the input in step S1, and the thinking reflection decision mechanism is: S11, thinking: let the reflection decision model make preliminary decision thinking and provide thought chain through the thinking instruction, get the result of thinking, the calculation formula is: y draft = M(p think ‖x), y draft : y CoT ‖y desicion 0 , wherein y draft represents the output of the thinking step; M() represents the reflection decision model; p think represents the thinking instruction; ‖ represents connection; x represents the input of the reflection decision model; y CoT represents the thought chain content output; y desicion 0 represents the preliminary decision content output; Thinking about the user input, the historical question and answer between the user and the reflection decision model, and the current round of question and answer context, the thinking content is: analyzing which aspects of related information are needed to fully answer the user's question, whether all the required information is included in the current round of question and answer context or historical question and answer, how to retrieve the missing information or how to use the integrated information to provide an answer for the user; let the reflection decision model provide a thinking chain of the thinking step process to help the next reflection step to identify errors and make a preliminary decision, and get the decision action and the corresponding action content; S12, reflecting: through the reflection instruction, the reflection decision model observes and reflects on the preliminary decision of the thinking and provides feedback suggestions, obtains the result of the reflection, and the calculation formula is: y feedback = M(p reflect ‖x‖y draft ), wherein y feedback represents the output of the reflection step; M() represents the reflection decision model; p reflect represents the reflection instruction; ‖ represents connection; x represents the input of the reflection decision model; y draft represents the output of the thinking step; According to the description of the decision process of the thinking chain of the last step, the decision made by the last step of thinking is reflected and feedback suggestions are provided, the reflection content for optimizing the sub-search query is: whether special attention is needed when searching for specific information, whether there are additional points that need to be searched for in addition to the given sub-search query, and whether synonyms can be searched when collecting information in a certain aspect; the reflection content for optimizing the answer is: whether the obtained answer has logical errors, whether the answer fully answers the user's question, and whether the required details are detailed enough; the reflection content for optimizing the decision is: whether the sub-search query continues is redundant, whether the given answer is missing, and whether the current round of question and answer context lacks relevant information and needs further retrieval; S13, decision: let the reflection decision model generate the final decision according to the result of thinking and reflection or correction through the decision instruction, obtain the result of decision, and the calculation formula is: y desicion = M(p refine ‖x‖y draft ‖y feedback ), wherein y desicion represents the final decision; M() represents the reflection decision model; p refine represents the decision instruction; ‖ represents connection; x represents the input of the reflection decision model; y draft represents the output of the thinking step; y feedback represents the output of the reflection step; According to the feedback suggestions given by the reflection step, the preliminary decision made by the thinking step is optimized accordingly, so that the final query is more conducive to searching for comprehensive and effective information, or the final answer is more accurate and reliable and meets the user's intent, or the decision is more conducive to the generation of the final answer, and the optimized final decision is given; S14, output of the reflective decision model: the reflective decision model explicitly and gradually outputs the whole process of thinking, reflecting and decision-making, and the output is in the form of time sequence language, which is strengthened in the progressive process: y = M(p‖x), y: y draft ‖y feedback ‖y desicion , wherein y represents the output of the reflective decision model; M() represents the reflective decision model; p represents the complete prompt word of the reflective decision model; ‖ represents connection; x represents the input of the reflective decision model; y draft represents the output of the thinking step; y feedback represents the output of the reflecting step; y desicion represents the final decision; The output content of the thinking step includes the preliminary decision made by the reflection decision model and the thinking chain content when the preliminary decision is made; the output content of the reflection step includes the evaluation and feedback suggestions for the preliminary decision made by the thinking step; the decision step will correct and optimize the preliminary decision according to the evaluation and feedback given by the reflection step, and only output the final decision of the reflection decision model; In addition to the thinking, reflection, and correction instructions, the complete prompt words of the reflection decision model also include the complete target instructions of the process, restrictions, few sample examples, and special details, and the calculation formula of the complete prompt words of the reflection decision model is: p: p goal ‖ p think ‖ p reflect ‖ p refine where p represents a complete cue for a reflective decision model; ‖ represents a concatenation; p goal represents a complete goal instruction; p think represents a thinking instruction; p reflect represents a reflecting instruction; p refine represents a decision instruction; Final complete goal: y draft ‖y feedback ‖y desicion = M(p goal ‖p think ‖p reflect ‖p refine ‖x), where y draft represents the output of the thinking step; y feedback represents the output of the reflection step; y desicion represents the final decision; ‖ represents concatenation; M() represents the reflection decision model; p goal represents the complete goal instruction; p think represents the thinking instruction; p reflect represents the reflection instruction; p refine represents the decision instruction; x represents the input of the reflection decision model; After obtaining the reflective decision model output, only the final decision y desicion React and perform the action of the final decision.
Citation Information
Patent Citations
Reverse rollback type retrieval enhancement generation method and device, equipment and storage medium
CN120123375A
Dynamic knowledge retrieval enhancement method based on large language model
CN120407570A