A multi-turn dialogue synthesis method using real data

By using multi-turn dialogue backbone abstraction technology, user intent and context are extracted from real data to generate logically coherent multi-turn dialogue data, which solves the problem of insufficient data quality and diversity in existing technologies and improves the generation capability and naturalness of multi-turn dialogue models.

CN120144705BActive Publication Date: 2025-11-11INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510204012.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-11-11
Estimated Expiration
2045-02-24

AI Technical Summary

Technical Problem

Existing methods for generating multi-turn dialogue data suffer from data quality issues, insufficient diversity, and incoherent context, making it difficult to generate high-quality, natural, and logically consistent multi-turn dialogue data.

Method used

Employing multi-turn dialogue backbone abstraction technology, user intent, key questions, and contextual information are extracted from real data. High-quality multi-turn dialogue data is generated through a large language model. Backbone abstraction is performed using real dialogue datasets such as lmsys-chat-1m. User interaction is simulated in real-world scenarios, high-quality prompt words are constructed, and iterative optimization is carried out to finally generate logically coherent multi-turn dialogue data.

Benefits of technology

The generated multi-turn dialogue data is more natural and thematically consistent, better simulating real user behavior, improving the model's responsiveness and data quality in multi-turn dialogue scenarios, and reducing the gap between synthetic data and real user interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144705B_ABST
    Figure CN120144705B_ABST
Patent Text Reader

Abstract

This invention discloses a multi-turn dialogue synthesis method using real data, comprising the following steps: 1) designing a set of initial prompt words; 2) inputting the selected dialogue data and initial prompt words into a large language model, outputting dialogue intent and interaction logic; 3) detecting whether the dialogue intent and interaction logic meet the set conditions, and if not, adjusting the prompt words and inputting them along with the selected dialogue data into the large language model; 4) repeating step 3) to obtain refined final prompt words that meet the set conditions; 5) classifying the dialogue intents in the final prompt words, extracting the K highest-ranking dialogue intents, and generating a dialogue information flow and scenario for each type of dialogue intent; 6) generating corresponding backbone templates based on the dialogue information flow and scenario of each type of dialogue intent; 7) filling in the context corresponding to the backbone templates; 8) using the large language model to fill in the specific content of each backbone template, generating a dialogue flow and verifying and self-consistency reviewing it.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data synthesis technology and relates to a multi-turn dialogue synthesis method using real data. Background Technology

[0002] In recent years, multi-turn dialogue technology, as one of the key technologies in the field of large language models, has received widespread attention from industry and academia. In advanced dialogue systems, whether in intelligent customer service, chatbots, virtual assistants, or professional scenarios such as education, gaming, and healthcare, multi-turn dialogue plays a central role, aiming to achieve a more natural and fluid interactive experience. However, training high-quality multi-turn dialogue models inherently relies on a large amount of real user intent and diverse and coherent dialogue data. The synthesis of multi-turn dialogue data is not merely to solve the problem of high data acquisition costs; its core significance lies in the following key aspects:

[0003] 1. Enhance the capabilities of the dialogue system

[0004] Multi-turn dialogue data helps models better understand contextual information, develop global cognition and comprehension capabilities, and enhance their ability to handle complex dialogue situations. Real user intent modeling and scenario simulation data can enrich the model's performance capabilities in different industries and scenarios.

[0005] 2. Diversity and generalization ability

[0006] Synthetic data can avoid the bias that may exist in real data, expand the contextual diversity of dialogue models, and improve the ability to generalize to unseen scenarios.

[0007] 3. Adaptability to the characteristics of different fields

[0008] In specific industries (such as medical consultations and educational tutoring), multi-turn dialogues need to cover domain-specific knowledge. Synthetic data can generate relevant scenario dialogues in a targeted manner, reducing the cost of relying on manual annotation.

[0009] 4. Saves data collection costs

[0010] Traditional methods of collecting user dialogue data usually require a lot of manpower and time. Synthesizing multi-turn data can significantly reduce the cost of data collection and annotation, and improve R&D efficiency.

[0011] Existing large language models mainly employ the following three technical solutions during the multi-turn dialogue data collection phase:

[0012] 1. User-generated dialogue data

[0013] This type of data originates from user queries, which are gradually collected through multiple rounds of interaction after the system provides a response. The data synthesized by this method is a true reflection of real user intent, especially rich, natural, and diverse query methods and question scenarios. However, its data collection depends on user interaction, limiting its scale and diversity. Furthermore, due to the uncontrollability of actual user behavior, the generated dialogue data may be mixed with a large amount of noise, making it difficult to use directly for training models.

[0014] 2. Artificially synthesized high-quality data

[0015] This method involves manually generating a small amount of high-quality question-and-answer data to fine-tune the model, and then using the fine-tuned model to generate a batch of high-quality dialogue data. This approach enhances the model's dialogue capabilities through a small amount of high-quality dialogue data. However, this method relies on manual intervention and is difficult to scale; while the synthesized question-and-answer pairs are of high quality, the generated multi-turn dialogues lack controllability and may not reflect the complexity and diversity of real user intent.

[0016] 3. Generate data based on context

[0017] Some dialogue frameworks, based on a given initial question, use models to predict the questions users might ask in future interactions and continue to generate responses in multiple rounds. This can better simulate the contextual continuity of multi-turn dialogues in real-world applications; however, this has weaker global quality control over the generated results, and the dialogue flow may have logical inconsistencies or go off track. The dialogue topics generated by the model may lack diversity and easily fall into repetition or patterning.

[0018] Based on the above analysis, the main problems with the existing solutions can be identified as follows:

[0019] 1. Data quality issues

[0020] While existing data generation methods strive to maintain naturalness and high quality, they inevitably introduce noisy data. Some data generation methods rely too heavily on the model's existing capabilities, which may lead to problems such as illogical output and unnatural expression, ultimately affecting the model's effective learning.

[0021] 2. Insufficient diversity in dialogue

[0022] Synthetic data often suffers from a lack of diversity, especially in multi-turn dialogues, where the generated dialogues tend to be rigid or formulaic, making it difficult to meet the diverse questions and behaviors of users in real-world scenarios.

[0023] 3. Incoherence

[0024] Multi-turn dialogues require ensuring consistency in contextual logic and continuity of topic. However, existing methods often fail to accurately retain the dialogue topic, and the generated content may deviate from or stray from the initial question. When dealing with complex intent shifts and non-linear dialogues, models lack a global understanding, resulting in poor dialogue continuity. Summary of the Invention

[0025] To address the problems existing in the prior art, the purpose of this invention is to provide a multi-turn dialogue synthesis method using real data. This invention is a novel multi-turn dialogue data synthesis method that utilizes multi-turn dialogue backbone abstraction technology extracted from real data to enhance the model's responsiveness in multi-turn dialogue scenarios.

[0026] The key point of this invention is:

[0027] 1. This paper proposes a method based on multi-turn dialogue backbone abstraction. This method generates high-quality dialogue data with different intent classifications from a batch of unlabeled data. Conventional multi-turn dialogue data collection mainly relies on user-generated or reverse-generated data, which introduces noise or unnaturalness. The backbone abstraction method involves identifying core information in the dialogue, such as user intent, key questions, and contextual information, thereby generating coherent multi-turn data suitable for high-quality dialogue generation.

[0028] 2. A mechanism for abstracting and transforming the dialogue backbone is proposed. By abstracting the user intent, system response, and implicit context in multi-turn dialogues, each turn of dialogue can be simplified into a basic structure, thereby reasonably preserving key information points and ensuring the compactness and coherence of the entire multi-turn dialogue.

[0029] 3. A multi-turn dialogue synthesis method based on real-world usage scenarios. By abstracting the backbone of real dialogues, such as the lmsys-chat-1m dataset, and combining it with actual scenarios, dialogue data is synthesized to simulate complex and realistic multi-turn user interactions. This step is not limited to generating high-quality responses, but also simulates continuous questioning by real users, making the prompts more consistent with real-world user behavior.

[0030] 4. Construct high-quality cue words. Use a sufficiently powerful large language model as an adjudicator to analyze the intent and patterns in multi-turn dialogues within the dataset during the initial analysis.

[0031] The technical solution of this invention is as follows:

[0032] A multi-turn dialogue synthesis method utilizing real data includes the following steps:

[0033] 1) Design a set of initial prompt words for analyzing multi-turn dialogue intent and interaction logic using a large language model;

[0034] 2) Input the selected real user dialogue data and the initial prompt words into the large language model, and output the dialogue intent and interaction logic of the selected real user dialogue data;

[0035] 3) Check whether the current output dialogue intent and interaction logic meet the set conditions. If they do not meet the set conditions, adjust the prompt words. Then, input the adjusted prompt words and the selected real user dialogue data into the large language model, and output the dialogue intent and interaction logic of the selected real user dialogue data.

[0036] 4) Repeat step 3) until the dialogue intent and interaction logic output by the large language model meet the set conditions, and obtain the refined final prompt words;

[0037] 5) Classify the dialogue intent in the refined final prompts, extract the K types of dialogue intent with the highest intent category, and generate a corresponding dialogue information stream and random scene for each of the K types of dialogue intent.

[0038] 6) Generate the backbone template of the corresponding dialogue intent based on the dialogue information flow and random scenario of each of the K types of dialogue intents;

[0039] 7) Use the data from the selected knowledge base to populate the context corresponding to each backbone template;

[0040] 8) Use the large language model to fill in the specific content of each backbone template to generate a dialogue flow; verify the generated content based on contextual logic consistency and topic consistency; after verification, use the large language model as the judge to conduct a self-consistency review on each generated dialogue flow; if the self-consistency review is passed, it is used as the dialogue flow of the corresponding category dialogue intent of the backbone template; otherwise, it is iteratively corrected.

[0041] Furthermore, interaction backbone information is extracted from the dialogue information flow and random scenarios of each type of dialogue intent as a backbone template; the interaction backbone information includes the user's main intent, key questions, typical interaction patterns and necessary context.

[0042] Furthermore, the stated condition is that the dialogue intent and interaction logic can stably and effectively describe the characteristics of multi-turn dialogues.

[0043] Furthermore, the categories of the dialogue intent include: problem-solving interaction, educational interaction, health interaction, exploratory interaction, entertainment interaction, simulation interaction, emotional support interaction, information retrieval interaction, and transactional interaction.

[0044] Furthermore, the selected knowledge base is the Wiki knowledge base.

[0045] Furthermore, the initial prompt is: Please analyze the main intent, interaction structure, and logical clarity of the following dialogue, ... and output a summary: [Dialogue text].

[0046] Furthermore, a large language model is used to extract the dialogue information flow and the backbone template of random scenarios for each of the K types of dialogue intents.

[0047] A server is characterized by comprising a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the methods described above.

[0048] A computer-readable storage medium having a computer program stored thereon, characterized in that the computer program implements the above-described method when executed by a processor.

[0049] The advantages of this invention are as follows:

[0050] This invention combines innovative multi-turn dialogue backbone abstraction technology, significantly improving the data quality, coherence, and naturalness of large language models in multi-turn dialogue generation. By extracting the dialogue backbone, the generated data not only maintains the contextual structure of the dialogue but also highlights the core information of the user's intent. The trained model can more accurately identify and respond to complex user needs, thereby generating responses more suitable for real-world application scenarios.

[0051] This invention reduces the gap between synthetic dialogue data and real user interaction data, resulting in more natural synthetic dialogue data with higher topic consistency. Attached Figure Description

[0052] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0053] The present invention will now be described in further detail with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0054] I. Cleaning and preprocessing real user dialogue data

[0055] Collect multi-turn dialogue data from real users, such as lmsys-chat-1m and wildchat. First, preprocess the data to remove potential noise. The specific method is as follows:

[0056] 1. Remove obviously invalid or low-quality data

[0057] Remove poorly formatted or incomplete dialogue data, such as single-turn interactions, discontinuous dialogue streams, or data containing only user input without model responses. Exclude blank spaces, garbled text, excessive repetition, or obviously meaningless text content, such as purely symbolic input, irrelevant keystrokes, and obvious noise.

[0058] 2. Filter inappropriate content

[0059] By using keyword filtering and natural language discrimination methods, content containing discriminatory, violent, offensive language or sensitive information (such as account numbers, passwords, names, etc.) in the dialogue is cleaned up to ensure the ethical and general applicability of the dataset.

[0060] 3. Remove dialogues that are disjointed or illogical.

[0061] For multi-turn dialogues, the system cleans up conversations with obvious semantic contradictions or logical inconsistencies by detecting discontinuous or incoherent contexts. For example, the user's question and the model's answer may be clearly irrelevant or off-topic.

[0062] 4. Standardize format and correct potential errors.

[0063] Standardize the basic format of the data (such as usernames, reply paragraph separators, and punctuation) to ensure the clarity and readability of the dialogue text. Use spell checking and grammar correction tools (such as model-based or rule-based language tools) to correct spelling errors and language problems in the dialogue.

[0064] II. Constructing prompt words and analyzing them using a large language model

[0065] Input data: Cleaned real user conversation data.

[0066] Specific procedures:

[0067] 1. Initial prompt word design

[0068] Design a set of initial cue words, either manually or using a model-based approach, to analyze the intent and interaction logic of multi-turn dialogues. For example: Analyze the main intent, interaction structure, and logical clarity of the following dialogue, ..., and output a summary in the required format (e.g., structured JSON format, containing values ​​corresponding to the current dialogue intent, interaction structure, and logical clarity for easier subsequent analysis and clustering): [Dialogue Text]. The goal of the cue words is to enable large language models to accurately summarize the intent, logic, and key issues of multi-turn dialogues.

[0069] 2. Improve the iteration process of prompt words.

[0070] Based on the analysis results of the dialogue intent and interaction logic from the previous round, the prompts can be adjusted manually or through the model. If the previous round's analysis was insufficient, more explicit analysis instructions can be added. If the model failed to recognize contextual information in the previous round, the prompts can be adjusted to describe contextual dependencies.

[0071] The prompts are iterated to the point that the results can cover most common dialogue intents, and the dialogue intent analysis generated by the model is logically consistent and clearly expressed.

[0072] 3. Stopping conditions

[0073] In determining the stability and high-quality descriptive ability of the model output, we not only adopted quantitative evaluation criteria (intent accuracy, interaction logic consistency, and stability), but also incorporated research findings from a systematic review paper in the field of human-computer interaction (Rapp et al., 2021, The human side of human-chatbot interaction: A systematic literature review of ten years of research on text-based chatbots). This paper summarizes common dialogue intents of humans when interacting with chatbots. Starting from this systematic review of human-computer interaction, this invention uses a large model to analyze the dialogue intents of multiple multi-turn dialogue datasets, performs cluster analysis, and analyzes the most prevalent intents, matching them with the intents mentioned in the paper. In other words, this invention pre-defines the dialogue intents of real user dialogue data. After finally identifying multiple dialogue intents, it designs the interaction logic (dialogue information flow) that must be followed in multi-turn dialogues for each dialogue intent.

[0074] The specific optimization process of this invention is as follows:

[0075] Multi-turn dialogue dataset analysis: Analyze multiple multi-turn dialogue datasets, select dialogue instances with the highest intent, and use a large model for intent annotation and logical reasoning analysis.

[0076] Cluster analysis and manual screening: Clustering is performed based on the results of multiple analyses, and high-quality dialogue intents that are common and account for a large proportion of human interactions are manually screened by domain experts.

[0077] Comparison with intentions in review papers: Comparative analysis of the selected intention categories with the research results in Rapp et al. (2021) ensures high coverage, and finally summarizes nine common human dialogue intentions as intention labels for corresponding multi-turn dialogues.

[0078] Information flow design and rule formulation: Based on the summarized common intents, a reasonable dialogue information flow is designed for each intent to conform to natural interaction logic, and used to guide the subsequent optimization of prompt words and distillation rule formulation in the large model. That is, after obtaining nine user intents, the large model generates the scene topics that each dialogue intent may contain, for example, generating 500 dialogue scenarios for each dialogue intent. The dialogue intents and dialogue information flows are the same inputs for each model distillation, while also providing the generated scene topics. Each dialogue intent can generate 500 multi-turn dialogue scenarios.

[0079] The optimization iteration terminates when all of the following conditions are met: intent recognition accuracy ≥ 90%; interaction logic consistency score ≥ 85%; output stability (the model performs normal analysis and can output results as required) ≥ 85%. Nine common human dialogue intents are effectively covered, and a reasonable dialogue information flow is designed for each intent.

[0080] The final output prompts not only ensure high accuracy in intent recognition and logical analysis, but also comprehensively cover common human dialogue intents, providing crucial support for rule formulation in subsequent large-scale distillation models.

[0081] The iteration stops when the output dialogue intent and logical analysis results can stably and effectively describe the characteristics of multi-turn dialogues. The final output prompts explicitly include consistency checks for multiple intent classifications and contextual logic.

[0082] Output: Refined final prompts and the results of intent and logic analysis in multi-turn dialogues provide key input for the core abstraction method.

[0083] III. Summarize high-frequency dialogue intentions and extract interaction backbones

[0084] Input data: multi-turn dialogue intents, corresponding dialogue information flows, and random scenarios that match the dialogue intents from the analysis results.

[0085] Specific steps:

[0086] 1. Model statistical analysis of high-frequency intents

[0087] The analyzed multi-turn dialogues are categorized according to intent tags, and frequently occurring intent categories (such as inquiry questions, need confirmation, error handling, etc.) are extracted. A large language model is used as an auxiliary method to summarize the commonalities of each intent category.

[0088] 2. Extract the interaction backbone

[0089] Based on the statistically analyzed high-frequency intent categories and the dialogue information flow and random scenarios within each intent category, the core interaction information is extracted. This core includes the user's primary intent, key questions, typical interaction patterns, and necessary context. For example: User asks a question → System confirms the scope of the question → User clarifies their intent → System provides a specific answer.

[0090] Output: A backbone template containing high-frequency dialogue intent classification and interaction logic, providing a core example for the backbone abstraction method.

[0091] IV. Combining core abstraction methods with external data such as Wikis to generate multi-turn dialogues

[0092] Input data: Dialogue backbone templates from the analysis results, as well as extended data from external knowledge bases such as Wiki.

[0093] Specific steps:

[0094] 1. Integrate external knowledge data

[0095] Use Wiki data to populate specific contexts in the backbone template, such as generating answer elements for specific questions in intent categories.

[0096] 2. Generate multi-turn dialogue data based on the backbone.

[0097] For each backbone template, specific content is populated using a large model. The generated content is validated based on contextual logic consistency and topic consistency to ensure that the generated dialogue flow remains coherent and conceptually consistent across multiple rounds.

[0098] 3. Automatic adjustment and optimization

[0099] A large language model is used as the judge to conduct a self-consistency review on each generated dialogue stream to ensure there are no logical contradictions. Dialogues that do not conform to the logical backbone definition are automatically filtered or marked and included in subsequent correction iterations.

[0100] Output: A batch of multi-turn dialogue data with high topic consistency and coherent dialogue logic.

[0101] Based on the experimental steps above, nine common dialogue intentions were collected and corresponding dialogue information flows were compiled. These information flows reflect the development trend and direction of each multi-turn dialogue. Finally, different information flows were matched according to different interaction intention categories, serving as prompt templates for subsequently constructing multi-turn dialogue instructions.

[0102]

[0103]

[0104] V. Output a multi-turn dialogue dataset with high topic consistency

[0105] Final result: By combining cleaned real user data, backbone templates, and multi-turn dialogues generated by a large model, a high-quality dialogue dataset is formed.

[0106] This dataset has the following characteristics:

[0107] 1. The topics of the multiple rounds of dialogue are continuous and logically consistent.

[0108] 2. It can effectively cover multiple intent categories and has scalability.

[0109] 3. The data has been reviewed and screened, and has a high degree of naturalness and contextual coherence.

[0110] Although specific embodiments of the invention have been disclosed for illustrative purposes to aid in understanding and implementing the invention, those skilled in the art will understand that various substitutions, variations, and modifications are possible without departing from the spirit and scope of the invention and the appended claims. Therefore, the invention should not be limited to the content disclosed in the preferred embodiments, and the scope of protection claimed by the invention is defined by the claims.

Claims

1. A multi-turn dialogue synthesis method utilizing real data, comprising the following steps: 1) Design a set of initial prompt words for analyzing multi-turn dialogue intent and interaction logic using a large language model; 2) Input the selected real user dialogue data and the initial prompt words into the large language model, and output the dialogue intent and interaction logic of the selected real user dialogue data; 3) Check whether the current output dialogue intent and interaction logic meet the set conditions. If they do not meet the set conditions, adjust the prompt words. Then, the adjusted prompts and the selected real user dialogue data are input into the large language model, and the dialogue intent and interaction logic of the selected real user dialogue data are output. 4) Repeat step 3) until the dialogue intent and interaction logic output by the large language model meet the set conditions, and obtain the refined final prompt words; 5) Classify the dialogue intents in the refined final prompts and extract the K-class dialogue intents with the highest intent categories. And generate a corresponding dialogue information stream and random scenario for each of the K types of dialogue intents; 6) Generate the backbone template of the corresponding dialogue intent based on the dialogue information flow and random scenario of each of the K types of dialogue intents; 7) Use the data from the selected knowledge base to populate the context corresponding to each backbone template; 8) Use the large language model to fill in the specific content of each backbone template to generate a dialogue flow; verify the generated content based on contextual logic consistency and topic consistency; after verification, use the large language model as the judge to conduct a self-consistency review on each generated dialogue flow; if the self-consistency review is passed, it is used as the dialogue flow of the corresponding category dialogue intent of the backbone template; otherwise, it is iteratively corrected.

2. The method according to claim 1, characterized in that, Interaction backbone information is extracted from the dialogue information flow and random scenarios of each type of dialogue intent as a backbone template; the interaction backbone information includes the user's main intent, key questions, typical interaction patterns and necessary context.

3. The method according to claim 1, characterized in that, The set condition is that the dialogue intent and interaction logic can stably and with high quality describe the characteristics of multi-turn dialogue.

4. The method according to claim 1, 2, or 3, characterized in that, The categories of dialogue intent include: problem-solving interaction, educational interaction, health interaction, exploratory interaction, entertainment interaction, simulation interaction, emotional support interaction, information retrieval interaction, and transactional interaction.

5. The method according to claim 1, 2, or 3, characterized in that, The selected knowledge base is the Wiki knowledge base.

6. The method according to claim 1, 2, or 3, characterized in that, The large language model is used to extract the dialogue information flow and the backbone template of random scenarios for each of the K types of dialogue intents.

7. A server, characterized in that, It includes a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the method of any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Prompt word updating method, device and system based on multi-dimensional large language model

    CN118132716A

  • Prompt word generation method of large language model and question answering method of large language model

    CN119168062A