Dynamic retrieval enhancement generation and deep reasoning method and framework based on intelligent agent
By dividing the problems into different levels of difficulty and combining in-depth inference modules for dynamic searching, the shortcomings of large language models in handling dynamic information and complex inference tasks are solved, and more efficient and accurate knowledge utilization is achieved, which is suitable for a variety of knowledge-intensive application scenarios.
Patent Information
- Application Number
- CN202510642656.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-19
AI Technical Summary
When existing large-scale pre-trained language models deal with dynamically changing information and complex multi-layer reasoning tasks, there is a problem of insufficient ability to utilize external knowledge, resulting in inconsistent content with reality and inefficient computing.
Dynamic search enhancement generation and deep inference methods based on intelligent agents are adopted. By dividing the problem into simple, medium and complex difficulty levels, dynamically adjusting the search strategy, combining the deep inference module for multiple rounds of search and information filtering, and optimizing knowledge utilization.
The performance of large language models in complex tasks is improved, especially in multi-hop reasoning, the overall efficiency and accuracy of the system is improved, redundant information interference is reduced, and the logical continuity and accuracy of the answers are enhanced.
Smart Images

Figure CN120508624A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language processing technology, and specifically relates to a dynamic retrieval enhancement generation and deep reasoning method and framework based on intelligent agents. Background Art
[0002] In the field of natural language processing (NLP), with the widespread adoption of large-scale pre-trained models (such as the GPT series), generative models have achieved significant progress in tasks such as text generation, question-answering systems, and dialogue generation. However, these models have numerous limitations in leveraging external knowledge. These models typically rely on internal embedded knowledge bases or training data, which limits their ability to leverage external, updated knowledge in real time, particularly when dealing with dynamically changing information or complex, multi-layer reasoning tasks. This limitation often leads to so-called "hallucinations," where the generated content does not match reality.
[0003] To overcome this limitation, Retrieval-Augmented Generation (RAG) has been proposed as a solution. By combining information retrieval with generative models, it enables the model to not only retrieve relevant information from external knowledge bases but also integrate it into the generation process, thereby improving the accuracy and richness of the output. However, traditional RAG methods primarily rely on static retrieval strategies. While this approach can improve output quality to a certain extent, it lacks consideration for problem complexity, often leading to knowledge redundancy, low computational efficiency, and the potential introduction of erroneous or low-quality information.
[0004] Therefore, a new approach is urgently needed. Summary of the Invention
[0005] The purpose of this invention is to provide a dynamic retrieval enhancement generation and deep reasoning method and framework based on intelligent agents. This method not only enhances the performance of large language models in various complex tasks, especially in multi-hop reasoning, but also improves the overall efficiency and accuracy of the system through the synergy between its modules, and is suitable for a variety of knowledge-intensive application scenarios.
[0006] To achieve the above objectives, the present invention provides a dynamic retrieval enhancement generation and deep reasoning method and framework based on intelligent agents, comprising the following steps: S1. Input the question into the large language model, which analyzes the question and divides it into three difficulty levels: simple, medium, and complex. S2, process the questions according to their difficulty and retrieve knowledge from the corpus; S3, the large language model processes the knowledge acquired in S2 and outputs the final result.
[0007] Preferably, in S1, questions are divided into three difficulty levels, specifically: questions about public entity knowledge are marked as simple difficulty questions; questions that require external knowledge are marked as medium difficulty questions; and questions that require reasoning and processing long texts are marked as complex questions.
[0008] Preferably, in S2, different processing is performed according to the difficulty of the questions, including no retrieval for simple questions; retrieval of information from the corpus for medium-difficulty questions; and retrieval of information from the corpus for complex questions through multiple rounds of retrieval combined with deep reasoning.
[0009] Preferably, in S2, retrieving knowledge from the corpus includes the following steps: S201, dynamically evaluate the response quality and determine whether additional external knowledge is needed. If no external knowledge is needed, stop the search; S202: If external knowledge is required, a search statement is constructed based on the context and generation requirements, and the search statement is used to search the corpus to obtain accumulated information; S203: After the search is completed, redundant information is filtered and the accumulated information in S202 is input into the large language model.
[0010] Preferably, retrieving information from a corpus through multiple rounds of retrieval combined with deep reasoning includes the following steps: S20201. Decompose the original query into multiple independent search sub-questions; S20202. Each sub-question is considered as a search statement. The search statement gradually introduces external knowledge by searching the corpus to obtain cumulative information. S20203. Determine the relevance between the accumulated information in S20202 and the sub-question. If relevant, input the accumulated information into the large language model; if not relevant, return to S20201.
[0011] The present invention also provides a dynamic retrieval enhancement generation and deep reasoning framework based on intelligent agents, including the following modules: The question difficulty classification module is used to analyze the input questions using the large language model and classify them into three difficulty levels: simple, medium, and complex. A dynamic retrieval optimization module, connected to the question difficulty classification module, is used to process questions according to their difficulty and retrieve relevant knowledge from the corpus; The answer generation module is connected to the dynamic retrieval optimization module and is used to process the knowledge obtained by the dynamic retrieval optimization module and output the results after integration and analysis.
[0012] Preferably, the dynamic search optimization module further includes the following submodules: The intelligent retrieval trigger submodule is used to dynamically evaluate the response quality and determine whether additional external knowledge is needed. If external knowledge is not needed, the retrieval is stopped; A deep reasoning submodule, connected to the intelligent retrieval trigger submodule, is used to retrieve external knowledge, combine context and generation requirements, construct a retrieval statement, and use the retrieval statement to search the corpus to obtain accumulated information; The dynamic knowledge filtering submodule is connected to the deep reasoning submodule and is used to process the results after the retrieval is completed, filter redundant information, and input the accumulated information into the large language model.
[0013] Preferably, the deep reasoning submodule further includes the following submodules: The question decomposition submodule is used to automatically decompose the original query into multiple independent retrieval sub-questions; an iterative retrieval submodule, connected to the question decomposition submodule, for treating each subquestion as a retrieval statement, which gradually introduces external knowledge from the corpus through retrieval to obtain accumulated information; The knowledge matching and reasoning submodule is connected to the iterative retrieval submodule and is used to determine the relevance between the retrieved accumulated information and the sub-questions. If relevant, the information is input into the large language model; if not, the question decomposition submodule is triggered.
[0014] Therefore, the present invention adopts the above-mentioned intelligent agent-based dynamic retrieval enhancement generation and deep reasoning method and framework. Compared with the existing technology, the present invention has the following significant beneficial effects: (1) The present invention automatically classifies the difficulty of questions and matches different search strategies to avoid unnecessary searches. It also dynamically adjusts search decisions, optimizes queries and filters knowledge, reduces invalid searches, and improves knowledge utilization efficiency. (2) The present invention filters redundant and low-quality information, reduces generation interference, and the deep reasoning module supports complex tasks, aggregates multi-document information, and improves answer accuracy and coherence; (3) The present invention simulates the human reasoning process, recursively calls components to handle complex problems, iteratively searches to build reasoning chains, evaluates knowledge and adjusts sub-problems to ensure logical continuity.
[0015] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of the method and framework for dynamic retrieval enhancement generation and deep reasoning based on intelligent agents of the present invention; Figure 2A deep reasoning flow chart of the dynamic retrieval enhancement generation and deep reasoning method and framework based on intelligent agents of the present invention; Figure 3 This is an ablation experiment data diagram of the dynamic retrieval enhancement generation and deep reasoning method and framework based on intelligent agents in the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used in the present invention should be the common meanings understood by people with ordinary skills in the field to which the present invention belongs.
[0018] Example 1 like Figure 1-Figure 2 As shown, the intelligent agent-based dynamic retrieval enhancement generation and deep reasoning method and framework of the present invention include the following steps: S1. Input the question into the large language model, which analyzes it and categorizes it into three difficulty levels: simple, medium, and complex. Questions requiring public entity knowledge are marked as simple; questions requiring external knowledge are marked as medium; and questions requiring reasoning and processing long text are marked as complex.
[0019] S2. Process the questions separately according to their difficulty. For simple questions, which involve public entity knowledge or basic facts, they can be answered directly using the internal knowledge of the large language model without triggering external retrieval. For example, "Is apple a fruit?" The large language model can directly answer based on its own knowledge reserves without the need for additional information retrieval. For medium-difficulty questions, it is necessary to use external knowledge (such as obtaining information from knowledge bases such as Wikipedia) to fill in the missing contextual information and solve it through a single round of retrieval. For example, "In which year did a certain historical event occur?", the key information required for the answer can be obtained through a single retrieval. For complex questions, it usually involves tasks such as multi-hop reasoning and long text integration. For example, "Analyze the causes of a historical event and its impact on a series of subsequent related events", it is necessary to retrieve different document information multiple times and integrate reasoning to form relevant knowledge. Retrieving relevant knowledge from the corpus includes the following steps: S201. Dynamically evaluate the response quality of the model to determine whether additional external knowledge is needed. If it is determined that external knowledge is not needed, the search operation is stopped to avoid unnecessary search behavior, reduce redundant knowledge integration, and improve search efficiency; S202: For situations where external knowledge is required, construct and optimize the search statement based on the context and generation requirements. Use the optimized search statement to search the corpus and obtain relevant accumulated information, aiming to improve the precision and recall of the search and ensure that the acquired knowledge can better support subsequent processing. For complex problems, deep reasoning is also required, including the following steps: S20201. For complex problems such as multi-hop reasoning, the original query is automatically broken down into multiple independent and searchable sub-questions. By breaking down complex questions and clarifying the specific knowledge required for each sub-question, subsequent searches are more targeted, improving the accuracy of knowledge retrieval and the quality of answer generation. For example, the question "Analyze the causes of a historical event and its impact on the subsequent economy" can be broken down into sub-questions such as "What are the causes of the historical event?" and "What are the direct impacts of the event on the subsequent economy?" S20202: Treat each sub-question as an independent retrieval unit, gradually introduce external knowledge from the corpus through multiple rounds of retrieval to build a complete reasoning chain. Each retrieval obtains relevant information based on the specific needs of the sub-question, and accumulates the results of multiple rounds of retrieval to ensure that the cross-document knowledge required for complex questions is fully covered. For example, for each sub-question, multiple searches are conducted on knowledge bases such as Wikipedia to gradually aggregate information such as event background, timeline, and impact data; S20203. Evaluate the relevance of the retrieved cumulative information to the sub-questions: If relevant, the information is fed into the large language model for subsequent reasoning and answer generation. If irrelevant, the question is re-decomposed (returning to S20201). By adjusting the sub-question representation or refining the search requirements, the search results are optimized to ensure the logical continuity of the generated response. By dynamically verifying the relevance of knowledge, invalid information interference is avoided, ensuring the logical consistency of the reasoning chain of complex problems and preventing reasoning failures caused by insufficient single searches. S203. After the retrieval is completed, the accumulated information obtained in S202 is processed, redundant information is filtered out, and the filtered, high-quality information is input into the large language model to ensure that the knowledge input into the large language model is highly relevant, providing a guarantee for generating high-quality results.
[0020] S3, the large language model processes the knowledge acquired in S2 and outputs the results.
[0021] This embodiment uses the following public datasets, covering tasks of different difficulty levels: CommonsenseQA2.0 (easy difficulty, level A): evaluates common sense reasoning ability, including multiple-choice questions based on common sense (such as "Is an apple a fruit?"). SQuAD (medium difficulty, level B): a single-hop reading comprehension task that requires extracting factual answers from a single document (such as "the time when a certain historical event occurred"). TriviaQA (medium difficulty, level B): an open-domain factual question answering task that requires retrieving information from an external knowledge base (such as "the main contributions of a certain scientist"). HotpotQA (complex difficulty, level C): a multi-hop reasoning task that requires integrating information from multiple documents and inferring a logical chain (such as "the causes of a certain historical event and its impact on the subsequent economy").
[0022] This embodiment is compared with mainstream large language models (GPT-3.5-Turbo, Llama 2-7B / 13B-chat, Qwen 2-7B-chat) and the traditional RAG method (single-round retrieval based on BM25), as shown in Tables 1 and 2.
[0023] Table 1 Test results of various models in different datasets
[0024] Table 2 Test results of various models on the HotPotQA dataset
[0025] This framework outperforms mainstream models across all difficulty levels, particularly on the complex multi-hop task (HotpotQA), where accuracy is improved by 5.4%. This demonstrates the effectiveness of dynamic retrieval and deep reasoning.
[0026] In addition, if Figure 3 As shown in the figure, ablation experiments were conducted on this framework. When using only the traditional retrieval mode based on the BM25 algorithm, the model's accuracy dropped significantly. Specifically, on the HotpotQA dataset, the accuracy dropped from 63.9% to 41.6%, and on the CommonsenseQA dataset, the accuracy dropped from 81.8% to 74.1%. These results fully demonstrate that this framework can bring substantial performance improvements when facing complex tasks that traditional methods struggle to effectively handle.
[0027] Therefore, the present invention adopts the above-mentioned intelligent agent-based dynamic retrieval enhancement generation and deep reasoning method and framework, which not only enhances the performance of large language models in various complex tasks, especially in multi-hop reasoning, but also improves the overall efficiency and accuracy of the system through the synergy between its modules, and is suitable for a variety of knowledge-intensive application scenarios.
[0028] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. Dynamic retrieval enhancement generation and deep reasoning method based on intelligent agent, characterized by: The following steps are involved: S1. Input the question into the large language model, which analyzes the question and divides it into three difficulty levels: simple, medium, and complex. S2, process the questions according to their difficulty and retrieve knowledge from the corpus; S3, the large language model processes the knowledge acquired in S2 and outputs the final result.
2. The method for dynamic retrieval enhancement generation and deep reasoning based on intelligent agents according to claim 1 is characterized in that: In S1, questions are divided into three difficulty levels: questions about public entity knowledge are marked as simple difficulty questions; questions that require external knowledge are marked as medium difficulty questions; and questions that require reasoning and processing long texts are marked as complex questions.
3. The method for dynamic retrieval enhancement generation and deep reasoning based on intelligent agents according to claim 2 is characterized in that: In S2, different problems are processed according to their difficulty. For simple problems, no retrieval is performed; for medium-difficulty problems, information is retrieved from the corpus; for complex problems, information is retrieved from the corpus through multiple rounds of retrieval combined with deep reasoning.
4. The method for dynamic retrieval enhancement generation and deep reasoning based on intelligent agents according to claim 3 is characterized in that: In S2, retrieving knowledge from the corpus includes the following steps: S201, dynamically evaluate the response quality and determine whether additional external knowledge is needed. If no external knowledge is needed, stop the search; S202: If external knowledge is required, a search statement is constructed based on the context and generation requirements, and the search statement is used to search the corpus to obtain accumulated information; S203: After the search is completed, redundant information is filtered and the accumulated information in S202 is input into the large language model.
5. The method for dynamic retrieval enhancement generation and deep reasoning based on intelligent agents according to claim 4 is characterized in that: Retrieving information from a corpus through multiple rounds of retrieval combined with deep reasoning involves the following steps: S20201. Decompose the original query into multiple independent search sub-questions; S20202. Each sub-question is considered as a search statement. The search statement gradually introduces external knowledge by searching the corpus to obtain cumulative information. S20203. Determine the relevance between the accumulated information in S20202 and the sub-question. If relevant, input the accumulated information into the large language model; if not relevant, return to S20201.
6. Dynamic retrieval enhancement generation and deep reasoning framework based on intelligent agents, characterized by: Includes the following modules: The question difficulty classification module is used to analyze the input questions using the large language model and classify them into three difficulty levels: simple, medium, and complex. A dynamic retrieval optimization module, connected to the question difficulty classification module, is used to process questions according to their difficulty and retrieve relevant knowledge from the corpus; The answer generation module is connected to the dynamic retrieval optimization module and is used to process the knowledge obtained by the dynamic retrieval optimization module and output the results after integration and analysis.
7. The intelligent agent-based dynamic retrieval enhancement generation and deep reasoning framework according to claim 6 is characterized in that: The dynamic retrieval optimization module also Includes the following submodules: The intelligent retrieval trigger submodule is used to dynamically evaluate the response quality and determine whether additional external knowledge is needed. If external knowledge is not needed, the retrieval is stopped; A deep reasoning submodule, connected to the intelligent retrieval trigger submodule, is used to retrieve external knowledge, combine context and generation requirements, construct a retrieval statement, and use the retrieval statement to search the corpus to obtain accumulated information; The dynamic knowledge filtering submodule is connected to the deep reasoning submodule and is used to process the results after the retrieval is completed, filter redundant information, and input the accumulated information into the large language model.
8. The intelligent agent-based dynamic retrieval enhancement generation and deep reasoning framework according to claim 7 is characterized in that: The deep reasoning submodule also includes the following submodules: The question decomposition submodule is used to automatically decompose the original query into multiple independent retrieval sub-questions; an iterative retrieval submodule, connected to the question decomposition submodule, for treating each subquestion as a retrieval statement, which gradually introduces external knowledge from the corpus through retrieval to obtain accumulated information; The knowledge matching and reasoning submodule is connected to the iterative retrieval submodule and is used to determine the relevance between the retrieved accumulated information and the sub-problems. If relevant, the information is input into the large language model; if not, the question decomposition submodule is triggered.
Citation Information
Cited By
Retrieval enhancement generation method and device based on large language model and electronic equipment
CN121542392A
Weight coefficient dynamic updating-based dual-path generation method, medium and system
CN121998073A
Dual-path generation method, medium and system based on dynamic updating of weight coefficients
CN121998073B
Double-path generation method based on elastic difficulty threshold decision, medium and system
CN121998074A
Dual-path generation method, medium and system based on elastic difficulty threshold decision
CN121998074B