Dialogue method and device based on large model, equipment and storage medium
By using a target model generated through training a large self-game model, forward and backward reasoning in the field of insurance consulting is performed, solving the problems of unidirectional reasoning mode and poor domain adaptability in existing technologies, and achieving improved streaming output and dialogue efficiency.
Patent Information
- Application Number
- CN202511366293.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-02-06
AI Technical Summary
Existing generative model-based dialogue systems in the insurance sales field suffer from problems such as the inability of one-way reasoning to handle complex multi-round logical games, poor domain adaptability, and severe response delays, leading to increased customer churn rates.
A self-playing large model is used to generate question-and-answer data for the target domain, train the target model to perform forward and backward reasoning, and combine the answers from forward and backward reasoning for streaming output to improve dialogue efficiency.
It enables multi-task learning, generates timely responses, reduces silence time in conversations, and improves conversation efficiency and user experience.
Smart Images

Figure CN121480690A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of large model technology, and in particular to a dialogue method, apparatus, device and storage medium based on a large model. Background Technology
[0002] With the development of the times, the advancement of science and technology, and the increasing risk awareness of the people, insurance, as an economic security system, has played an unprecedented role, giving rise to the AI insurance broker industry. Today, with the rapid development of artificial intelligence technology, human-computer interactive chatbots are increasingly entering people's daily lives, making the speed of chatbot responses particularly important.
[0003] Existing solutions include dialogue systems based on generative models (such as Seq2Seq and Transformer models) that are gaining popularity. Examples include large language models like Chatgpt, Chatglm, and Qwen, which fine-tune models using massive amounts of dialogue context data from vertical domains to train a large-scale dialogue model within a specific domain, enabling the implementation of algorithms in fields such as insurance sales.
[0004] However, the existing solution is not perfect and still has the following shortcomings:
[0005] The traditional Seq2Seq / Transformer model only performs one-way reasoning of questions and answers, which cannot cope with the complex multi-round logical games in insurance sales (such as the chain of customer questioning, explanation, and further questioning).
[0006] Poor domain adaptability: General large models lack the reverse reasoning ability specific to insurance (such as inferring the applicability of insurance terms from the claims conclusion), and have a high error rate in professional Q&A.
[0007] Severe response delay: The autoregressive generation mechanism waits for the complete sentence to be generated before outputting speech, resulting in high latency during dialogue silences. Furthermore, the larger the model parameter count, the slower the inference speed, leading to increased customer churn. Summary of the Invention
[0008] To address the aforementioned technical problems, embodiments of the present invention provide a dialogue method based on a large model, comprising:
[0009] A large self-game model is used to generate question-and-answer data for a target domain. The question-and-answer data includes the inputs and outputs of the forward reasoning stage and the inputs and outputs of the backward reasoning stage.
[0010] A target model is trained based on the question-and-answer data. The target model is used to perform forward and backward reasoning on input data in the target domain and generate corresponding forward and backward output data. The forward output data includes forward reasoning answers corresponding to the input data, and the backward reasoning data includes backward reasoning answers. The backward reasoning answers are matched with backward reasoning questions corresponding to the input data and / or forward reasoning answers. The backward reasoning questions are at least related to the causal relationship that forms the input data and / or forward reasoning answers.
[0011] In response to obtaining a target question corresponding to the target domain from user input, the target model is invoked to process the target question, generating a target forward reasoning answer and a target backward reasoning answer;
[0012] The target response is determined by combining the forward reasoning answer and the reverse reasoning answer, and the target response is output in a streaming manner.
[0013] In one embodiment, training and generating the target model based on the question-and-answer data includes:
[0014] The question-and-answer data is preprocessed;
[0015] An initial model is determined, wherein the number of parameters of the initial model is less than the number of parameters of the large self-game model;
[0016] The initial model is trained based on the preprocessed question-and-answer data to generate candidate models;
[0017] The candidate models are evaluated for performance.
[0018] Upon successful evaluation, the candidate model is determined as the target model.
[0019] In one embodiment, the performance evaluation of the candidate model includes:
[0020] The dialogue generation quality, long context processing, and understanding capabilities of the candidate models are evaluated.
[0021] In one embodiment, the question-and-answer data includes:
[0022] The first question-and-answer data includes the input question and the corresponding positive reasoning answer;
[0023] The second question-and-answer data includes the input question, the forward reasoning answer, and the corresponding reverse reasoning question;
[0024] The third set of question-and-answer data includes the reverse reasoning questions and their corresponding reverse reasoning answers.
[0025] In one embodiment, the method further includes:
[0026] Construct a first loss function corresponding to the first question-and-answer data;
[0027] Construct a second loss function corresponding to the second question-and-answer data;
[0028] Construct a third loss function corresponding to the third question-and-answer data;
[0029] A loss function corresponding to the target model is constructed based on the first loss function, the second loss function, and the third loss function.
[0030] In one embodiment, generating question-and-answer data for a target domain using a large self-game model includes:
[0031] The self-game model is used to generate question-and-answer data for the insurance consulting field, which includes medical insurance consulting and life insurance consulting.
[0032] In one embodiment, determining the target response by combining the target forward reasoning answer and the target backward reasoning answer, and outputting the target response, includes:
[0033] The forward reasoning answer for the target is output in a streaming manner, while the reverse reasoning answer for the target is cached.
[0034] In response to the completion of the output of the target forward reasoning answer, the target reverse reasoning answer is streamed; or
[0035] The reverse reasoning answer to the target is output first.
[0036] Another embodiment of the present invention also provides a large-model-based dialogue device, comprising:
[0037] The first generation module is used to generate question-and-answer data for the target domain using a self-game model. The question-and-answer data includes the input and output of the forward reasoning stage and the input and output of the backward reasoning stage.
[0038] The second generation module is used to train and generate a target model based on the question-and-answer data. The target model is used to perform forward reasoning and backward reasoning on input data in the target domain, and generate corresponding forward output data and backward output data. The forward output data includes forward reasoning answers corresponding to the input data, and the backward reasoning data includes backward reasoning answers. The backward reasoning answers are matched with backward reasoning questions corresponding to the input data and / or forward reasoning answers. The backward reasoning questions are at least related to the causal relationship that forms the input data and / or forward reasoning answers.
[0039] The third generation module is used to respond to the target question corresponding to the target domain input by the user, call the target model to process the target question, and generate the target forward reasoning answer and the target backward reasoning answer;
[0040] The output module is used to determine the target response by combining the target forward reasoning answer and the target reverse reasoning answer, and to stream the target response.
[0041] Another embodiment of the present invention also provides an electronic device, comprising:
[0042] One or more processors;
[0043] Memory, configured to store one or more programs;
[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the large model-based dialogue method as described in any of the above descriptions.
[0045] Another embodiment of the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the large-model-based dialogue method as described above.
[0046] Based on the above disclosure, the beneficial effects of the solution described in the embodiments of the present invention include the simultaneous generation of forward inference data and backward inference data based on user input data, realizing multi-task learning; in addition, by listening to and monitoring the dialogue state, the target model can be invoked in a timely manner to perform response inference and generate response content in a timely manner. The response content supports streaming output, that is, it does not need to wait for all content to be generated before outputting, but can output the generated content first, thus improving dialogue efficiency.
[0047] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0048] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0049] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0050] Figure 1 This is a flowchart illustrating the large-model-based dialogue method in an embodiment of the present invention.
[0051] Figure 2 This is a flowchart illustrating a large-model-based dialogue method according to another embodiment of the present invention.
[0052] Figure 3 This is a flowchart illustrating a large-model-based dialogue method in another embodiment of the present invention.
[0053] Figure 4 This is a structural block diagram of a large-model-based dialogue device in an embodiment of the present invention. Detailed Implementation
[0054] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings, but these are not intended to limit the scope of the invention.
[0055] It should be understood that various modifications can be made to the embodiments disclosed herein. Therefore, the following description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope of this disclosure will be apparent to those skilled in the art.
[0056] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present disclosure and, together with the general description of the disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
[0057] These and other features of the invention will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0058] It should also be understood that although the invention has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of the invention, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0059] The above and other aspects, features and advantages of this disclosure will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0060] Specific embodiments of the present disclosure are described thereafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure and can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the present disclosure. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but merely to serve as the basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of substantially any suitable detailed structures.
[0061] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in still another embodiment,” all of which may refer to one or more of the same or different embodiments according to this disclosure.
[0062] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0063] like Figure 1 As shown, this embodiment of the invention provides a dialogue method based on a large model, including:
[0064] S1: Generate question-and-answer data for the target domain using a self-game model, wherein the question-and-answer data includes the input and output of the forward reasoning stage and the input and output of the backward reasoning stage;
[0065] S2: Based on the question-and-answer data, a target model is trained and generated. The target model is used to perform forward reasoning and backward reasoning on input data in the target domain, and generate corresponding forward output data and backward output data. The forward output data includes forward reasoning answers corresponding to the input data, and the backward reasoning data includes backward reasoning answers. The backward reasoning answers are matched with backward reasoning questions corresponding to the input data and / or forward reasoning answers. The backward reasoning questions are at least related to the causal relationship that forms the input data and / or forward reasoning answers.
[0066] S3: In response to obtaining a target question corresponding to the target domain from user input, the target model is invoked to process the target question, generating a target forward reasoning answer and a target backward reasoning answer;
[0067] S4: Combine the target forward reasoning answer and the target reverse reasoning answer to determine the target response, and output the target response in a streaming manner.
[0068] The solution in this embodiment can be applied to any technical field, such as medical consultation, study abroad consultation, or other product promotion fields; it is not unique and has a wide range of applications. The self-game model in this embodiment can be a pre-built model or an existing model, as long as the model has excellent performance and a large number of parameters, it can be used; there are no specific limitations. After determining the self-game model, the system or user can process the collected historical question-and-answer data corresponding to the target domain, such as text data or audio / video data, in a way that the self-game model can recognize, and then input it into the model for processing to obtain the question-and-answer data for the corresponding target domain. This question-and-answer data is different from the historical question-and-answer data. The question-and-answer data in this embodiment includes the input and output of the forward reasoning stage, as well as the input and output of the backward reasoning stage. The input and output of the forward reasoning stage include, for example, the user-inputted question, the forward reasoning performed by the system or human agent in response to the question, and the resulting answer. The inputs and outputs of the reverse reasoning stage include, for example, points of contention that users might have, i.e., potential confusion or implicit questions, obtained by analyzing questions and / or answers from the large model. This involves determining why the user would ask the question, generating a reverse reasoning question, and a reverse reasoning answer to that question. The reverse reasoning question and answer expand upon the response, providing a deeper or more comprehensive explanation from other dimensions, thus thoroughly clarifying the user's questions and addressing any hidden doubts.
[0069] The question-and-answer data mentioned above is essentially the knowledge data distilled from the large self-game model after serving the target domain. Training a smaller model with this data yields a target model for that domain. This target model can then output forward and backward reasoning responses based on user input. The smaller model has no specific structural limitations; any model architecture of the same type with fewer parameters than the large self-game model can be used. Once the target model is obtained by training the smaller model architecture with the distilled question-and-answer data, it can be deployed in real-world applications. For example, in a question-and-answer scenario, a user inputs a question—the target question. Since this question belongs to the target domain, the system calls the corresponding target model to process it, generating a forward reasoning response and a backward reasoning question for the user's question, and at least a backward reasoning response based on the backward reasoning question. After receiving these two responses, the system determines the target response to present to the user.
[0070] In practical applications, the system can store multiple target models corresponding to different fields. Based on the user's input question, the system determines the relevant field and calls the matching target model. This assists the system in quickly and accurately engaging in dialogue with the user, or in assisting agents in communicating with users. For example, the method in this embodiment can generate dialogue scripts for agents, assisting / guiding them in communicating with users, such as in the product sales industry.
[0071] In this embodiment, the step of generating question-and-answer data for the target domain using a self-game model includes:
[0072] S101: Use the self-game model to generate question-and-answer data for the insurance consulting field, which includes medical insurance consulting and life insurance consulting.
[0073] That is, the target field in this embodiment is the insurance consulting field, which may include, but is not limited to, the medical insurance consulting field, the life insurance consulting field, or other insurance consulting fields, depending on the specifics.
[0074] For example, in the field of insurance consultation, the system or user can input the history of insurance conversations as the "original question" and the standard responses from human agents as the "answers" into a large-scale self-game model. In this embodiment, the large-scale self-game model can be a model with a large number of parameters, such as 72B. This model processes and learns from the input historical data to generate reverse questions and reverse reasoning chains. Specifically, in this embodiment:
[0075] Forward reasoning stage:
[0076] #Enter: Insurance question Q
[0077] Q: Why are critical illness insurance premiums higher than medical insurance premiums?
[0078] # Output: Inference chain R_f (equivalent to response A)
[0079] R_f = """
[0080] 1. Differences in coverage: Critical illness insurance covers major illnesses such as cancer / stroke, while medical insurance covers ordinary hospitalization;
[0081] 2. Compensation method: Critical illness insurance provides a lump sum payment of the insured amount, while medical insurance reimburses actual expenses incurred.
[0082] 3. Conclusion: Due to differences in coverage and compensation methods.
[0083] Reverse problem construction phase:
[0084] # Input: Q+A
[0085] A = "Due to differences in coverage and compensation methods";
[0086] # Output: Reverse problem Q_b;
[0087] Q_b = "If a customer believes that the critical illness insurance premium is too high, what points might they question?"
[0088] Reverse reasoning stage:
[0089] #Input: Q_b
If a customer believes that the critical illness insurance premium is too high, what points might they question?
[0090] #Output: Reverse inference R_b;
[0091] R_b =:
[0092] 1. Question 1: Does it include mild cases? → The exemption clause for mild cases needs to be explained;
[0093] 2. Question 2: Claim threshold? → Compare the claim standards for different diseases;
[0094] 3. Conclusion: Premium differences stem from the depth of coverage.
[0095] Through the above forward and backward reasoning processes, question-and-answer data for different questions, i.e. different dialogue scenarios, can be obtained. After obtaining the question-and-answer data, the system can use it to train the target model.
[0096] In another embodiment, in order to enable the target model to have the ability to perform multi-task joint execution, that is, to further optimize the target model so that it can perform forward and backward reasoning more accurately and continuously, the question-answering data includes:
[0097] The first question-and-answer data includes the input question and the corresponding positive reasoning answer;
[0098] The second question-and-answer data includes the input question, the forward reasoning answer, and the corresponding reverse reasoning question;
[0099] The third set of question-and-answer data includes the reverse reasoning questions and their corresponding reverse reasoning answers.
[0100] Furthermore, such as Figure 2 As shown, in order to match different forms of question-and-answer data and train a target model with multi-task processing capabilities and superior performance, the design process of the loss function of the target model in this embodiment includes:
[0101] S207: Construct a first loss function corresponding to the first question-and-answer data;
[0102] S208: Construct a second loss function corresponding to the second question-and-answer data;
[0103] S209: Construct a third loss function corresponding to the third question-and-answer data;
[0104] S210: Construct a loss function corresponding to the target model based on the first loss function, the second loss function, and the third loss function.
[0105] In other words, a matching loss function is set for each type of question-and-answer data, and the overall loss function of the model is formed by combining the loss functions of each branch. After the model is trained, the loss functions of each branch, as well as the overall loss function, will converge.
[0106] For example, Task 1: User question → Standard response (forward reasoning);
[0107] Task 2: User Questions → Reverse Questions (Anticipating Points of Criticism);
[0108] Task 3: Reverse Problem → Reverse Reasoning (Generate Coping Strategies);
[0109] L1: is the loss function given input (Q, A), where Q is the original user input question and A is the forward reasoning answer.
[0110] L2: is the loss function given the input (Q+A,Q′), where Q+A is the combination of the question and the answer, and Q′ is the question regenerated by the model, i.e., the back-reasoning question.
[0111] L3: is the loss function given the input (Q′, A′), where Q′ is the regenerated question, i.e. the back-inference question, and A′ is the answer generated by the model based on Q′, i.e. the back-inference answer.
[0112] The loss function of the target model is Ltotal = L1 + L2 + L3.
[0113] Furthermore, when training the target model, the system can input the different types of question-and-answer data mentioned above into the target model for training.
[0114] Specifically, such as Figure 3 As shown, the process of constructing the target model, i.e., training the target model based on the question-and-answer data, includes:
[0115] S201: Preprocess the question-and-answer data;
[0116] S202: Determine an initial model, wherein the number of parameters of the initial model is less than the number of parameters of the self-game large model;
[0117] S203: Train the initial model based on the preprocessed question-and-answer data to generate candidate models;
[0118] S204: Evaluate the performance of the candidate models;
[0119] S205: In response to the successful evaluation, the candidate model is determined as the target model.
[0120] The performance evaluation of the candidate model includes:
[0121] S206: Evaluate the dialogue generation quality, long context processing and understanding capabilities of the candidate models.
[0122] For example, the overall process includes:
[0123] 1. Data collection: The training set is generated by the base model with a large number of parameters, namely the self-game large model, based on the data generated during the self-game stage.
[0124] 2. Data preprocessing: The question-and-answer data is preprocessed and transformed into a form that the model can accept, such as word embedding.
[0125] 3. Model initialization: In order to speed up inference, this embodiment selects a model with small parameters as the initial model of the target model, such as Qwen3-8B, and then initializes the parameters of the model, including weights, biases and memory.
[0126] 4. Training the model: Iterate repeatedly using forward and backward propagation until the model's loss function converges.
[0127] 5. Model Evaluation: The evaluation of the model mainly includes two aspects: one is to evaluate the quality of the model's dialogue generation, and the other is to evaluate the model's ability to process long contexts.
[0128] 6. Deploy the model: After the model is trained, it can be deployed to specific application scenarios.
[0129] After the target model is trained and put into use, as described above, the system can call the corresponding target model to process the question input by the user, generating forward reasoning answers and backward reasoning answers. When outputting the target response to the user, the system in this embodiment can also perform analysis to determine the final target response based on the two answers. For example, determining the target response by combining the target forward reasoning answer and the target backward reasoning answer, and then outputting the target response, includes:
[0130] S401: Stream the forward reasoning answer of the target, and cache the reverse reasoning answer of the target;
[0131] S402: In response to the completion of the output of the target forward reasoning answer, stream the target reverse reasoning answer; or
[0132] S403: Prioritize outputting the reverse reasoning answer for the target.
[0133] For example, in one embodiment, suppose a scenario is a customer remaining silent after inquiring about medical insurance:
[0134] Forward reasoning output:
[0135] "The annual fee for this product is 600 yuan, which covers outpatient and inpatient services...";
[0136] Reverse question generation:
[0137] The reverse reasoning problem is: "The customer may think the premium is too high."
[0138] Reverse reasoning output:
[0139] The answer based on reverse reasoning is: "Compared to an annual income of 100,000, 600 yuan only accounts for 0.6%, but it can avoid the risk of 500,000 yuan in medical expenses."
[0140] When outputting, a streaming output method is used.
[0141] The above embodiment first performs forward reasoning to answer the user's input question. If the user does not respond further after receiving the forward reasoning answer, entering a silent phase, the system can directly read the reverse reasoning answer from the cache and control the streaming output. This significantly shortens the silence interval, improves question-and-answer efficiency, avoids awkward silences, and positively contributes to advancing the dialogue.
[0142] In another embodiment, when the reverse reasoning answer is more comprehensive than the forward reasoning answer and covers a wider range of content, the system can directly control the output of the reverse reasoning answer in a streaming manner, instead of outputting the forward reasoning answer. Alternatively, the system can analyze and compare the forward and reverse reasoning answers to determine the optimal answer before outputting it, or it can select the optimal answer from the two types of answers based on historical question-and-answer data before outputting it; the specific approach is not unique.
[0143] Furthermore, the streaming output described in the above embodiments is specifically implemented as follows:
[0144] First, the data is dynamically segmented:
[0145] Input: Model streaming output "Hello, the annual fee for the million-dollar medical insurance is only 600 yuan (pause), covering 200 critical illnesses..."
[0146] Segmentation: Detect punctuation marks and segments with a length of ≥5 characters, segmented as ["Hello, the annual fee for million-dollar medical insurance is only 600 yuan", "covering 200 critical illnesses..."].
[0147] During output, the system outputs based on segmented paragraphs, either segment by segment or word by word. This means that before the target model generates a complete response, the system prioritizes broadcasting the already generated and segmented compliant short sentences to reduce the question-and-answer interval, improve efficiency, and enhance the user's communication experience. For example, in the above embodiment, the system can choose to control the first short sentence "annual fee 600 yuan" to be broadcast within 100ms, while preloading the reverse-reasoned answer into the cache for easy retrieval.
[0148] The dynamic cutting rules of the streaming segmentation module in this embodiment include:
[0149] 1. Input: Model streaming output "Hello, the annual fee for the million-dollar medical insurance is only 600 yuan (pause), covering 200 critical illnesses...".
[0150] 2. Segmentation: Detect punctuation marks and segments with a length of ≥5 characters, segmented as ["Hello, the annual fee for million-dollar medical insurance is only 600 yuan", "covering 200 critical illnesses..."].
[0151] 3. Caching mechanism: Real-time updates of the queue of unbroadcasted short phrases, supporting interrupted responses.
[0152] In practical applications, the system can utilize a state machine for output control. The states involved include "broadcasting," "waiting for customer termination," and "model inference." The triggering conditions for each state are as follows: In the broadcasting state, the trigger condition is "TTS output in progress," and if so, the ASR input is buffered. In the "waiting for customer termination" state, the trigger condition is detecting a silence duration exceeding x seconds (e.g., 5 seconds), and the triggered action is sending the complete user-input question to the target model. In the model inference state, the trigger condition is receiving the reverse-reasoned answer, and the triggered action is prioritizing the output of the reverse-reasoned answer.
[0153] Optionally, the target model in this embodiment can also be configured to support real-time changes and adjustments, such as periodically updating the parameters of the target model in conjunction with newly accumulated dialogue predictions to further optimize the target model and make it have better performance.
[0154] As can be seen from the methods described in the above embodiments, this application employs a self-game training method to perform knowledge distillation from a large-parameter model, thereby transferring it to a small-parameter model for application. This is not only convenient and easy to implement with low computational cost, but also significantly improves human-computer dialogue, such as the interaction speed between users and chatbots or AI dialogue assistants, increasing dialogue fluency and enhancing user experience. Furthermore, based on the knowledge reasoning capabilities of the large model, the capabilities of AI agents can be significantly improved.
[0155] like Figure 4 As shown, another embodiment of the present invention also provides a dialogue device based on a large model, comprising:
[0156] The first generation module is used to generate question-and-answer data for the target domain using a self-game model. The question-and-answer data includes the input and output of the forward reasoning stage and the input and output of the backward reasoning stage.
[0157] The second generation module is used to train and generate a target model based on the question-and-answer data. The target model is used to perform forward reasoning and backward reasoning on input data in the target domain, and generate corresponding forward output data and backward output data. The forward output data includes forward reasoning answers corresponding to the input data, and the backward reasoning data includes backward reasoning answers. The backward reasoning answers are matched with backward reasoning questions corresponding to the input data and / or forward reasoning answers. The backward reasoning questions are at least related to the causal relationship that forms the input data and / or forward reasoning answers.
[0158] The third generation module is used to respond to the target question corresponding to the target domain input by the user, call the target model to process the target question, and generate the target forward reasoning answer and the target backward reasoning answer;
[0159] The output module is used to determine the target response by combining the target forward reasoning answer and the target reverse reasoning answer, and to stream the target response.
[0160] In one embodiment, training and generating the target model based on the question-and-answer data includes:
[0161] The question-and-answer data is preprocessed;
[0162] An initial model is determined, wherein the number of parameters of the initial model is less than the number of parameters of the large self-game model;
[0163] The initial model is trained based on the preprocessed question-and-answer data to generate candidate models;
[0164] The candidate models are evaluated for performance.
[0165] Upon successful evaluation, the candidate model is determined as the target model.
[0166] In one embodiment, the performance evaluation of the candidate model includes:
[0167] The dialogue generation quality, long context processing, and understanding capabilities of the candidate models are evaluated.
[0168] In one embodiment, the question-and-answer data includes:
[0169] The first question-and-answer data includes the input question and the corresponding positive reasoning answer;
[0170] The second question-and-answer data includes the input question, the forward reasoning answer, and the corresponding reverse reasoning question;
[0171] The third set of question-and-answer data includes the reverse reasoning questions and their corresponding reverse reasoning answers.
[0172] In one embodiment, the apparatus further includes a construction module for:
[0173] Construct a first loss function corresponding to the first question-and-answer data;
[0174] Construct a second loss function corresponding to the second question-and-answer data;
[0175] Construct a third loss function corresponding to the third question-and-answer data;
[0176] A loss function corresponding to the target model is constructed based on the first loss function, the second loss function, and the third loss function.
[0177] In one embodiment, generating question-and-answer data for a target domain using a large self-game model includes:
[0178] The self-game model is used to generate question-and-answer data for the insurance consulting field, which includes medical insurance consulting and life insurance consulting.
[0179] In one embodiment, determining the target response by combining the target forward reasoning answer and the target backward reasoning answer, and outputting the target response, includes:
[0180] The forward reasoning answer for the target is output in a streaming manner, while the reverse reasoning answer for the target is cached.
[0181] In response to the completion of the output of the target forward reasoning answer, the target reverse reasoning answer is streamed; or
[0182] The reverse reasoning answer to the target is output first.
[0183] Another embodiment of the present invention also provides an electronic device, comprising:
[0184] One or more processors;
[0185] Memory, configured to store one or more programs;
[0186] When the one or more programs are executed by the one or more processors, the one or more processors implement the large model-based dialogue method as described in any of the above descriptions.
[0187] Furthermore, one embodiment of the present invention also provides a storage medium storing a computer program that, when executed by a processor, implements the large-model-based dialogue method described above. It should be understood that the various solutions in this embodiment have the corresponding technical effects in the above-described method embodiments, and will not be repeated here.
[0188] Furthermore, embodiments of the present invention also provide a computer program product tangibly stored on a computer-readable medium and comprising computer-readable instructions that, when executed, cause at least one processor to perform a large-model-based dialogue method such as those described in the embodiments above.
[0189] It should be noted that the computer storage medium of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program configured for use by or in connection with an instruction execution system, system, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, antenna, optical fiber, RF, etc., or any suitable combination thereof.
[0190] Furthermore, those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0191] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.
[0192] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0193] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.
Claims
1. A dialogue method based on a large model, characterized in that, include: A large self-game model is used to generate question-and-answer data for a target domain. The question-and-answer data includes the inputs and outputs of the forward reasoning stage and the inputs and outputs of the backward reasoning stage. A target model is trained based on the question-and-answer data. The target model is used to perform forward and backward reasoning on input data in the target domain and generate corresponding forward and backward output data. The forward output data includes forward reasoning answers corresponding to the input data, and the backward reasoning data includes backward reasoning answers. The backward reasoning answers are matched with backward reasoning questions corresponding to the input data and / or forward reasoning answers. The backward reasoning questions are at least related to the causal relationship between the input data and / or forward reasoning answers. In response to obtaining a target question corresponding to the target domain from user input, the target model is invoked to process the target question, generating a target forward reasoning answer and a target backward reasoning answer; The target response is determined by combining the forward reasoning answer and the reverse reasoning answer, and the target response is output in a streaming manner.
2. The dialogue method based on a large model according to claim 1, characterized in that, The process of training and generating the target model based on the question-and-answer data includes: The question-and-answer data is preprocessed; An initial model is determined, wherein the number of parameters of the initial model is less than the number of parameters of the large self-game model; The initial model is trained based on the preprocessed question-and-answer data to generate candidate models; The candidate models are evaluated for performance. Upon successful evaluation, the candidate model is determined as the target model.
3. The dialogue method based on a large model according to claim 2, characterized in that, The performance evaluation of the candidate models includes: The dialogue generation quality, long context processing, and understanding capabilities of the candidate models are evaluated.
4. The dialogue method based on a large model according to claim 2, characterized in that, The question-and-answer data includes: The first question-and-answer data includes the input question and the corresponding positive reasoning answer; The second question-and-answer data includes the input question, the forward reasoning answer, and the corresponding reverse reasoning question; The third set of question-and-answer data includes the reverse reasoning questions and their corresponding reverse reasoning answers.
5. The dialogue method based on a large model according to claim 4, characterized in that, The method further includes: Construct a first loss function corresponding to the first question-and-answer data; Construct a second loss function corresponding to the second question-and-answer data; Construct a third loss function corresponding to the third question-and-answer data; A loss function corresponding to the target model is constructed based on the first loss function, the second loss function, and the third loss function.
6. The dialogue method based on a large model according to claim 1, characterized in that, The method of generating question-and-answer data for the target domain using a large self-game model includes: The self-game model is used to generate question-and-answer data for the insurance consulting field, which includes medical insurance consulting and life insurance consulting.
7. The dialogue method based on a large model according to claim 1, characterized in that, The process of determining the target response by combining the target forward reasoning answer and the target backward reasoning answer, and outputting the target response, includes: The forward reasoning answer for the target is output in a streaming manner, while the reverse reasoning answer for the target is cached. In response to the completion of the output of the target forward reasoning answer, the target reverse reasoning answer is streamed; or The reverse reasoning answer to the target is output first.
8. A dialogue device based on a large model, characterized in that, include: The first generation module is used to generate question-and-answer data for the target domain using a self-game model. The question-and-answer data includes the input and output of the forward reasoning stage and the input and output of the backward reasoning stage. The second generation module is used to train and generate a target model based on the question-and-answer data. The target model is used to perform forward reasoning and backward reasoning on input data in the target domain, and generate corresponding forward output data and backward output data. The forward output data includes forward reasoning answers corresponding to the input data, and the backward reasoning data includes backward reasoning answers. The backward reasoning answers are matched with backward reasoning questions corresponding to the input data and / or forward reasoning answers. The backward reasoning questions are at least related to the causal relationship that forms the input data and / or forward reasoning answers. The third generation module is used to respond to the target question corresponding to the target domain input by the user, call the target model to process the target question, and generate the target forward reasoning answer and the target backward reasoning answer; The output module is used to determine the target response by combining the target forward reasoning answer and the target reverse reasoning answer, and to stream the target response.
9. An electronic device, comprising: One or more processors; Memory, configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the large-model-based dialogue method as described in any one of claims 1-7.
10. A storage medium having a computer program stored thereon, which, when executed by a processor, implements the large-model-based dialogue method as described in any one of claims 1-7.
Citation Information
Cited By
Model training method, device, apparatus, storage medium, and program product
CN122242622A
