A controllable supervised simulated conversation method and system based on large language model
By implementing a controllable supervised simulated conversation method on a large language model, using small parameter supervision model and retrieval enhancement generation mechanism, the technical challenges of dialogue model behavior control in complex conversation scenarios are solved, the authenticity and accuracy of dialogue are improved, and effective guidance is provided to the talkers.
Patent Information
- Application Number
- CN202411719035.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In complex conversation scenarios, how to effectively control the behavior of dialogue models, especially through the evolution of emotions and logic, to simulate the thinking process of real characters, remains a technical challenge.
Through a controllable supervised simulated conversation method based on large language models, the small parameter supervision model and retrieval enhancement generation mechanism are used to supervise and adjust the simulated conversation model to ensure that the answer statements output meet the emotional evolution laws and preset constraints.
It realizes effective control of dialogue model behavior in complex conversation scenarios, simulates the real character thinking process, improves the authenticity and accuracy of the conversation, and can provide effective conversation guidance for the talkers and improve their business capabilities.
Smart Images

Figure CN119202211B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of artificial intelligence and natural language processing, and in particular to a controllable supervised conversation method, system, computer device and computer-readable storage medium based on a large language model. Background Art
[0002] Chatbot, also known as a chatbot, is an artificial intelligence application based on computer programming. It can simulate human conversations, understand the text or voice information input by the user, and generate corresponding answers to complete the conversation interaction.
[0003] In terms of conversational robot technology, traditional rule- and template-based systems face many limitations, especially when dealing with complex and changing conversation scenarios, with low intelligence and poor interactive performance. However, by configuring large language models in scenarios, they can be adapted to specific professional conversation scenarios, such as medical consultation, legal Q&A, customer service, etc.
[0004] However, in complex conversation scenarios, how to effectively control the behavior of the dialogue model, especially to simulate the thinking process of real people through the evolution of emotions and logic, and the comparison of objective facts, remains a technical challenge. Summary of the invention
[0005] The embodiments of the present application provide a controllable supervised simulated conversation method, system, computer device and computer-readable storage medium based on a large language model, so as to at least solve the problem in the related art that the behavior of the dialogue model cannot be effectively controlled in a specific dialogue scenario.
[0006] In a first aspect, an embodiment of the present application provides a controllable supervised simulated conversation method based on a large language model, the method comprising:
[0007] Fine-tune the large language model based on the training set to obtain a simulated dialogue model;
[0008] The simulated dialogue model is supervised by a small parameter supervision model according to preset constraints and multi-dimensional annotations added to the training set, and the simulated dialogue model is used based on the retrieval enhancement results to output a reply sentence that imitates the conversation object and conforms to the law of emotional evolution.
[0009] Wherein, the search enhancement result is obtained by enhancing the query sentence of the conversation partner through the search enhancement mechanism;
[0010] The small parameter supervision model uses multiple agent intelligent bodies to supervise the simulated dialogue model from the perspective of whether the answer sentence contains specific annotations, whether the association between annotations is logical, and whether it violates preset constraints;
[0011] After receiving the abnormal feedback, the small parameter model sends a re-answer feedback to instruct the simulated dialogue model to output a revised answer statement according to N rounds of context information adjacent to the current dialogue.
[0012] In some embodiments, the small parameter model includes a first agent, a second agent, and a third agent, and supervising the simulated dialogue model according to preset constraints and the annotations through the small parameter supervision model includes:
[0013] By means of the first Agent, determining whether the annotation of any one of the answer statements includes the emotion annotation, the action annotation and the attitude annotation, and if not, outputting abnormal feedback;
[0014] By means of the second Agent, it is judged whether the association between the emotion annotation, the action annotation and the attitude annotation in any of the answer sentences is logical, and if not, an abnormal feedback is output;
[0015] Through the third Agent, based on the prompt words, the simulated dialogue model is guided to generate the answer statement under preset constraints, and it is determined whether the simulated dialogue model outputs an answer statement that violates the preset constraints. If so, abnormal feedback is output, wherein the constraints include: role constraints of the simulated dialogue model, case background information confidentiality constraints, and character relationship constraints.
[0016] In some embodiments, supervising the simulated dialogue model according to preset constraints and the annotations through a small parameter supervision model further includes:
[0017] In case of receiving the abnormal feedback, sending a re-answer feedback to the simulated dialogue model,
[0018] to instruct the simulated dialogue model to obtain N rounds of context dialogue information adjacent to the current dialogue statement, and output a modified answer statement according to the context dialogue information;
[0019] The first Agent agent, the second Agent agent and the third Agent agent are respectively used to determine whether the modified answer statement is normal. If so, an output signal is sent to the simulated dialogue model to instruct the simulated dialogue model to output the modified answer statement to the user receiving end.
[0020] In some embodiments, converting the query statement into a search enhancement result through a search enhancement generation mechanism includes:
[0021] Converting the query statement into a query vector, and selecting a knowledge segment related to the query vector in the preset knowledge base, wherein the background knowledge data related to the conversation scene is converted into a numerical vector, and the preset knowledge base is constructed according to a plurality of numerical vectors;
[0022] Through prompt engineering, the knowledge fragment is added to the query statement to obtain retrieval enhancement results.
[0023] In some of the embodiments, the method further comprises: obtaining key accumulated data of the current conversation through the small parameter supervision model, and performing a multi-dimensional weighted operation based on the key accumulated data to determine whether a trigger condition is met;
[0024] If the trigger condition is met, an emotion reversal instruction is sent to the simulated dialogue model to instruct the simulated dialogue model to switch model parameters and knowledge base to generate a reversed answer statement.
[0025] The key accumulated data include: the accumulated round number, the number of preset clue word hits and the number of bad word matches, among which:
[0026] Obtaining the key accumulated data of the current conversation includes: obtaining the accumulated number of rounds of the current conversation content and the number of hits of the historical conversation content relative to the preset clue words through the third Agent intelligent body,
[0027] and obtaining the number of matches of bad words in the historical conversation content, and obtaining the number of risks of risk logic problems in the historical conversation content;
[0028] Performing a multi-dimensional weighted operation based on the key accumulated data to determine whether the trigger condition is met includes: performing a multi-dimensional weighted operation based on the accumulated round number, the hit number, the match number, and the risk number, and determining whether the trigger condition is met based on the result of the multi-dimensional weighted operation,
[0029] If so, sending an emotion reversal instruction to the simulated dialogue model to instruct the simulated dialogue model to switch model parameters and switch the currently used knowledge base to the reversed knowledge base;
[0030] The inverted knowledge base is used to generate an updated retrieval enhancement result corresponding to the query statement, and the updated retrieval enhancement result is input into the simulated dialogue model to instruct the simulated dialogue model to generate an answer statement after emotion inversion.
[0031] In some embodiments, fine-tuning the large language model based on the training set to obtain the simulated dialogue model includes:
[0032] In the training set, the repeated character background information in the question part is deleted, and the constraint information used to constrain the model to generate the answer sentence is deleted to construct a valid training information set;
[0033] Using the effective training information set as a parameter for iteratively calculating a loss function, fine-tuning the large language model to obtain the simulated dialogue model, wherein the loss function is used to determine the gap between the answer statement output by the simulated dialogue model and the real answer statement;
[0034] The loss function is expressed by the following formula:
[0035]
[0036] in, represents the problem part of the current training round, represents the answer part of the current training round, Xt represents the tth character, and p(x) represents the probability of xt being generated when (x1 to xt-1) exists;
[0037] L is the loss function, and T is the character background information and the constraint information.
[0038] In a second aspect, an embodiment of the present application provides a controllable supervised simulated conversation system based on a large language model, the system comprising: a model training module and a supervision module, wherein:
[0039] The model training module is used to fine-tune the large language model based on the training set to obtain a simulated dialogue model;
[0040] The supervision module is used to supervise the simulated dialogue model through a small parameter supervision model according to preset constraints and multi-dimensional annotations added to the training set, and output a reply sentence that imitates the conversation object and conforms to the law of emotional evolution based on the retrieval enhancement result and using the simulated dialogue model.
[0041] Wherein, the search enhancement result is obtained by enhancing the query sentence of the conversation partner through the search enhancement mechanism;
[0042] The small parameter supervision model uses multiple agent intelligent bodies to supervise the simulated dialogue model from the perspective of whether the answer sentence contains specific annotations, whether the association between annotations is logical, and whether it violates preset constraints;
[0043] After receiving the abnormal feedback, the small parameter model sends a re-answer feedback to instruct the simulated dialogue model to output a revised answer statement according to N rounds of context information adjacent to the current dialogue.
[0044] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect above when executing the computer program.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect above.
[0046] Compared with the related art, the controllable supervised simulated conversation method based on a large language model provided in the embodiment of the present application, through multi-dimensional annotation and emotion injection technology of the conversation corpus data, uses a small parameter supervision model to evaluate the logic and emotion of each round of conversation. Once a contradiction is detected in the content of the conversation, or its emotional response is inconsistent with expectations, the response content of the large model will be adjusted. This dynamic feedback mechanism can simulate the emotional turning points in the conversation, so that the conversation is more in line with the needs of the real scene; and when certain trigger conditions are met, the model parameters are changed and the knowledge base is switched to adapt to the emotional changes of the role being talked about, so that the large language model can show different levels of emotional changes, so as to ensure that the trained simulated conversation model can accurately simulate the entire conversation process in the actual application process, and ensure the authenticity of the conversation. It can provide effective conversation guidance for the conversation personnel and help them improve their business capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0048] Figure 1 is a flow chart of a controllable supervised simulated conversation method based on a large language model according to an embodiment of the present application;
[0049] Figure 2 is a schematic diagram of another controllable supervised simulated conversation method based on a large language model according to an embodiment of the present application;
[0050] Figure 3 is a schematic diagram of a knowledge base according to an embodiment of the present application;
[0051] Figure 4 is a schematic diagram of a first Agent provided in an embodiment of the present application;
[0052] Figure 5 is a schematic diagram of a second Agent provided in an embodiment of the present application;
[0053] Figure 6is a schematic diagram of a third Agent intelligent body provided in an embodiment of the present application;
[0054] Figure 7 is a structural block diagram of a controllable supervised simulated conversation system based on a large language model according to an embodiment of the present application;
[0055] Figure 8 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0057] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0058] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0059] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0060] In recent years, with the advancement of deep learning and pre-training models, dialogue systems based on large language models (such as GPT, BERT, T5, etc.) have achieved remarkable results in many fields. Large language models are trained with massive corpus and have powerful natural language generation capabilities. They can not only answer simple questions, but also conduct contextually coherent dialogues, and have demonstrated unique application potential in many professional fields.
[0061] In terms of conversational robot technology, traditional rule-based and template-based systems face many limitations, especially when dealing with complex and changeable conversation scenarios, with low intelligence and poor interactive performance. In some scenarios where the depth of the conversation needs to be gradually advanced, the reaction and emotional fluctuations of the conversation partner will gradually change as the conversation deepens, and traditional conversation systems find it difficult to simulate complex logical thinking and psychological games. However, large language models are gradually breaking through these bottlenecks due to their powerful language understanding and generation capabilities, especially in simulating role-playing, emotional guidance and multi-round conversations, showing obvious advantages.
[0062] Current research and applications have shown that by fine-tuning large language models in scenarios, they can be adapted to general conversation scenarios, such as medical consultation, legal Q&A, customer service, etc. However, in complex and difficult scenarios, how to effectively control the behavior of the model, especially to simulate the thinking process of real people through the evolution of emotions and logic, remains a technical challenge.
[0063] In view of this, the present application scheme uses the powerful language generation and understanding capabilities of the large language model to develop an intelligent conversation system that can simulate the conversation process in complex scenarios. The system can not only simulate the logical reasoning and psychological state changes of the person being interviewed during the conversation, but also gradually adjust its behavior according to the way the interviewer asks questions, from the initial resistance and lying stage to the final emotional reversal and real communication or continued denial. Through this simulated scenario, the interviewer can exercise his conversation skills and case breakthrough ability in a safe and virtual environment.
[0064] Figure 1 is a flow chart of a controllable supervised simulated conversation method based on a large language model according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:
[0065] S101, fine-tune the large language model based on the training set to obtain a simulated dialogue model;
[0066] It should be noted that before fine-tuning the training, it is necessary to collect relevant data to construct a training set and add multi-dimensional annotations to the data in the training set. In this embodiment, the emotions of the person being talked to in this scenario show a progressive evolution of simulating human beings;
[0067] The scenario features are various characteristic elements that can reflect the essential characteristics of the scenario and affect the conversation process and the performance of the participants. These characteristic elements include but are not limited to the nature of the topic of the conversation, the role relationship between the two parties, the standard procedures followed, the emotional changes, actions and expressions of the person being talked to, etc. Specifically, the multi-dimensional annotations can at least include attitude annotations, tone annotations and action annotations.
[0068] In addition, since the labeled training data has clearer features and structures, the model can better learn the emotional evolution, logical self-consistency and coherence of multiple rounds of dialogue during the model training process; the labeling provides a basis for the injection of emotions in model training. By learning text data with different emotional labels, the model can more accurately grasp the emotional expression and show multi-level emotional changes in simulated dialogues, from the resistance period to the emotional fluctuation period to the emotional collapse period, making its simulation more in line with the emotional evolution law in real conversations.
[0069] It should be noted that after obtaining the corpus data in the conversation scenario, the corpus data needs to be preprocessed to obtain optimized corpus data to provide a more reliable and effective data basis for subsequent language model training, analysis and other tasks.
[0070] Furthermore, after the annotation is completed, the optimized corpus data is formatted to obtain multiple question-answer pairs, where the question-answer pair includes a question part and an answer part. The question part includes role background information, answer constraints and historical dialogue records, and the answer part is the answer content of the role being interviewed to the current question part. Multiple question-answer pairs with temporal associations correspond to the overall emotional evolution process during the conversation and constitute the training set required for training the model.
[0071] Through the above steps, the optimized corpus data is processed into question-answer pairs containing detailed information. Since the question part covers a variety of key information, the system can flexibly adjust the generation of answers based on different background descriptions, answer constraints and historical conversation records, so that the dialogue model can more accurately simulate the real reactions of the characters being talked to in different scenarios. In complex conversation scenarios, the attitude, tone and actions of the person being talked to can be accurately analyzed from all aspects based on the rich information in these question-answer pairs, making the subsequent simulation training process more accurate and the operation process more realistic.
[0072] After the corpus data is prepared, the specific fine-tuning training process includes the following steps:
[0073] S1, delete the background information in the question content, and delete the constraint information used to constrain the model to generate the answer in the answer content, and build a valid training information set based on the question part with the background information deleted and the answer part with the constraint information deleted;
[0074] In this application, in order to ensure that the model learns the most relevant information and improve the efficiency of model training, the loss of questions and answers is included in the model parameter iteration in this training, and a large amount of repeated character background information and constraint information on the model's answers are not included in the parameter iteration. The advantage of this is that the model can fully learn the key information in the conversation, including the semantic relationship between questions and answers, language structure, and emotional expression.
[0075] By calculating the loss of questions and answers, the model can better understand how to generate accurate, reasonable, emotional and logical answers. At the same time, a large amount of repeated character background information and constraint information on the model's answers are not included in parameter iteration. This effectively avoids the model's over-learning of these repeated information and reduces the risk of overfitting.
[0076] The specific implementation is as follows: the part for calculating the loss function is defined as X, where X includes the question and the answer but does not include the character background information in the question and the constraint information on the model's answer, and the character background information and the constraint information on the model's answer are represented by T.
[0077] The loss function is expressed by the following formula:
[0078]
[0079] in, represents the problem part of the current training round, represents the answer part of the current training round, Xt represents the tth character, and p(x) represents the probability of xt being generated when (x1 to xt-1) exists;
[0080] L is the loss function, It is expressed in natural logarithm form, given the first t-1 characters. The logarithm of the probability of elements, T is the role background information and the constraint information, is an indicator function, if Not , then the value is 1, otherwise it is 0. This shows the role background information and the constraint information of the model's answer.
[0081] S2, based on the effective training information set, iteratively calculates the parameters of the loss function, and fine-tunes the large language model to obtain a simulated dialogue model, wherein the loss function is used to determine the gap between the response content output by the large language model and the actual response content.
[0082] The fine-tuning method of the present application redefines the loss function, and defines the part for calculating the loss function as X, where X includes the question and the answer but does not include the background information of the characters in the question and the constraint information on the model question and answer. In addition, the annotation information in the above step S101 is combined to provide emotion injection, so that the model can better learn the emotion evolution, logical consistency and coherence of multiple rounds of dialogue in the dialogue, and the model can grasp the emotion expression more accurately.
[0083] In addition, the new loss function excludes character background information and model answer constraint information (represented by T) from participating in parameter iteration, effectively reducing repeated learning and the risk of overfitting, allowing the model to focus more on learning the core content of questions and answers, thereby improving the grasp of conversation emotion evolution, logical autonomy, and coherence of multiple rounds of conversations.
[0084] In addition, in the present application, in an exemplary embodiment, in any round of fine-tuning training, the large language model generates simulated response content including the following specific steps:
[0085] S1, through the input layer, performs word embedding processing on the effective training information set, converting the effective training information set from text to a high-dimensional vector;
[0086] The text data of questions and answers enters the input layer of the model. In this layer, the text is converted into numerical representations suitable for model processing, such as converting each word into a high-dimensional vector through word embedding technology.
[0087] S2, through the middle layer, uses linear transformation and nonlinear activation function to perform multi-level iterative feature abstraction and extraction based on high-dimensional vectors, learns the sentiment transformation and logical association in high-dimensional vectors, and obtains prediction features;
[0088] The word vector output by the previous layer enters the middle layer (which may be multiple hidden layers). The middle layer gradually abstracts and extracts the input features through a series of linear transformations and nonlinear activation functions.
[0089] In each layer, the model learns different levels of semantic information and logical relationships. For example, the lower layers may learn lexical and syntactic features, and the higher layers may learn more abstract semantic concepts and contextual relationships. The middle layer will continue to receive feature representations from the previous layer, perform specific calculations and processing, and then output new feature representations to the next layer.
[0090] S3, through the output layer, predicts the expected probability of outputting a certain reply content under the current conditions based on the prediction features.
[0091] The middle layer gradually abstracts and extracts the word vectors of the input questions and answers, and learns semantic information and logical relationships at different levels. This process enables the model to have a deeper understanding and representation of questions and answers, and the calculation of the loss function needs to rely on the model's understanding and representation of questions and answers.
[0092] By calculating the loss function, the model can evaluate the accuracy of its predictions for questions and answers under the current parameters. The loss function value reflects the accuracy of the model's predictions for questions and answers. This loss value is back-propagated to each layer of the model, including the middle layer, through an optimization algorithm (such as gradient descent). During the back-propagation process, the parameters of the middle layer are adjusted according to the gradient of the loss function, so that the model can better learn the information in the questions and answers and reduce the prediction error. By continuously adjusting the parameters of the middle layer, the model can gradually improve its ability to handle questions and answers, thereby gradually reducing the loss function value.
[0093] Repeat the above process and iterate the training until the loss function converges or the preset number of training times is reached, and the simulated dialogue model with fine-tuning training is obtained. After testing, it is found that the overall accuracy of the model for emotional evolution, logical self-consistency and coherence of multiple rounds of dialogue in the above method is improved by 9.65%, and the training time is saved by 5.72% compared with the mode of incorporating all questions and answers into the model parameter iteration.
[0094] S102, through a small parameter supervision model, the simulated dialogue model is supervised according to preset constraints and multi-dimensional annotations added in the training set, and the simulated dialogue model is used based on the retrieval enhancement results to output a response sentence that imitates the conversation object and conforms to the law of emotional evolution.
[0095] It should be noted that the simulation model obtained after fine-tuning and applicable to some vertical fields can achieve the effect of emotional simulation dialogue to a certain extent, but it still faces the following problems in the process of dialogue simulation in specific scenarios:
[0096] Knowledge limitations: Since the model's own knowledge is entirely derived from its training data, it lacks real-time and non-public data capabilities; once the model is trained, what it knows is basically fixed within the scope of the information it is exposed to during training. For new situations and new information that appear after training, it is difficult for the model to know and respond accurately;
[0097] Hallucination problem: There is a certain probability that large models will produce hallucinations, that is, generate content that is inconsistent with the facts. This hallucination problem is particularly prominent when facing a scenario in which the model has no knowledge or is not good at a certain aspect;
[0098] Data security: When users upload private domain data to a third-party platform for model training, there is a risk of data leakage. Especially in conversation scenarios, private domain data often contains sensitive content such as personal privacy information. Once leaked, it will not only cause serious economic losses or privacy violations to users.
[0099] In view of the above problems, the embodiments of the present application are improved in the following ways, specifically:
[0100] The Retrieval Augmented Generation (RAG) mechanism is adopted. When the simulated dialogue model generates dialogues or answers questions, relevant information is first retrieved from the preset knowledge base, and then the retrieved information is used to guide the generation of text, thereby improving the quality and accuracy of the prediction.
[0101] It can be understood that the background knowledge of a conversation is first stored as objective facts in a specific vector database. In the knowledge construction stage, text segmentation and cleaning, text vectorization, and finally storage in the vector database are required. This process converts the data into large vectors in the form of numerical representation, and then stores them in the vector database for subsequent document retrieval. The data can be unstructured (usually text), semi-structured, or structured (such as knowledge graphs).
[0102] Figure 2 is a schematic diagram of another controllable supervised simulated conversation method based on a large language model according to an embodiment of the present application, such as Figure 2 As shown in the figure, when the user and the model have a conversation, the query sentence is first converted into a query vector, and the knowledge fragments related to the query vector are selected from the preset knowledge base. Through prompt engineering, the knowledge fragments are combined with the original query sentence and embedded into the preset prompt template to obtain the retrieval enhancement result. After retrieval enhancement, it is input into the trained large language model (LLM) to generate the required answer sentence output.
[0103] Figure 3 is a schematic diagram of a knowledge base according to an embodiment of the present application, with reference to Figure 3 From the content shown, it can be understood that through the above-mentioned retrieval enhancement mechanism, the latest information can be dynamically obtained from the external knowledge base to make the generated answers more timely. In addition, the introduction of external data to enhance the accuracy of the answers overcomes the problem of hallucinations in the language model. At the same time, these external knowledge is not directly exposed to the public network environment to participate in model training. Therefore, it not only improves the transparency and credibility of the answers, allowing users to verify the accuracy of the answers, but also improves data security.
[0104] In addition, according to different application scenarios and requirements, the appropriate knowledge base and retrieval method can be selected to customize and improve the simulated dialogue model. If no relevant context is retrieved, the question needs to be directly passed to the trained large language model for answer output.
[0105] Furthermore, in this embodiment, a small parameter supervision model is also used to supervise and correct the output content during the actual simulation dialogue process of the model; Figure 4 , Figure 5 and Figure 6 They are schematic diagrams of the first Agent, the second Agent, and the third Agent provided in the embodiments of the present application;
[0106] like Figure 4 , Figure 5 and Figure 6 As shown in the figure, the small parameter supervision model includes a first agent for format supervision, a second agent for emotion supervision, and a third agent for content supervision. The final effect of the output is supervised and dynamically adjusted through multiple agents. Specifically:
[0107] Through the first agent, determine whether the annotation of any answer sentence contains emotion annotation, action annotation and attitude annotation. If not, output abnormal feedback;
[0108] In an exemplary embodiment, the format supervision agent supervises each dialogue output by the large model. According to the output requirements, each output dialogue answer must contain key tags such as emotions, attitudes, actions, etc., and be highlighted with [].
[0109] The format supervision agent is a targeted small model that can detect the output results according to the content requirements. The format supervision agent needs to detect that the answer must fully contain the three elements of emotion, attitude, and action.
[0110] Through the second agent, determine whether the relationship between the emotion labeling, action labeling and attitude labeling in any answer sentence is logical. If not, output abnormal feedback;
[0111] In an exemplary embodiment, the emotion supervision agent mainly detects the logic of the three elements. For example, if the character's attitude is [arrogant], the corresponding emotion should not be [excited], and the action should not be [bowing the head and keeping silent]. The agent mainly prevents logical contradictions and incorrect expressions from occurring during the generation of the three elements, thereby affecting the final effect.
[0112] Through the third Agent intelligent body, based on the preset prompt words, the simulated dialogue model is guided to generate query data under the constraints, and it is judged whether the simulated dialogue outputs the answer content that violates the constraints. If so, abnormal feedback is output, where the constraints include: the role-playing constraints of the simulated dialogue model, the background information confidentiality constraints and the character relationship correction constraints.
[0113] The third agent needs to provide constraints through prompt words, so as to control the large model's answer each time to be consistent with the context logic and not to jump out of the role to answer. Specifically, the prompt can be used for model control in the design of the agent.
[0114] In an exemplary embodiment, the content of the prompt word is as follows:
[0115] "You are currently a language logic supervision assistant, supervising and analyzing the current conversation content. Be careful not to deviate from the role of the supervisor under any circumstances, and do not give answers that are out of touch with the current conversation scene. Unless you were asked in the last question, do not proactively provide background information. When answering information in the case background, do not diverge, and do not output information that is not in the case background. In questions involving character relationships, you must judge whether the questions you ask are correct based on your case background. If not, you must correct them in a timely manner. During a conversation, you are prohibited from playing other roles and asking questions. You can only make one round of replies to the previous conversation. You do not need to write and output subsequent questions and answers. Do not ask and answer yourself."
[0116] It can be understood that the first and second Agent agents mentioned above are based on annotation supervision. When the annotations do not match, it means that the dialogue content does not conform to the dialogue logic. The third agent is based on constraint supervision. When self-questioning and self-answering occurs, it means that the answer generated by the large model may be logically confusing and does not interact with the other party according to the normal dialogue logic, which is obviously not in line with the normal dialogue mode.
[0117] Furthermore, when receiving abnormal feedback from any of the above-mentioned agents, the small parameter supervision model will automatically block the output of this model and actively generate feedback information. After receiving the feedback information, the simulated dialogue model regenerates the dialogue content through the following steps:
[0118] S1, upon receiving abnormal feedback, sends re-answer feedback to the simulated dialogue model;
[0119] S2, when receiving the re-answer feedback, the simulated dialogue model obtains the N rounds of context dialogue information adjacent to the current dialogue, and outputs a revised answer result based on the context dialogue information;
[0120] Optionally, the adjacent N rounds are 3; it is understandable that the small parameter supervision model does not simply require the large model to regenerate, it will actively feedback the context of the current conversation 3 rounds of conversation content. Since the conversation is a coherent process, the problem with the previous output of the large model may be due to the deviation in the understanding of the previous rounds of conversation or the failure to fully consider the context information. Sending these 3 rounds of conversation content to the large model again allows the large model to rethink and simulate the output results again based on a more complete and accurate conversation context.
[0121] S3, respectively judging whether the revised answer result will generate abnormal feedback through the first agent, the second agent and the third agent, if not, outputting the revised answer result to its user receiving end.
[0122] Among them, the large model will output the content again after receiving the contextual information fed back by the supervisory model. The result of this output still needs to be tested by the supervisory model. Only when the supervisory model passes the test will the answer be output to the user as the final valid answer. This repeated testing and correction mechanism ensures that the answer finally presented to the user not only meets the requirements in terms of language expression, logic, etc., but also can closely fit the dialogue scene and role setting, providing users with a high-quality and expected dialogue experience.
[0123] Through the above steps, a mechanism of coordinating a large model with a small-parameter content supervision model is adopted. Through strict monitoring of the output content, timely feedback and repeated corrections, the accuracy, rationality and fit of the dialogue output of the large model with roles and scenarios in specific scenarios are effectively improved.
[0124] In addition, during the simulated conversation, as the conversation content deepens, the role emotions and case background need to be reversed, for example: in the psychological counseling scenario of autistic patients, from the resistance period of the conversation to the emotional fluctuation period, and then to the emotional breakdown period; in this embodiment, as the emotional evolution of the simulated character is simulated, by setting specific trigger conditions, different knowledge bases are switched, and then content output suitable for different emotional stages is achieved, and the answer content of the conversation robot is effectively managed, so as to achieve the effect of knowledge content switching and emotional reversal, specifically:
[0125] A trigger condition is set in the supervision model. The trigger condition is an algorithm based on multi-dimensional weights. The parameters mainly include whether the number of conversation rounds exceeds the preset threshold, whether the number of content clue hits in the conversation is greater than the preset threshold, whether the number of bad words used in the conversation is greater than the third preset threshold, and whether the number of logical problems such as suggestive and misleading statements in the logic of the conversation exceeds the fourth preset threshold.
[0126] 1) Set the number of rounds of conversation to be greater than a certain threshold as one of the trigger conditions. Therefore, when the conversation reaches a certain level and reaches the specified number of rounds, it may trigger a subsequent reversal operation. Optionally, the round threshold may be set to 3 rounds, 5 rounds, etc. When the conversation reaches the 4th or 6th round or later, part of the requirements of this trigger condition are met;
[0127] 2) The conversation requires more than 3 content clues. During the conversation, a sufficient number of specific content clues need to appear. These clues may be key information related to the case, specific plot elements, etc.
[0128] 3) It is stipulated that bad words cannot be used more than 3 times in a conversation. This is a constraint from the perspective of language standardization and appropriateness to ensure that the conversation process remains relatively civilized and standardized. Once the number of bad words exceeds the limit, it may affect the satisfaction of the trigger condition and the subsequent reversal operation.
[0129] 4) It is also necessary to make it clear that the logic of the conversation cannot contain more than 2 logical problems such as inductive statements. This is to ensure the fairness and rationality of the conversation and avoid influencing the direction of the conversation through improper logical guidance.
[0130] In the above steps, the trigger conditions include the number of conversation rounds, the number of content clues hit, the number of bad words and the number of logical problems. A number of factors of different natures are considered comprehensively, and each dimension has its own independent measurement standard and meaning, and independently affects the final evaluation.
[0131] Furthermore, the trigger condition is determined by comprehensively considering multiple dimensions and their weights. The actual situation of each dimension (such as whether the number of conversation rounds has reached the standard, the number of content clues hit, etc.) is calculated in combination with its weight to obtain a comprehensive judgment result.
[0132] Each dimension is assigned a different weight, which reflects the relative importance of each dimension in the judgment of trigger conditions. For example, if the weight of the number of conversation turns is set to 0.4, the weight of the number of content clue hits is set to 0.3, the weight of the number of inappropriate words is set to 0.2, and the weight of the number of logical problems is set to 0.1, then when judging the trigger conditions, the actual value of each dimension must be calculated according to this weight distribution to determine whether the trigger criteria are met.
[0133] It should also be noted that the weights can be adjusted according to the specific conversation scenario and goals. For example, in a scenario where the logic of the conversation is extremely high, the weight of the logical problem dimension may be set higher than the parameters of other dimensions. It can be understood that this weight adjustment mechanism acts like a regulator, allowing the entire system to adapt to different needs.
[0134] A single factor may lead to the risk of misjudgment. For example, if only the number of conversation rounds is used as a trigger condition, a reversal may be triggered even when the content is empty and there is no substantial progress. The design of multi-dimensional weights can avoid this situation. Only when the conditions of multiple dimensions meet a certain standard after comprehensive consideration of the weights will a reversal be triggered, making the whole process more reasonable.
[0135] In this embodiment, when the trigger condition is met, the content supervision model will change the system parameters. The change of these parameters is the basis for a series of subsequent reversal operations, which may involve adjustments to various internal settings, operating rules, etc. of the conversational robot.
[0136] Specifically, in an exemplary embodiment, the direction and magnitude of the change of the system parameters are determined according to the performance of different dimensions in the trigger conditions. If the number of conversation turns and content clue hits contribute more to the trigger (because they have higher weights and their actual values exceed the threshold more), then when changing the system parameters, the parameters related to the depth and breadth of the conversation may be adjusted. For example, the parameters related to the deep knowledge call in the scene knowledge base link may be increased to guide the conversation simulation dialogue model to answer questions from a deeper perspective.
[0137] It is understandable that different combinations of trigger conditions may lead to different parameter adjustment strategies. If the trigger is caused by the number of bad words approaching the threshold, the system parameters related to language style and review may be adjusted to make the chatbot pay more attention to the standardization of language in subsequent answers.
[0138] At the same time, after receiving the trigger condition, it will automatically switch to another reversed scenario knowledge base link according to the parameter change. The knowledge content that the simulated dialogue model can obtain has changed, switching from the original scenario knowledge base to the corresponding knowledge base after the reversal. For example, the knowledge base originally based on regular scenarios may switch to a knowledge base in a reversed situation involving different positions of the characters after the reversal, thereby providing knowledge reserves for generating the reversed answer content.
[0139] To match this, the prompt words used to control the model to generate specific content will also be switched. The switched prompt words can guide the model to generate answers according to the reversed scene and emotional requirements. For example, the original prompt words may be guided around the normal character emotions and case background. After switching, they will redirect the generation of answer content according to the reversed situation, such as the character's emotions changing from calm to excited, the conversation event background changing from superficial to hidden complex situations, etc.
[0140] Through the above-mentioned reversal operation mechanism based on multi-dimensional weight trigger conditions, it is possible to follow the emotional changes of the virtual interviewee during the conversation, flexibly switch the knowledge content, and effectively reverse the role's emotions. It has important application value in simulating complex conversation scenes, such as legal case inquiries and plot simulation dialogues, making the conversation process more diverse and the entire process conforms to the law of emotional evolution in real conversations and meets the needs of different situations.
[0141] Through the above steps S101 to S102, by multi-dimensionally annotating the conversation corpus data and using emotion injection technology, and using a small parameter supervision model, the logic and emotion of each round of dialogue are evaluated. Once a contradiction is detected in the conversation content, or its emotional response is inconsistent with expectations, the response content of the large model will be adjusted. This dynamic feedback mechanism can simulate the emotional turning points in the conversation, so that the conversation is more in line with the needs of the real scene; and when certain trigger conditions are met, the model parameters are changed and the knowledge base is switched to adapt to the emotional changes of the role being talked about, so that the large language model can show different levels of emotional changes, so as to ensure that the trained simulated dialogue model can accurately simulate the conversation process in the actual application process and ensure the authenticity of the conversation. It can provide accurate and effective conversation guidance for the conversation personnel to help them improve their business capabilities.
[0142] In a second aspect, the present application also provides a controllable supervised simulated conversation system based on a large language model. Figure 7 is a structural block diagram of a controllable supervised simulated conversation system based on a large language model according to an embodiment of the present application, such as Figure 7 As shown, the system includes: a model training module 70 and a supervision module 71, wherein:
[0143] The model training module 70 is used to fine-tune the large language model based on the training set to obtain a simulated dialogue model;
[0144] The supervision module 71 is used to supervise the simulated dialogue model through a small parameter supervision model according to preset constraints and multi-dimensional annotations added in the training set, and output a response sentence that imitates the conversation object and conforms to the law of emotional evolution based on the retrieval enhancement result using the simulated dialogue model.
[0145] Among them, the retrieval enhancement result is obtained by enhancing the query sentence of the conversation partner through the retrieval enhancement mechanism; the small parameter supervision model supervises the simulation dialogue model through multiple agent intelligent bodies, respectively, from whether the answer sentence contains specific annotations, whether the association between annotations is logical, and whether it violates the preset constraints; after receiving abnormal feedback, the small parameter model sends re-answer feedback to instruct the simulation dialogue model to output a corrected answer sentence based on the N rounds of context information adjacent to the current dialogue.
[0146] The following are some specific application examples of personnel business training after the actual deployment of the system:
[0147] It helps new interviewers get started quickly and provides a simulation environment close to reality to train their questioning skills and emotional guidance abilities. At the same time, through the dynamic feedback mechanism of the big model, it helps interviewers discover the logical loopholes and emotional weaknesses of the interviewee and improve their ability to break through cases.
[0148] When facing different interviewees, the system allows interviewers to practice how to deal with different types of interviewees in virtual scenes. The system will adjust the rhythm and style of the conversation according to different situational responses, helping interviewers hone their questioning skills;
[0149] Specifically, the example includes:
[0150] Conversation scene setting: Simulate the real case background and inject key knowledge points and factual information related to the case. The large language model simulates the logical thinking and emotional response of the person being interviewed through a customized knowledge base and fine-tuning technology.
[0151] Model fine-tuning and emotion control: In this scenario, the large language model can simulate the entire process of the person being interviewed from initial resistance to gradual emotional change and finally cooperating with the person to confess through emotion injection. The system will adjust the content of the conversation according to the person's questioning method and logic.
[0152] Real-time supervision and feedback: The small parameter supervision model continuously monitors the interaction between the chatbot and the person. If it finds logical contradictions or emotions that do not meet expectations in the conversation, the small parameter model will immediately adjust the response of the large language model to ensure the authenticity of the entire conversation process.
[0153] Through this system, interviewers can conduct multiple simulation training in a safe virtual environment to improve their conversation skills. For example, a new interviewer may not be able to accurately judge the timing of the conversation or the logical breakthrough at the beginning. The simulation system can help the interviewer discover the other party's emotional and logical weaknesses through role-playing guidance, so as to conduct effective conversation guidance. As the training deepens, the interviewer can gradually master how to guide the interviewee to confess through questioning, guidance and psychological analysis.
[0154] According to the above exemplary embodiments, the present application scheme successfully provides an efficient training tool through intelligent simulation of a large language model, allowing new interviewers to gradually transform from a lack of experience to mastering interview skills in a short period of time and be able to deal with complex cases proficiently. This not only improves the professional ability of personnel, but also effectively reduces the risk of mistakes caused by lack of experience in actual interviews.
[0155] Through the above system, multi-dimensional annotation and emotion injection technology are performed on the conversation corpus data, and a small parameter supervision model is used to evaluate the logic and emotion of each round of dialogue. Once a contradiction is detected in the conversation content, or its emotional response is inconsistent with expectations, the system will adjust the response content of the large model. This dynamic feedback mechanism can simulate the emotional turning points in the conversation, so that the conversation is more in line with the needs of the real scene; and when certain trigger conditions are met, the model parameters are changed and the knowledge base is switched to adapt to the emotional changes of the role being talked to, so that the large language model can show different levels of emotional changes, so as to ensure that the trained simulated dialogue model can accurately simulate the entire conversation process in the actual application process and ensure the authenticity of the conversation. It can provide a virtual training platform that is highly close to the real scene for the conversation personnel, which can help the conversation personnel gradually master the conversation skills and help them improve their business capabilities.
[0156] In one embodiment, Figure 8 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 8 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 8 As shown. The electronic device includes a processor, a network interface, an internal memory and a non-volatile memory connected through an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used to provide computing and control capabilities, the network interface is used to communicate with an external terminal through a network connection, the internal memory is used to provide an environment for the operation of the operating system, the computer program is executed by the processor to implement a controllable supervised simulated conversation method based on a large language model, and the database is used to store data.
[0157] Those skilled in the art will understand that Figure 8 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A controllable supervised simulated conversation method based on a large language model, characterized in that: The method comprises: Fine-tune the large language model based on the training set to obtain a simulated dialogue model; The simulated dialogue model is supervised by a small parameter supervision model according to preset constraints and multi-dimensional annotations added to the training set, and the simulated dialogue model is used based on the retrieval enhancement results to output a reply sentence that imitates the conversation object and conforms to the law of emotional evolution. The search enhancement result is obtained by enhancing the query statement of the conversation partner through the search enhancement mechanism; The small parameter supervision model supervises the simulated dialogue model through multiple agent intelligent agents, respectively from whether the answer statement contains specific annotations, whether the association between annotations is logical, and whether it violates preset constraints. The small parameter supervision model includes a first agent intelligent agent, a second agent intelligent agent and a third agent intelligent agent; Supervising the simulated dialogue model according to preset constraints and the annotations through a small parameter supervision model includes: By means of the first Agent, determining whether the annotation of any of the answer statements includes an emotion annotation, an action annotation and an attitude annotation, and if not, outputting an abnormal feedback; By means of the second Agent, it is judged whether the association between the emotion annotation, the action annotation and the attitude annotation in any of the answer sentences is logical, and if not, an abnormal feedback is output; Through the third Agent, based on the prompt word, the simulated dialogue model is guided to generate the answer statement under the preset constraint conditions, and it is determined whether the simulated dialogue model outputs an answer statement that violates the preset constraint conditions, and if so, an abnormal feedback is output, wherein the constraint conditions include: the role-playing constraint of the simulated dialogue model, the confidentiality constraint of case background information, and the character relationship constraint; After receiving the abnormal feedback, the small parameter supervision model sends a re-answer feedback to instruct the simulated dialogue model to output a revised answer statement based on the N rounds of context information adjacent to the current dialogue.
2. The method according to claim 1, characterized in that Supervising the simulated dialogue model according to the preset constraints and the annotations through the small parameter supervision model also includes: In case of receiving the abnormal feedback, sending a re-answer feedback to the simulated dialogue model, to instruct the simulated dialogue model to obtain N rounds of context dialogue information adjacent to the current dialogue statement, and output a modified answer statement according to the context dialogue information; The first Agent agent, the second Agent agent and the third Agent agent are respectively used to determine whether the modified answer statement is normal. If so, an output signal is sent to the simulated dialogue model to instruct the simulated dialogue model to output the modified answer statement to the user receiving end.
3. The method according to claim 2, characterized in that The query statement is converted into a search enhancement result by using a search enhancement generation mechanism, including: Converting the query statement into a query vector, and selecting a knowledge segment related to the query vector in a preset knowledge base, wherein background knowledge data related to the conversation scene is converted into a numerical vector, and the preset knowledge base is constructed according to a plurality of numerical vectors; Through prompt engineering, the knowledge fragment is added to the query statement to obtain retrieval enhancement results.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Obtain key accumulated data of the current conversation through the small parameter supervision model, and perform multi-dimensional weighted operations based on the key accumulated data to determine whether the trigger condition is met; If the trigger condition is met, an emotion reversal instruction is sent to the simulated dialogue model to instruct the simulated dialogue model to switch model parameters and knowledge base to generate a reversed answer statement.
5. The method according to claim 4, characterized in that The key accumulated data include: the accumulated round number, the number of preset clue word hits and the number of bad word matches, among which: Acquiring the key accumulated data of the current conversation includes: acquiring the accumulated number of rounds of the current conversation content, acquiring the number of hits of the historical conversation content relative to the preset clue words, acquiring the number of matches of the bad words in the historical conversation content, and acquiring the number of risks of risk logic problems in the historical conversation content through the third agent; Performing a multi-dimensional weighted operation based on the key accumulated data to determine whether the trigger condition is met includes: performing a multi-dimensional weighted operation based on the accumulated round number, the hit number, the match number, and the risk number, and determining whether the trigger condition is met based on the result of the multi-dimensional weighted operation, If so, sending an emotion reversal instruction to the simulated dialogue model to instruct the simulated dialogue model to switch model parameters and switch the currently used knowledge base to the reversed knowledge base; The inverted knowledge base is used to generate an updated retrieval enhancement result corresponding to the query statement, and the updated retrieval enhancement result is input into the simulated dialogue model to instruct the simulated dialogue model to generate an answer statement after emotion inversion.
6. The method according to claim 1, characterized in that Fine-tuning the large language model based on the training set to obtain a simulated dialogue model includes: In the training set, the repeated character background information in the question part is deleted, and the constraint information used to constrain the model to generate the answer sentence is deleted to construct a valid training information set; Using the effective training information set as a parameter for iteratively calculating a loss function, fine-tuning the large language model to obtain the simulated dialogue model, wherein the loss function is used to determine the gap between the answer statement output by the simulated dialogue model and the real answer statement; The loss function is expressed by the following formula in, represents the problem part of the current training round, represents the answer part of the current training round, represents the tth character, p(x) represents the arrive ) exists Probability of occurrence; L is the loss function, and T is the character background information and the constraint information.
7. A controllable supervised simulated conversation system based on a large language model, characterized in that: The system comprises: a model training module and a supervision module, wherein: The model training module is used to fine-tune the large language model based on the training set to obtain a simulated dialogue model; The supervision module is used to supervise the simulated dialogue model through a small parameter supervision model according to preset constraints and multi-dimensional annotations added to the training set, and output a reply sentence that imitates the conversation object and conforms to the law of emotional evolution based on the retrieval enhancement result using the simulated dialogue model, wherein the retrieval enhancement result is obtained by enhancing the query sentence of the conversation object through the retrieval enhancement mechanism; The small parameter supervision model supervises the simulated dialogue model through multiple agent intelligent agents, respectively from whether the answer statement contains specific annotations, whether the association between annotations is logical, and whether it violates preset constraints. The small parameter supervision model includes a first agent intelligent agent, a second agent intelligent agent and a third agent intelligent agent; Supervising the simulated dialogue model according to preset constraints and the annotations through a small parameter supervision model includes: By means of the first Agent, determining whether the annotation of any of the answer statements includes an emotion annotation, an action annotation and an attitude annotation, and if not, outputting an abnormal feedback; By means of the second Agent, it is judged whether the association between the emotion annotation, the action annotation and the attitude annotation in any of the answer sentences is logical, and if not, an abnormal feedback is output; Through the third Agent, based on the prompt word, the simulated dialogue model is guided to generate the answer statement under the preset constraint conditions, and it is determined whether the simulated dialogue model outputs an answer statement that violates the preset constraint conditions, and if so, an abnormal feedback is output, wherein the constraint conditions include: the role-playing constraint of the simulated dialogue model, the confidentiality constraint of case background information, and the character relationship constraint; After receiving the abnormal feedback, the small parameter supervision model sends a re-answer feedback to instruct the simulated dialogue model to output a revised answer statement based on the N rounds of context information adjacent to the current dialogue.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Zero fine tuning anthropomorphic session generation method and equipment based on pre-training language model
CN114780694A
Large language model training method and device
CN118349852A