Conversational disease diagnosis method based on big language model feedback
By combining the interaction framework of reinforcement learning and expert feedback modules, dynamically adjusting symptom weights and optimizing symptom queries using interaction records, the problems of random symptom queries and a single reward mechanism in conversational disease diagnosis systems are solved, achieving higher diagnostic accuracy and stability.
Patent Information
- Application Number
- CN202511019944.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-12-09
AI Technical Summary
Existing conversational disease diagnosis systems suffer from insufficient diagnostic accuracy and stability when there is a lack of sufficient data, sparse symptom information, and complex symptom combinations. Furthermore, the design of symptom query sequences suffers from randomness and a lack of simplistic reward mechanisms.
We adopt a conversational disease diagnosis method based on feedback from a large language model. By combining a reinforcement learning module and an expert feedback module, we optimize the symptom query strategy through dynamic symptom attention mechanism, interactive record management and Prompt construction. We also utilize the knowledge reasoning ability of the large language model to simulate the dynamic feedback provided by human experts, thereby improving the accuracy and stability of diagnosis.
It improves the diagnostic accuracy and stability of conversational disease diagnosis systems in scenarios with scarce data and complex symptom combinations, and enhances the model's adaptability to different scenarios, especially in optimizing symptom query strategies under multi-turn dialogue and sparse symptom information conditions.
Smart Images

Figure CN121096580A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and medical information technology, and relates to a conversational disease diagnosis method based on feedback from a large language model. Background Technology
[0002] Automated disease diagnosis is an effective way to address the shortage of medical resources, and conversational disease diagnosis has significant practical value in this field. Conversational disease diagnosis systems collect symptom information through user interaction and infer possible diseases based on these symptoms; symptom screening and disease classification are the core of conversational medical diagnosis. The introduction of reinforcement learning has brought new development opportunities to conversational disease diagnosis.
[0003] Existing conversational disease diagnosis systems still face a series of challenges in the symptom query and decision-making process. Among them, the design of the symptom query sequence is a key issue that deserves special attention because it directly affects the effectiveness of symptom query.
[0004] Existing models exhibit significant randomness in symptom querying. Many systems rely on single predefined rules or simple serialization models, which fail to effectively capture the complex relationship between diseases and symptoms. Furthermore, the lack of universal reward models applicable to different application scenarios hinders conversational disease autodiagnosis from generating accurate and effective symptom query sequences in dynamic environments. Moreover, due to the high privacy and scarcity of medical data, model performance remains inadequate in real-world scenarios such as multi-turn dialogues and sparse symptom information. Existing conversational diagnostic systems are relatively simplistic in their reward mechanism design and responses to data insufficiency, often failing to acquire comprehensive and multi-dimensional symptom information in a timely manner. Summary of the Invention
[0005] To address the shortcomings of existing conversational disease diagnosis systems, which rely on high-quality datasets and suffer from insufficient diagnostic accuracy and stability when faced with a lack of sufficient data, sparse symptom information, and complex symptom combinations, this invention provides a conversational disease diagnosis method based on feedback from a large language model. This method effectively addresses the challenges of symptom scarcity and complex symptom combinations, helps the model focus on key symptoms, improves symptom query strategies, and enhances the adaptability of disease diagnosis models to different scenarios. It is particularly suitable for optimizing symptom query strategies and disease inference in scenarios with sparse data features.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] A conversational disease diagnosis method based on feedback from a large language model includes the following steps:
[0008] Step S1: Constructing an interaction framework between the reinforcement learning module and the expert feedback module for a conversational disease diagnosis model based on large language model feedback: The conversational disease automatic diagnosis model based on large language model feedback consists of a reinforcement learning module and an expert feedback module. The reinforcement learning module is responsible for interacting with the user, asking about symptoms and informing them of the diagnosis results. The expert feedback module simulates a human medical expert, evaluates and analyzes the quality of the symptoms generated by the reinforcement learning module at each step, and provides feedback to guide the symptom generation process of the reinforcement learning module.
[0009] Step S2: The reinforcement learning module generates the next symptom to be queried and inputs the current symptom sequence, disease list and symptom to be queried into the expert feedback module;
[0010] Step S3: The expert feedback module assigns dynamic weights to each symptom in the current symptom sequence through a dynamic symptom attention mechanism, and filters key symptoms based on symptom frequency and specificity. This dynamic symptom attention mechanism includes: calculating initial weights based on the frequency of symptom occurrence in the target disease group; decreasing the weight of a symptom if it occurs frequently in multiple diseases, and increasing the weight of a symptom if it occurs frequently only in a single disease. Frequent occurrence is defined as a symptom occurrence frequency in the target disease group exceeding a preset threshold; dynamically filtering symptoms based on weights to remove redundant or low-discrimination symptoms; and determining the frequency of various symptoms corresponding to each disease. The calculation is as follows:
[0011]
[0012] Where M represents the total number of symptoms of the current disease, and N represents the number of users suffering from the disease. Indicates current symptoms. =1 indicates that the current user has this symptom;
[0013] Step S4: The expert feedback module, through the memory component, retrieves the most similar historical interaction records to the current symptom sequence based on the current disease list, and extracts contextual information. The retrieval process of the memory component includes: converting the current symptom sequence and the symptom to be queried into natural language descriptions, and generating vector representations through a pre-trained embedding model; calculating the similarity between the current symptom vector and the historical records based on cosine similarity; and returning the top N historical records with the highest similarity as contextual references. The specific steps are as follows:
[0014] (1) Symptom vectorization:
[0015] First, define the list of confirmed symptoms as follows: ,in As symptoms, The status is "true", "false", or "not sure", and the next symptom to query is indicated by... The concatenation of these two elements forms a complete sentence, defined as a "sentence." This sentence is used to generate a natural language description based on the state of each symptom. The generated sentence is then input into the paraphrase-MiniLM-L6-v2 model to generate corresponding embedding vectors. express:
[0016]
[0017] (2) Caching mechanism:
[0018] Each symptom list and its corresponding embedding vector are stored in a cache dictionary. There is a one-to-one mapping between each symptom list and its corresponding vector. When querying, first check if the symptom list already exists in the cache. If it exists, the embedding vector in the cache is returned directly. If it does not exist, the embedding vector is calculated and added to the cache.
[0019] (3) Calculate the cosine similarity:
[0020] Cosine similarity is used to measure the similarity between the current symptom list and each symptom list in the history; that is, it is determined by calculating the cosine of the angle between the two vectors. Given the current symptom list vector... and a list vector of each symptom in the history The formula for cosine similarity is:
[0021]
[0022] (4) Interactive record retrieval:
[0023] During each query, the memory component first calculates the similarity between the current symptom list and each symptom list in the history, sorts the history records according to the similarity values, and returns the N history records that are most similar to the current symptom list, which serve as a reference for subsequent interactions between the reinforcement learning agent model and the expert feedback module.
[0024] Step S5: Based on dynamically weighted symptoms, historical interaction records, and preset rules, construct a Prompt input including system prompts, example prompts, and current-round prompts to drive the large language model to generate a feedback score for the symptom query strategy. The Prompt input includes: system prompts, used to define the medical expert role and scoring rules of the large language model; example prompts, used to provide high and low score cases to standardize the reasoning logic of the large language model; and current-round prompts, used to integrate dynamically weighted symptoms, the symptom to be queried, and the disease list to generate structured input. The logic for generating the feedback score includes: inputting the constructed prompt information and historical interaction records into the large language model; the large language model reasoning based on medical knowledge, evaluating the ability of the symptom to be queried to distinguish between diseases in the current disease list, generating a reasonableness score for the symptom to be queried, and returning this score as a reward signal to the reinforcement learning module to optimize its symptom query strategy.
[0025] Step S6: Use the feedback score as a reward signal for reinforcement learning to optimize the symptom query strategy of the reinforcement learning module and achieve iterative training of conversational disease diagnosis.
[0026] Compared with the prior art, the present invention has the following advantages:
[0027] 1. This invention combines a reinforcement learning module and an expert feedback module. The expert feedback module includes a dynamic symptom attention mechanism, interaction record management, and prompt construction. The dynamic symptom attention mechanism helps the model focus on key symptoms by dynamically assigning weights to each symptom, thereby improving diagnostic accuracy. The interaction record management uses historical record retrieval methods to extract the 10 most similar records from the user's interaction history, further enhancing the decision-making basis of the reinforcement learning model. The prompt construction combines system prompts, example prompts, and current round prompts to guide the large language model to generate accurate scoring feedback in medical reasoning, ultimately improving the accuracy and stability of the disease diagnosis system.
[0028] 2. This invention embeds a large language model into the reinforcement learning process, leveraging the model's knowledge reasoning capabilities to simulate the dynamic feedback provided by human experts to the symptom query process generated by the reinforcement learning agent. This optimizes the symptom query strategy and improves diagnostic performance. This method combines the advantages of reinforcement learning and large language models, effectively mitigating the challenges posed by symptom scarcity and complex symptom combinations through innovative designs such as dynamic symptom attention mechanisms, interaction record management, and prompt construction. Attached Figure Description
[0029] Figure 1 The flowchart shows a conversational disease diagnosis method based on feedback from a large language model.
[0030] Figure 2This is a schematic diagram of the model structure of the conversational disease diagnosis method based on large language model feedback proposed in Example 1;
[0031] Figure 3 This is a schematic diagram of the Prompt construction for the conversational disease diagnosis method based on large language model feedback proposed in Example 1;
[0032] Figure 4 This is the confusion matrix of the conversational disease diagnosis method based on large language model feedback proposed in Example 1. Detailed Implementation
[0033] The technical solution of the present invention will be further described below with reference to the accompanying drawings, but it is not limited thereto. Any modifications or equivalent substitutions to the technical solution of the present invention that do not depart from the spirit and scope of the technical solution of the present invention should be covered within the protection scope of the present invention.
[0034] This invention provides a conversational disease diagnosis (LFRD) method based on large language model feedback. The method constructs an interaction framework between a reinforcement learning module and an expert feedback module based on a conversational disease diagnosis model with large language model feedback. Figure 2 The overall architecture of the framework is demonstrated. The large language model feedback-based conversational disease automatic diagnosis model mainly consists of a reinforcement learning (RL) model and an expert feedback module (AIExpert). The RL model is responsible for interacting with the user, asking about symptoms, and providing diagnostic results. AIExpert simulates a human medical expert, evaluating and analyzing the quality of symptoms generated at each step of the RL process, and providing feedback to guide the RL model's symptom generation process. The main components of the AIExpert module are: a dynamic symptom attention mechanism, a memory component, and a prompt construction. The large language model feedback-based conversational disease automatic diagnosis model is built according to a modular framework, making it easily accessible and extensible. Each component can be modified as needed, providing additional flexibility for future design choices. The main components of the AIExpert module are: a dynamic symptom attention mechanism, a memory component, and a prompt construction. The large language model feedback-based conversational disease automatic diagnosis model is built according to a modular framework, making it easily accessible and extensible. Each component can be modified as needed, providing additional flexibility for future design choices.
[0035] like Figure 1As shown, in the conversational disease auto-diagnosis architecture based on large language model feedback, the interaction flow between AIExpert and the RL model is as follows: First, the RL model generates the symptom to be queried next and passes this symptom, along with the currently confirmed symptom list and the current disease list, to the AIExpert module. The dynamic weighted attention mechanism in the AIExpert component dynamically weights all symptoms, while the retrieval module in the memory component selects the 10 most relevant records from the interaction history based on the current disease list. Subsequently, the weighted confirmed symptoms, the weighted next query symptoms, and the relevant interaction records are passed to the Prompt building component to assemble the final prompt. This prompt is then sent to the LLM component, which generates feedback evaluation through inference analysis, extracts specific scores, and finally feeds the scores back to the RL model. The specific steps are as follows:
[0036] First, the RL model generates the symptom to be queried next and passes this symptom, along with the currently confirmed symptom list and the current disease list, to the AIExpert module. Upon receiving this information, the AIExpert component's dynamic weighted attention mechanism dynamically weights all symptoms. In the process of automatic disease diagnosis, noise often affects the model's accuracy. Taking childhood diarrhea as an example, a patient may simultaneously present with symptoms such as watery stools and fever. Watery stools, as a typical symptom with high diagnostic value, are more indicative of childhood diarrhea, while fever, as a common symptom in many diseases, has less clear diagnostic information and may introduce misjudgments, becoming noise in the information transmission process. Therefore, in model training, all symptoms should not be assigned the same weight; instead, different weights should be set for each symptom, allowing the model to focus on high-weight symptoms. By assigning higher weights to key symptoms (such as watery stools and abdominal pain) and lower weights to common symptoms (such as fever), the model can dynamically adjust its attention in multi-turn dialogues, focusing more resources on symptom information that has a greater impact on the diagnostic results. To implement this strategy, the frequency of occurrence of each symptom corresponding to each disease can serve as an important basis for weight design, thereby providing the model with more accurate observational information. The frequency of each symptom corresponding to each disease is calculated as follows:
[0037]
[0038] Where M represents the total number of symptoms of the current disease, and N represents the number of users suffering from the disease. Indicates current symptoms. =1 indicates that the current user has this symptom.
[0039] Based on the analysis of the probability of symptoms appearing in different diseases, it was found that there may be a high degree of overlap between symptoms of different diseases within the same disease group. During the inference process, the model should focus more on symptoms with low overlap rates and high specificity across different diseases, while reducing the interference of common and highly repetitive symptoms on diagnostic results. To this end, a "dynamic symptom attention mechanism" is proposed, which assigns weights to each symptom based on its frequency and uniqueness.
[0040] Specifically, the default weight is set to the frequency of the symptom. This is to reflect the informational value of a symptom. When a symptom frequently appears in different diseases, its informational value decreases significantly and can be considered diagnostic noise; conversely, if a symptom appears almost exclusively in one disease, its weight will increase significantly. This invention considers symptoms with a frequency greater than 0.2 as high-value symptoms of a disease, and symptoms with a frequency less than 0.2 as low-value symptoms. Symptoms that appear only as high-value symptoms of a single disease are considered the most valuable information, and their weight is marked as 1. If a high-value symptom appears in multiple diseases simultaneously, it is assigned a lower weight (e.g., 0.1) to reflect its relatively low discriminative power.
[0041] The "current symptom sequence" and "next query symptom" generated by the reinforcement learning model first pass through this symptom attention mechanism. Each symptom is dynamically assigned a weight based on the frequency of various diseases within the current disease group. Symptoms that have no weight for any disease within the group are directly discarded. Through this process, the system can more accurately capture symptom information that has a key impact on diagnosis in multi-turn dialogues, thereby optimizing subsequent reasoning and decision-making steps.
[0042] The AIExpert module includes a memory component responsible for storing and retrieving all interaction records between the reinforcement learning model and the AIExpert module. Each interaction record needs to be stored to provide contextual information for new dialogue interactions. Each interaction record is in the form of (u, e), where u represents a dialogue between the reinforcement learning model and the AIExpert module, and e represents a disease group in the dataset. Each dialogue record u has a corresponding disease group e, indicating that relevant symptoms are considered and feedback is given within that disease group. The retrieval module in the memory component selects the 10 most relevant records from the interaction history based on the current disease list. Each interaction between the reinforcement learning model and the AIExpert module generates a new interaction record, which is added to the interaction history. Define U as the set of dialogue interaction records and E as the set of disease groups, where each disease group e corresponds to a specific disease group. For each pair (u, e) ∈ U × E, there is a specific disease group e. All interaction records can be represented as:
[0043]
[0044] As the reinforcement learning agent model interacts with the AIExpert module, the dialogue history grows, potentially exceeding the context length of the current large language model. To address this, a retrieval component is implemented, responsible for retrieving the most relevant item for the current query from the user's interaction history. Before each interaction, both the AIExpert module and the reinforcement learning agent model perform a history retrieval. Based on the confirmed symptom list and the next symptom query, they retrieve the 10 most similar interaction records related to the current symptom list from all interaction history entries, thus providing a reasonable query basis for the AIExpert module's next inference response.
[0045] The retrieval component uses a cosine similarity-based symptom retrieval method, combining a paraphrase-MiniLM-L6-v2 embedding model and a caching mechanism to optimize the symptom vectorization process. The specific process includes:
[0046] (1) Symptom vectorization
[0047] The confirmed symptom list and the next symptom to be queried are represented as vectors. To ensure high accuracy while reducing computational resource consumption, paraphrase-MiniLM-L6-v2 was selected to convert the confirmed symptom list and the next symptom to be queried extracted from the history record u into an embedded vector.
[0048] First, define the list of confirmed symptoms as follows: (in As symptoms, The status is represented by a value of "true", "false", or "not sure". The next symptom to query is indicated by... The complete sentence formed by combining the two is defined as a sentence. This sentence is used to generate a natural language description—a symptom list—based on the state of each symptom. Each symptom in the list will be translated into a statement such as "The current patient has a certain symptom," "The current patient does not have a certain symptom," or "The current patient is unsure whether they have a certain symptom." For example, given a list of symptoms... The next symptom to be queried is "watery stool". The sentence is: "The current patient has no cough symptoms, it is uncertain whether there are fever symptoms, ..., has abdominal pain symptoms, and the next symptom to be queried is watery stool".
[0049] Then, the generated sentence is input into the paraphrase-MiniLM-L6-v2 model to generate the corresponding embedding vector representation:
[0050]
[0051] The embedding vector This will be used for subsequent similarity calculations.
[0052] (2) Caching mechanism
[0053] To improve efficiency and reduce redundant calculations, this invention employs a caching mechanism to avoid repeatedly calculating the embeddings of the same symptom list. Each symptom list (in simplified terms, it actually includes a list of confirmed diseases and the symptoms to be queried next) and its corresponding embedding vector are stored in a cache dictionary, with a one-to-one mapping between each symptom list and its corresponding vector. During a query, the system first checks if the symptom list already exists in the cache. If it does, the system directly returns the cached embedding vector; otherwise, it calculates the embedding vector and adds it to the cache.
[0054] (3) Calculate cosine similarity
[0055] Cosine similarity is used to measure the similarity between the current symptom list and each symptom list in the history; that is, it is determined by calculating the cosine of the angle between the two vectors. Given the current symptom list vector... and a list vector of each symptom in the history The formula for cosine similarity is:
[0056]
[0057] The cosine similarity value is between [0,1]. The larger the value, the more similar the two symptom lists are, and the more worthy it is to be used as a reference for subsequent inferences.
[0058] (4) Interactive record retrieval
[0059] During each query, the memory component first calculates the similarity between the current symptom list and each symptom list in the history, and then sorts the history records according to the similarity values. It returns the 10 history records most similar to the current symptom list as a reference for subsequent interactions between the reinforcement learning agent model and the AIExpert module.
[0060] The main task of the prompt building component is to generate a prompt containing all the necessary information so that the large language model can provide accurate feedback and scoring. Figure 3 The build process shown in the prompt is illustrated. The build prompts include system prompts, example prompts, and prompts for this round.
[0061] (1) System prompt
[0062] The core purpose of the system prompts is to clarify the role of the large language model, informing it of its responsibilities as a medical expert in reasoning and scoring during conversational disease diagnosis. The system prompts detail the various factors the large language model needs to consider when generating feedback scores. Besides considering the applicability of known symptoms within the symptom sequence, the system prompts also require the large language model to evaluate the role and value of the current symptom in distinguishing different diseases in the disease list. Specifically, the system prompts instruct the large language model to not only focus on the symptom itself during reasoning but also to comprehensively consider the symptom's impact on the diagnostic process, including the frequency of symptom occurrence, the correlation between the symptom and the disease, and whether it effectively helps distinguish different diseases. Furthermore, the system prompts include explicit rules, such as directly giving a low score when the next symptom to be queried overlaps with a symptom in the confirmed symptom list.
[0063] (2) Example prompts
[0064] The example hints provide reference cases to help the large language model understand the scoring criteria and framework. Through these examples, the large language model can understand how to make scoring decisions in a given symptom and disease context. The example hints demonstrate scoring methods for similar situations, including high and low scores, and provide clear reference patterns for subsequent scoring by the large language model, thereby ensuring the consistency and reasonableness of its generated scores.
[0065] (3) Tips for this round
[0066] This round of prompts is constructed based on the symptom information of the current interaction round. It includes the following detailed components:
[0067] List of confirmed symptoms: Lists the symptoms that have been confirmed for the current patient, which were known through interaction with the reinforcement learning agent model.
[0068] Next step: identify the symptoms that need further confirmation, i.e. the symptoms to be queried next. These symptoms are also obtained through interaction with the reinforcement learning agent model.
[0069] Dynamic weighting of each symptom: This represents the weight of each symptom within each disease in the current disease group, indicating the importance of the symptom in the current diagnosis. These weights are adjusted based on different dialogue rounds to ensure the model focuses on more critical symptoms.
[0070] Current Disease List: Lists all diseases within the disease group used for the current dialogue, derived from the reinforcement learning agent model. Its purpose is to limit the scope of the analysis. Large language models need to consider the importance of symptoms within these disease groups and their contribution to determining whether a user has a particular disease.
[0071] By constructing prompts as input, the large language model can understand the context of the current symptom query and the value of each symptom (as reference information), thereby making more accurate analysis and reasoning, and generating feedback scores as rewards to be returned to the reinforcement learning agent model to further optimize the learning strategy of the reinforcement learning agent model.
[0072] The prompt is then fed into the large language model component, which generates feedback evaluation through reasoning analysis, extracts specific scores from it, and finally feeds the scores back to the reinforcement learning model.
[0073] Experimental results:
[0074] The experiment used the synthetic dataset (SD) to evaluate the model. The SD dataset, provided by Fudan University, is a synthetic dataset built for training disease diagnosis dialogue agents. This dataset originates from the SymCat (www.SymCat.com) disease-symptom database. The SD database contains 30,000 patient visits (i.e., the user's target) and 90 diseases. The experimenters divided these into 9 groups according to medical standards, with each group containing 10 typical diseases, each disease associated with a specific set of symptoms.
[0075] To evaluate the performance of the model proposed in this invention, four published methods were selected as controls, and the experimental results are shown in Table 1.
[0076] Table 1. Performance of each model on SD
[0077]
[0078] To verify the effectiveness of the method proposed in this invention, ablation experiments were conducted, as shown in Table 2. Here, LFRD(w / o attention) represents the model with the attention mechanism for dynamically assigning symptom weights removed, LFRD(w / oretrieval) represents the model with the interaction record retrieval module removed, and LFRD(ours) is the complete model containing all design components.
[0079] Table 2 Ablation study of the model proposed in this invention on SD
[0080]
[0081] To further analyze the misjudgment situation of the proposed model, the present invention conducted the following experiments, the results of which are shown below. Figure 4 All user cases where the agent system gave incorrect disease classifications on the SD dataset were collected, and a confusion matrix for the disease classifier was constructed based on these cases.
[0082] 3. Conclusion
[0083] Through comparative experiments, ablation experiments, and error analysis experiments on the public dataset SD, the effectiveness of the conversational disease diagnosis method based on large language model feedback proposed in this invention is demonstrated, and the highest accuracy of 60.20% is achieved on SD.
Claims
1. A conversational disease diagnosis method based on feedback from a large language model, characterized in that... The method includes the following steps: Step S1: Construct an interaction framework between the reinforcement learning module and the expert feedback module of the conversational disease diagnosis model based on feedback from a large language model; Step S2: The reinforcement learning module generates the next symptom to be queried and inputs the current symptom sequence, disease list and symptom to be queried into the expert feedback module; Step S3: The expert feedback module assigns dynamic weights to each symptom in the current symptom sequence through a dynamic symptom attention mechanism, and filters key symptoms based on symptom frequency and specificity. Step S4: The expert feedback module uses the memory component to retrieve the most similar historical interaction records to the current symptom sequence based on the current disease list, and extracts contextual information; Step S5: Based on dynamically weighted symptoms, historical interaction records, and preset rules, construct a Prompt input that includes system prompts, example prompts, and current prompts, driving the large language model to generate feedback scores for the symptom query strategy; Step S6: Use the feedback score as a reward signal for reinforcement learning to optimize the symptom query strategy of the reinforcement learning module and achieve iterative training of conversational disease diagnosis.
2. The conversational disease diagnosis method based on large language model feedback according to claim 1, characterized in that... The large language model feedback-based conversational disease automatic diagnosis model consists of a reinforcement learning module and an expert feedback module. The reinforcement learning module is responsible for interacting with the user, asking about symptoms and informing them of the diagnosis results. The expert feedback module simulates a human medical expert, evaluates and analyzes the quality of the symptoms generated by the reinforcement learning module at each step, and provides feedback to guide the symptom generation process of the reinforcement learning module.
3. The conversational disease diagnosis method based on large language model feedback according to claim 1, characterized in that... The dynamic symptom attention mechanism includes: calculating an initial weight based on the frequency of symptom occurrence in the target disease group; reducing the weight of a symptom if it occurs frequently in multiple diseases, and increasing the weight of a symptom if it occurs frequently only in a single disease; and dynamically filtering symptoms based on the weight to remove redundant or low-discrimination symptoms.
4. The conversational disease diagnosis method based on large language model feedback according to claim 3, characterized in that... The term "high frequency occurrence" is defined as the frequency of symptom occurrence in the target disease group being greater than a preset threshold; the frequency of various symptoms corresponding to each disease. The calculation is as follows: Where M represents the total number of symptoms of the current disease, and N represents the number of users suffering from the disease. Indicates current symptoms. =1 indicates that the current user has this symptom.
5. The conversational disease diagnosis method based on large language model feedback according to claim 1, characterized in that... The retrieval process of the memory component includes: converting the current symptom sequence and the symptom to be queried into natural language descriptions, and generating vector representations through a pre-trained embedding model; calculating the similarity between the current symptom vector and historical records based on cosine similarity; and returning the top N historical records with the highest similarity as contextual references.
6. The conversational disease diagnosis method based on large language model feedback according to claim 5, characterized in that... The specific steps of the retrieval process are as follows: (1) Symptom vectorization: First, define the list of confirmed symptoms as follows: ,in As symptoms, The status is represented by the value "true", "false", or "not sure", and the next symptom to query is indicated by... The concatenation of these two elements forms a complete sentence, defined as a "sentence." This sentence is used to generate a natural language description based on the state of each symptom. The generated sentence is then input into the paraphrase-MiniLM-L6-v2 model to generate corresponding embedding vectors. express: (2) Caching mechanism: Each symptom list and its corresponding embedding vector are stored in a cache dictionary. There is a one-to-one mapping between each symptom list and its corresponding vector. When querying, first check if the symptom list already exists in the cache. If it exists, the embedding vector in the cache is returned directly. If it does not exist, the embedding vector is calculated and added to the cache. (3) Calculate the cosine similarity: Cosine similarity is used to measure the similarity between the current symptom list and each symptom list in the history; that is, it is determined by calculating the cosine of the angle between the two vectors. Given the current symptom list vector... and a list vector of each symptom in the history ; (4) Interactive record retrieval: During each query, the memory component first calculates the similarity between the current symptom list and each symptom list in the history, sorts the history records according to the similarity values, and returns the N history records that are most similar to the current symptom list, which serve as a reference for subsequent interactions between the reinforcement learning module and the expert feedback module.
7. The conversational disease diagnosis method based on large language model feedback according to claim 6, characterized in that... The cosine similarity formula is: 。 8. The conversational disease diagnosis method based on large language model feedback according to claim 1, characterized in that... The Prompt input includes: system prompts, used to define the medical expert roles and scoring rules of the large language model; example prompts, used to provide high and low score cases to standardize the reasoning logic of the large language model; and current round prompts, used to integrate dynamically weighted symptoms, the symptoms to be queried, and the disease list to generate structured input.
9. The conversational disease diagnosis method based on large language model feedback according to claim 1, characterized in that... The logic for generating the feedback score includes: inputting the constructed prompt information and historical interaction records into the large language model; the large language model, based on medical knowledge reasoning, assesses the ability of the queried symptom to distinguish between diseases in the current disease list, generates a reasonableness score for the queried symptom, and returns this score as a reward signal to the reinforcement learning module to optimize its symptom query strategy.