Multi-round question and answer under large model multi-path retrieval question and answer parameter and data source optimization method

By using a small model for intent recognition and dynamically adjusting the question-answering parameters and data sources of the large model, the problem of difficulty in selecting data sources and parameters in multi-way retrieval technology is solved, and efficient personalized question answering in multi-round question answering is achieved.

CN121146095BActive Publication Date: 2026-03-24SHIP INFORMATION RES CENT (NO 714 RES INST OF CHINA STATE SHIPBUILDING CORP)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing multi-way retrieval technologies suffer from problems such as difficulty for users to determine the data source and question-answering parameters in large-scale question-answering models, and the neglect of users' personalized needs in multi-round question-answering.

Method used

A small model is used to identify the intent of user queries. Vector databases, full-text search engines or structured databases are selected for enhanced retrieval based on the intent category. Question and answer parameters and data sources are dynamically adjusted in multiple rounds of question answering.

Benefits of technology

Achieving efficient intent recognition under limited computing resources, meeting the question-answering needs of different application scenarios, reducing the burden of manual parameter tuning, improving the recall and accuracy of the knowledge base, and ensuring personalized and high-quality answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121146095B_ABST
    Figure CN121146095B_ABST
Patent Text Reader

Abstract

The application discloses a multi-round question and answer large model multi-path retrieval question and answer parameter and data source optimization method, which adopts a small model to recognize the intention of user query, so that better recognition performance is realized under the condition that the computing resources are limited. According to the recognized intention category, a large model is used to determine which data source in a vector database, a full-text search engine or a structured database is used for enhanced retrieval, while each query parameter is given in different application scenarios. Moreover, the intention recognition result is dynamically adjusted with different queries and historical question and answer of each round of user in multi-round question and answer, so that the final large model calling parameter and data source are formed. Compared with the prior art, the application realizes efficient intention recognition to obtain intention classification by using a small model under the condition that the computing power is limited, can select a suitable knowledge base and question and answer parameter configuration for a large model in various application scenarios, and has obvious advantages in low resource consumption and question and answer accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence and natural language processing, and in particular to a large model multi-path retrieval question and answer parameter and data source optimization method under multi-round question and answer, a readable storage medium and a computer device. BACKGROUND

[0002] Systems based on retrieval augmented generation (RAG) technology can improve the answer quality of large models by retrieving relevant information from external knowledge sources, and are widely used in question and answer systems, intelligent customer service, content creation and other scenarios. A typical RAG system first uses a retriever (such as a search engine or database) to obtain relevant documents or data based on user queries, and then inputs the retrieval results and the query into a large model to generate answers highly related to the knowledge of interest to the user, and effectively reduce the hallucination phenomenon of the large model.

[0003] However, the existing multi-path retrieval technology has the problems of difficulty for users to determine the data source and question and answer parameters in the large model question and answer, and neglecting the personalized needs of users in multi-round question and answer. SUMMARY

[0004] The present application provides a large model multi-path retrieval question and answer parameter and data source optimization method under multi-round question and answer, a readable storage medium and a computer device, in order to solve the problem that the existing multi-path retrieval technology has difficulty for users to determine the data source and question and answer parameters in the large model question and answer, and neglects the personalized needs of users in multi-round question and answer.

[0005] In order to solve the above technical problems, the present application adopts the following technical solutions:

[0006] A large model multi-path retrieval question and answer parameter and data source optimization method under multi-round question and answer, comprising:

[0007] The first round of question and answer performs the following steps:

[0008] The front-end server obtains the first round of user input information, classifies the first round of information by a lightweight model, and determines the intent category;

[0009] The back-end server calls a large model, which selects pre-configured question and answer parameters according to the intent category, and determines the database and corresponding data source to be queried;

[0010] The large model retrieves and queries the first round of information according to the question and answer parameters and the database and corresponding data source, and generates first round of answer information according to the retrieval results;

[0011] The front-end server displays the first round of answer information;

[0012] The nth round of question and answer will proceed as follows, where n > 1:

[0013] The front-end server retrieves the nth round of query information input by the user;

[0014] The backend server calls the large model, taking the nth round of query information, the query information obtained from the 1st to the (n-1)th round of dialogue, the answer information generated from the 1st to the (n-1)th round of dialogue, the question-and-answer parameters of the (n-1)th round of dialogue, and the database and corresponding data source selected in the (n-1)th round of dialogue as the input information for the nth round. The large model adjusts the question-and-answer parameters and the database and corresponding data source to be queried for the nth round according to the input information for the nth round. After adjustment, it retrieves and queries the query information for the nth round and generates the answer information for the nth round based on the retrieval results.

[0015] The front-end server displays the answer information for the nth round.

[0016] Based on this, the present invention can be further improved as follows:

[0017] Intent categories include: consultation categories that require accurate answers, generation categories that require creative output, and generation categories that require data analysis.

[0018] Based on this, the present invention can be further improved as follows:

[0019] The large model selects pre-configured question-answering parameters based on the intent category, specifically including:

[0020] For inquiry categories that require accurate answers, set the temperature value below the first threshold;

[0021] For generation categories that require creative output, set the temperature value higher than the second threshold and the top_p value higher than the third threshold;

[0022] For the generation categories that require data analysis, set the temperature value below the fourth threshold and set the max_tokens value within the preset range;

[0023] Wherein, the first threshold is less than or equal to the second threshold, and the fourth threshold is less than or equal to the second threshold.

[0024] Based on this, the present invention can be further improved as follows:

[0025] Determine the database and corresponding data source to be queried, specifically including:

[0026] For inquiry categories that require accurate answers, select the MySQL database for retrieval;

[0027] For categories that require creative output, select the Milvus database for semantic retrieval;

[0028] For generated categories that require data analysis, select the Elasticsearch database for full-text search.

[0029] Based on this, the present invention can be further improved as follows:

[0030] Determining the database to be queried and its corresponding data source also includes:

[0031] When the intent category includes at least two of the following: consultation category requiring accurate answers, generation category requiring creative output, and generation category requiring data analysis, the corresponding database is selected for parallel retrieval, and the retrieval results are merged.

[0032] To solve the above-mentioned technical problems, the present invention can also adopt the following technical solution:

[0033] A readable storage medium storing at least one program, which, when executed, is used to implement the method for tuning question-answering parameters and data sources for large-scale multi-way retrieval under multi-turn question answering as described in any of the above technical solutions.

[0034] To solve the above-mentioned technical problems, the present invention can also adopt the following technical solution:

[0035] A computer device includes a processor and a memory, the memory being used to store at least one program, and the processor being used to read the at least one program to implement the method for tuning question-answering parameters and data sources for large-scale multi-way retrieval under multi-turn question answering as described in any of the above technical solutions.

[0036] This invention provides a method for optimizing large-scale model multi-path retrieval question-answering parameters and data sources under multi-turn question-answering conditions. It employs a small model to identify user query intent, achieving better recognition performance under limited computing resources. Based on the identified intent category, the large model determines which data source—Milvus, Elasticsearch, or MySQL—to use for enhanced retrieval, while providing various query parameters (including model name, search TopK value, temperature, top_p, etc.) for different application scenarios. Furthermore, the intent recognition results are dynamically adjusted based on the different user queries and historical question-answering data in each round of multi-turn question-answering, forming the final large model calling parameters and data source. Compared to existing technologies, this invention achieves efficient intent recognition and classification using a small model under limited computing power, and allows the large model to select appropriate knowledge bases and question-answering parameter configurations in diverse application scenarios, demonstrating significant advantages in low resource consumption and question-answering accuracy.

[0037] This invention has the following advantages:

[0038] Lightweight and efficient processing: Utilizing a small model for real-time intent recognition and classification, the system accurately categorizes user queries into relevant business scenarios and automatically configures corresponding question-and-answer parameters and data source selection strategies, significantly reducing the burden of manual parameter tuning. While maintaining recognition accuracy, it drastically reduces computational resource consumption, enabling the system to operate stably on edge devices or in resource-constrained environments. This small model can be adapted to different business scenarios through low-cost fine-tuning, achieving efficient deployment and rapid response.

[0039] Intelligent Scene Adaptation: The system accurately distinguishes between scenarios such as creative writing, customer service Q&A, and data analysis through an intent recognition module. It automatically matches optimal preset Q&A parameters and data source strategies based on intent classification, meeting the system's Q&A query needs in different business environments. Furthermore, it automatically matches the optimal combination of Q&A parameters according to different intents, achieving scenario-based output and high-quality answers. During multi-round interactions, the system can dynamically adjust parameters (such as answer length and temperature coefficient) to ensure the contextual coherence of continuous dialogue and the accuracy of answers.

[0040] Enhanced Knowledge Retrieval: Based on intent classification, the system can intelligently select the most suitable knowledge retrieval strategy (vector retrieval, full-text retrieval, structured query, or hybrid retrieval), dynamically optimize data source calls in multi-round question answering, significantly improve the recall and accuracy of the knowledge base, and thus ensure that the generated answers are highly matched with user needs.

[0041] Based on user query intent and historical interaction records, the system can dynamically adjust question and answer parameters in multiple rounds of question and answering to achieve personalized question and answering and high-quality output. At the same time, it can intelligently select the most suitable data source, such as vector search, full-text search or structured query.

[0042] Dynamic adaptive optimization: Through a multi-round loop mechanism, the modules work together to not only achieve real-time adjustment of the large model's question-answering parameters and data sources, but also continuously accumulate historical interaction information to optimize the question-answering effect in subsequent rounds.

[0043] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0044] Figure 1 This is a schematic diagram of the method flow provided in an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of the structural framework provided for an embodiment of the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.

[0047] Existing retrieval enhancement models typically rely on multiple knowledge base systems, including vector databases (such as Milvus) for semantic matching of unstructured text and support for deep semantic retrieval; full-text search engines (such as Elasticsearch) for full-text retrieval of large-scale text and structured data querying; and structured relational databases (such as MySQL) for storing tabular business data and records. In practical applications, to balance retrieval accuracy and recall, multi-path retrieval strategies are often employed, such as simultaneously utilizing vector retrieval and full-text retrieval.

[0048] However, existing multi-way retrieval technologies suffer from problems such as difficulty for users to determine the data source and question-answering parameters in large-scale question-answering models, and the neglect of users' personalized needs in multi-round question-answering.

[0049] On the one hand, users need to select the appropriate knowledge base when making a query, but they usually cannot understand the specific data from each data source. If the user's intent is not identified, the search results may not meet their needs.

[0050] On the other hand, after multi-path retrieval, the retrieved documents are input into a large model for question-answer generation. Several adjustable parameters exist (such as model name, Top-K, temperature, top_p, etc.), and different parameter combinations significantly impact the output style and answer quality. For example, a low temperature is suitable for factual question answering to ensure deterministic output, while a high temperature enhances creative output and is suitable for copywriting generation. However, existing multi-path retrieval technologies do not fully consider the optimization of question-answering parameters because retrieval and parameter configuration largely rely on experiential knowledge, which is often difficult for ordinary users to understand or manually set.

[0051] Furthermore, the aforementioned research methods do not take into account the personalized information of users in the multiple rounds of historical question-and-answer scenarios, which makes it difficult for large model answers to meet users' personalized query needs.

[0052] Therefore, how to achieve adaptive parameter tuning of question-answering parameters and data sources based on intent recognition in multi-turn question-answering scenarios to meet the needs of different application scenarios has become an urgent problem to be solved.

[0053] To address the aforementioned issues, this invention proposes a retrieval enhancement technique based on small-model intent recognition and large-model parameter tuning. This scheme employs a small model (such as Tongyi Qianwen Qwen3-0.6B) to recognize user query intent, achieving good recognition performance under limited computing resources. Based on the identified intent category, the large model determines which data source—Milvus, Elasticsearch, or MySQL—to use for enhanced retrieval, while also providing various query parameters (including model name, search TopK value, temperature, top_p, etc.) for different application scenarios. Furthermore, the intent recognition results are dynamically adjusted based on different user queries and historical question-and-answer sessions across multiple rounds of question answering, forming the final large-model call parameters and data source.

[0054] Compared with existing technologies, this invention achieves efficient intent recognition and intent classification using a small model under limited computing power conditions. It allows for the selection of appropriate knowledge bases and question-answering parameter configurations for large models in diverse application scenarios, demonstrating significant advantages in low resource consumption and question-answering accuracy, including:

[0055] In environments with limited computing resources, lightweight models (such as Qwen3-0.6B) can be introduced to achieve real-time intent recognition, accurately classify the business scenarios to which user queries belong, and automatically configure corresponding question-and-answer parameters and data source selection strategies, thereby significantly reducing the burden of manual parameter tuning.

[0056] For various application scenarios (such as customer service, content creation, and data analysis), it automatically matches the optimal preset question and answer parameters and data source strategies through intent classification to meet the question and answer query needs of the system in different business environments.

[0057] Based on user query intent and historical interaction records, the system can dynamically adjust question and answer parameters in multiple rounds of question and answering to achieve personalized question and answering and high-quality output. At the same time, it can intelligently select the most suitable data source method, such as vector retrieval, full-text retrieval or structured query, to improve the recall rate and retrieval accuracy of the knowledge base and ensure that the content generated by the large model is highly consistent with user needs.

[0058] The following examples illustrate this.

[0059] like Figure 1 As shown, a method for tuning question-answering parameters and data sources in a large-scale model under multi-turn question answering includes:

[0060] The first round of question and answer will proceed as follows:

[0061] The front-end server obtains the first round of query information input by the user, and uses a lightweight model to classify the intent of the first round of query information to determine the intent category;

[0062] For example, a small model (such as Qwen3-0.6B with a parameter size of about 0.6B) can identify which business scenario (customer service, content creation, data analysis, etc.) a user query belongs to and output the intent category.

[0063] For example, in intelligent customer service scenarios, the small model may identify intents such as "return request," "complaint," and "product inquiry"; in creative writing scenarios, the model may identify intents such as "generate copy"; and in data analysis scenarios, it may identify intents such as "data aggregation" or "report generation." Compared to large models of 3B or more, this small model has lower computational resource costs and can be deployed on resource-constrained devices.

[0064] Optionally, the small model can be fine-tuned with a small amount of sample data to adapt to intent classification tasks in specific application scenarios.

[0065] The backend server calls the large model, which selects pre-configured question-and-answer parameters based on the intent category and determines the database and corresponding data source to be queried.

[0066] It should be understood that the backend server has built-in parameter strategies corresponding to different intents, which can automatically determine the optimal values ​​of parameters such as the base model (such as DeepSeek or Qianwen), temperature, top-K, top_p, and max_tokens used for answering inference in different application scenarios.

[0067] It should be understood that the backend server has multiple built-in search backend APIs: for unstructured text, it uses the vector database Milvus for semantic retrieval; for scenarios requiring keyword matching, it uses Elasticsearch for full-text retrieval; and for structured data queries, it uses relational databases such as MySQL.

[0068] Alternatively, the large model can be either the DeepSeek large model or the Qianwen 32B large model.

[0069] The large model retrieves and queries the first round of query information based on the question-and-answer parameters, the database, and the corresponding data source, and generates the first round of answer information based on the retrieval results;

[0070] After determining the retrieval data source and question-and-answer parameters, the actual question-and-answer process needs to be executed.

[0071] In the specific implementation, if Milvus search is selected, the user query is converted into a vector embedding, for example, using a trained text embedding model BGE for vectorization. This vector retrieves the top K most relevant documents in Milvus. If Elasticsearch search is selected, a corresponding full-text search statement is constructed. If MySQL search is selected, the corresponding SQL query is executed and data is extracted. If a hybrid search is selected, relevant documents are retrieved from all databases. The retrieved document fragments or data results are concatenated or encoded with the original query to form the input context of a larger model, and the question-answering parameters of the larger model are set to generate the answer returned to the user.

[0072] The front-end server displays the first round of response information;

[0073] The nth round of question and answer will proceed as follows, where n > 1:

[0074] The front-end server retrieves the nth round of query information input by the user;

[0075] The backend server calls the large model, taking the nth round of query information, the query information obtained from the 1st to the (n-1)th round of dialogue, the answer information generated from the 1st to the (n-1)th round of dialogue, the question-and-answer parameters of the (n-1)th round of dialogue, and the database and corresponding data source selected in the (n-1)th round of dialogue as the input information for the nth round. The large model adjusts the question-and-answer parameters and the database and corresponding data source to be queried for the nth round according to the input information for the nth round. After adjustment, it retrieves and queries the query information for the nth round and generates the answer information for the nth round based on the retrieval results.

[0076] By automating the selection of the most suitable data source, manual switching of data sources is avoided, and the preset data source selected in each round of dialogue is dynamically adjusted based on the current historical dialogue and user queries.

[0077] The front-end server displays the answer information for the nth round.

[0078] This invention provides a method for optimizing large-scale model multi-path retrieval question-answering parameters and data sources under multi-turn question-answering conditions. It employs a small model to identify user query intent, achieving better recognition performance under limited computing resources. Based on the identified intent category, the large model determines which data source—Milvus, Elasticsearch, or MySQL—to use for enhanced retrieval, while providing various query parameters (including model name, search TopK value, temperature, top_p, etc.) for different application scenarios. Furthermore, the intent recognition results are dynamically adjusted based on the different user queries and historical question-answering data in each round of multi-turn question-answering, forming the final large model calling parameters and data source. Compared to existing technologies, this invention achieves efficient intent recognition and classification using a small model under limited computing power, and allows the large model to select appropriate knowledge bases and question-answering parameter configurations in diverse application scenarios, demonstrating significant advantages in low resource consumption and question-answering accuracy.

[0079] This invention has the following advantages:

[0080] Lightweight and efficient processing: Utilizing a small model for real-time intent recognition and classification, the system accurately categorizes user queries into relevant business scenarios and automatically configures corresponding question-and-answer parameters and data source selection strategies, significantly reducing the burden of manual parameter tuning. While maintaining recognition accuracy, it drastically reduces computational resource consumption, enabling the system to operate stably on edge devices or in resource-constrained environments. This small model can be adapted to different business scenarios through low-cost fine-tuning, achieving efficient deployment and rapid response.

[0081] Intelligent Scene Adaptation: The system accurately distinguishes between scenarios such as creative writing, customer service Q&A, and data analysis through an intent recognition module. It automatically matches optimal preset Q&A parameters and data source strategies based on intent classification, meeting the system's Q&A query needs in different business environments. Furthermore, it automatically matches the optimal combination of Q&A parameters according to different intents, achieving scenario-based output and high-quality answers. During multi-round interactions, the system can dynamically adjust parameters (such as answer length and temperature coefficient) to ensure the contextual coherence of continuous dialogue and the accuracy of answers.

[0082] Enhanced Knowledge Retrieval: Based on intent classification, the system can intelligently select the most suitable knowledge retrieval strategy (vector retrieval, full-text retrieval, structured query, or hybrid retrieval), dynamically optimize data source calls in multi-round question answering, significantly improve the recall and accuracy of the knowledge base, and thus ensure that the generated answers are highly matched with user needs.

[0083] Based on user query intent and historical interaction records, the system can dynamically adjust question and answer parameters in multiple rounds of question and answering to achieve personalized question and answering and high-quality output. At the same time, it can intelligently select the most suitable data source, such as vector search, full-text search or structured query.

[0084] Dynamic adaptive optimization: Through a multi-round loop mechanism, the modules work together to not only achieve real-time adjustment of the large model's question-answering parameters and data sources, but also continuously accumulate historical interaction information to optimize the question-answering effect in subsequent rounds.

[0085] Optionally, in some possible implementations, the intent categories include: consultation categories that require accurate answers, generation categories that require creative output, and generation categories that require data analysis.

[0086] Optionally, in some possible implementations, the large model selects pre-configured question-answering parameters based on the intent category, specifically including:

[0087] For inquiry categories that require accurate answers, set the temperature value below the first threshold;

[0088] For generation categories that require creative output, set the temperature value higher than the second threshold and the top_p value higher than the third threshold;

[0089] For the generation categories that require data analysis, set the temperature value below the fourth threshold and set the max_tokens value within the preset range;

[0090] Wherein, the first threshold is less than or equal to the second threshold, and the fourth threshold is less than or equal to the second threshold.

[0091] It should be understood that the thresholds and preset ranges can be set according to actual needs.

[0092] For example, for customer service inquiries requiring accurate answers, a high-quality model with a short response time can be selected, and the temperature can be set low (e.g., 0.2) to reduce generation randomness. For advertising copy generation requiring creative output, the temperature (e.g., 0.8) and top_p (e.g., 0.9) can be automatically increased to enhance question-and-answer diversity. For data analysis report generation, a low temperature and a reasonable max_tokens (e.g., 200) are set to ensure accurate and concise content. This module's automatic parameter tuning eliminates the complexity of manual parameter setting for users and ensures that the model's output style matches the query intent. Furthermore, the preset parameters selected in each round of dialogue are dynamically adjusted based on the current historical dialogue and user queries.

[0093] Optionally, in some possible implementations, determining the database to be queried and its corresponding data source specifically includes:

[0094] For inquiry categories that require accurate answers, select the MySQL database for retrieval;

[0095] For categories that require creative output, select the Milvus database for semantic retrieval;

[0096] For generated categories that require data analysis, select the Elasticsearch database for full-text search.

[0097] Optionally, in some possible implementations, determining the database to be queried and the corresponding data source further includes:

[0098] When the intent category includes at least two of the following: consultation category requiring accurate answers, generation category requiring creative output, and generation category requiring data analysis, the corresponding database is selected for parallel retrieval, and the retrieval results are merged.

[0099] The present invention also provides a readable storage medium storing at least one program, which, when executed, is used to implement the method for tuning question-answering parameters and data sources for large-scale model multi-way retrieval under multi-turn question answering as disclosed in any of the above embodiments.

[0100] The present invention also provides a computer device, the computer device comprising: a processor and a memory, the memory for storing at least one program, and the processor for reading the at least one program to implement the method for tuning question-answering parameters and data sources for large-scale model multi-way retrieval under multi-turn question answering as disclosed in any of the above embodiments.

[0101] The system architecture of this invention consists of front-end components and back-end components. The front-end receives user queries and displays the generated answers. The back-end mainly includes an intent recognition module, a parameter configuration module, a data source selection module, and a retrieval enhancement generation module. All modules interact through a unified FastAPI interface to jointly realize an intelligent question-answering system based on knowledge base retrieval.

[0102] For example, a knowledge base system such as Milvus vector database, Elasticsearch search engine, and MySQL can be deployed on the backend server. Documents and logs from different fields can be prepared or imported, segmented, and vector indexes generated. Large and small model modules can be designed to call APIs. A chat interface can be deployed on the frontend server to receive user queries and display answers.

[0103] Training the intent recognition model first requires constructing datasets around three typical scenarios: creative writing, customer service Q&A, and data analysis. Creative writing samples include requirements such as brainstorming and text generation and rewriting; customer service Q&A samples cover questions related to account operations, product usage, and troubleshooting; and data analysis samples involve tasks such as query statistics, trend analysis, and result visualization. The data is then labeled with the corresponding intent categories and divided into training, validation, and test sets at a ratio of 70%, 15%, and 15%, respectively.

[0104] During model training, Qwen3-0.6B was selected with an additional fully connected layer as the classifier. Fine-tuning was performed on the training set using cross-entropy loss, while the learning rate and number of iterations were adjusted using the validation set to avoid overfitting. Finally, the recognition accuracy was calculated on the test set. If the average recognition accuracy was greater than 95%, the trained recognition model was deployed in real-world applications to accurately distinguish between creative writing, customer service inquiries, and data analysis intents based on user queries.

[0105] To determine the optimal question-and-answer parameters for a user query, it is necessary to identify and classify the user's intent and predefine the generation parameter strategies corresponding to different intent categories. This can be configured through the parameter configuration module. For example, for the customer service question-and-answer intent, set the parameters temperature=0.2, top_p=0.5, and max_tokens=100; for the creative writing intent, set temperature=0.8 and top_p=0.9; and for the data analysis intent, set temperature=0.3, top_p=0.6, and max_tokens=200.

[0106] To determine the optimal knowledge base and data source for a user query, the data source selection module also needs to identify and classify user intent and predefine RAG data source selection strategies for different intent categories. It also needs to design mapping rules between intents and data sources. For example, if the intent requires rule-based answers (such as customer service Q&A), the system selects to query relevant tables in MySQL; if the intent involves domain knowledge (such as creative writing), the system executes Milvus vector retrieval; if the intent focuses on log or keyword search (such as data analysis), then Elasticsearch is used.

[0107] In the multi-round question-and-answer process, each round of interaction executes a loop: When a user enters a query, the system first receives the request through the front-end interface and passes it to the back-end. In the back-end processing, the system uses preset question-and-answer parameters (such as answer length, temperature coefficient, output format, etc.), data source mapping relationships, and the user's historical dialogue content as context input, and inputs them along with the user's latest query into the DeepSeek large model. The model dynamically outputs adjusted parameters and data sources based on this context, such as shortening or lengthening the answer length or adding new knowledge base calls. Subsequently, the system constructs a unified large model request JSON based on the question-and-answer parameters generated in this round, and performs a database search in the adjusted data source based on the user query to obtain the most relevant documents. Through iterative loops, this mechanism continuously optimizes question-and-answer parameters and data source selection in multi-round dialogues, ensuring the contextual coherence of the question-and-answer process, the accuracy of the search results, and the stability of the model's generated results.

[0108] In the multi-turn dialogue loop mechanism, each round of interaction executes a large-scale question-and-answer model based on the adjusted question-and-answer request JSON and retrieved relevant documents. Specifically, the system calls the DeepSeek question-and-answer interface, sets the JSON of the question-and-answer request, and inputs the user's query and relevant documents as context into the large-scale model to generate a context-appropriate answer. The final generated answer is returned to the user in real time through the front-end interface, completing the current round of interaction. After the large-scale model generates an answer, the system stores the query and answer of this round in the historical dialogue database for use as context input in subsequent rounds.

[0109] Through the aforementioned system, this invention constructs a retrieval enhancement system based on small-model intent recognition and adaptive tuning of large-model parameters. Each module operates collaboratively under a multi-round loop mechanism, achieving dynamic adjustment of large-model question-and-answer parameters and data sources. This effectively solves the problems of traditional methods requiring manual adjustment of large-model parameters and retrieval enhancement techniques relying on manual data source selection. Furthermore, this mechanism can dynamically optimize question-and-answer parameters and data source selection in multi-round dialogues, meeting the diverse needs of users in multi-round queries. It is applicable to question-and-answer optimization in various application scenarios such as creative writing, customer service Q&A, and data analysis.

[0110] like Figure 2 As shown, this is the overall framework of the technical solution. The front-end components can use technologies such as HTML, JavaScript, and CSS to display user questions and answers, while the back-end components can pre-deploy small and large models to achieve intent classification, retrieval, and other functions.

[0111] Optionally, some possible implementations may include all or part of the above-described implementations.

[0112] It is understood that the above embodiments are product embodiments corresponding to the prior method embodiments. Therefore, the description of the product embodiments can be referred to the prior method embodiments, and will not be repeated here.

[0113] It should be noted that in the above embodiments, the connection method of each device / component can be a wired connection and / or a wireless connection. For example, wired connection includes wired connection with power line, standard serial port RS485 or Ethernet RJ45 as interface; wireless connection includes wireless connection based on Zigbee, Z-wave, Wifi or GPRS wireless communication transmission mode.

[0114] In the above description, a server refers to a device that connects to devices such as mobile phones, computers, tablets, or industrial control computers to control these devices or communicate data with them. It can be a computing device that runs specific programs to achieve the functions mentioned above in the general sense.

[0115] It should be understood that in the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples" refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this description, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate different embodiments or examples described in this specification, as well as some features of different embodiments or examples.

[0116] Of course, those skilled in the art can make various corresponding changes and modifications based on the present invention without departing from its spirit and essence, but such changes and modifications should all fall within the protection scope of the claims of the present invention.

Claims

1. A method for tuning question-answering parameters and data sources in a large-scale model under multi-turn question answering, characterized in that, include: The first round of question and answer will proceed as follows: The front-end server obtains the first round of query information input by the user, and uses a lightweight model to classify the intent of the first round of query information to determine the intent category; The backend server calls the large model, which selects pre-configured question-and-answer parameters based on the intent category and determines the database and corresponding data source to be queried. The large model retrieves and queries the first round of query information based on the question-and-answer parameters, the database, and the corresponding data source, and generates the first round of answer information based on the retrieval results; The front-end server displays the first round of response information; The nth round of question and answer will proceed as follows, where n > 1: The front-end server obtains the nth round of query information input by the user; The backend server calls the large model, taking the nth round of query information, the query information obtained from the 1st to the (n-1)th round of dialogue, the answer information generated from the 1st to the (n-1)th round of dialogue, the question-and-answer parameters of the (n-1)th round of dialogue, and the database and corresponding data source selected in the (n-1)th round of dialogue as the input information for the nth round. The large model adjusts the question-and-answer parameters and the database and corresponding data source to be queried for the nth round according to the input information for the nth round. After adjustment, it retrieves and queries the query information for the nth round and generates the answer information for the nth round based on the retrieval results. The front-end server displays the nth round of response information; Intent categories include: inquiry categories requiring accurate answers, generation categories requiring creative output, and generation categories requiring data analysis; The large model selects pre-configured question-answering parameters based on the intent category, specifically including: For inquiry categories that require accurate answers, set the temperature value below the first threshold; For generation categories that require creative output, set the temperature value higher than the second threshold and the top_p value higher than the third threshold; For the generation categories that require data analysis, set the temperature value below the fourth threshold and set the max_tokens value within the preset range; Wherein, the first threshold is less than or equal to the second threshold, and the fourth threshold is less than or equal to the second threshold.

2. The method for tuning question-answering parameters and data sources for large-scale models under multi-turn question answering as described in claim 1, characterized in that, Determine the database and corresponding data source to be queried, specifically including: For inquiry categories that require accurate answers, select the MySQL database for retrieval; For categories that require creative output, select the Milvus database for semantic retrieval; For generated categories that require data analysis, select the Elasticsearch database for full-text search.

3. The method for tuning question-answering parameters and data sources for large-scale models under multi-turn question answering as described in claim 2, characterized in that, Determining the database to be queried and its corresponding data source also includes: When the intent category includes at least two of the following: consultation category requiring accurate answers, generation category requiring creative output, and generation category requiring data analysis, the corresponding database is selected for parallel retrieval, and the retrieval results are merged.

4. A readable storage medium, characterized in that, The readable storage medium stores at least one program, which, when executed, is used to implement the method for tuning question-answering parameters and data sources for large-scale multi-way retrieval under multi-turn question answering as described in any one of claims 1 to 3.

5. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one program, and the processor being used to read the at least one program to implement the method for tuning question-answering parameters and data sources for large-scale multi-way retrieval under multi-turn question answering as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Intelligent customer service question and answer method and device, electronic equipment, storage medium and product

    CN119513240A

  • Retrieval enhancement generation method and system based on large language model

    CN120045750A