A method for dynamic knowledge retrieval enhancement based on large language model
By building a dynamic knowledge indexing system and a multi-feature fusion decision model, the retrieval and generation process of the large language model is optimized, the problems of knowledge solidification, insufficient timeliness and hallucination of LLM are solved, efficient and reliable knowledge retrieval and generation are achieved, and it adapts to multi-source heterogeneous data interfaces, thereby improving the timeliness of the system and user trust.
Patent Information
- Application Number
- CN202510898004.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-01
AI Technical Summary
Traditional large language models (LLMs) have problems with knowledge solidification and timeliness, hallucination problems, and insufficient coverage of long-tail knowledge, making it difficult to meet the high-precision requirements of vertical scenarios.
A dynamic knowledge indexing system is constructed, and intelligent routing selection is performed between retrieval channels and generation channels through a multi-feature fusion decision model. Combined with a knowledge hybrid retrieval mechanism based on multimodal fusion, user satisfaction is monitored in real time and the conversation status map is updated. Dual-channel information fusion technology is used to optimize the LLM generation process.
It enables real-time access to the latest knowledge resources, improves the timeliness and professionalism of answers, reduces misleading information, increases system response speed and user trust, adapts to multi-source heterogeneous data interfaces, and enhances the system's versatility and sustainable development capabilities.
Smart Images

Figure CN120407570B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge retrieval, and in particular to a method for dynamic knowledge retrieval enhancement based on a large language model. Background Art
[0002] In recent years, with the rapid development of large language models (LLMs), generative AI, represented by DeepSeek and GPT, has demonstrated powerful capabilities in natural language processing (NLP) tasks. However, traditional LLMs have the following key issues:
[0003] Knowledge solidification and lack of timeliness
[0004] LLM training relies on a static corpus and cannot dynamically update knowledge, resulting in limited performance when faced with the latest information or domain-specific data. For example, when answering news events or industry technology trends after 2024, an unenhanced LLM may generate outdated or incorrect answers.
[0005] Hallucination Problem
[0006] Since LLM is essentially a probability-based text generation model, in the absence of reliable knowledge support, it may output seemingly reasonable but actually wrong answers (such as fictitious facts, incorrect citations, etc.).
[0007] Insufficient coverage of long-tail knowledge
[0008] General LLMs have limited knowledge of low-frequency or professional fields (such as medicine, law, engineering, etc.) and are unable to meet the high-precision requirements of vertical scenarios.
[0009] To address these issues, Retrieval-Augmented Generation (RAG) technology has emerged. RAG dynamically retrieves external knowledge bases (such as structured databases, document collections, or real-time data sources) to inject relevant context into the LLM generation process, thereby improving the accuracy, timeliness, and interpretability of answers. Typical technical solutions include:
[0010] Dense Retrieval: Use models such as BERT and DPR to encode queries and documents into vectors and match relevant paragraphs through approximate nearest neighbor search (ANN).
[0011] Hybrid Retrieval: Combines traditional keyword search (such as BM25) with vector search, taking into account both semantic matching and precise term recall.
[0012] Dynamic knowledge update (Hot-Reload): Supports real-time addition, deletion, modification, and query of the knowledge base, avoiding the retraining cost of traditional LLM.
[0013] Although RAG technology significantly improves the reliability of LLM, its implementation still faces challenges such as balancing retrieval efficiency and accuracy, integrating multimodal knowledge, and building complex reasoning chains. Therefore, optimizing the collaborative mechanism between dynamic knowledge retrieval and LLM generation has become a key research and application direction. Summary of the Invention
[0014] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for dynamic knowledge retrieval enhancement based on a large language model.
[0015] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0016] A method for dynamic knowledge retrieval enhancement based on a large language model, comprising the following steps:
[0017] S1. Build a dynamic knowledge index system;
[0018] S2. Based on the constructed dynamic knowledge index system, analyze user input intentions and determine knowledge retrieval needs;
[0019] S3: Based on the results obtained in S2, a multi-feature fusion decision model is constructed to perform intelligent routing between the retrieval channel and the generation channel;
[0020] S4: Based on the decision model obtained in S3, a multimodal fusion knowledge hybrid retrieval mechanism is constructed to output candidate knowledge fragments;
[0021] S5. The candidate knowledge fragments obtained in S4 are combined with the user's current input and context history to form input pairs. Through semantic relevance calculation, context alignment analysis, and knowledge source credibility score multi-dimensional indicators, an automatic evaluation system integrating semantic and structural information is constructed. The accuracy and reliability of the retrieved knowledge are evaluated based on the source confidence weight of the knowledge fragments.
[0022] S6. Encode the content of the knowledge fragment after accuracy and reliability evaluation into a context vector, use dual-channel information fusion to control the information weight distribution between the knowledge fragment and the internal language modeling of the large prediction model, monitor user satisfaction and conversation status changes in real time, and update the conversation status map.
[0023] Furthermore, the S1 specifically includes the following steps:
[0024] S11. Use data access and analysis to convert multi-source heterogeneous data into a unified intermediate format;
[0025] S12. Perform knowledge extraction on the converted data, including entity extraction, relationship identification, and semantic annotation, and map it to a unified knowledge structure;
[0026] S13. Build keyword index, semantic vector index and cross-domain knowledge graph. The semantic vector index encodes knowledge fragments based on the Sentence-BERT model, and constructs approximate nearest neighbor retrieval through the HNSW algorithm.
[0027] Furthermore, the S2 specifically includes the following steps:
[0028] S21. Normalize user input and build a contextual embedding representation based on the conversation history.
[0029] S22. Determine whether it is an information request statement through the intent classifier and calculate the knowledge requirement score;
[0030] S23. Dynamically trigger the knowledge retrieval process based on the knowledge demand score and user behavior rules.
[0031] Furthermore, the specific method of calculating the knowledge requirement score in S22 is:
[0032]
[0033] in, Score the knowledge need, is the question word density score, is the proper noun density score, Score the knowledge entity matching, are the weight parameters corresponding to the scores.
[0034] Furthermore, the S3 specifically includes the following steps:
[0035] S31, extracting word vector features, question structure features, and historical behavior features input by the user;
[0036] S32. Calculate the probabilities of the retrieval path and the generation path through a lightweight neural network decision model. If the retrieval probability is higher than a threshold, trigger knowledge retrieval.
[0037] S33. Write the decision result into the dialogue state diagram for subsequent retrieval strategy optimization.
[0038] Furthermore, the S4 specifically includes the following steps:
[0039] S41. parse the user query text to extract keywords, intent vectors, and multimodal demand tags;
[0040] S42, obtaining candidate knowledge fragments through a keyword retrieval module, a semantic vector retrieval module, and a multimodal completion module;
[0041] S43. Perform several rounds of fusion sorting on the search results, use the LambdaMART model to optimize the final sorting, and eliminate redundant content through semantic similarity detection to obtain candidate knowledge fragments.
[0042] Furthermore, the specific method of eliminating redundant content in step S43 is:
[0043] S431. Remove duplicate knowledge units, calculate the coverage and confidence of the results, and convert the text into a vector representation of fixed dimension;
[0044] S432, performing word segmentation and stop word removal on the remaining key texts of the knowledge units, and generating an embedding vector for each knowledge unit;
[0045] S433. Calculate the similarity between the embedding vectors of each knowledge unit. When the similarity exceeds a set threshold, determine that the semantics is redundant and remove it to obtain a candidate knowledge fragment.
[0046] Furthermore, the S5 specifically includes the following steps:
[0047] S51, organize all candidate knowledge fragments returned in step 4 and the user's current input and context history into input pairs, and construct<query, document> Structure pair collection;
[0048] S52. For each<query, document> Sentence pair matching is scored using the pre-trained BERT-based model to obtain semantic similarity;
[0049] S53. Concatenate the semantic similarity, context adaptation semantics, and knowledge source credibility score into a vector and input it into the fully connected network FFN for confidence score prediction. Output the credibility score and set the confidence threshold. Filter out knowledge units that do not meet the standards and sort the remaining content in descending order of confidence.
[0050] The present invention has the following beneficial effects:
[0051] Through the dynamic retrieval mechanism, the system can access the latest knowledge resources in real time, overcome the problem of outdated knowledge in traditional large language models, and ensure the timeliness and professionalism of the answer content.
[0052] The dual-channel decision module and fusion algorithm are used to enable efficient collaboration between the retrieval and generation processes, avoid invalid retrieval and information redundancy, and improve system response speed and resource utilization.
[0053] It supports cross-level retrieval from keywords to semantic fragments, meeting query requirements of different complexities and granularity, and improving the comprehensiveness and accuracy of knowledge recall.
[0054] Through the retrieval result credibility assessment model, relevant content is automatically screened and sorted, reducing the interference of misleading or irrelevant information, and improving the reliability of answers and user trust.
[0055] Combining context-aware search optimization and conversation state tracking, dynamic adjustment of search strategies is achieved, making the system's understanding of user intent more accurate, improving the interactive experience and conversation coherence.
[0056] The technical solution supports multi-source heterogeneous data interfaces, facilitates the expansion and maintenance of dynamic knowledge bases, adapts to different application scenarios such as enterprise customer service, professional Q&A, intelligent education, etc., and enhances the system's versatility and sustainable development capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0058] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.
[0059] A method for dynamic knowledge retrieval enhancement based on large language models, such as Figure 1 As shown, the following steps are included:
[0060] S1. Build a dynamic knowledge index system;
[0061] In this embodiment, this step aims to establish a knowledge base architecture that supports multi-granularity indexing to address issues such as static knowledge aging and single data sources. A unified embedded representation of structured, semi-structured, and unstructured data is introduced at the knowledge storage layer; keyword indexes and semantic indexes are constructed at the index layer. Specifically, the following steps are included:
[0062] S11. Use data access and analysis to convert multi-source heterogeneous data into a unified intermediate format;
[0063] User-uploaded or automatically acquired documents are converted into a unified intermediate format, Markdown, through API interfaces, HTML, PDF, Word documents, etc.
[0064] S12. Perform knowledge extraction on the converted data, including entity extraction, relationship identification, and semantic annotation, and map it to a unified knowledge structure;
[0065] S13. Build keyword index, semantic vector index and cross-domain knowledge graph. The semantic vector index encodes knowledge fragments based on the Sentence-BERT model, and constructs approximate nearest neighbor retrieval through the HNSW algorithm.
[0066] Construct an inverted index for the processed knowledge units, and use the Analyzer tool to perform word frequency statistics, position records, and quick retrieval indexing on keywords and named entities.
[0067] Based on the Sentence-BERT model, each knowledge fragment is encoded into a fixed-dimensional vector, and the HNSW approximate nearest neighbor algorithm is used to construct a vector index, supporting efficient retrieval based on semantic similarity.
[0068] Extract entities and relationships to construct heterogeneous graphs, use relational databases for storage, support graph structure queries, and make up for the lack of logical reasoning in text indexes.
[0069] S2. Based on the constructed dynamic knowledge index system, analyze user input intentions and determine knowledge retrieval needs;
[0070] In this embodiment, this step mainly involves identifying the user's input prompt's intention, understanding the context, and determining knowledge dependencies. The core mechanism is a fusion of multimodal semantic understanding and a trigger scoring model. By analyzing the user input's position, expression, and information density in the context, it determines whether to call the knowledge base for search enhancement. Specifically, it includes the following steps:
[0071] S21. Normalize user input and build a contextual embedding representation based on the conversation history.
[0072] User input is standardized, including word segmentation, removal of blank lines, scripts, repeated paragraphs, and stop word filtering, to construct a structured input vector. The conversation history cache is used to perform window modeling on the most recent conversation rounds, combining positional encoding to form a contextual embedding representation.
[0073] S22. Determine whether it is an information request statement through the intent classifier and calculate the knowledge requirement score;
[0074] Based on the fine-tuned RoBERTa model, the current input sentence is classified into intent, and the output is whether it is an "information request" sentence. The number of question words, proper nouns, and knowledge entities in the input sentence is counted to construct a knowledge demand score. The score is used Calculation, where QW_score: question word density score, NNP_score: proper noun density score, NE_score: knowledge entity matching score. is a weight parameter that reflects the contribution of each indicator to knowledge dependence. The default value is .
[0075] S23. Dynamically trigger the knowledge retrieval process based on the knowledge demand score and user behavior rules.
[0076] Combined with user behavior (such as whether the question is repeated, whether the question is asked in reverse, whether the expression is vague) and the score, it is determined whether the knowledge retrieval process needs to be triggered and a Boolean value and confidence level are returned for use by the subsequent dual-channel decision module.
[0077] S3: Based on the results obtained in S2, a multi-feature fusion decision model is constructed to perform intelligent routing between the retrieval channel and the generation channel;
[0078] In this embodiment, this step introduces a "collaborative decision-making model" to perform intelligent routing between the retrieval channel and the generation channel. A context-aware path discrimination builds a multi-feature fusion decision model by analyzing the current input, historical context, and previous rounds of system behavior to achieve dynamic, explainable, and personalized channel selection. The specific process is as follows:
[0079] S31, extracting word vector features, question structure features, and historical behavior features input by the user;
[0080] Extract word vector features, question structure, and sentence length from user input, and reference the knowledge demand score and intention discrimination results in S2. Reference the system behavior of the last three rounds in the state diagram to extract features such as whether knowledge retrieval was used in the past, retrieval effect score, and user satisfaction.
[0081] S32. Calculate the probabilities of the retrieval path and the generation path through a lightweight neural network decision model. If the retrieval probability is higher than a threshold, trigger knowledge retrieval.
[0082] A lightweight two-branch neural network (e.g., a dual-tower structure) is used: one branch processes the input features of the generation path, and the other processes the features of the retrieval path. Finally, a softmax fusion is used to determine the probability value. If the retrieval path probability exceeds a threshold (dynamically settable, such as 0.6), the system calls the knowledge base module for subsequent knowledge retrieval; otherwise, it directly enters the generation path.
[0083] S33. Write the decision result into the dialogue state diagram for subsequent retrieval strategy optimization.
[0084] Regardless of which path is chosen, the decision basis and results of the current round are recorded in the dialogue state diagram. This step ensures smooth switching between search and generation paths, is highly context-aware, and avoids useless searches or knowledge gaps.
[0085] S4: Based on the decision model obtained in S3, a multimodal fusion knowledge hybrid retrieval mechanism is constructed to output candidate knowledge fragments;
[0086] This step aims to build a hybrid knowledge retrieval mechanism that supports the collaborative work of keyword retrieval and semantic vector retrieval, and introduces multimodal fusion technology to enable the system to have stronger adaptability and recall capabilities when processing multiple types of knowledge units such as text, images, and tables. This mechanism adopts a three-level retrieval strategy of "keyword filtering + semantic matching + multimodal expansion" to significantly improve coverage while ensuring accuracy. The specific process is as follows:
[0087] S41. parse the user query text to extract keywords, intent vectors, and multimodal demand tags;
[0088] User input is parsed to extract keyword entities, related terms, and hyponyms, and construct a preliminary query vector. If the input involves multimodal elements (e.g., mentioning keywords like "diagram" or "table"), it is marked as a multimodal request.
[0089] S42, obtaining candidate knowledge fragments through a keyword retrieval module, a semantic vector retrieval module, and a multimodal completion module;
[0090] Keyword retrieval module: Use the ElasticSearch inverted index structure to perform Boolean logic matching retrieval on keywords, obtain the first batch of candidate knowledge fragments, and sort them by TF-IDF score.
[0091] Semantic Vector Retrieval Module: Calls the Chinese version of Sentence-BERT to encode user input into a vector, uses the Milvus engine to perform vector approximate nearest neighbor search (ANN) in the semantic index of the knowledge base, and returns semantically relevant candidates.
[0092] Multimodal completion module: If the input involves non-text content such as images and charts, the retrieval engine CLIP of the corresponding modality is called for cross-modal matching, and the results are uniformly converted into knowledge fragments.
[0093] S43. Perform several rounds of fusion sorting on the search results, use the LambdaMART model to optimize the final sorting, and eliminate redundant content through semantic similarity detection to obtain candidate knowledge fragments.
[0094] The three categories of results are combined and the scores (keyword search score, semantic similarity, and multimodal relevance) are integrated through a weighted ranking mechanism. Ranking is performed using the LambdaMART learning-to-rank model, and duplicate knowledge units are removed. The coverage and confidence of the results are statistically analyzed to provide raw data for the credibility assessment in the fifth step. Detection is primarily based on semantic similarity. Sentence-BERT, a semantic analysis technology, is used to embed and vectorize the fragments, converting the text into a fixed-dimensional vector representation. Semantic redundancy is then determined by calculating a similarity between vectors greater than 0.8. This allows for the identification of situations where sentences differ in wording but share the same meaning. Calculation steps: Each knowledge unit undergoes text preprocessing (such as word segmentation and stop word removal). The Sentence-BERT model is then used to generate an embedding vector for each unit. Finally, the similarity between knowledge units is measured using Cosine similarity or Euclidean distance. If the similarity exceeds a preset threshold, the units are marked as duplicates.
[0095] S5. The candidate knowledge fragments obtained in S4 are combined with the user's current input and context history to form input pairs. Through semantic relevance calculation, context alignment analysis, and knowledge source credibility score multi-dimensional indicators, an automatic evaluation system integrating semantic and structural information is constructed. The accuracy and reliability of the retrieved knowledge are evaluated based on the source confidence weight of the knowledge fragments.
[0096] In this embodiment, this step introduces multi-dimensional indicators such as semantic relevance calculation, contextual alignment analysis, and knowledge source credibility rating to build an automatic evaluation system that integrates semantic and structural information. The core algorithm is a context-based bidirectional attention scoring model, which combines the source confidence weight of the knowledge element to achieve a comprehensive evaluation of the accuracy and reliability of the retrieved knowledge. Specifically, it includes:
[0097] S51, organize all candidate knowledge fragments returned in step 4 and the user's current input and context history into input pairs, and construct<query, document> Structure pair collection;
[0098] S52. For each<query, document> Sentence pair matching is scored using the pre-trained BERT-based model to obtain semantic similarity;
[0099] S53. Concatenate the semantic similarity, context adaptation semantics, and knowledge source credibility score into a vector and input it into the fully connected network FFN for confidence score prediction. Output the credibility score and set the confidence threshold. Filter out knowledge units that do not meet the standards and sort the remaining content in descending order of confidence.
[0100] S6. Encode the content of the knowledge fragment after accuracy and reliability evaluation into a context vector, use dual-channel information fusion to control the information weight distribution between the knowledge fragment and the internal language modeling of the large prediction model, monitor user satisfaction and conversation status changes in real time, and update the conversation status map.
[0101] In this embodiment, this step aims to achieve high-quality fusion between the output of the large language model and the knowledge retrieval results, ensuring that the generated text possesses both natural linguistic fluency and factual accuracy and reliability. Retrieval-Augmented Generation (RAG) technology is used to improve the structure, design a dual-channel information fusion, and control the information weight distribution between knowledge fragments and the LLM intrinsic language modeling. The specific steps are:
[0102] Knowledge fragment encoding: Encode the knowledge content after credibility assessment into context vectors and add them to the encoder in segments (such as the Retriever encoder in RAG).
[0103] User input fusion: The user's current input is concatenated with the conversation history as the input token sequence, which is interactively fused with the knowledge support vector.
[0104] Fusion mechanism: By controlling the attention fusion weight of the knowledge vector and the autoregressive language generation token, the generation is guided to rely more on high-confidence knowledge points.
[0105] Enhanced annotation: Add a knowledge reference annotation mechanism to clearly reference the corresponding knowledge number in the output content, and enhance the knowledge fragment position embedding in the underlying Transformer.
[0106] Output filtering and post-processing: A knowledge alignment check is performed on the generated response. If the key conclusion is not reflected in the knowledge, the generator is warned to reduce the confidence of the relevant content or regenerate it to improve the accuracy of the response. This mechanism breaks through the drawbacks of traditional LLM "hallucination generation" and realizes natural language generation output under knowledge guidance, effectively integrating external fact support and model language advantages.
[0107] Specific embodiments are used in the present invention to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
[0108] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the present invention.
Claims
1. A method for dynamic knowledge retrieval enhancement based on a large language model, characterized in that: The steps include: S1. Constructing a dynamic knowledge index system, specifically including the following steps: S11. Use data access and analysis to convert multi-source heterogeneous data into a unified intermediate format; S12. Perform knowledge extraction on the converted data, including entity extraction, relationship identification, and semantic annotation, and map it to a unified knowledge structure; S13. Build keyword indexes, semantic vector indexes, and cross-domain knowledge graphs. The semantic vector index encodes knowledge fragments based on the Sentence-BERT model, and constructs approximate nearest neighbor retrieval using the HNSW algorithm. S2. Based on the constructed dynamic knowledge index system, analyze user input intentions and determine knowledge retrieval needs; S3: Based on the results obtained in S2, a multi-feature fusion decision model is constructed to perform intelligent routing between the retrieval channel and the generation channel. Specifically, a two-branch lightweight neural network is used, one for processing the input features of the generation path and the other for processing the features of the retrieval path. The probability value is finally determined through softmax fusion. If the retrieval channel probability is higher than the threshold, the system calls the knowledge base module for subsequent knowledge retrieval; otherwise, it directly enters the generation channel. The specific method is as follows: S31, extracting word vector features, question structure features, and historical behavior features input by the user; S32. Calculate the probabilities of the retrieval path and the generation path through a lightweight neural network decision model. If the retrieval probability is higher than a threshold, trigger knowledge retrieval. S33. Write the decision result into the dialogue state graph for subsequent retrieval strategy optimization; S4: Based on the decision model obtained in S3, a multimodal fusion knowledge hybrid retrieval mechanism is constructed to output candidate knowledge fragments; S5. The candidate knowledge fragments obtained in S4 are combined with the user's current input and context history to form input pairs. Through semantic relevance calculation, context alignment analysis, and knowledge source credibility score multi-dimensional indicators, an automatic evaluation system integrating semantic and structural information is constructed. The accuracy and reliability of the retrieved knowledge are evaluated based on the source confidence weight of the knowledge fragments. S6. Encode the content of the knowledge fragment after accuracy and reliability evaluation into a context vector, use dual-channel information fusion to control the information weight distribution between the knowledge fragment and the internal language modeling of the large prediction model, monitor user satisfaction and conversation status changes in real time, and update the conversation status map.
2. The method for dynamic knowledge retrieval enhancement based on a large language model according to claim 1, characterized in that: The S2 specifically includes the following steps: S21. Normalize user input and build a contextual embedding representation based on the conversation history. S22. Determine whether it is an information request statement through the intent classifier and calculate the knowledge requirement score; S23. Dynamically trigger the knowledge retrieval process based on the knowledge demand score and user behavior rules.
3. The method for dynamic knowledge retrieval enhancement based on a large language model according to claim 2, characterized in that: The specific method of calculating the knowledge requirement score in S22 is: in, Score the knowledge need, is the question word density score, is the proper noun density score, Score the knowledge entity matching, are the weight parameters corresponding to the scores.
4. The method for dynamic knowledge retrieval enhancement based on a large language model according to claim 1, characterized in that: The S3 specifically includes the following steps: S31, extracting word vector features, question structure features, and historical behavior features input by the user; S32. Calculate the probabilities of the retrieval path and the generation path through a lightweight neural network decision model. If the retrieval probability is higher than a threshold, trigger knowledge retrieval. S33. Write the decision result into the dialogue state diagram for subsequent retrieval strategy optimization.
5. The method for dynamic knowledge retrieval enhancement based on a large language model according to claim 1, characterized in that: The S4 specifically includes the following steps: S41. parse the user query text to extract keywords, intent vectors, and multimodal demand tags; S42, obtaining candidate knowledge fragments through a keyword retrieval module, a semantic vector retrieval module, and a multimodal completion module; S43. Perform several rounds of fusion sorting on the search results, use the LambdaMART model to optimize the final sorting, and eliminate redundant content through semantic similarity detection to obtain candidate knowledge fragments.
6. The method for dynamic knowledge retrieval enhancement based on a large language model according to claim 5, characterized in that: The specific method of eliminating redundant content in step S43 is: S431. Remove duplicate knowledge units, calculate the coverage and confidence of the results, and convert the text into a vector representation of fixed dimension; S432, performing word segmentation and stop word removal on the remaining key texts of the knowledge units, and generating an embedding vector for each knowledge unit; S433. Calculate the similarity between the embedding vectors of each knowledge unit. When the similarity exceeds a set threshold, determine that the semantics is redundant and remove it to obtain a candidate knowledge fragment.
7. The method for dynamic knowledge retrieval enhancement based on a large language model according to claim 1, characterized in that: The S5 specifically includes the following steps: S51, organize all candidate knowledge fragments returned in step 4 and the user's current input and context history into input pairs, and construct<query, document > Structure pair collection; S52. For each<query, document> Sentence pair matching is scored using the pre-trained BERT-based model to obtain semantic similarity; S53. Concatenate the semantic similarity, context adaptation semantics, and knowledge source credibility score into a vector and input it into the fully connected network FFN for confidence score prediction. Output the credibility score and set the confidence threshold. Filter out knowledge units that do not meet the standards and sort the remaining content in descending order of confidence.
Citation Information
Patent Citations
Large model knowledge base retrieval method based on multi-granularity retrieval
CN119646201A
Large language model knowledge base question answering system based on multi-path fusion recall retrieval algorithm
CN120144773A