Large model dialogue control method and system, storage medium and computer equipment
By converting user input and dialogue history data into state-aware vectors, selecting matching expert models to generate candidate responses, and filtering them through value scoring, the problem of knowledge illusion and resource waste in large-model dialogue systems is finally solved, achieving efficient, flexible, and reliable dialogue control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN NEOWAY TECH
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-08
AI Technical Summary
Existing large-scale model dialogue systems suffer from problems such as knowledge illusion, waste of computational resources, insufficient style and domain adaptation capabilities, and poor dialogue consistency, resulting in low reliability and efficiency of dialogue responses.
User input and dialogue history data are converted into state-aware vectors. Multiple expert models that match the vectors are selected to generate candidate responses. The final response is then filtered by value scoring. A pre-set pool of expert models and a knowledge base are used to enhance dialogue control.
It improves the accuracy and reliability of dialogue responses, reduces computational costs and latency, enables efficient, flexible and interpretable control of dialogue, and enhances the coherence and style adaptability of dialogue.
Smart Images

Figure CN121996748A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a large-scale model dialogue control method, system, storage medium, and computer device. Background Technology
[0002] In the field of AI dialogue systems, dialogue systems based on large language models have achieved fluent and coherent open-domain dialogue. Their core relies on pre-trained models with massive single-parameter scales, learning language rules and world knowledge through massive amounts of data. To improve the accuracy and professionalism of dialogue, the industry widely uses Retrieval Augmented Generation (RAG) technology. This technology retrieves relevant information fragments from external knowledge bases before generating responses, combining them as context with prompts from the large model to guide the model in generating more factually based content. Furthermore, for different business scenarios or individual needs, existing technologies typically employ methods such as designing specific prompts or fine-tuning all parameters of the basic large model to obtain multiple independent dialogue models adapted to different styles or domains.
[0003] However, existing technologies still have several core shortcomings that urgently need to be addressed, resulting in poor reliability of large-scale model dialogue responses. On the one hand, traditional single-model architectures inherently contradict capabilities and efficiency, and are prone to factual biases, i.e., "knowledge illusions." Large, monolithic models need to activate all parameters when processing simple queries, leading to high computational resource consumption and significant response latency. Existing retrieval-enhanced generation techniques only use external knowledge as a reference and do not impose effective constraints on the model generation process. The model may ignore or misinterpret retrieved knowledge, generating responses that are inconsistent with reality. On the other hand, stylization / specialization solutions based on prompt words or full-parameter fine-tuning lack flexibility and are inefficient. Prompt word-based style control methods have poor stability; even slight changes in expression can lead to style instability. Full-parameter fine-tuning of models for each scenario requires a large amount of labeled data and computational resources, resulting in high costs. Furthermore, switching styles or domains requires abrupt model changes, disrupting dialogue consistency and user experience.
[0004] Therefore, there is an urgent need for a dialogue control method that can effectively avoid the problems caused by tightly coupling knowledge storage, style control and language generation tasks into a single model under the existing architecture, such as knowledge illusion, waste of computing resources, insufficient style and domain adaptation capabilities and poor dialogue consistency, and can control large models to make efficient, accurate and flexible dialogue responses. Summary of the Invention
[0005] This application mainly provides a large model dialogue control method, system, storage medium, and computer device, aiming to solve the technical problem of poor reliability of existing large model dialogue responses.
[0006] To address the aforementioned technical problems, this application adopts the following technical solution: providing a large-model dialogue control method. This large-model dialogue control method includes: converting user input data and dialogue history data into state-aware vectors; selecting multiple expert models from a preset expert model pool that match the state-aware vectors; inputting the user input data and the dialogue history data into each of the selected expert models to obtain multiple candidate responses; calculating the value score of each candidate response; and outputting the candidate response with the highest value score as the final dialogue response.
[0007] In some embodiments, the state-aware vector includes a dialogue state vector; the step of converting user input data and dialogue history data into a state-aware vector includes: performing vector encoding on the user input data and the dialogue history data to obtain the dialogue state vector.
[0008] In some embodiments, the state-aware vector further includes a memory pool aggregation vector; the step of converting user input data and dialogue history data into a state-aware vector includes: extracting description objects and their associated information from the user input data and the dialogue history data; vectorizing the mapping relationship between each description object and its associated information and updating it to the dialogue state memory pool; and performing weighted aggregation on multiple vectors in the dialogue state memory pool to obtain the memory pool aggregation vector.
[0009] In some embodiments, selecting multiple expert models that match the state-aware vector from a preset expert model pool includes: calculating the matching probability between the state-aware vector and each expert model in the preset expert model pool; selecting and activating a preset first number of expert models in the preset expert model pool that have the highest matching probability with the state-aware vector.
[0010] In some embodiments, after converting user input data and dialogue history data into state-aware vectors, the method further includes: querying a preset second number of knowledge fragments that match the state-aware vectors from a preset knowledge base; and incorporating the knowledge fragments into the calculation of value scores.
[0011] In some embodiments, the value score includes a routing probability factor and at least one quality assessment factor, the quality assessment factor including a factual assessment factor; before calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response, the method further includes: extracting assertive statements from the candidate responses; calculating the implication probability of each assertive statement with each knowledge fragment; and taking a representative value from each implication probability as the factual assessment factor.
[0012] In some embodiments, calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response includes: weighting and summing the routing probability factor and each of the quality evaluation factors to obtain the value score of the corresponding candidate response; comparing the value scores of each candidate response and outputting the candidate response with the highest value score as the final dialogue response.
[0013] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a large-scale model dialogue control system, which includes: a dialogue state awareness module for converting user input data and dialogue history data into state awareness vectors; a multi-expert routing module for selecting multiple expert models from a preset expert model pool that match the state awareness vectors; an expert model pool module for inputting the user input data and dialogue history data into the selected expert models respectively to obtain multiple candidate responses; and a knowledge-enhanced fusion and reordering module for calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response.
[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a storage medium storing program data, characterized in that the program data, when executed by a processor, implements the steps of the large model dialogue control method described above.
[0015] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer device, which includes a processor and a memory connected to each other, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the large model dialogue control method described above.
[0016] The beneficial effects of this application are as follows: Unlike existing technologies, this application discloses a large-scale model dialogue control method, system, storage medium, and computer device. By converting user input data and dialogue history data into state-aware vectors, this application can accurately capture the contextual semantics of the dialogue and the user's core intent, enhancing the coherence understanding and management of complex multi-turn dialogues, accurately understanding the evolution of user intent, and providing a reliable decision-making basis for subsequent model selection. Simultaneously, based on this vector, dynamically and sparsely selecting matching expert models from a pre-set expert model pool to generate candidate responses integrates the professional advantages of different expert models, avoiding the resource redundancy of activating all parameters in a traditional single model, significantly reducing computational costs and inference latency, achieving efficient computation and resource utilization. Furthermore, since each expert model in the pre-set expert model pool can adapt to different styles or domain requirements, the candidate responses generated by the expert models also possess flexible and natural style and domain adaptability. Finally, by selecting the optimal response through value scoring for output, the quality of candidate responses can be verified post-hocly, ensuring the optimal quality of the output response, effectively improving the accuracy and reliability of dialogue responses, and effectively suppressing factual errors such as "knowledge illusions." Furthermore, because this method adopts a modular and discretized decision-making process, the dialogue control and generation process is transparent, which can meet the requirements of interpretability and controllability in high-risk application scenarios, facilitate the tracking of decision-making basis, and help to debug and optimize the model, thereby further improving the reliability of large model dialogue responses. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 This is a flowchart illustrating an embodiment of the large-model dialogue control method provided in this application; Figure 2 This is a schematic diagram of the structure of an embodiment of the large-scale dialogue control system provided in this application; Figure 3 yes Figure 2 A schematic diagram of a specific implementation of the large-model dialogue control system of the embodiment; Figure 4 This is a schematic diagram of the structure of an embodiment of the storage medium provided in this application; Figure 5 This is a schematic diagram of the structure of an embodiment of the computer device provided in this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0019] The terms "first," "second," and "third" used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0021] This application provides a large-model dialogue control method, see reference. Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the large model dialogue control method provided in this application. The large model dialogue control method includes: Step 10: Convert user input data and dialogue history data into state-aware vectors.
[0022] In this embodiment, the user input data (denoted as u) t This refers to the text information currently entered by the user. This text information can be text directly entered into the text box, or text extracted from speech and images using technologies such as speech recognition or image recognition, corresponding to the user's current interaction needs or query content. Dialogue history data (denoted as H={u1,r1,...,u...) t-1 ,r t-1The `}` represents the interaction sequence consisting of all previous user inputs and system responses. This sequence can be managed by modules such as a dialogue management queue, session storage unit, or database. When processing the current user input, relevant dialogue history data can be extracted from these modules. Both types of data effectively reflect the user's current interaction intent and the context of the dialogue. Using this data as the foundation for large-scale model dialogue control provides comprehensive contextual information for subsequent model selection and response generation.
[0023] In this embodiment, since user input data and dialogue history data are raw, serialized text information, they are difficult for the model to directly understand and process semantically. Therefore, they can be converted into machine-understandable, semantically rich vector forms, i.e., state-aware vectors. This vector conversion can be implemented through pre-trained language model encoding, semantic embedding models, or neural network encoders, as long as it preserves the textual semantics while converting it into a fixed-dimensional vector representation. This state-aware vector can comprehensively capture the contextual semantic information of the dialogue and the user's core intent. It not only includes the key semantics of the current user input but also integrates long-term dependencies and semantic evolution in the dialogue history, providing accurate and reliable decision-making basis for subsequent model selection and response generation.
[0024] Optionally, in some embodiments, the state-aware vector includes a dialogue state vector; converting user input data and dialogue history data into a state-aware vector includes: performing vector encoding on the user input data and dialogue history data to obtain the dialogue state vector.
[0025] In this optional embodiment, the state-aware vector specifically includes a dialogue state vector (denoted as s). t s t ∈R d Where R is the real number field and d is the vector dimension), the dialogue state vector is a core vector used to comprehensively represent the semantics of the current dialogue context and the user's core intent. Specifically, it can include information from core dialogue dimensions such as user intent, sentiment, and topic, providing crucial semantic reference for subsequent expert model selection. This dialogue state vector is obtained through vector encoding, specifically using a state encoder (denoted as E). state The concatenated dialogue context text is semantically encoded, and a vector representation of the corresponding dimension is output.
[0026] In this optional embodiment, the state encoder preferably employs a lightweight bidirectional Transformer encoder, such as BERT-small. This type of state encoder can be used to convert serialized dialogue context text into a machine-understandable fixed-dimensional vector, effectively capturing the contextual dependencies and latent semantic information of the dialogue. For example, user input data and dialogue history data can be concatenated to obtain contextual information (denoted as C). t C t =[H;u t After inputting this context information into a state encoder such as BERT-small, the output vector corresponding to the [CLS] tag parsed by the state encoder can be used as the basic dialogue state vector, i.e., s t =E state (C t ) [CLS] The [CLS] tag integrates core information such as contextual logical relationships, potential semantic associations, and user interaction intentions contained in the entire context, resulting in the dialogue state vector s. t It can accurately represent the semantics, user intent, and sentiment of the current dialogue, providing a precise semantic matching basis for the subsequent multi-expert dynamic routing module.
[0027] Optionally, in some embodiments, the state-aware vector further includes a memory pool aggregation vector; converting user input data and dialogue history data into state-aware vectors further includes: extracting description objects and their associated information from the user input data and dialogue history data; vectorizing the mapping relationship between each description object and its associated information and updating it to the dialogue state memory pool; and weightedly aggregating multiple vectors in the dialogue state memory pool to obtain the memory pool aggregation vector.
[0028] In this optional embodiment, the state-aware vector is specifically defined in the dialogue state vector s, which represents the semantics of the current dialogue context and the user's core intent. t Simultaneously, it also includes a memory pool aggregation vector (denoted as ) that tracks long-range dependencies and represents the structured memory of core descriptive objects and their associated information in long-range dialogues. By fusing the two vectors, a more comprehensive contextual basis can be provided for subsequent routing decisions.
[0029] In this optional embodiment, during the process of obtaining the memory pool aggregation vector, the descriptive object and its associated information are first extracted from user input data and dialogue history data. The descriptive object refers to the semantic embedding of the core entity or topic appearing in the dialogue. Specifically, it can be a noun object appearing in the dialogue (such as "Brand A mobile phone", "Engineer B", "Policy C", "Project D", etc.), or some more abstract discussion focus topics (such as "device troubleshooting", "financial approval process", etc.). The associated information refers to the attributes and metadata related to the descriptive object. Specifically, it can be descriptive attributes (e.g., for the descriptive object "Brand A mobile phone", the corresponding associated information could include "color: titanium metal color", "problem: short battery life", etc.), or it can be relational descriptions (e.g., for "Engineer B")... The description object, and the corresponding associated information can include "Position: Project Manager", "Responsible for: Project D", etc., or it can be dialogue context metadata, which can include the frequency of occurrence of the description object in the dialogue (e.g., "Frequency of occurrence: 6 times"), the most recent mention time of the last mention of the description object (e.g., "Most recent mention time: 3rd round of user input"), the sentiment tendency shown by the user when mentioning the description object (e.g., "Sentence tendency: Positive"), and the user intent related to the description object (e.g., "User intent: Inquiry", "User intent: Complaint", "User intent: Purchase", etc.).
[0030] In this optional embodiment, the extraction of descriptive objects and their associated information can be achieved using information extraction techniques, such as Named Entity Recognition (NER) and relation extraction to accurately identify descriptive objects and their associated information from user input data and dialogue history data, and construct corresponding semantic structures. Through the extraction of descriptive objects and their associated information, unstructured dialogue text can be transformed into structured semantic information, enabling subsequent vectorization processing and memory pool updates to be based on a clear and accurate semantic structure, improving the efficiency and accuracy of information processing. The extracted descriptive objects and their corresponding associated information can be specifically represented by key-value pairs (k... i v i The vectors are represented and stored in the form of a memory pool to facilitate subsequent vector retrieval and aggregation, providing a data foundation for the generation of aggregated vectors in the memory pool.
[0031] In this optional embodiment, since the latest round of user input and system response can carry core new information about the dialogue, and the dialogue content of previous rounds has been structured into a premise summary of the latest round of dialogue, and information can also be managed and traced through the dialogue state memory pool as described later, therefore, when extracting the descriptive object and its associated information, it is possible to extract only the user input data (u) of the current dialogue. t) and the previous round of system response data (r t-1 In order to extract new descriptive objects and their associated information, while taking into account extraction efficiency and information integrity, a highly efficient extraction strategy is achieved to capture the maximum information increment at the lowest cost, thereby improving the efficiency of information extraction. This approach also makes the dialogue response of the large model more focused on the core semantics of the current dialogue, which is more conducive to ensuring the coherence of the dialogue response.
[0032] In this optional embodiment, after the mapping relationship between the description object and its associated information is extracted, the extracted description object and associated information are vectorized and updated to the dialogue state memory pool (denoted as M). t Vectorization aims to convert the descriptive objects and related information into a machine-understandable vector form to facilitate subsequent similarity calculation and aggregation operations. This vectorization can be implemented through pre-trained semantic embedding models (such as the Sentence-BERT model), word vector models, or neural network encoders. This application does not impose specific restrictions on the implementation method of this vectorization.
[0033] In this optional embodiment, the dialogue state memory pool is a dynamic data structure used to store and manage the vector representations of descriptive objects and their associated information in the dialogue. It can track and record the core descriptive objects and their associated information in long-range dialogues. For example, based on the aforementioned storage of descriptive objects and associated information in the form of key-value pairs, the dialogue state memory pool can be represented as M. t ={(k1,v1),(k2,v2),...,(k m ,v m The dialog state memory pool is defined as follows: The keys and values are both vectors. The total number of key-value pairs, *m*, can be determined based on the number of results extracted from the aforementioned descriptive objects. This dialog state memory pool is updated after each dialogue round based on the information of the current round. It is used to explicitly record the evolution of core descriptive objects and related information in the dialogue to support subsequent semantic aggregation and reasoning. Furthermore, due to the limited resources available to form this dialog state memory pool, it also has a capacity limit. This can be addressed by using LRU (Least Recently Used) strategies, first-in-first-out queue management strategies, or dynamic eviction strategies based on information importance to dynamically manage and update the information in the dialog state memory pool, ensuring effective storage of core information while avoiding excessive resource consumption.
[0034] In this optional embodiment, the memory pool aggregation vector is a vector that aggregates the semantic information of all core descriptive objects and related information in the dialogue state memory pool, used to represent the structured memory of core descriptive objects and their related information in long-range dialogues. Specifically, this embodiment can aggregate multiple vectors in the dialogue state memory pool using a weighted summation of attention weights to obtain the memory pool aggregation vector. Specifically, attention weights can be calculated on the key-value pairs in the memory pool based on the current dialogue state vector. These attention weights highlight the descriptive objects and related information most relevant to the current dialogue. The attention weights can be calculated using the formula... The calculation yields a result where sim is the cosine similarity calculation function, specifically derived by calculating the dialogue state vector s. t With each key k i similarity For all similarities, an exponent is taken to ensure that the value is positive, and the ratio of each similarity to the total similarity is calculated. The proportion in the middle is used to obtain the normalized attention weight a. i This attention weight characterizes the relevance of each descriptive object and associated information to the current dialogue state, providing a basis for subsequent weighted aggregation. Based on this, the formula can be used... , each key k i Attention weight a i As the corresponding value v i The weight coefficients are calculated and then summed to obtain the aggregate vector of the memory pool. The memory pool aggregation vector calculated in this way can fully integrate the core semantic information in the memory pool, highlight the long-range memory content most relevant to the current dialogue, and provide a more comprehensive contextual basis for subsequent routing decisions.
[0035] In this optional embodiment, the state-aware vector, which includes a dialogue state vector and a memory pool aggregation vector, can combine the advantages of both vectors to comprehensively capture the dynamic semantic features of the dialogue. The dialogue state vector focuses on characterizing the immediate semantics and user intent of the current dialogue, while the memory pool aggregation vector focuses on tracking the core descriptive objects and their associated information in long-term dialogues, reflecting the long-term dependencies and semantic evolution of the dialogue. Before subsequently applying this state-aware vector to model selection and response generation, the dialogue state vector s can be specifically... t and memory pool aggregation vector The vectors are concatenated to form a holistic state-aware vector [s]. t , This avoids information dispersion and semantic weight imbalance caused by discrete vector inputs, ensuring the integrity of information and the coherence of semantics. Furthermore, in the subsequent selection of expert models, this holistic state-aware vector can provide a precise and consistent semantic matching basis for the matching of subsequent expert models, effectively improving the accuracy and coherence of dialogue control.
[0036] Step 20: Select multiple expert models from the preset expert model pool that match the state-aware vector.
[0037] In this embodiment, after the state-aware vector is generated, a pre-defined expert model pool is constructed and a dynamic selection mechanism is executed to achieve accurate assignment of dialogue tasks. The pre-defined expert model pool is a collaborative hybrid expert system comprising multiple expert models. Specifically, it can be a distributed model management architecture in the form of independently deployed microservice clusters, containerized model instances, or shared-memory model collections. This pre-defined expert pool can include multiple expert models covering different styles and domains, such as formal, humorous, and concise dialogue styles, as well as professional domains like medicine, law, and finance, providing diverse and professional model support for subsequent dialogue tasks. The methods for determining the match between the state-aware vector and the expert model include, but are not limited to, probability calculation based on routing networks, semantic similarity matching, and rule engine matching. The goal is to ensure the selection of the most relevant expert model, choosing the one with the highest matching degree as the activation object for generating candidate responses. The number of selected expert models can be determined by comprehensively considering factors such as computational resource constraints, dialogue complexity, and response quality requirements to balance efficiency and effectiveness and avoid resource waste.
[0038] Optionally, in some embodiments, selecting multiple expert models that match the state-aware vector from a preset expert model pool includes: calculating the matching probability between the state-aware vector and each expert model in the preset expert model pool; and selecting and activating a preset first number of expert models in the preset expert model pool that have the highest matching probability with the state-aware vector.
[0039] In this optional embodiment, the matching relationship between the state-aware vector and the expert model is determined by calculating the matching probability, and dynamic sparse activation is achieved by selecting a preset first number of models. The matching probability can be calculated through a routing network (denoted as r). router The state-aware vector is obtained by processing it. Specifically, in the matching probability calculation process, the state-aware vector (denoted as r) can be processed... input r input =[st, Using a lightweight multilayer perceptron (MLP) as the input to the routing network, a nonlinear transformation and probability normalization are performed on the routing network to calculate the matching probability distribution (denoted as P) between the N expert models in the preset expert model pool and the state perception vector.
[0040] In this optional embodiment, the formula for calculating the matching probability distribution can be specifically as follows: Wherein, the matching probability distribution P includes the matching probabilities p1, p2, ..., p of each expert model and the state-aware vector. N In the formula, Softmax is the normalized exponential function, ReLU (Rectified Linear Unit) is an activation function that introduces a nonlinear transformation, W1, W2, b1, and b2 are the learnable parameters of the routing network, W1 and W2 are the weight matrices of different network layers, and b1 and b2 are the bias vectors of different network layers. These learnable parameters can be optimized and updated during model training through backpropagation, and are obtained by the routing network through autonomous learning and parameter tuning. The process of determining these learnable parameters through model training will not be elaborated here. As long as the model selection is more in line with the requirements and the matching probability distribution is more reasonable through training and optimization of these learnable parameters, it is acceptable. Through this formula, the first layer network (denoted as net1) will first be used to determine the learning parameters. ) high-dimensional state-aware vector A mapping transformation is performed, mapping to a new feature space (usually a hidden layer). Then, by correcting the ReLU linear unit, a nonlinear transformation is introduced, enabling net1 to learn the nonlinear relationship between the input and expert selection, thereby enhancing the model's expressive power. Afterward, a second layer (the output layer, denoted as net2) is used... The hidden layer features are mapped to a dimension equal to the number of experts, N, producing a score vector (often called logits) containing N values. This score vector represents the original bias score for selecting the corresponding expert in the current dialogue state. Finally, the softmax function is applied... This can transform the score vector calculated by the second-layer network net2 into a standard probability distribution (i.e., ), each The value represents the matching probability between the corresponding expert in the preset expert model pool and the state-aware vector. The matching probability obtained by this calculation method can take into account both the current semantics and the relevant facts in long-term memory. This makes the selection of expert models based on the matching probability both based on the "semantic perception" of the dialogue state and the "knowledge perception" of the memory pool, ensuring that the selected expert model is highly relevant to the current dialogue and that the generated response conforms to both semantic logic and factual knowledge.
[0041] In this optional embodiment, after determining the matching probability of each expert model in the preset expert model pool with the state-aware vector, a preset first number of expert models can be selected and activated according to the matching probability ranking (the set of activated experts is denoted as A). The preset first number (denoted as Top-K), as mentioned above, is a value determined by factors such as comprehensive computing resources, dialogue complexity, and response quality requirements. It is used to select the expert model with the highest matching probability to achieve sparse activation. After selecting and activating the Top-K expert models, since the expert models are matched with the current dialogue state, they are more professional and refined for specific dialogue tasks, and their understanding of user intent and response generation are more accurate. Therefore, they can output candidate responses that are more suitable for the dialogue scenario, ensuring the professionalism and adaptability of the responses. Furthermore, since expert models are usually more lightweight and have lower resource consumption compared to large models with large single-parameter scales in traditional solutions, and do not need to activate all model parameters when executing candidate response generation tasks in parallel, the consumption of computing resources and inference latency are significantly reduced, improving system throughput. Subsequently, user input data and dialogue history data can be input into each activated expert model to generate candidate responses independently and in parallel, providing diverse and high-quality candidates for subsequent fusion and rearrangement.
[0042] Step 30: Input the user input data and dialogue history data into the selected expert models respectively to obtain multiple candidate responses.
[0043] In this embodiment, after activating multiple expert models, user input data and dialogue history data can be separately or concatenated into context information (C). t Input each expert model to ensure that the expert model obtains complete dialogue context information. In each expert model (denoted as Expert...), ... i After generating candidate responses from the input data, it can provide candidate responses (denoted as c) that meet the dialogue requirements within the corresponding domain knowledge system. i c i =Expert i (C t ), i∈A). Among them, each expert model... i (e.g., Expert) 正式 Expert 幽默 Expert 医疗 Expert 代码The expert model can be a homogeneous model fine-tuned from data from different domains, or it can be a model with a different structure and specialization in a particular style or task. This application does not impose any specific restrictions on this. The activated expert model can be executed in parallel or asynchronously. For example, parallel computing can improve system throughput, or asynchronous computing can flexibly cope with different computing resource conditions. The resulting candidate responses can cover the possibilities of responses in different styles or domains, providing diverse high-quality options and a rich candidate basis for subsequent knowledge-enhanced fusion and rearrangement, so as to select the optimal final dialogue response.
[0044] Step 40: Calculate the value score of each candidate response and output the candidate response with the highest value score as the final dialogue response.
[0045] In this embodiment, candidate responses are evaluated using a value score to select the optimal final dialogue response. The evaluated value score (denoted as S) i Specifically, the value score can be a multi-dimensional quantitative indicator of candidate responses, including fluency, relevance to the context, and degree of help to the user's needs. This comprehensive indicator reflects the quality of candidate responses and provides an objective basis for the final response selection. These quantitative indicators can be calculated using specific weighted formulas that balance factors such as factual accuracy, quality score, and routing probability. Alternatively, they can be obtained by setting up specific evaluation models, scoring candidate responses across multiple dimensions, and then weighting and summing the results. They can also be obtained by combining the output of natural language inference models to comprehensively judge the consistency between candidate responses and retrieved knowledge. The key is to comprehensively evaluate the overall quality of candidate responses and provide a reliable basis for the final selection. If a candidate response receives the highest value score, it indicates that it performs best across all evaluation angles, maximizing the balance between user needs, dialogue coherence, and factual accuracy, and can be used as the final dialogue response to be presented to the user.
[0046] Optionally, in some embodiments, after converting user input data and dialogue history data into state-aware vectors, the method further includes: querying a preset second number of knowledge fragments that match the state-aware vectors from a preset knowledge base; and incorporating the knowledge fragments into the calculation of the value score.
[0047] In this optional embodiment, knowledge fragments highly relevant to the current dialogue, retrieved from a preset knowledge base, are introduced as external knowledge supplements in the value scoring calculation to enhance the accuracy and reliability of the assessment. The preset knowledge base (denoted as D) is a structured or unstructured database storing professional domain knowledge and factual information, such as knowledge graphs and vector databases. The data in this preset knowledge base needs to ensure authoritativeness, accuracy, and timeliness, providing solid support for the evaluation of the factuality, validity, and professionalism of candidate responses. Introducing the knowledge fragments retrieved from the preset knowledge base into the value scoring calculation process further enhances the value scoring's consideration of the factual accuracy of candidate responses, ensuring that the final selected dialogue response is not only semantically coherent and meets user needs but also has reliable factual basis.
[0048] In this optional embodiment, the preset second quantity (denoted as Top-R) is a value determined by comprehensively considering factors such as knowledge relevance, retrieval efficiency, and computational resource consumption. It is used to select the knowledge fragments that best match the state-aware vector. During the knowledge fragment retrieval process, advanced retrieval techniques such as dense paragraph retrieval, vector similarity matching, and knowledge graph traversal can be used to perform approximate nearest neighbor retrieval in the preset knowledge base to query the Top-R knowledge fragments (denoted as {doc1, doc2, ..., doc...) that are most relevant to the current dialogue state. R},{doc1,doc2,…,doc R}=Retrieve(s t (D), where Retrieve is the knowledge retrieval function. This embodiment does not restrict the specific implementation of this retrieval function, as long as it returns knowledge fragments highly relevant to the current dialogue and meets the factual verification requirements. Through this knowledge retrieval method, a set of knowledge fragments closely related to the current dialogue state can be obtained. These knowledge fragments cover professional domain knowledge and factual information that may be involved in the dialogue, providing rich external knowledge support for subsequent value scoring calculations and improving the reliability of the final dialogue response.
[0049] Optionally, in some embodiments, the value score includes a routing probability factor and at least one quality assessment factor, the quality assessment factor including a factual assessment factor; before calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response, the method further includes: extracting assertive statements from the candidate responses; calculating the implication probability of each assertive statement with each knowledge fragment; and taking the representative value of each implication probability as the factual assessment factor.
[0050] In this optional embodiment, multiple evaluation factors are specifically included in the value scoring. Among them, the routing probability factor refers to the confidence of the routing network in the matching degree between the expert model and the current dialogue state. Specifically, it can be the matching probability (p) between the corresponding expert model and the current dialogue state determined in the aforementioned process of selecting the expert model. i By using the routing probability factor as one of the evaluation factors for value scoring, the rationality of the expert model selection can be reflected in the value scoring, ensuring that the final response is both in line with the dialogue scenario and professionally adaptable.
[0051] In this optional embodiment, the quality assessment factor is a set of multi-dimensional indicators for evaluating the overall quality of candidate responses. Specifically, it includes the factual assessment factor (denoted as V) calculated using the aforementioned knowledge fragments as the basis for factual verification. factuality ), and quality assessment factors such as fluency, relevance to context, and helpfulness (denoted as V). quality This application mainly introduces factual evaluation factors that introduce external knowledge fragments for factual verification. It does not impose specific restrictions on the specific implementation methods of other quality evaluation factors, as long as they can comprehensively and objectively evaluate the performance of candidate responses in all aspects and provide a reliable basis for the final selection.
[0052] In this optional embodiment, during the calculation of the factual evaluation factor, assertive statements (denoted as stmt) are first extracted from the candidate responses. kWhere k is the sequence number of the assertive statement (used to distinguish different assertions in the candidate response), the assertive statement refers to all declarative statements in the candidate response, such as assertions, descriptions, and conclusions that require factual support. These statements can be automatically extracted using specific natural language processing techniques, such as named entity recognition, syntactic analysis, or semantic role labeling, combined with pre-defined rules or models. These assertive statements represent the core viewpoints or information in the candidate response and are a crucial part of factual verification. After extracting all assertive statements, the implied probability of each statement is calculated. This implied probability refers to the probability that the content of an assertive statement is implied by a knowledge fragment, representing the factual correctness of the assertive statement and its consistency with the retrieved knowledge. This implied probability can be calculated using a Natural Language Inference (NLI) model. Each assertion can be verified individually by the NLI model, achieving atomic-level fact-checking. After processing an assertive statement, if subsequent candidate responses have low factual scores, the implied probability result can be used to backtrack and determine which specific assertive statement lacks supporting evidence, thus accurately locating factual errors. This avoids rejecting an entire candidate response due to partial assertion errors, improving the accuracy of factual assessment. After obtaining the implied probabilities of each assertive statement and each knowledge fragment, representative values (such as the average, minimum, or median) from all implied probabilities can be used as factual assessment factors to quantify the overall factual level of candidate responses, providing a factual dimension basis for value scoring. Taking the average as an example, this can be achieved using the formula... Calculate this factual assessment factor, where The summation of the implied probabilities of each assertion statement is represented by the average of the number of all assertion statements. Other parameters in this process have been introduced above and will not be repeated here.
[0053] Optionally, in some embodiments, calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response includes: weighting and summing the routing probability factor and each quality assessment factor to obtain the value score of the corresponding candidate response; comparing the value scores of each candidate response and outputting the candidate response with the highest value score as the final dialogue response.
[0054] In this optional embodiment, the routing probability factor (p) is balanced specifically by weighted summation. i Factual assessment factor V factuality Other quality assessment factors V qualityThe value score is calculated by weighting the dimensions of the multi-dimensional evaluation. Specifically, the weights of each evaluation factor can be adjusted based on considerations such as business scenario requirements, dialogue task type, and factual accuracy requirements. This allows the value score to comprehensively reflect the performance of candidate responses in terms of professional suitability, factual accuracy, and semantic quality, providing an objective quantitative basis for the final response selection. Finally, the candidate response with the highest value score is determined as the final dialogue response, which can maximize the satisfaction of user needs, ensure dialogue coherence, suppress knowledge illusions, and improve response reliability.
[0055] In this optional embodiment, it can be specifically achieved through the formula. Calculate the value score, where, Indicates the comprehensive candidate response c i and the dialogue context C t Evaluate the fluency, contextual relevance, and helpfulness of candidate responses to user needs. Indicates the comprehensive candidate response c i and various knowledge fragments {doc j The consistency between candidate responses and retrieved knowledge is evaluated to ensure factual accuracy. Here, λ1, λ2, and λ3 are adjustable hyperparameters used to balance the weights of various indicators. These can be determined through methods such as adjustment based on experimental results, business-oriented weighting, and dynamic learning. This application does not impose specific restrictions on the specific values of each hyperparameter, as long as they can be adjusted to a reasonable balance of the needs of each dimension. Furthermore, in practical applications, these hyperparameters can also be configurable, allowing users to adjust them according to specific scenario requirements. For example, in high-risk dialogue scenarios such as finance and law, λ2 and λ3 can be set with higher weights to strictly ensure factual accuracy and the professional adaptability of the expert model; in open-domain casual conversations and other scenarios with lower factual requirements, the weight of λ1 can be increased to improve the fluency and interest of the response. Through the above weighted summation calculation method, multi-dimensional evaluation indicators can be dynamically balanced, selecting the candidate response with the best overall performance, effectively improving the output quality and user experience of the dialogue system.
[0056] This embodiment, through steps 10 to 40 and their optional steps, converts user input data and dialogue history data into state-aware vectors that integrate immediate semantics and long-range memory. This accurately captures the semantic context of the dialogue and the user's core intent, enhancing the coherent understanding and management of complex multi-turn dialogues. By dynamically selecting matching Top-K expert models from a pre-set expert model pool, sparse activation is achieved, avoiding resource redundancy in traditional single models, significantly reducing computational costs and inference latency, while integrating the professional advantages of multiple experts. The parallel generation of candidate responses by activated expert models provides diverse and professional candidate responses, laying a high-quality foundation for subsequent screening. By introducing relevant knowledge fragments from a pre-set knowledge base, it can provide... Candidate responses provide external factual evidence, enhancing factual verification capabilities. By extracting assertive statements and calculating their implied probabilities with knowledge fragments, atomic-level fact-checking can be achieved, accurately locating factual errors and effectively suppressing knowledge illusions. A value score is calculated by weighted summation based on routing probability factors and multi-dimensional quality assessment factors, comprehensively evaluating the professional suitability, factual accuracy, and semantic quality of candidate responses. By selecting the candidate response with the highest value score as the final output, optimal output response quality is ensured, maximizing user satisfaction and improving dialogue reliability. A modular and discretized decision-making process design enhances system interpretability and controllability, facilitating the tracking of decision-making basis and debugging optimization, meeting the reliability requirements of high-risk application scenarios. Therefore, the implementation of this invention effectively solves the problems of insufficient coherence understanding, resource redundancy, difficulty in guaranteeing factual accuracy, and lack of interpretability in existing large-scale model dialogue systems in complex multi-turn dialogue scenarios. It significantly improves the output quality and user experience of the dialogue system, meets the stringent reliability requirements of high-risk application scenarios, and promotes the widespread application and in-depth development of large-scale model dialogue systems in more fields.
[0057] See Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the large model dialogue control system 50 provided in this application. The large model dialogue control system 50 includes: a dialogue state awareness module 51, used to convert user input data and dialogue history data into state awareness vectors; a multi-expert routing module 52, used to select multiple expert models from a preset expert model pool that match the state awareness vectors; an expert model pool module 53, including multiple expert models, used to input user input data and dialogue history data into each selected expert model respectively to obtain multiple candidate responses; and a knowledge-enhanced fusion and rearrangement module 54, used to calculate the value score of each candidate response and output the candidate response with the highest value score as the final dialogue response.
[0058] For that Figure 2 For more details, please refer to the large-scale dialogue control system 50. Figure 3 .
[0059] Optionally, in some embodiments, the state-aware vector includes a dialogue state vector; the dialogue state-aware module 51 further includes a state encoder, which is used to perform vector encoding on user input data and dialogue history data to obtain the dialogue state vector.
[0060] Optionally, in some embodiments, the state-aware vector further includes a memory pool aggregation vector; the dialogue state-aware module 51 also includes a dialogue state memory pool, and the dialogue state-aware module 51 is further configured to: convert user input data and dialogue history data into state-aware vectors, and further include: extracting description objects and related information of description objects from user input data and dialogue history data; vectorizing the mapping relationship of each description object and related information and updating it to the dialogue state memory pool; and performing weighted aggregation on multiple vectors in the dialogue state memory pool to obtain a memory pool aggregation vector.
[0061] Optionally, in some embodiments, the multi-expert routing module 52 includes a routing network; the routing network is used to: calculate the matching probability between the state-aware vector and each expert model in a preset expert model pool; and select and activate a preset first number of expert models in the preset expert model pool that have the highest matching probability with the state-aware vector.
[0062] Optionally, in some embodiments, the large model dialogue control system 50 further includes a real-time knowledge retrieval module 55, which is used to: query a preset second number of knowledge fragments that match the state perception vector from a preset knowledge base; and incorporate the knowledge fragments into the calculation of value scores.
[0063] Optionally, in some embodiments, the value score includes a routing probability factor and at least one quality assessment factor, the quality assessment factor including a factual assessment factor; the knowledge-enhanced fusion and rearrangement module 54 includes a value assessment model, which is used to: extract assertive statements from candidate responses; calculate the implied probability of each assertive statement and each knowledge fragment; and take the representative value of each implied probability as the factual assessment factor.
[0064] Optionally, in some embodiments, the value assessment model in the knowledge-enhanced fusion and rearrangement module 54 is also used to: perform a weighted summation of the routing probability factor and each quality assessment factor to obtain the value score of the corresponding candidate response; compare the value scores of each candidate response, and output the candidate response with the highest value score as the final dialogue response.
[0065] Since the embodiments of the system described above correspond to the embodiments of the methods described above, please refer to the above method embodiments for the introduction of the large model dialogue control system 50 provided by the embodiments of the present invention. The embodiments of the present invention will not be described again here, but they have the same beneficial effects as the above large model dialogue control methods.
[0066] See Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the storage medium provided in this application.
[0067] The storage medium 60 stores program data 61, which, when executed by the processor, implements, as follows: Figure 1 The large-scale dialogue control method described.
[0068] The program data 61 is stored in a storage medium 60 and includes several instructions for causing a network device (such as a router, personal computer, or server) or processor to execute all or part of the steps of the methods of the various embodiments of this application.
[0069] Optionally, the storage medium 60 can be any medium capable of storing program data 61, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), disk, or optical disc.
[0070] See Figure 5 , Figure 5 This is a schematic diagram of the structure of an embodiment of the computer device provided in this application.
[0071] The computer device 70 includes a processor 72 and a memory 71 interconnected. The memory 71 stores a computer program, and when the processor 72 executes the computer program, it implements, for example, Figure 1 The large-scale dialogue control method described herein. The memory 71 may include the storage medium 60, or it may be another separately developed memory.
[0072] Unlike existing technologies, this application discloses a large-scale dialogue control method, system, storage medium, and computer device. By converting user input data and dialogue history data into state-aware vectors, it can accurately capture the contextual semantics of the dialogue and the user's core intent, enhancing the coherence understanding and management of complex multi-turn dialogues, accurately understanding the evolution of user intent, and providing a reliable decision-making basis for subsequent model selection. Simultaneously, based on this vector, it dynamically and sparsely selects matching expert models from a pre-set expert model pool to generate candidate responses, integrating the professional advantages of different expert models, avoiding the resource redundancy of activating all parameters in a traditional single model, significantly reducing computational costs and inference latency, achieving efficient computation and resource utilization. Furthermore, since each expert model in the pre-set expert model pool can adapt to different styles or domain requirements, the candidate responses generated by the expert models also possess flexible and natural style and domain adaptability. Finally, by selecting the optimal response through value scoring for output, it can achieve post-event verification of the candidate response quality, ensuring the optimal quality of the output response, effectively improving the accuracy and reliability of dialogue responses, and effectively suppressing factual errors such as "knowledge illusions." Furthermore, because this method adopts a modular and discretized decision-making process, the dialogue control and generation process is transparent, which can meet the requirements of interpretability and controllability in high-risk application scenarios, facilitate the tracking of decision-making basis, and help to debug and optimize the model, thereby further improving the reliability of large model dialogue responses.
[0073] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments, storage medium embodiments, and device embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0074] This application can be used in a wide range of general-purpose or special-purpose computing system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed methods, systems, storage media, and computer devices can be implemented in other ways. For example, the embodiments of the large-scale dialogue control system described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0076] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A large-scale dialogue control method, characterized in that, include: Convert user input data and dialogue history data into state-aware vectors; Select multiple expert models that match the state-aware vector from a preset pool of expert models; The user input data and the dialogue history data are respectively input into the selected expert models to obtain multiple candidate responses; Calculate the value score for each candidate response, and output the candidate response with the highest value score as the final dialogue response.
2. The large-scale dialogue control method according to claim 1, characterized in that, The state-aware vector includes the dialogue state vector; The process of converting user input data and dialogue history data into state-aware vectors includes: The user input data and the dialogue history data are vector-encoded to obtain the dialogue state vector.
3. The large-scale dialogue control method according to claim 2, characterized in that, The state-aware vector also includes a memory pool aggregation vector; The process of converting user input data and dialogue history data into state-aware vectors also includes: Extract the description objects and their associated information from the user input data and the dialogue history data; The mapping relationship between each described object and the associated information is vectorized and updated to the dialogue state memory pool; The multiple vectors in the dialogue state memory pool are weighted and aggregated to obtain the memory pool aggregate vector.
4. The large-scale dialogue control method according to claim 1, characterized in that, The step of selecting multiple expert models from a preset expert model pool that match the state-aware vector includes: Calculate the matching probability between the state-aware vector and each of the expert models in the preset expert model pool; Select and activate a preset first number of expert models from the preset expert model pool that have the highest matching probability with the state-aware vector.
5. The large-model dialogue control method according to claim 1, characterized in that, After converting user input data and dialogue history data into state-aware vectors, the process further includes: Query a preset second number of knowledge fragments that match the state perception vector from a preset knowledge base; The knowledge fragments are incorporated into the calculation of the value score.
6. The large-model dialogue control method according to claim 5, characterized in that, The value score includes a route probability factor and at least one quality assessment factor, the quality assessment factor including a factual assessment factor; Before calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response, the method further includes: Extract assertive statements from the candidate responses; Calculate the implication probability of each assertive statement and each stated knowledge fragment; The representative value among the implied probabilities is taken as the factual evaluation factor.
7. The large-model dialogue control method according to claim 6, characterized in that, The step of calculating the value score of each candidate response and outputting the candidate response with the highest value score as the final dialogue response includes: The value score corresponding to the candidate response is obtained by weighted summation of the routing probability factor and each of the quality assessment factors. The value scores of each candidate response are compared, and the candidate response with the highest value score is output as the final dialogue response.
8. A large-scale dialogue control system, characterized in that, include: The dialogue state awareness module is used to convert user input data and dialogue history data into state awareness vectors; A multi-expert routing module is used to select multiple expert models that match the state-aware vector from a preset pool of expert models. The expert model pool module is used to input the user input data and the dialogue history data into the selected expert models respectively to obtain multiple candidate responses; The knowledge-enhanced fusion and rearrangement module is used to calculate the value score of each candidate response and output the candidate response with the highest value score as the final dialogue response.
9. A storage medium storing program data thereon, characterized in that, When the program data is executed by the processor, it implements the steps of the large model dialogue control method as described in any one of claims 1 to 7.
10. A computer device, characterized in that, It includes an interconnected processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the steps of the large model dialogue control method as described in any one of claims 1 to 7.