Doctor-patient communication model training method and system based on synthetic roles
By constructing a virtual character library and teacher model to generate synthetic data and training a basic large language model, the problems of data sparsity and privacy risks in existing technologies are solved, enabling efficient and personalized doctor-patient communication and improving communication quality and efficiency.
Patent Information
- Application Number
- CN202511676606.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2025-12-16
AI Technical Summary
Existing technologies, when building doctor-patient communication models, suffer from problems such as data sparsity, high privacy risks, and insufficient generalization ability of model roles due to reliance on real data, resulting in low communication efficiency and quality.
We employ a training method based on large-scale synthetic role-playing data. By constructing a virtual role library covering a wide range of medical scenarios, we generate high-quality dialogue data using a teacher's language model, and then train a basic large language model through supervised fine-tuning to achieve personalized communication capabilities.
It achieves the goal of eliminating the need for real data collection, reducing privacy risks, while possessing strong role generalization capabilities, enabling the generation of empathetic and personalized doctor-patient dialogues, significantly improving communication efficiency and quality.
Smart Images

Figure CN121148745A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and natural language processing, and in particular to a method and system for training a doctor-patient communication model based on synthetic roles. Background Technology
[0002] Doctor-patient communication is a core component of the modern healthcare system, and its quality directly impacts patient adherence, satisfaction, and ultimately, clinical outcomes. Ideal doctor-patient communication requires doctors not only to accurately convey complex medical information but also to possess empathy and engage in personalized, humane communication based on the patient's background knowledge, emotional state, and personality traits. However, in the real-world medical environment, due to heavy workloads for doctors, limited clinic hours, and information asymmetry between doctors and patients, inefficient and low-quality communication is prevalent. This has become a key technical challenge leading to doctor-patient conflicts and affecting medical outcomes.
[0003] With the rapid development of large language models, leveraging their powerful language generation and understanding capabilities to assist or empower doctor-patient communication has become a highly promising research direction. Currently, the technical solutions in this field can be mainly divided into the following categories: 1. Question-answering robots based on fixed knowledge bases: This is an early approach that works by constructing medical knowledge graphs or maintaining a database containing "standard questions and standard answers." These systems can accurately answer some factual medical questions, but they completely lack contextual understanding and emotional perception capabilities. Their interaction is rigid and mechanical, unable to handle non-standardized questions, let alone conduct warm and humanized communication, resulting in extremely limited application scenarios. 2. Dialogue models fine-tuned based on general corpora: This approach uses general medical literature and question-answering data from online health communities (such as WebMD) to fine-tune a basic large language model. Compared to knowledge base robots, these models possess certain multi-turn dialogue and natural language understanding capabilities. However, because the training data is usually anonymous and non-contextual, the model learns an "averaged" and "de-personalized" communication pattern. It cannot perceive and adapt to the specific role characteristics of a particular patient—for example, it will explain a patient's condition to a medical professor and an illiterate elderly person in the same professional tone, making it difficult to communicate effectively in real-world applications. 3. Models based on limited real doctor-patient dialogue data for role-playing learning: To enable models to learn personalized communication, some studies have attempted to collect or utilize limited, authentic (anonymized) doctor-patient dialogue recordings or texts for model training. These methods attempt to allow the model to learn the language styles of different doctors or patients.
[0004] However, the aforementioned existing technical solutions, especially those relying directly on real data for training, face significant challenges in building efficient and reliable doctor-patient communication models. The core issues lie in the "sparseness" of training data, "privacy risks," and the model's "insufficient role generalization ability": 1. Data Sparsity and Bias: High-quality, comprehensive real-world doctor-patient dialogue data is extremely difficult to obtain. Data that can be collected in reality is often limited to a few departments or specific diseases, failing to cover thousands of diseases and diverse doctor-patient combinations. This leads to severe data bias in model training, resulting in very limited communication patterns learned. 2. Privacy and Ethical Risks: Doctor-patient dialogue involves highly sensitive personal privacy information. Even after anonymization, the collection, storage, and use of data still face significant legal and ethical risks, greatly limiting the scalability and application prospects of this technical approach. 3. Poor Role Generalization Ability: Models trained on limited real data essentially only "imitate" a few roles that have appeared in the training set. When faced with a patient with entirely new combinations of characteristics never seen during training (e.g., an engineer with a rare disease who is stubborn and skeptical of treatment options), the model fails to perform effective "role generalization," and its communication ability drops sharply, degenerating into a generic, generalized dialogue model. Summary of the Invention
[0005] This invention aims to address the problems existing in the prior art, namely, the data sparsity, high privacy risks, and severe lack of model role generalization ability caused by relying on real data when constructing intelligent doctor-patient communication models. Therefore, it proposes a more efficient, scalable, and secure training method for doctor-patient communication models based on large-scale synthetic role-based data. This method can be applied to intelligent healthcare, medical informatics, and clinical decision support systems to improve the efficiency and quality of doctor-patient communication.
[0006] This invention proposes a complete framework for synthetic data generation and model training. First, it programmatically constructs a library of tens of thousands of virtual "patient-doctor" roles covering a wide range of medical scenarios. Then, it drives a powerful teacher model to generate high-quality dialogue data around these roles. This "role-driven data generation" paradigm fundamentally eliminates the reliance on real, sensitive medical data. Through massive and diverse synthetic data, the model learns deep communication patterns rather than simply imitating them, thus possessing a powerful generalization ability for any unseen role. Extensive experiments have demonstrated that the model trained in this invention significantly outperforms existing methods in generating empathetic, medically accurate, and highly personalized doctor-patient dialogues.
[0007] The technical solution of the present invention is described in detail below.
[0008] A method for training a doctor-patient communication model based on synthetic roles includes the following sequentially executed steps: Step 1: Synthesis of the Medical Role Database Using a pre-trained teacher language model, based on pre-defined multi-dimensional role prototypes covering both patients and doctors, a database containing a large number of diverse and information-rich medical role profiles is generated. Step Two: Generation of Role-Based Doctor-Patient Dialogue Data Medical role profiles are selected from the database to drive the teacher language model. Through a role-based doctor-patient dialogue generation mechanism, large-scale doctor-patient dialogue data that is highly consistent with the role profiles is synthesized around a preset medical communication scenario (such as initial consultation, explaining test reports, discussing treatment plans, etc.). Step 3: Fine-tuning of the doctor-patient communication model. The role-based doctor-patient dialogue data generated in step two, including role introductions, dialogue context, and role responses, is used to construct an instruction fine-tuning dataset. This dataset is then used to perform supervised fine-tuning on a basic large language model, enabling the model to learn the ability to conduct efficient and personalized doctor-patient communication based on any specified role. Finally, an optimized doctor-patient communication language model is output.
[0009] In this invention, in step one, the multi-dimensional character prototype includes: The patient archetype is defined by the following dimensions: demographic characteristics (age, occupation), disease characteristics (disease type, course of disease), level of medical knowledge, emotional and psychological state (anxiety, optimism), and communication style (concise, talkative). The archetype of a doctor includes dimensions such as: professional field (cardiology, pediatrics), communication style (patient, direct), level of empathy, and level of experience.
[0010] In this invention, step two involves introducing the medical roles, such as an anxious newly diagnosed diabetic patient or an endocrinologist skilled in analogies.
[0011] In this invention, step two, the role-based doctor-patient dialogue generation mechanism includes the following two dialogue generation strategies: Scenario simulation generation strategy: Input a specified medical communication scenario, a patient role profile selected from the database, and a doctor role profile into the teacher language model, so that it can simulate the identities of both parties and generate a complete dialogue from scratch that conforms to all input settings; Medical knowledge rewriting strategy: Input a standardized text from a medical knowledge base, a patient role profile, and a doctor role profile into the teacher language model, and rewrite the standardized text into a personalized dialogue that is easy for patients to understand and conforms to the doctor's communication style.
[0012] In this invention, in step two, the teacher language model is driven to generate dialogue through instruction prompts, wherein: The instruction prompts used for the scenario simulation generation strategy include variable placeholders for populating the medical communication scenario, patient role profile, and doctor role profile, and explicitly instruct the model to generate a dialogue that conforms to the settings of the medical communication scenario, patient role profile, and doctor role profile. The instruction prompts for medical knowledge rewriting strategies include variable placeholders for populating the original standardized text, patient role profiles, and doctor role profiles, and explicitly instruct the model to interpret and restate the original text in the tone and style of the specified roles.
[0013] In this invention, in step three, the fine-tuning stage of the doctor-patient communication model aims to minimize the difference between the model-generated answers and the standard answers in the synthetic data.
[0014] In this invention, in step three, the fine-tuning stage of the doctor-patient communication model only calculates and backpropagates the loss of the target response sequence portion of the model output, while masking the loss of the lexical components of the input role description and dialogue context portion, to ensure that the model focuses on learning to generate responses that conform to the role; the training objective of the supervised fine-tuning is to update the parameters θ of the base large language model by minimizing the following loss function L:
[0015] Where N is the total number of training samples; for the i-th training sample, This is the input of doctor and patient role descriptions. It's the context of the conversation or the user's question. This is the target answer sequence that the model needs to generate. It is the j-th token in the response sequence. It is the length of the target response sequence; Given a character description, context, and partially generated answers, the model predicts the next lexical term. The probability of.
[0016] In this invention, in step three, the basic large language model is an autoregressive language model based on the Transformer architecture, such as LLaMA-3, ChatGLM, etc.
[0017] This invention also provides a doctor-patient communication system, which incorporates a doctor-patient communication model trained using the above-described method; the system's workflow includes: Receive a system instruction that defines the current communication role, which contains one or more specific medical role descriptions; Receive user input requests; The system invokes the doctor-patient communication language model, which generates a response that matches the role's identity, style, and professional knowledge based on the roles defined in the system instructions, and outputs it to the user.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Fundamentally solves data bottleneck and privacy security issues: This invention employs a fully synthetic data generation path, eliminating the need to collect or process any real doctor-patient dialogues, thus completely avoiding data privacy leaks and related ethical risks. Simultaneously, the synthesis method boasts extremely high scalability, capable of generating nearly unlimited training data covering various rare diseases and complex role combinations at low cost and high efficiency, solving the problems of sparsity and bias in real-world data.
[0019] 2. It achieves powerful role generalization capabilities, enhancing personalized communication: By training on a vast and diverse range of roles, the model learns not just superficial imitation of specific individuals, but a deep mapping relationship between role characteristics and language patterns. This gives the model powerful "zero-shot" or "few-shot" role generalization capabilities. Even when faced with arbitrary patient or doctor roles assigned by the user that were never seen during training, it can quickly adapt and generate responses highly consistent with their identity, emotions, and communication styles, achieving truly personalized communication.
[0020] 3. Significantly improves communication efficiency and quality, possessing high practical value: The model trained by this invention can serve as a "communication engine" for various intelligent medical applications. For example, before a consultation, it can simulate a patient nurse, guiding patients to clearly and completely describe their symptoms; during a consultation, it can act as an "empathy translator" for doctors, converting professional terminology into easily understandable explanations in real time; after a consultation, it can act as a tireless family doctor, providing patients with rehabilitation guidance and emotional support. These applications can effectively save doctors' time, enhance patient understanding and trust, thereby significantly improving the overall efficiency and quality of medical services. Attached Figure Description
[0021] Figure 1 This is a diagram of the doctor-patient communication model training system based on large-scale synthetic data proposed in this invention.
[0022] Figure 2 This is a schematic diagram of the workflow of the "role-based doctor-patient dialogue generation" mechanism in this invention, which shows in detail the two strategies of scenario simulation generation and medical knowledge rewriting.
[0023] Figure 3This is a bar chart comparing the "patient understanding" index of the model of this invention and the existing publicly available technical methods in the scenario of "simulating blood glucose control education for anxious diabetic patients".
[0024] Figure 4 This is a bar chart comparing the "communication empathy" index between the model of this invention and existing publicly available technical methods in the same scenario. Detailed Implementation
[0025] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0026] Existing technical solutions, such as fine-tuning with general medical corpora or training with a small amount of real doctor-patient dialogue data, have introduced large language models into the field of doctor-patient communication. However, in practical applications, they struggle to effectively address inherent shortcomings such as sparse training data, high privacy risks, and insufficient model role generalization ability. These shortcomings prevent the model from engaging in truly personalized and empathetic communication, ultimately limiting the practicality of the trained model.
[0027] The present invention aims to address the aforementioned problems in existing technical solutions, namely, the data bottleneck caused by dependence on real data and the performance bottleneck of poor model generalization ability, and proposes a scalable, secure and efficient training framework for doctor-patient communication models.
[0028] To fundamentally address the issues of data dependency and role generalization, this invention introduces the core idea of large-scale data synthesis. The key lies in shifting the paradigm from "learning from existing data" to "generating data for a specific goal." This invention establishes a powerful, universal "teacher language model" that acts as a "data generator." First, it programmatically constructs a vast and comprehensive database of roles within the medical field. Then, it drives this teacher model to generate massive amounts of high-quality dialogue data around these roles, which is used to "teach" a "student language model" that needs to be trained.
[0029] like Figure 1 As shown, the overall framework of this invention revolves around a "teacher-student" model. The teacher model is responsible for executing all data synthesis tasks. The student model is the target model to be trained. The entire process begins with a medical role library synthesis module, which defines a rich set of doctor-patient role prototypes. Next, a role-based dialogue generation module uses these roles to drive the teacher model to generate massive amounts of dialogue data through two strategies. This data is then formatted into an instruction fine-tuning dataset and used for supervised fine-tuning of the student model.
[0030] The key to model training lies in the diversity and high quality of the synthesized data. This invention ensures data diversity through procedural role combinations and scenario settings; and ensures high quality in terms of medical accuracy, logical coherence, and role consistency by utilizing state-of-the-art teacher models.
[0031] A method for training a doctor-patient communication language model based on large-scale synthetic role-playing data includes the following sequentially executed steps: Step 1: Synthesis of the Medical Field Role Database The goal of this phase is to create a structured, information-rich database of virtual doctor-patient roles. We first defined multi-dimensional role prototypes. In a specific embodiment, the patient role prototype includes five dimensions: {demographic characteristics, disease characteristics, knowledge level, emotional state, and communication style}. The doctor role prototype includes four dimensions: {specialty, communication style, level of empathy, and level of experience}.
[0032] The synthesis process is accomplished by sending a structured instruction prompt to the teacher language model (such as GPT-4o or more advanced). This prompt contains descriptions of the aforementioned dimensions and instructs the model to generate a detailed character profile based on a brief core setting (e.g., "a programmer newly diagnosed with hypertension"). For example: Input core setting: "A recently retired history teacher who is skeptical of modern medicine and suffers from type 2 diabetes." Example of a teacher model's character profile: {Name: Li ××, Age: 62, Occupation: Retired middle school history teacher, ... Disease characteristics: Type 2 diabetes, duration of illness: 2 weeks, with mild complications..., Knowledge level: Has some understanding of traditional Chinese medicine theory, fears the side effects of Western medicine..., Emotional state: Outwardly calm, inwardly anxious and stubborn..., Communication style: Likes to quote classical texts, expresses opinions in a didactic tone...}
[0033] By procedurally combining thousands of core settings, this stage can generate tens of thousands (e.g., 20,000) unique, highly detailed medical character profiles, which are then stored in a database.
[0034] Step Two: Generation of Role-Based Doctor-Patient Dialogue Data The core of this stage is to drive the teacher model, generating dialogue data for fine-tuning the student model based on the role library produced in step one. For example... Figure 2 As shown, this stage includes two generation strategies: Scenario Simulation Generation: This strategy is used to generate complete, multi-turn dialogues. First, a patient role profile and a doctor role profile are randomly selected from the role database, and a specific communication scenario is set, such as "explaining the first glycated hemoglobin test report." Then, these three elements are combined into a detailed instruction prompt and sent to the teacher model, which is then required to generate a dialogue that conforms to the specified scenario.
[0035] Medical Knowledge Rewriting: This strategy generates explanatory dialogues for specific knowledge points. First, a standardized text is extracted from an authoritative medical knowledge base (such as the well-known medical textbook UpToDate), for example, a standard description of the side effects of metformin. Then, a patient role profile and a doctor role profile are extracted and combined into a prompt, requiring the teacher model to explain the standardized medical knowledge text to the patient in the doctor's voice. For example, for an anxious patient with low knowledge levels, the teacher model would be guided to use simpler metaphors, a gentler tone, and proactively offer reassurance.
[0036] Step 3: Fine-tuning of the doctor-patient communication model All dialogue data generated in step two are uniformly formatted into an instruction fine-tuning dataset. The format of each data sample is typically: {"instruction": "You are playing the role of [Doctor Introduction]. Now you need to have a dialogue with [Patient Introduction]. The following is the context of the dialogue: [Dialogue History]. Please generate your next response.", "output": "[Standard response generated by the teacher model]"}.
[0037] Supervised fine-tuning of a base student large language model (e.g., LLaMA-3 8B) is performed using this dataset. The goal of training is to update the student model's parameters θ by minimizing the cross-entropy loss between the student model's predicted token sequences and the standard responses in the "output" portion of the dataset.
[0038] The specific form of the loss function is:
[0039] Where N is the total number of training samples, This is the input of doctor and patient role descriptions. It is the dialogue history, that is, the context of the dialogue or the user's questions. ,Right now This is the target answer sequence that the model needs to generate. It is the length of the target response sequence; Given a character description, context, and partially generated answers, the model predicts the next lexical term. The probability of this. In this way, the student model learns to generate the most appropriate response given any character and dialogue history.
[0040] Example 1 To verify the superiority of the method described in this invention over the prior art, a simulation evaluation experiment was conducted.
[0041] Experimental task: Simulate a medical communication scenario—"An empathetic endocrinologist explains the importance of blood sugar control and provides initial lifestyle advice to a newly diagnosed type 2 diabetes patient who is anxious and has a low level of medical knowledge."
[0042] Comparison method: 1. General Large Language Model (Baseline): A general large language model (GPT-3.5-turbo) without any medical domain fine-tuning.
[0043] 2. General Medical Fine-tuned Large Language Model: A model fine-tuned using general medical literature and online question-and-answer data.
[0044] 3. The method of the present invention: a doctor-patient communication model trained using the method described in the present invention.
[0045] Evaluation method: A more powerful model (GPT-4o) is used as an automatic evaluator to score the dialogues generated by the three methods from the following two dimensions (1-5 points, the higher the score, the better): 1. Patient comprehension: Assess whether the model uses plain language and appropriate metaphors to explain professional concepts.
[0046] 2. Empathic Communication: Assess whether the model can identify and respond to the patient's anxiety, and whether the language is caring and supportive.
[0047] Experimental results: 100 dialogues were generated for each comparison method, and the average evaluation score was calculated.
[0048] Table 1: Performance Comparison of the Invention with Existing Public Techniques
[0049] From Table 1, Figure 3 and Figure 4As can be seen, the method of this invention significantly outperforms other comparative methods in both key evaluation dimensions. While the general large language model can provide generally accurate medical information, its language is stiff and lacks empathy. The general medical fine-tuning large language model improves in professionalism, but its improvement in personalization and empathy is limited. In contrast, the method of this invention, trained on a large amount of role-playing data, can accurately identify and assume the role of an "empathetic" doctor, and proactively uses simpler and more reassuring language for patients with "anxiety and low knowledge levels." Therefore, it achieved near-perfect scores in both dimensions.
[0050] Experimental results fully demonstrate that the training paradigm of this invention, through large-scale synthetic role-based data, can effectively endow large language models with the ability to conduct high-quality, personalized doctor-patient communication, and its effect is significantly better than existing general models or models that have only been fine-tuned with general medical data.
Claims
1. A training method for a doctor-patient communication model based on synthetic roles, characterized in that, The following steps are executed consecutively: Step 1: Synthesis of the Medical Role Database Using a pre-trained teacher language model, based on pre-defined multi-dimensional role prototypes covering both patients and doctors, a database containing a large number of diverse and information-rich medical role profiles is generated. Step Two: Generation of Role-Based Doctor-Patient Dialogue Data Medical role profiles are selected from the database to drive the teacher language model. Through a role-based doctor-patient dialogue generation mechanism, large-scale doctor-patient dialogue data that is highly consistent with the role profiles is synthesized around a preset medical communication scenario. Step 3: Fine-tuning of the doctor-patient communication model. Role-based doctor-patient dialogue data is used to construct an instruction fine-tuning dataset. A basic large language model is then subjected to supervised fine-tuning, enabling the basic large language model to learn the ability to conduct efficient and personalized doctor-patient communication based on any specified role. Finally, an optimized doctor-patient communication language model is output.
2. The method for training a doctor-patient communication model according to claim 1, characterized in that, In step one, the multi-dimensional character prototype includes: The patient archetype includes dimensions such as demographic characteristics, disease characteristics, medical knowledge level, emotional and psychological state, and communication style. The archetype of a doctor includes dimensions such as: professional field, communication style, level of empathy, and level of experience.
3. The method for training a doctor-patient communication model according to claim 1, characterized in that, In step two, the role-based doctor-patient dialogue generation mechanism includes the following two dialogue generation strategies: Scenario simulation generation strategy: Input a specified medical communication scenario, a patient role profile selected from the database, and a doctor role profile into the teacher language model, so that it can simulate the identities of both parties and generate a complete dialogue from scratch that conforms to all input settings; Medical knowledge rewriting strategy: Input a standardized text from a medical knowledge base, a patient role profile, and a doctor role profile into the teacher language model, and rewrite the standardized text into a personalized dialogue that is easy for patients to understand and conforms to the doctor's communication style.
4. The method for training a doctor-patient communication model according to claim 3, characterized in that, In step two, the teacher language model is driven to generate dialogue through instruction prompts, wherein: The instruction prompts used for the scenario simulation generation strategy include variable placeholders for populating the medical communication scenario, patient role profile, and doctor role profile, and explicitly instruct the model to generate a dialogue that conforms to the settings of the medical communication scenario, patient role profile, and doctor role profile. The instruction prompts for medical knowledge rewriting strategies include variable placeholders for populating the original standardized text, patient role profiles, and doctor role profiles, and explicitly instruct the model to interpret and restate the original text in the tone and style of the specified roles.
5. The method for training a doctor-patient communication model according to claim 1, characterized in that, In step three, the fine-tuning stage of the doctor-patient communication model aims to minimize the difference between the model-generated answers and the standard answers in the synthetic data.
6. The method for training a doctor-patient communication model according to claim 1, characterized in that, In step three, the loss is calculated and backpropagated only for the target response sequence portion of the model output, while the loss is masked for the lexical components of the input character description and dialogue context portion, to ensure that the model focuses on learning to generate responses that fit the character. The training objective of the supervised fine-tuning is to update the parameters θ of the base large language model by minimizing the following loss function L: , Where N is the total number of training samples; for the i-th training sample, This is the input of doctor and patient role descriptions. It's the context of the conversation or the user's question. This is the target answer sequence that the model needs to generate. It answers the j-th word in the sequence. It is the length of the target response sequence; Given a character description, context, and partially generated answers, the model predicts the next lexical term. The probability of being.
7. The method for training a doctor-patient communication model according to claim 1, characterized in that, In step three, the basic large language model is an autoregressive language model based on the Transformer architecture.
8. A doctor-patient communication system, characterized in that, The system incorporates a doctor-patient communication model trained according to any one of claims 1-7; the system's workflow includes: Receive a system instruction that defines the current communication role, which contains one or more specific medical role descriptions; Receive user input requests; The system invokes the doctor-patient communication language model, which generates a response that matches the role's identity, style, and professional knowledge based on the roles defined in the system instructions, and outputs it to the user.
Citation Information
Patent Citations
Large language model training method and device
CN118349852A
Intelligent agent oral hospital diagnosis and treatment model establishment method and device
CN119230121A
Doctor-patient communication simulation training method and system based on emotion recognition model
CN119964845A
Medical question and answer data generation method and system, terminal and medium
CN119993562A
Personalized dialogue generation method and system based on role description enhancement
CN120523908A