Large model cue word optimization-oriented network retrieval enhancement generation method and system
By combining jieba word segmentation, Bing search, Baidu Embedding-V1 model, and Rerank scoring function, the keyword extraction, text retrieval, and ranking of the large model were optimized. This solved the problem of answer accuracy and relevance in LLM when external knowledge is insufficient, and achieved more efficient information acquisition and improved answer quality.
Patent Information
- Application Number
- CN202511505174.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-02-06
AI Technical Summary
Existing large-scale language models (LLMs) struggle to effectively extract keywords, retrieve efficient documents, and rank contexts when lacking external knowledge updates, resulting in insufficient accuracy and relevance in responses.
This paper employs the jieba word segmenter to extract keywords, combines this with the Bing search engine to retrieve documents, uses the Baidu Embedding-V1 model to vectorize text blocks, and optimizes these text blocks using cosine similarity and the Rerank scoring function. The final prompt words are generated using the jieba word segmenter, and the text blocks are sorted and selected using cosine similarity and the Rerank scoring function.
It significantly improves the accuracy and relevance of LLM responses, enhances the timeliness and domain coverage of information, reduces the interference of irrelevant information, and significantly improves the content and fluency of the generated text responses.
Smart Images

Figure CN121480702A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing. Specifically, this invention relates to a network retrieval enhancement generation method and system for optimizing prompt words for large models. Background Technology
[0002] Existing large-scale models often rely solely on the distributed representations implicit in their internal parameters when lacking external knowledge or information updates. Traditional LLMs (Large-Scale Language Models) often fall short when users submit queries that include domain-specific knowledge, timeliness requirements, or exceed the coverage of their training corpus.
[0003] While existing traditional RAG frameworks have alleviated the "forgetting" problem and knowledge blind spots in LLM to some extent, the following technical issues still need to be addressed:
[0004] 1. Insufficient efficiency in keyword extraction and retrieval:
[0005] User input commands are often described in natural language, and extracting keywords from them to efficiently retrieve relevant external information is one of the key steps in NRAG. Existing methods, when segmenting and extracting keywords from Chinese text, often fail to extract the keywords that best represent the query intent from user commands simply and effectively, leading to a decrease in retrieval efficiency and accuracy.
[0006] 2. The search results do not match LLM well:
[0007] The retrieved documents are numerous and need to be segmented, quantized, and stored in a vector database. However, due to the high-dimensional semantic representation and diverse textual information, ensuring that the retrieved text blocks are most relevant to the user's query and minimizing irrelevant contextual information is crucial to the quality of the final answer.
[0008] 3. The challenges of contextual ordering and selection:
[0009] Relevant text blocks retrieved from vector databases typically require further filtering and reordering. Using only a simple similarity metric function may fail to adequately consider user intent, contextual coherence, and information density, thus affecting the quality of the final prompts and consequently the accuracy of the LLM-generated answers.
[0010] In response, some studies have proposed Rerank algorithms based on similarity, information entropy, or multimodal features; other literature has proposed integrating scoring functions from pre-trained models to reorder text blocks, improving the effectiveness of retrieving enhanced information. However, integrating and optimizing this series of steps into an efficient and collaborative system remains a current research hotspot and challenge.
[0011] Therefore, this invention proposes a network retrieval enhancement generation method and system for optimizing prompt words for large models. Summary of the Invention
[0012] This invention aims to overcome the shortcomings of existing technologies and proposes a network retrieval enhancement generation method and system for large model prompt word optimization, in order to achieve the following objectives: improve the accuracy, relevance and practicality of LLM responses in diverse scenarios.
[0013] To achieve the above objectives, the technical solution adopted by this invention is: a network retrieval enhancement generation method for large-scale model prompt word optimization, the method comprising the following steps:
[0014] Step S1: Obtain the user's input command;
[0015] Step S2: Use a word segmentation tool to segment the instruction to obtain a word sequence and extract keywords from it;
[0016] Step S3: Based on the core keywords, conduct a web search using an external search engine to obtain a collection of search documents;
[0017] Step S4: Perform text segmentation on the retrieved document set to obtain multiple text blocks;
[0018] Step S5: Vectorize the text block and store it in the vector database;
[0019] Step S6: Retrieve text blocks related to the user's instruction from the vector database to obtain a set of related text blocks;
[0020] Step S7: Reorder the relevant text block set and select text blocks as enhanced context based on the sorting results;
[0021] Step S8: Integrate the enhanced context with the user command to generate the final prompt word;
[0022] Step S9: Input the final prompt word into the large model and obtain the response result output by the large model.
[0023] Preferably, in step S2, the jieba word segmenter is used to perform Chinese word segmentation on the user input command to obtain a word sequence, and keywords are extracted based on the word sequence.
[0024] Preferably, the keyword extraction strategy includes selecting the word sequence with the highest TF-IDF value as the keyword, expressed by the following formula:
[0025] ;
[0026] ;
[0027] in, Represents word sequence { , , ... , The words in}; This indicates user input commands; Indicator Word frequency in Q; This represents the total number of documents in the corpus; Indicates the inclusion word The number of documents; Indicator of Value; K represents the selected keyword.
[0028] Preferably, in step S3, the external search engine includes the Bing search engine.
[0029] Preferably, step S5 includes: mapping each text block to a d-dimensional vector space using a pre-trained text embedding model, wherein the pre-trained text embedding model includes the Baidu Embedding-V1 model, and the specific method is as follows:
[0030] ;
[0031] in, This represents a vectorized text block. Represents a text block; This represents a pre-trained text embedding model.
[0032] Preferably, step S6 includes:
[0033] Vectorize the user input commands, that is:
[0034] ;
[0035] Where Q represents the user input command, This represents a pre-trained text embedding model, including the Baidu Embedding-V1 model; q represents the vectorized user input command.
[0036] In the vector database, q is calculated based on a predefined similarity metric function. Similarity score between , Representing vectorized text blocks, the similarity measurement function includes the cosine similarity function, i.e.:
[0037] ;
[0038] For the set of text block vectors v={v1,v2,...,v... n Sort all text block vectors in the array by similarity, and select the top r text blocks with the highest similarity ranking to form a candidate set. As a set of related text blocks, i.e.;
[0039]
[0040] in, .
[0041] Preferably, step S7 includes: introducing a Rerank scoring function to the candidate set. text blocks in To conduct an assessment, namely:
[0042] ;
[0043] in, Represents the Rerank scoring function; Indicate q and Similarity score between them; Represents a text block Pre-defined additional evaluation metrics include information density, matching degree, keyword coverage in specific fields, and contextual complementarity; and This is a weighting parameter used to balance similarity with additional evaluation metrics;
[0044] From the candidate set Select k text blocks with the highest Rerank scores as enhanced context, i.e.:
[0045] ;
[0046] in, .
[0047] Preferably, step S8 includes:
[0048] set All text blocks in the code are combined with the user input command Q to obtain the final prompt word, namely:
[0049] ;
[0050] in, Indicates the final prompt word.
[0051] Preferably, in step S9, the large model is a large-scale language model (LLM).
[0052] This application also provides a network retrieval enhancement generation system for large-model prompt word optimization, using the aforementioned network retrieval enhancement generation method for large-model prompt word optimization, the system comprising:
[0053] The instruction acquisition module is used to receive instructions input by the user.
[0054] The word segmentation and extraction module is used to segment instructions into words and extract core keywords;
[0055] The network search module is used to retrieve a collection of documents using an external search engine based on the keywords.
[0056] The text segmentation module is used to perform text segmentation processing on the retrieved document set to obtain multiple text blocks;
[0057] A vectorization and storage module is used to vectorize the text block and store it in a vector database;
[0058] The similarity retrieval module is used to retrieve relevant text blocks from the vector database according to user instructions;
[0059] The reordering module is used to reorder related text blocks and select the optimal text block.
[0060] The prompt word generation module is used to integrate the optimal text block with user commands to generate the final prompt word;
[0061] The response generation module is used to input the final prompt words into the large model and obtain the response results.
[0062] The technical effects of this invention are as follows:
[0063] (1) This invention introduces the jieba word segmenter to efficiently extract keywords from user commands. By selecting the most representative keyword K from the user input command Q, targeted external retrieval is achieved. When the external search space corresponding to keyword K is more concentrated, the probability of irrelevant documents entering the processing flow can be reduced, and the external retrieval can return a set of documents with higher relevance in a shorter time, thereby improving the overall efficiency and accuracy of subsequent text vectorization and similarity retrieval.
[0064] (2) This invention utilizes real-time search results provided by external search engines to obtain the latest information periodically or immediately, which enables the knowledge injected into the LLM to maintain a dynamic update attribute. Even if the parameters of the LLM are fixed at a specific point in time, this invention can still effectively answer timeliness and domain-specific questions through document blocks obtained from subsequent searches.
[0065] (3) This invention, by vectorizing document blocks and performing cosine similarity retrieval in a vector database, can quickly select the contextual information most closely related to the user's query from a large-scale set of text blocks. Then, by introducing the Rerank scoring function to re-rank similar text blocks, the optimal set of text blocks is selected. This achieves more accurate context enhancement. This multi-level filtering mechanism can significantly reduce the interference of irrelevant information on LLM responses, ensuring the contextual relevance of the response.
[0066] (4) This invention adopts a flexible final prompt word construction method, directly embedding the optimized context into the LLM input. The LLM then performs reasoning and answers based on this. With contextual auxiliary information, the LLM can effectively avoid random fabrication caused by knowledge blind spots, and the generated text answers are significantly improved in terms of content, facts, and language fluency. Attached Figure Description
[0067] Figure 1 The flowchart illustrates a network retrieval enhancement generation method for optimizing prompt words in large models, as provided in this embodiment of the invention. Detailed Implementation
[0068] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. The purpose is to help those skilled in the art to have a more complete, accurate, and in-depth understanding of the inventive concept and technical solutions of the present invention, and to facilitate its implementation. It should be noted that the terms "first," "second," etc., used in this application are only for the convenience of describing the technical solutions and to distinguish components; the corresponding component configurations may be the same or different, and are not intended to limit the scope of this application.
[0069] This invention provides a network retrieval enhancement generation method for optimizing prompt words in large models, such as... Figure 1 As shown, the method includes the following steps:
[0070] Step S1: Obtain the user's input command;
[0071] Step S2: Use a word segmentation tool to segment the instruction to obtain a word sequence and extract keywords from it;
[0072] Step S3: Based on the core keywords, conduct a web search using an external search engine to obtain a collection of search documents;
[0073] Step S4: Perform text segmentation on the retrieved document set to obtain multiple text blocks;
[0074] Step S5: Vectorize the text block and store it in the vector database;
[0075] Step S6: Retrieve text blocks related to the user's instruction from the vector database to obtain a set of related text blocks;
[0076] Step S7: Reorder the relevant text block set and select text blocks as enhanced context based on the sorting results;
[0077] Step S8: Integrate the enhanced context with the user command to generate the final prompt word;
[0078] Step S9: Input the final prompt word into the large model and obtain the response result output by the large model; the large model is a large-scale language model (LLM).
[0079] This invention aims to significantly improve the accuracy, relevance, and practical value of LLM by extracting keywords from user-input commands, performing network-based information retrieval, text segmentation and embedding, vector database retrieval, text block reordering, and context filtering.
[0080] Specifically, the user input command is denoted as Q, which is natural language text, such as a Chinese sentence. Then, in step S2 of this invention, the jieba word segmenter is used to perform Chinese word segmentation on the user input command to obtain a word sequence. Let the word sequence be { , , ... , The process involves extracting keywords based on the word sequence. This step aims to focus on the information the user truly wants to obtain, laying the foundation for subsequent external retrieval and overcoming the semantic redundancy and ambiguity in natural language expressions of user input commands.
[0081] The keyword extraction strategy of this invention includes selecting the word sequence with the highest TF-IDF value as the keyword, as expressed by the following formula:
[0082] ;
[0083] ;
[0084] in, Represents word sequence { , , ... , The words in}; This indicates user input commands; Indicator Word frequency in Q; This represents the total number of documents in the corpus; Indicates the inclusion word The number of documents; Indicator of Value; K represents the selected keyword.
[0085] Referring to step S3, keyword K is used as the query input to an external search engine to obtain the retrieved document set D={D1,D2,...,D...} m Available external search engines include Bing, which can be flexibly selected according to needs during implementation. Each document in the document collection may contain several paragraphs or web page text. This invention dynamically retrieves the latest information related to the user's query in real time, which helps to compensate for the lack of updated information after the LLM training deadline.
[0086] Referring to step S4, the obtained document set D is segmented into text based on strategies such as text length thresholds or semantic content partitioning to ensure that each text block is of appropriate length and relatively complete semantically. Let the set of text blocks obtained after text segmentation be C = {C1,C2,...,C...} n}
[0087] Referring to step S5, each text block in C is mapped to a d-dimensional vector space using a pre-trained text embedding model. The pre-trained text embedding model includes the Baidu Embedding-V1 model, and the specific method is as follows:
[0088] ;
[0089] in, This represents a vectorized text block. Represents a text block; This represents a pre-trained text embedding model. Finally, all models are summarized. We obtain the text block vector set v = {v1, v2, ..., v} n The similarity data is stored in a vector database, laying the foundation for subsequent similarity retrieval and re-ranking.
[0090] When a user query requires a final answer, see step S6, which includes:
[0091] The user input command is vectorized to obtain the query vector q, i.e.:
[0092] ;
[0093] Where Q represents the user input command, This represents a pre-trained text embedding model, including the Baidu Embedding-V1 model; q represents the vectorized user input command, i.e., the query vector q.
[0094] In the vector database, q is calculated based on a predefined similarity metric function. Similarity score between , Representing vectorized text blocks, the similarity measurement function includes the cosine similarity function, i.e.:
[0095] ;
[0096] Then, for the text block vector set v={v1,v2,...,v... n Sort all text block vectors in the array by similarity, and select the top r text blocks with the highest similarity ranking to form a candidate set. As the set of relevant text blocks, we obtain the set of text block vectors most relevant to q, i.e.:
[0097]
[0098] in, .
[0099] To ensure that the selected text blocks are more relevant to user instructions, as described in step S7, this invention introduces a Rerank scoring function for the candidate set. text blocks in To conduct an assessment, namely:
[0100] ;
[0101] in, Represents the Rerank scoring function; Indicate q and Similarity score between them; Represents a text block Pre-defined additional evaluation metrics include information density, matching degree, keyword coverage in specific fields, and contextual complementarity; and This is a weighting parameter used to balance similarity with additional evaluation metrics;
[0102] Then, from the candidate set Select k text blocks with the highest Rerank scores. As an enhanced context, it provides directly usable external information support for LLM, namely:
[0103] ;
[0104] in, .
[0105] Next, refer to step S8 to set All text blocks in the code are combined with the user input command Q to obtain the final prompt word, namely:
[0106] ;
[0107] in, This indicates the final suggestion, which contains external contextual information that is highly relevant to the user's query.
[0108] Finally, referring to step S9, the Final Prompt is input into the Large Language Model (LLM) for inference. The model generates a more accurate, relevant, and timely answer based on rich contextual information.
[0109] Meanwhile, this invention also provides a network retrieval enhancement generation system optimized for large model prompt words. Using the aforementioned network retrieval enhancement generation method optimized for large model prompt words, the system includes:
[0110] The instruction acquisition module is used to receive instructions input by the user.
[0111] The word segmentation and extraction module is used to segment instructions into words and extract core keywords;
[0112] The network search module is used to retrieve a collection of documents using an external search engine based on the keywords.
[0113] The text segmentation module is used to perform text segmentation processing on the retrieved document set to obtain multiple text blocks;
[0114] A vectorization and storage module is used to vectorize the text block and store it in a vector database;
[0115] The similarity retrieval module is used to retrieve relevant text blocks from the vector database according to user instructions;
[0116] The reordering module is used to reorder related text blocks and select the optimal text block.
[0117] The prompt word generation module is used to integrate the optimal text block with user commands to generate the final prompt word;
[0118] The response generation module is used to input the final prompt words into the large model and obtain the response results.
[0119] This invention addresses the problem of low response quality in existing technologies when LLM lacks real-time, dynamic external knowledge injection by deeply integrating Large Language Model (LLM) with Network-based Retrieval-Augmented Generation (NRAG). Compared to traditional LLM invocation methods, this invention optimizes multiple aspects such as keyword extraction, network information retrieval, vector retrieval, context enhancement, and prompt word generation, thereby significantly improving the accuracy, context relevance, and information update rate of the model's responses. This results in the following advantages and positive effects in diverse practical application scenarios.
[0120] Through the above technical solution, this invention can flexibly and dynamically supplement the input of a large model with external contextual information without modifying the parameters of the large model, thereby effectively improving the understanding and response capabilities of the large model in multi-scenario tasks. The solution described in this invention has strong scalability, and the word segmentation tool, embedding model, search engine, or Rerank algorithm can be replaced according to the application scenario to meet the needs of different fields and application environments.
[0121] By comparing performance metrics under the same computing resources and response time, this invention can improve the proportion of accurate information in the answer without significantly increasing inference time. When using the optimized process of this invention, the amount of key correct information in the answer can be increased by ∆I ≈ 19.85%, which has a real benefit to end-user experience and business decision support.
[0122] Example 1:
[0123] The user submitted the command: "Q = Please explain the basic principles of quantum entanglement".
[0124] First, Q is segmented using the jieba word segmentation tool to obtain a word sequence:
[0125] {w1="Please", w2="Introduction", w3="A little bit", w4="Quantum", w5="Entanglement", w6="Of", w7="Basic", w8="Principle"}.
[0126] Within this sequence, the most representative keywords for the query are selected based on the TF-IDF strategy:
[0127] "K = Quantum entanglement".
[0128] Enter keyword K into the Bing search engine to retrieve relevant document set D:
[0129] D = {D1,D2,D3,...}.
[0130] Assume the retrieved documents contain Wikipedia entries, quantum mechanics blog posts, and snippets from science knowledge bases.
[0131] Perform text segmentation on each document in D. The length of each text block can be controlled according to the number of characters or sentences, for example, each text block is about 200 to 300 characters, so that the set of text blocks obtained after text segmentation is C = {C1, C2, ..., C...} n Each text block in the} is a relatively complete text block in terms of semantics, such as paragraphs that introduce the definition, history, mathematical description, or experimental verification of quantum entanglement.
[0132] The vector representation of each text block is calculated using the Baidu Embedding-V1 model: and all Store in a vector database.
[0133] When the user needs to generate an answer, the user command Q is also vectorized: .
[0134] Based on the cosine similarity function in the vector database:
[0135] ;
[0136] For all Calculate the similarity and select the top r text blocks by similarity as the candidate set:
[0137]
[0138] in, These candidate text blocks may include the definition of quantum entanglement, the principle of superposition of states, Bell's inequality, and experimental verification methods.
[0139] Introducing the Rerank scoring function for the candidate set text blocks in An evaluation is conducted to assess whether the text blocks directly relate to "fundamental principles." Higher scores are given to purely descriptive passages, explanations of mathematical formulas, and paragraphs verifying classic experiments.
[0140] ;
[0141] Then, from the candidate set Select the three text blocks with the highest Rerank scores. As an enhanced context, it provides directly usable external information support for LLM, namely:
[0142] ;
[0143] Assume these three text blocks are as follows:
[0144] Explain the definition of quantum entangled states and the mathematical description of the superposition of states;
[0145] This section provides an overview of the basic principles of quantum state collapse and Bellki studies.
[0146] : Describes the fundamental theory of quantum entanglement in quantum information processing.
[0147] The three selected text blocks are combined with the user's original command Q to generate the final prompt word:
[0148] ;
[0149] The final prompt word structure obtained in this way is shown below:
[0150] User instruction: Please explain the basic principles of quantum entanglement.
[0151] Contextual information:
[0152] [Document Block 1]: Quantum entanglement refers to two or more quantum systems being in the same superposition state, and its mathematical description is...
[0153] [Document Block 2]: In the fundamental principles of quantum mechanics, entangled states cause the system's state to collapse through measurement, and the correlation exceeds the description of classical locality...
[0154] [Document Block 3]: Experimentally, the nonlocality of entangled states was verified by violating Bell's inequality...
[0155] Based on the information above, please explain the basic principles of quantum entanglement to me.
[0156] Finally, the above final prompts are input into an LLM (such as Deepseek, GPT-4o, Grok, LLaMA series, or other large-scale language models). The LLM will take into account the above context and answer the user's question with higher accuracy, such as clearly explaining the mathematical definition of quantum entanglement, the superposition characteristics of states, and nonlocality, ensuring that the content is accurate and reliable.
[0157] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution; or the direct application of the inventive concept and technical solution to other situations without modification, are all within the protection scope of the present invention.
Claims
1. A network retrieval enhancement generation method for optimizing prompt words in large models, characterized by: The method includes the following steps: Step S1: Obtain the user's input command; Step S2: Use a word segmentation tool to segment the instruction to obtain a word sequence and extract keywords from it; Step S3: Based on the core keywords, conduct a web search using an external search engine to obtain a collection of search documents; Step S4: Perform text segmentation on the retrieved document set to obtain multiple text blocks; Step S5: Vectorize the text block and store it in the vector database; Step S6: Retrieve text blocks related to the user's instruction from the vector database to obtain a set of related text blocks; Step S7: Reorder the relevant text block set and select text blocks as enhanced context based on the sorting results; Step S8: Integrate the enhanced context with the user command to generate the final prompt word; Step S9: Input the final prompt word into the large model and obtain the response result output by the large model.
2. The network retrieval enhancement generation method for large model prompt word optimization according to claim 1, characterized in that: In step S2, the jieba word segmenter is used to process the user input command into Chinese words to obtain a word sequence, and keywords are extracted based on the word sequence.
3. A network retrieval enhancement generation method for large-scale model prompt word optimization as described in claim 1 or 2, characterized in that: Keyword extraction strategies include selecting the word sequence with the highest TF-IDF value as the keyword, expressed by the following formula: ; ; in, Represents word sequence { , , ... , The words in}; This indicates user input commands; Indicator Word frequency in Q; This represents the total number of documents in the corpus; Indicates the inclusion word The number of documents; Indicator of Value; K represents the selected keyword.
4. The network retrieval enhancement generation method for large model prompt word optimization according to claim 1, characterized in that: In step S3, the external search engine includes the Bing search engine.
5. The network retrieval enhancement generation method for large model prompt word optimization according to claim 1, characterized in that: Step S5 includes: mapping each text block to a d-dimensional vector space using a pre-trained text embedding model, wherein the pre-trained text embedding model includes the Baidu Embedding-V1 model, and the specific method is as follows: ; in, This represents a vectorized text block. Represents a text block; This represents a pre-trained text embedding model.
6. The network retrieval enhancement generation method for large model prompt word optimization according to claim 5, characterized in that: Step S6 includes: Vectorize the user input commands, that is: ; Where Q represents the user input command, This represents a pre-trained text embedding model, including the Baidu Embedding-V1 model; q represents the vectorized user input command. In the vector database, q is calculated based on a predefined similarity metric function. Similarity score between , Representing vectorized text blocks, the similarity measurement function includes the cosine similarity function, i.e.: ; For the set of text block vectors v={v1,v2,...,v... n Sort all text block vectors in the array by similarity, and select the top r text blocks with the highest similarity ranking to form a candidate set. As a set of related text blocks, i.e.; in, .
7. The network retrieval enhancement generation method for large model prompt word optimization according to claim 6, characterized in that: Step S7 includes: introducing a Rerank scoring function to evaluate the candidate set. text blocks in To conduct an assessment, namely: ; in, Represents the Rerank scoring function; Indicate q and Similarity score between them; Represents a text block Pre-defined additional evaluation metrics include information density, matching degree, keyword coverage in specific fields, and contextual complementarity; and This is a weighting parameter used to balance similarity with additional evaluation metrics; From the candidate set Select k text blocks with the highest Rerank scores as enhanced context, i.e.: ; in, .
8. The network retrieval enhancement generation method for large model prompt word optimization according to claim 7, characterized in that: Step S8 includes: set All text blocks in the code are combined with the user input command Q to obtain the final prompt word, namely: ; in, Indicates the final prompt word.
9. The network retrieval enhancement generation method for large model prompt word optimization according to claim 1, characterized in that: In step S9, the large model is a large-scale language model (LLM).
10. A network retrieval enhancement generation system for large-scale model prompt keyword optimization, using a network retrieval enhancement generation method for large-scale model prompt keyword optimization according to any one of claims 1-9, characterized in that: The system includes: The instruction acquisition module is used to receive instructions input by the user. The word segmentation and extraction module is used to segment instructions into words and extract core keywords; The network search module is used to retrieve a collection of documents using an external search engine based on the keywords. The text segmentation module is used to perform text segmentation processing on the retrieved document set to obtain multiple text blocks; A vectorization and storage module is used to vectorize the text block and store it in a vector database; The similarity retrieval module is used to retrieve relevant text blocks from the vector database according to user instructions; The reordering module is used to reorder related text blocks and select the optimal text block. The prompt word generation module is used to integrate the optimal text block with user commands to generate the final prompt word; The response generation module is used to input the final prompt words into the large model and obtain the response results.