Reasoning Like a Doctor: Improving Medical Dialogue Systems via Diagnostic Reasoning Process Alignment (2024)

Abstract: Medical dialogue systems have attracted significant attention for their potential to act as medical assistants. Enabling these medical systems to emulate clinicians’ diagnostic reasoning process has been the long-standing research focus. Previous studies rudimentarily realized the simulation of clinicians’ diagnostic process by fine-tuning language models on high-quality dialogue datasets. Nonetheless, they overly focus on the outcomes of the clinician’s reasoning process while ignoring their internal thought processes and alignment with clinician preferences. Our work aims to build a medical dialogue system that aligns with clinicians’ diagnostic reasoning processes. We propose a novel framework, EMULATION, designed to generate an appropriate response that relies on abductive and deductive diagnostic reasoning analyses and aligns with clinician preferences through thought process modeling. Experimental results on two datasets confirm the efficacy of EMULATION. Crucially, our framework furnishes clear explanations for the generated responses, enhancing its transparency in medical consultations.1

heading: 1 Introduction
text: Medical dialogue systems as a fundamental tool in facilitating effective healthcare consultations have garnered sustained attention in recent years (Zeng et al., 2020; Liu et al., 2022b). Especially with the rise of large language models (LLMs), these systems have shown promising potential to act as virtual medical assistants that can aid clinicians in accurate and efficient diagnosis (Bao et al., 2023; Chen et al., 2023; OpenAI, 2023). In this research area, how to enable these medical systems to emulate clinicians’ diagnostic reasoning process has been the long-standing research focus ever since
∗Equal Contribution. 1Our codes are available at https://github.com/
kaishxu/Emulation.
its inception (Holyoak and Morrison, 2005). To achieve this, previous research has paid tremendous efforts in constructing high-quality datasets of medical consultation dialogues, based on which they fine-tuned language models, rudimentarily realizing the simulation of clinicians’ diagnostic process that can inquire about symptoms and make a diagnosis (Bao et al., 2023; Chen et al., 2023; Liu et al., 2022b; Xu et al., 2023).
Nonetheless, existing research remains focused on the “output” of the clinician’s reasoning process (e.g., the symptoms and diseases mentioned in clinicians’ utterances), still neglecting the clinician’s internal thought process and decision-making mechanisms. As a result, available systems overly rely on the co-occurrence patterns in the training data, prone to inquire about the most frequent symptoms and diagnose the most common disease. In fact,
6796
a real clinician’s thought process goes far beyond this. In clinical medicine, there is a concept known as “Clinician Preference” (Silverman et al., 2016; Holyoak and Morrison, 2005; Murray et al., 2007). It refers to the inclinations that healthcare professionals exhibit during diagnostic reasoning. It has been widely acknowledged that clinician preferences are affected by many factors (Silverman et al., 2016), much more than the symptom and disease frequency. For example, in Figure 1, the clinician prefers to discuss examinations in the next response to rule out colitis rather than consider factors that cause irritable bowel syndrome. This is because the location of the discomfort typically indicates a more severe issue in the colon. For the existing systems that are constructed purely through dialogue data fine-tuning, it is difficult to capture such subtle reasoning preferences (Xiong et al., 2023).
In this paper, we aim to develop a medical dialogue system that can align with the internal diagnostic reasoning process of clinicians. To this end, we must first model a diagnostic analysis process. For the multi-turn medical dialogue, clinicians generally adopt an iterative, abductive, and deductive analysis that discovers an explanation of the patient’s condition and evaluates the effectiveness of the explanation (Holyoak and Morrison, 2005). This analysis provides a robust and comprehensive foundation for accurate diagnoses. Then, we need to align response generation with the clinician preference based on the analysis and dialogue context. The thought process of how clinicians reason and generate responses is a vital resource for learning their preferences. Extracting the thought process and modeling it together with responses can help learn the diagnostic reasoning process.
Based on the above motivation, we propose a novel medical dialogue system framework, EMULATION, which emulates clinicians’ diagnostic reasoning processes to generate an appropriate response that relies on ample diagnostic analysis and aligns with clinician preferences in consultation. First, an abductive reasoning module investigates potential diseases that can explain a patient’s condition. Then, a deductive reasoning module comprehensively analyzes the relation between clinical findings and potential diseases. Finally, the thought alignment module adjusts the potential disease priority that may be discussed next and generates thought processes that align with the clinician preference based on the above analysis. To learn the clinician preference, we build a new diagnostic
thought process dataset with the help of an LLM. Our key contributions are outlined as follows:
(1) We propose a novel medical dialogue system framework, EMULATION, that emulates clinicians’ diagnostic reasoning processes and aligns with clinician preferences. This is the first work that explores clinician preferences and internal thought processes. (2) We build a diagnostic thought process dataset that is employed to align response generation with clinician preferences. (3) Experimental results demonstrate the effectiveness and explainability of EMULATION.

heading: 2 Preliminary

heading: 2.1 Problem Formulation
text: In our work, we conceptualize a medical dialogue as a sequence U = {(UPk , UDk )}Tk=1, where each pair (UPk , U D k ) comprises an utterance from a patient followed by an utterance from a doctor. Each doctor’s utterance is annotated with a list of diseases Et = {ei} that could be relevant to the patient’s condition mentioned in the dialogue. Given a dialogue history Ut = {UP1 , UD1 , ..., UPt } up to the t-th patient utterance, our system’s objective is to generate a contextually appropriate and medically informed t-th doctor’s utterance UDt .

heading: 2.2 Diagnostic Reasoning
text: Diagnostic reasoning involves a detailed examination of how doctors think and make decisions in medicine (Holyoak and Morrison, 2005). It serves as a foundational element for advanced cognitive activities, such as formulating diagnostic conclusions and grasping the underlying pathology of diseases. The framework of diagnostic reasoning has been a focal point of medical cognition research (Patel and Ramoni, 1997). A widely recognized perspective holds that diagnosis represents an iterative, abductive, and deductive process of formulating and evaluating potential explanations for a patient’s abnormal condition (Elstein et al., 1978; Holyoak and Morrison, 2005). We summarize this perspective into two reasoning processes: Abductive Reasoning aims to create a plausible diagnosis to explain observed clinical findings; Deductive Reasoning further tests the available diagnoses by determining whether the findings support, refute, or are unrelated to the diagnoses. In our method, the first process efficiently explores a disease knowledge base to identify several possible diseases that explain the patient’s condition in the current turn of
the conversation. The second process comprehensively inspects the relationship between the clinical findings and possible diseases. These two processes are conducted iteratively across the conversation. Besides, the clinician preference for medical decision analysis plays an essential role in the diagnostic reasoning process (Silverman et al., 2016). This preference highlights behaviors and actions in medical conversations unique to each clinician, which LLMs may lack. It is the nuanced preference difference that distinguishes a superior clinician from other clinicians (Yu et al., 2024). We model a Thought Alignment process to align response generation with the general clinician preference in consultation.

heading: 2.3 Disease Annotation
text: Given GPT-4’s demonstrated effectiveness in several medical licensing examinations (OpenAI, 2023), we employ it to annotate potential diseases relevant to the patient’s condition automatically. We implement two ways to generate lists of diseases considered before and after examining the current doctor’s response. For the first list, we construct a prompt with the dialogue history Ut, utilizing the model’s diagnostic skills to identify potential diseases. For the second list, we create a prompt that incorporates both the history Ut and the ground truth response UDt , enabling the model to deduce the diseases that doctors might discuss. Then, we link the inferred diseases with those in an external medical knowledge base and obtain two lists of potential diseases, Eprit and E post t . We merge two lists as one Et for each doctor’s response. The details are described in the Appendix A.2.

heading: 3 Method
text: In this section, we introduce a diagnostic reasoning framework, which analyzes patient conditions through abductive reasoning and deductive reasoning (Holyoak and Morrison, 2005), and aligns responses with the clinician preferences. As shown in Figure 2, our framework includes three modules. The Abductive Reasoner (§3.1) first generates potential diseases based on the new clinical findings of each turn. Then, the Deductive Reasoner (§3.2) comprehensively analyzes the relation between potential diseases and new clinical findings. Finally, the Thought Alignment (§3.3) module adjusts the disease priority that might be discussed in subsequent dialogues and performs thought process
modeling to generate the next response.
Given the medical dialogue history Ut at the t-th conversation turn, we first use a pre-trained LLM to summarize new clinical findings from the recent utterances UDt−1 and U P t . The clinical findings are presented using the SOAP note (Cameron and Turtle-Song, 2002), a documentation technique utilized by healthcare professionals for recording notes (e.g., chief complaint) in a patient’s medical record. For example, we provide the LLM with a prompt to “summarize the clinical findings from the recent conversation between doctor and patient, adhering to the structure of the SOAP note”. Each of the summarized clinical findings is in the phrase format and merged into a set St = {sj}mj=1, where m represents the number of clinical findings at the t-th conversation turn.

heading: 3.1 Abductive Reasoner
text: The Abductive Reasoner aims to find the most possible diseases that explain the patient’s abnormal condition. Previous studies rely solely on the diagnosis capability of black-box language models or focus on limited diseases in one dataset. We design a two-step pipeline to achieve a comprehensive and explainable abduction. The first step employs a disease retriever to narrow down the scope of the disease. Then, the second step leverages a pretrained LLM to generate a potential disease list with detailed explanations based on the clinical findings and external medical knowledge.
Disease Retrieval. We concatenate all findings as the query and retrieve disease documents that are relevant to the findings from an external medical knowledge base. A dense retriever with a BERT encoder is applied to collect relevant documents. The sequences of the query and disease document, each prefixed with a “[CLS]” token, are fed independently into the encoder. The hidden state corresponding to the “[CLS]” token from each sequence is chosen to serve as their respective representations h ∈ Rd and hdoc ∈ Rd. We compute relevance scores through dot product as hT · hdoc. The diseases corresponding to the top-K documents ranked by the scores are considered candidate diseases Ê0t = {ei}Ki=1. Our approach utilizes Contrastive Learning (Gao et al., 2021) to train the retrieval model. The loss function applied to the

heading: Finding 𝑆!
text: training is specified as follows:
LCL =
− log exp ( hT ·h+doc )
exp ( hT ·h+doc ) + ∑ C exp ( hT ·h−doc ) , (1)
where h+doc and h − doc denotes document representations of the relevant diseases in this turn Et and the irrelevant ones in the knowledge base C. We adopt in-batch negative sampling for training.
Diagnosis Refinement. After the retrieval, we have assembled a list of potential diseases; however, this approach unavoidably results in the inclusion of diseases irrelevant to the patient’s condition. Furthermore, the disease retrieval, based on vector similarity, can not elucidate the rationale behind the presence of specific diseases within the potential list. In pursuit of an explainable diagnosis, we utilize a pre-trained LLM to identify possible diseases from this list, offering an explanation grounded in clinical findings. The diagnosis knowledge of each disease is provided since it can appropriately reduce the hallucination issue of LLMs. For instance, we prompt the LLM with “given the findings and knowledge, select possible diseases that can explain the new clinical findings while satisfying past findings”. To achieve a stable disease identification, we adopt a majority vote inspired by Wang et al. (2023). Specifically, we randomly divide the list into batches of the same size (since the maximum input tokens of LLMs limit the diseases and knowledge that can be input). Such division is repeated several times to construct different batch groups.
We utilize batch groups to generate several refined disease lists and calculate the voting score of each disease as follows:
v(ei) = B∑
j=1
1(ei ∈ Êjt ), ei ∈ Ê0t , (2)
where B stands for the number of batch groups, and Êjt represents the j-th refined list. The final refined list includes diseases with a voting score exceeding B/2, denoted as Ê′t = {ei}K ′ i=1.

heading: 3.2 Deductive Reasoner
text: While the Abductive Reasoner has offered an analysis of the relationship between potential diseases and new clinical findings, this analysis predominantly aims to confirm a disease rather than exclude one or sift through information irrelevant to the current diagnosis. It is crucial for clinicians to thoroughly examine the information presented in the dialogue history. However, previous studies often overlook these non-affirmative analyses in their diagnostic processes, which is not conducive to improving diagnostic accuracy.
We introduce the Deductive Reasoner to evaluate the affirmative and non-affirmative relations between new clinical findings and possible diseases. Given the clinical findings St and the refined disease list Ê′t, this reasoner applies a pre-trained LLM with a prompt as “analyze if the new clinical findings support, oppose, or are irrelevant to the possible diseases”. We improve the accuracy of analysis by incorporating additional diagnostic knowledge of each disease. The content of specific tags, i.e., findings, disease, and status, is extracted
as diagnosis memory Mt for subsequent response generation.

heading: 3.3 Thought Alignment
text: The clinician preference in consultation is critical, as it differentiates an experienced clinician from a novice clinical student. Prior research has always concentrated on diagnosing the most likely disease and discussing extra symptoms or treatment based on that diagnosis, which does not accurately reflect the dynamics of an actual healthcare consultation. To address this, we have developed the Thought Alignment module, which is designed to adapt preferences akin to that of an expert clinician. The module first prioritizes diseases to be discussed in the subsequent dialogue. Then, it models the thought process and response of real clinicians to align with clinician preferences.
Disease Priority Alignment We implement a disease ranker to establish the priority of each disease within the refined disease list Ê′t. The backbone of this ranker is the BERT encoder. For the input, we combine the dialogue history with each potential disease, formatting it as follows: “[CLS] {history} the next response will discuss: {disease}”. The relevance score of the dialogue history to the discussed disease is calculated:
r(Ut, ei) = MLP(repr(Ut; ei)), ei ∈ Ê′t, (3)
where repr(·) extracts the hidden state of the “[CLS]” token as the representation, and MLP(·) projects the representation to a scalar. The ranking model is also trained using a contrastive loss function. To better adjust the priority within the refined disease list, the selection of negative samples includes the union of this refined list Ê′t and the pre-annotated disease list Eprit . The positive diseases are from Epostt . We compute relevance scores between the dialogue history and all diseases in the refined list and then reorder the list to Ê′′t .
Thought Process Alignment Thought processes are a reflection of clinician preferences in consultation. Motivated by studies on distilling multi-step reasoning capabilities (Fu et al., 2023; Chae et al., 2023), we design a thought distillation method to empower a model that can generate thought processes consistent with clinician preferences. Specifically, we first leverage a pre-trained LLM to deduce a plausible thought process for each doctor’s response. The prompt to the LLM is organized
as “complete the thought process based on the dialogue context”. We augment the prompt with 3 human-annotated thought processes in the Chainof-Thought (CoT) format. The thought extraction can be defined as:
Yt ∼ LLM(Yt|Ut, UDt , prompt). (4)
Then, we gather the thought process for each dialogue turn and develop a thought process alignment model using the autoregressive language modeling approach as our training objective. The loss function can be defined as:
LG =− ∑
j
log p(yjt|Ut,M≤t, Epostt , Yt,<j), (5)
where M≤t denotes the diagnosis memory until the t-th turn and Epostt denotes the diseases discussed in the next response. During the inference, we utilize the top-K ′′ diseases in the list Ê′′t instead of Epostt and their related analyses to generate the thought process. The final response is extracted from “Therefore, the doctor responds {response}”.

heading: 4 Thought Process Corpus
text: In this section, we present the medical dialogue thought process corpus, MEDIATOR, where each dialogue turn is annotated with a chain-of-thought reasoning path. We utilize the powerful reasoning ability of GPT-4 and its impressive professional skills in the medical domain for automatic annotation. The annotated reasoning path is expected to reflect the thought process of clinicians who analyze the patient’s condition and determine what to discuss. Two datasets, MedDG (Liu et al., 2022b) and KaMed (Li et al., 2021), are annotated following the few-shot prompt in §3.3. As shown in Table 1, the former is annotated with 122K thought processes and the latter with 285K. Each thought process includes a reasoning path consisting of approximately four steps. An example of the generated thought process is displayed in Table 2. The doctor investigates the new clinical findings (i.e., discomfort under certain conditions) and plans to discuss allergy issues after multi-step reasoning.
Human assessments are carried out to evaluate the quality of the generated thought processes. We randomly select 100 samples from each dataset and ask three medical students who have undergone clinical internships to assess them. The evaluation employs three metrics: (1) Knowledge: whether the knowledge used in the thought process is accurate; (2) Consistency: whether the thought process is consistent with the dialogue history; (3) Rationality: whether the thought process starts with premises and uses logical progression to derive responses. Table 3 presents the evaluation results, demonstrating that the thought processes in MEDIATOR adequately fulfill the above three criteria.

heading: 5 Experiments

heading: 5.1 Datasets
text: Our experiments utilize two medical dialogue datasets, MedDG (Liu et al., 2022b) and KaMed
(Li et al., 2021). Dialogues in these datasets exhibit a clear multi-turn context, with each dialogue averaging about 10 turns. The MedDG dataset comprises 17,860 dialogues, focusing on 12 gastroenterology-related diseases. The dataset is divided into 14,862/1,999/999 for training, validation, and testing. The KaMed dataset includes more than 63,000 dialogues, spanning a wide range of diseases across approximately 100 hospital departments. We clean privacy-sensitive content following DFMed (Xu et al., 2023) and divide the dataset into 29,159/1,532/1,539 for training, validation, and testing.

heading: 5.2 Baseline methods
text: We compare our method with two categories of baselines: LLMs equipped with Chinese medical conversation abilities and language models that are fine-tuned on target datasets.
Medical LLMs. (1) HuatuoGPT-II (Chen et al., 2023) is a medical LLM performing state-of-theart in several Chinese medical tasks. (2) DISCMedLLM (Bao et al., 2023) is a medical LLM with strong multi-turn consultation capabilities. (3) GPT-4 (OpenAI, 2023) is one of the most advanced pre-trained LLMs designed by OpenAI.
Fine-tuned Models. (1) VRBot (Li et al., 2021) is a medical dialogue generation (MDG) model with entity tracking and predicting. (2) GPT-2 (Radford et al., 2019) is a transformer decoderbased language model. (3) BART (Lewis et al., 2020) is a transformer-based encoder-decoder model. (4) Qwen-7B (Bai et al., 2023) is a strong base language model focusing on Chinese and English. (5) DFMed (Xu et al., 2023) enhances MDG with entity and dialogue act flow learning.

heading: 5.3 Implementation Details
text: All the prompt-based operations in EMULATION are implemented with gpt-3.5-turbo, i.e., clinical findings extractions, abductive diagnosis refinement, and deductive diagnosis analysis. We apply the MedBERT2 pre-trained in the medical domain as the backbone of the disease retriever and the disease alignment model. The corpus of disease documents, utilized for disease retrieval and to enhance both abductive and deductive reasoning, is derived from a specialist-certified online medical knowledge base xiaohe3. We retrieve the top 50 (K=50)
2https://github.com/trueto/medbert 3https://www.xiaohe.cn/medical
relevant diseases for further refinement. The refined disease list is sent to the disease alignment model to obtain the top 5 (K ′′=5) diseases that may be discussed in subsequent responses. Then, we employ the pre-trained language model Qwen-7BChat4 to train the thought process alignment model, which has seven billion parameters and proficient Chinese understanding and generation ability. We train the model using the LoRA approach with r=64 and α=16. All experiments are carried out on a system equipped with four RTX 3090 GPUs. Other details are presented in the Appendix A.3.

heading: 5.4 Automatic Evaluation
text: We assess the generated responses using three automated metrics: BLEU-1/2/4 (B-1/4) (Papineni et al., 2002), evaluating n-gram precision; ROUGE1/2 (R-1/2) (Lin, 2004), assessing n-gram recall; and Entity-F15 (E-F) (Liu et al., 2022b), which gauges the accuracy of medical entities, such as diseases and medications.
Table 4 displays the response generation results of all baseline methods. Our framework outperforms the baselines in most metrics, especially the medical entity accuracy. It demonstrates the effectiveness of our framework in diagnostic reasoning and response generation. Specifically, EMULATION performs better than available medical LLMs trained on large-scale medical dialogues and knowledge bases in R-1/2 and E-F. It demonstrates that modeling the diagnostic reasoning process can help generate more accurate and targeted responses. Be-
4https://github.com/QwenLM/Qwen 5https://github.com/lwgkzl/MedDG
sides, our framework achieves better n-gram recall and entity accuracy than the state-of-the-art model DFMed. The B-1/4 scores are a bit lower, which may be because the fine-tuned parameters are too limited to approach the linguistic pattern of the gold utterances. However, benefiting from the construction of diagnostic reasoning processes, EMULATION can generate responses with more consistent content and higher entity accuracy.
We also adopt another multi-dimensional automatic evaluation using GPT-4, which follows the method in DISC-Med (Bao et al., 2023). This evaluation focuses on Proactivity, Accuracy, Helpfulness, and Linguistic Quality (LQ). Our EMULATION performs better than other baselines in the above aspects as shown in Table 5.

heading: 5.5 Human Evaluation
text: We conduct human evaluations on comparison with two baselines: DISC-MedLLM and DFMed. We randomly select 100 samples and ask three medical students to evaluate them according to Knowledge, Consistency, and Specificity. Besides, the overall quality is compared. EMULATION outperforms two baselines in all aspects, as shown in Figure 3. Details and case studies are in the Appendix A.5 and A.6. Cross-inference cases are displayed.

heading: 5.6 Analysis of Diagnostic Reasoning Process
text: To further evaluate the effectiveness of our framework, we analyze several variations of our EMULATION as detailed below: (1) w/o Abd. Reasoning, which omits abductive reasoning along with any related deductive reasoning, relying solely on dialogue history to form thought processes. (2) w/o Ded. Reasoning, which eliminates the process of deductively analyzing clinical findings and potential diseases. (3) w/o Dis. Alignment, which forgoes learning the disease priority, opting to select the most relevant diseases identified through abductive reasoning. (4) w/o Thot. Alignment, which directly generates responses based on the results of abductive and deductive reasoning.
Table 6 presents the comprehensive results of our ablation study. There is a noticeable decline in effectiveness across various metrics for the ablation models, underscoring the indispensable contribution of each module within our framework. Particularly, the variant w/o Abd. Reasoning experiences a significant drop in response quality due to the lack of initial diagnosis and subsequent analysis. This decline is attributed to the typical practice of clinicians to center medical conversations around certain diseases; thus, omitting precise abductive and deductive reasoning processes leads to a lack of focus in the dialogue. Besides, the w/o Dis. Alignment variant shows a marked decrease in performance, reinforcing the importance of disease priority alignment with clinician practices for achieving consistent responses. The outcomes from w/o Ded. Reasoning and w/o Thot. Alignment further affirm that detailed analyses and thought generation enhance the quality of response generation.

heading: 5.7 Analysis of Disease Alignment
text: We evaluate the diagnosis accuracy to determine the impact of aligning disease priorities. The metric Intersection over Union (IoU) between predicted diseases and plausible diseases Epostt is employed. As shown in Figure 4, aligned diagnoses substan-
tially outperform unaligned diagnoses that are derived directly from abductive reasoning. Remarkably, aligned diagnoses are marginally more accurate than the diseases diagnosed by GPT-4, i.e., Eprit . We also display the diagnosis results in different conversation turns as shown in Figure 5. Overall, the diagnosis accuracy continuously improves as the number of conversation turns increases. The diagnostic accuracy on the MedDG dataset was initially high but decreased in the second turn. It is because the patients in this dataset provide relatively sufficient information in the first turn, allowing EMULATION to make a good rough diagnosis. However, with the introduction of additional information, the difficulty of diagnosis increases, and the difference between EMULATION’s diagnosis and that of real doctors becomes greater.

heading: 6 Related Work
text: Medical Dialogue Systems Medical Dialogue Systems (MDS) aim to provide healthcare services to patients. A significant and early area of research focuses on automated diagnosis in the form of task-oriented dialogue systems, which prioritize the quick identification of underlying symptoms and the provision of a final diagnosis and do not offer further consultations (Liao et al., 2020; Lin et al., 2019; Chen et al., 2022; Liu et al., 2022a). The study by Wei et al. (2018) presented a dataset with symptom annotations and established an MDS
using reinforcement learning. Xu et al. (2019) incorporated a knowledge graph into MDS to control the sequence of symptom inquiries. Tchango et al. (2022) enhanced system dependability by applying an exploration-confirmation approach and giving precedence to severe diseases.
The emergence of large-scale medical dialogue datasets such as MedDialog (Zeng et al., 2020), MedDG (Liu et al., 2022b), and KaMed (Li et al., 2021), along with pre-trained language models (Lewis et al., 2020; Radford et al., 2019), has sparked increased interest in medical dialogue generation (Liu et al., 2022b, 2021; Lin et al., 2021; Zhao et al., 2022). The research by Liu et al. (2022b) tackled medical dialogue generation by emphasizing entity prediction and entity-centric response creation. Li et al. (2021) presented a semi-supervised variation reasoning system supplemented by a patient state tracker and a physician action network. Xu et al. (2023) introduced a dual flow (i.e., dialogue act and entity flows) modeling approach to enhance dialogue understanding and guide response generation using acts and entities. Dou et al. (2023) applies LLMs to medical dialogue generation in a plug-and-play way.
Medical Large Language Models Given the astonishing performance of GPT-4 in several medical examinations, an increasing number of researchers are directing their attention toward developing medical LLMs. ChatDoctor (Li et al., 2023) is equipped with an external Wikipedia knowledge base and trained on real medical conversations. DoctorGLM (Xiong et al., 2023) is developed using a medical dialogue and question answering dataset supplemented by ChatGPT-translated documents. HuatuoGPT-2 (Chen et al., 2023) and DISC-MedLLM (Bao et al., 2023) try to construct a unified domain adaption framework that uses ChatGPT to convert available documents into pretraining and fine-tuning instructions.
Available medical dialogue systems and medical LLMs try to learn from the outcome of the diagnostic reasoning (i.e., high-quality medical dialogue datasets) but ignore the internal thought process of real clinicians and alignment with clinician preferences. Our work seeks to construct a medical dialogue system that aligns with the internal diagnostic reasoning process of real clinicians.

heading: 7 Conclusion
text: This paper proposes a novel medical dialogue system framework, EMULATION, that emulates clinicians’ diagnostic reasoning processes to generate appropriate responses grounded in abductive and deductive diagnostic reasoning analysis and alignment with clinician preferences. Besides, a new diagnostic thought process corpus is presented and utilized to model the clinician preference. Experimental results demonstrate the effectiveness of EMULATION on two datasets. One promising area for future work is applying the EMULATION framework in telemedicine consultations. With the increasing demand for telemedicine, it is essential to explore how this framework can enhance virtual patient-doctor interactions. Future studies could investigate the framework’s effectiveness in improving patient satisfaction and overall consultation quality in remote settings.

heading: Limitations
text: While our framework outperforms various baseline approaches in medical dialogue generation, there is still room for progress. The corpus for the diagnostic thought process is constructed by inferring from doctors’ responses. Although it has been assessed that the thought processes in the corpus demonstrate a logical sequence, individual steps within these processes might not mirror those of a real clinician precisely. To enhance consistency in generated thought processes, additional humanannotated thought processes should be collected to conduct further alignment.

heading: Ethics Statement
text: Our designed system is intended to improve medical consultations for patient care. All datasets were anonymized upon their publication in dataset papers. Nonetheless, due to the training of our model on a limited number of samples for certain conditions, there’s a possibility that the responses might contain inaccurate information regarding diagnosis, treatment, and safety measures. We advise treating our system as a supplementary resource and seeking professional medical advice when necessary. Additionally, user interactions with the system could potentially expose sensitive data (e.g., user-reported gender), and the online LLM API services should be substituted by a local opensource model if our system is deployed. Therefore, we urge users to meticulously assess the ethical
considerations of the generated responses. Moreover, the scientific tools utilized in our research, such as NLTK, ROUGE, Transformers, and various GitHub repositories, are openly accessible for academic purposes. The application of these tools in this study adheres to their designated purposes.

heading: Acknowledgment
text: This work was supported by the Research Grants Council of Hong Kong (15207920, 15213323) and the National Natural Science Foundation of China (62076212).

heading: A Appendix

heading: A.1 Automatic Evaluation Details
text: We adopt the calculation approach used in the original dataset paper MedDG (Liu et al., 2022b) and in the most recent paper DFMed (Xu et al., 2023). The “nltk” package with version 4.5.1 is used to calculate BLEU scores. The “rouge” version is 1.0.1. There is a score gap between our study and some baseline studies since the metric package used for calculating BLEU is different. For example, the officially released code for VRBot doesn’t specify the metric package version such as “nlgeval” and “rouge”, while the results will be affected by the package version.

heading: A.2 Disease Annotation
text: We annotate the potential diseases for each dialogue turn with the help of GPT-4 using two different prompts. One is “Generate which disease the patient may suffer from based on the medical conversation and explain why. The diseases should be ranked by their possibility according to the conversation.” This prompt aims to leverage the diagnostic capability of GPT-4 to infer potential diseases. The other is “Generate which disease the doctor is considering or intending to rule out based on the doctor’s response and explain why. The diseases should be mainly ranked by their relationship to the response.” This prompt aims to deduce diseases from the doctor’s response. The difference between these two prompts is whether the current doctor’s response is given. Examples
of two disease annotation prompts are shown in Figure 6 and Figure 7.
After inferring diseases using two prompts respectively, we need to link each inferred disease to the disease in an external knowledge base. We divide this linking into two steps: (1) Coarse matching and (2) GPT-4 assisted matching. For the coarse matching, we first build a dense retriever to calculate the relevance score between disease name and disease documents. The disease documents are from the knowledge base. This retriever can bridge the gap between different aliases of one disease. Then, we retrieve the top 10 relevant diseases as a preliminary list. For the GPT-4 assisted matching, we organize a prompt that requires GPT-4 to select from the preliminary disease list. The prompt is “Select diseases from the candidate disease list that describe the same one as our target.” An example of a disease match prompt is shown in Figure 8.
A.3 Implementation Details
Baseline Methods. For the medical LLMs, we use the HuatuoGPT2-13B6 and DISC-MedLLM7
to generate responses in zero-shot way as they have already been fine-tuned on medical dialogue datasets and other large-scale medical knowledge datasets. These two models are all based on language models with 13B parameters. We utilize the default decoding parameters to generate responses.
For fine-tuned baseline methods, we employ generation results from the original papers.
Fine-tuned modules in our framework. For training disease retriever in §3.1, we use the MedBERT as the encoder and employ contrastive learning. The batch size is 8 with 6 gradient accumulation steps. The learning rate is set at 3e-5. We train 6 epochs for the MedDG dataset and 10 epochs for the KaMed dataset. We select the checkpoint with the highest disease recall rate in validation datasets.
For training the disease priority alignment model, we also use the MedBERT as the encoder and employ contrastive learning. The batch size is 2 with 8 gradient accumulation steps. The learning rate is set at 1e-5. We train 3 epochs for two datasets and select the checkpoint with the highest IoU in validation datasets.
For training the thought process generation model, we use the Qwen-7B-Chat model and adopt LoRa fine-tuning. The LoRa settings are: r equals
6https://github.com/FreedomIntelligence/HuatuoGPT-II 7https://github.com/FudanDISC/DISC-MedLLM

heading: Then, for the raw disease text:

heading: Given the raw disease text:
text: 64, α equals 16, dropout rate equals 0.05. The learning rate is set at 3e-4, the batch size for each GPU is 2 with 8 gradient accumulation steps. We train the LoRa parameters for 3 epochs and select the last checkpoint to generate responses.
Prompt modules in our framework. For the abductive reasoner, the prompt is shown in Figure 9. For the deductive reasoner, the prompt is shown in Figure 10.

heading: A.4 Disease Retrieval Results
text: Table 7 displays the recall rate of different top-K diseases (i.e., K=10, 25, 50, 100).

heading: A.5 Human Evaluations on Comparison with Baseline Methods
text: We compare our framework EMULATION with baseline methods from three aspects. (1) Knowledge Accuracy (Knowledge), which assesses whether the response correctly applies the disease knowledge. (2) Consistency, which assesses whether the response is consistent with the dialogue context and doctor’s ground truth response. (3) Specificity, which assesses whether the response provides specific diagnoses, prescriptions, treatment plans, or examination requirements rather than general suggestions. We ask our annotators to compare the responses generated by our method with the responses generated by baseline methods.

heading: A.6 Case Studies
text: Figure 11 and Figure 12 display cases on the MedDG and KaMed datasets, respectively. Besides, we also infer samples in MedDG with the model trained on KaMed and infer samples in KaMed with the model trained on MedDG in Figure 13 and Figure 14.

heading: New clinical findings are:

heading: 5. Your output format is: "... therefore, possible diseases are: ...". Possible diseases are enclosed in angle brackets and in Chinese, i.e., <.>, <.>, etc., and each bracket pair contains one disease.

heading: 4. If no disease can align with new clinical findings and the medical conversation, please input "Null".

heading: 3. You can select multiple diseases if necessary.

heading: 2. You should select from the candidate disease list.

heading: 1. You should carefully consider all patient information (e.g., symptoms, medical history, medicine, age, gender, etc.) and explain why.

heading: Instructions:

heading: Candidate disease list:

heading: New clinical findings are:

heading: Ground Truth Response:

heading: 5. The doctor may advises the patient to pay attention to their diet, as irregular eating habits could exacerbate gastrointestinal problems.

heading: 4. Considering the patient's symptoms, medical history, and response to previous treatments, the doctor contemplates recommending a gastroscopy to further investigate the patient's stomach condition. This could help identify any potential issues causing the patient's symptoms.

heading: 3. The patient inquires about the need for a colonoscopy, indicating their concern about the severity of their condition. A colonoscopy could provide valuable information about the patient‘s gastrointestinal health and help identify any abnormalities. But it is not needed at the moment as there are no symptoms related to colitis.

heading: 2. The patient mentioned that they have tried "stomach comfort granules" and "Stomach Ease," which are traditional Chinese medicines commonly used for treating gastrointestinal discomfort. The effectiveness of these treatments could provide clues about the nature of the patient's condition.

heading: 1. The patient reports frequent stomach and intestinal discomfort and significant changes in bowel movement regularity and shape. These symptoms, along with the patient's history of gastritis erosion, suggest the possibility of chronic gastrointestinal issues.

heading: Thought process:

heading: Clinical analysis:

heading: Ground Truth Response:

heading: 4. Considering these factors, the doctor suggests conducting a tuberculin skin test. This test can help determine whether the child has been infected with the bacteria that cause tuberculosis. While tuberculosis is less common in children, it cannot be ruled out when a child is ill for a long time and unresponsive to treatment.

heading: 3. However, despite treatment, the lack of improvement raises concerns about the accuracy of the diagnosis and the effectiveness of the treatment. It's also possible that the bacteria causing the pneumonia have developed resistance to meropenem.

heading: 2. The patient also mentioned that the child had been treated with meropenem, an antibiotic commonly used for severe bacterial infections. This may indicate that the pneumonia is bacterial, which is common in children.

heading: 1. The patient mentions that their child was hospitalized for pneumonia, treated for 27 days but showed no significant improvement. This raises concerns as it suggests that the current treatment regimen might be ineffective.

heading: Thought process:

heading: Clinical analysis:

heading: Ground Truth Response:

heading: 4. Considering the patient's symptoms, dietary habits, and vitamin C intake, the doctor concludes that the patient's diet could be contributing to her symptoms.

heading: 3. The patient also mentions having taken vitamin C for about two to three months. While vitamin C is generally safe, excessive intake can cause side effects such as diarrhea. However, given the duration the patient has been taking vitamin C and the duration of the symptoms, vitamin C is unlikely to be the primary cause of her symptoms.

heading: 2. The patient mentions that symptoms seem to worsen when not paying attention to her diet. This suggests that her diet could be a contributing factor to her symptoms. Diet plays a key role in gastrointestinal health, and certain foods can exacerbate symptoms like diarrhea.

heading: 1. The patient reports no blood in the stool, which is a good sign as it rules out some serious conditions such as gastrointestinal bleeding.

heading: Thought process:

heading: Clinical analysis:

heading: Clinical findings in the dialogue:

heading: Ground Truth Response:

heading: 4. The doctor also considers the potential side effects and risks of antibiotics, such as antibiotic resistance and adverse reactions. Antibiotics should only be used when absolutely necessary, such as when a bacterial infection is confirmed.

heading: 3. The doctor considers the necessity of using antibiotics. Antibiotics are typically used to treat bacterial infections, not viral infections. Given the child's symptoms and another doctor's assessment, the child may have a viral infection, leading the doctor to believe antibiotics might not be necessary at this time.

heading: 2. The doctor notes the child has already been given honeysuckle granules, a traditional Chinese medicine commonly used for treating symptoms of colds and flu. The doctor also suggests using a throat spray to soothe the child's throat.

heading: 1. The patient inquires about giving the child cephalosporin, an antibiotic. The doctor considers the child's symptoms and current treatment plan.

heading: Thought process:

heading: Clinical analysis:

heading: Clinical findings in the dialogue:

heading: Given the medical dialogue:

heading: Future Work
text: One promising area for future work is applying the EMULATION framework in telemedicine consultations. With the increasing demand for telemedicine, it is essential to explore how this framework can enhance virtual patient-doctor interactions. Future studies could investigate the framework’s effectiveness in improving patient satisfaction and overall consultation quality in remote settings