Prompt-based large language model drug recommendation method
By constructing a drug interaction map and generating dynamic prompts, combined with a large language model, the problem of insufficient consideration of drug interaction in drug recommendation in the prior art and insufficient integration of patient individual health status is solved, and more accurate and safe drug recommendations are achieved.
Patent Information
- Application Number
- CN202411471322.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-19
- Publication Date
- 2025-06-03
AI Technical Summary
The prior art has problems in drug recommendations that insufficient consideration of drug interactions and insufficient integration of patients' individual health status, which affects the accuracy and safety of diagnosis and treatment.
The drug recommendation method based on prompts is adopted, and the drug interaction map is constructed and encoded using graph convolution networks is used to generate embedded representations of the DDI map; dynamic prompts are generated based on the patient's electronic health records and current health conditions; the DDI map embed representation and dynamic prompts are input into the pre-trained large language model to generate drug recommendations for patients.
It improves the accuracy and safety of drug recommendations, reduces the risk of adverse reactions caused by improper drug combination, can provide personalized treatment suggestions, and improves the accuracy and safety of diagnosis and treatment.
Smart Images

Figure CN120089272A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical information technology, and particularly to a prompting-based large language model drug recommendation method. Background Art
[0002] As is well known, with the rapid development of the technology field, natural language processing in the field of artificial intelligence has been widely applied in the medical field in recent years. Among them, the reasonable recommendation of patient medications through recommendation system technology is a hot topic of concern to a large number of researchers. The main task of drug recommendation is to recommend reasonable and correct drugs for patients by means of feature comparison. Its goal is to obtain patient disease characteristics from electronic medical records, capture information through different methods, and combine the obtained information to recommend reasonable drugs to different patients, achieving a safe and efficient effect.
[0003] In modern medical practice, electronic health record systems have become an indispensable part of medical institutions. The EHR not only contains patient personal information, medical history, diagnosis results, treatment plans, laboratory test reports, etc., but also records the details of each patient visit. These data are valuable resources for doctors, which can help them better understand the overall health status of patients, and thus make more reasonable diagnosis and treatment decisions. Currently, existing LLMs have deficiencies in considering drug interactions and integrating patient historical visit information. The former may cause the model to prescribe conflicting medications, while the latter makes the model unable to provide personalized treatment recommendations based on the individual health status and medical history of patients. These problems may affect the accuracy and safety of diagnosis and treatment, and there is an urgent need for further optimization and improvement. Therefore, it is necessary to propose a solution to this technical problem. Summary of the Invention
[0004] Aiming at the deficiencies of the prior art, the present invention provides a prompting-based large language model drug recommendation method.
[0005] To achieve the above object, the present invention provides the following technical solution: A prompting-based large language model drug recommendation method, comprising the following steps: Step 1: Construct a drug interaction graph and encode it through a non-transitive graph convolutional network to generate an embedded representation of the DDI graph; Step 2: Compare the patient's electronic health record with the current health condition to generate dynamic prompts, where the dynamic prompts are generated by calculating the similarity between the patient's current health condition and historical visit records; Step 3: Input the DDI graph embedded representation and the dynamic prompts into a pre-trained large language model to generate drug recommendations for the patient.
[0006] Further, the present invention is improved in that step 1 includes the following steps: S1: Collect information on drugs and their interactions, and establish an undirected graph, where each drug entity serves as a node in the graph, and each interaction existing between a pair of drugs serves as an edge connecting these two nodes; S2: For each pair of drugs, assign corresponding edge weights according to their interaction types; S3: Use a graph data structure to store the DDI graph, and uniquely identify each drug node to obtain a graph; S4: Initialize the feature representation for each drug node; S5: Use the attention mechanism to calculate the aggregated representation of the neighbor nodes of each drug node; S6: Use a custom update function to update each node, enabling the GCN to effectively capture the mutual exclusion relationships between drugs; S7: Aggregate the embedding representations of all drug nodes to form the embedding representation of the entire DDI graph.
[0007] Further, the present invention is improved in that step 2 includes the following steps: S1: Obtain the current status of the patient, including the current diagnosis and treatment procedures. Extract the patient's historical visit information from the EHR, including historical diagnosis records, historical treatment procedures, and historical prescription drugs; S2: Use an embedding matrix (such as the embedding tables for diagnosis, procedures, and drugs) to generate corresponding encoded vectors for the historical records and the current health status using a Transformer; S3: Calculate the similarity at the diagnosis level. Using the encoded historical data and current data, calculate the similarity between each historical visit of the patient and the current visit; S4: Calculate the similarity at the drug level. For each drug combination in the historical visits, calculate its drug-level similarity with the current health status using the encoded vector representation; S5: Sort all the historical drugs according to the calculated similarity scores, and screen out the drugs most relevant to the current health status.
[0008] Further, the present invention is improved in that step 3 includes the following steps: S1: Input the DDI graph embedding representation and the dynamic prompt into a pre-trained large language model, keeping the pre-trained parameters of the large language model unchanged; S2: Design an input template, and integrate the DDI graph embedding representation and the current health status information and input them into the large language model; S3: Generate a drug recommendation list for the patient through the large language model.
[0009] Furthermore, the present invention is improved in that the large language model is a pre-trained model in a frozen state, and the model is pre-trained on a medical literature dataset.
[0010] Compared with the prior art, the present invention provides a large language model drug recommendation method based on prompts, which has the following beneficial effects: This prompt-based large language model drug recommendation method converts the patient's EHR data into structured information through a dynamic prompt mechanism, and uses this as the basis for LLM to generate drug recommendations. Since LLM has learned a large amount of medical literature and cases, it can master more comprehensive and up-to-date drug knowledge, so the recommendations generated based on this model are more accurate and reliable. At the same time, through the in-depth analysis of the interaction between drugs through DDI diagrams and GCN, the risk of adverse reactions caused by improper drug combinations is further reduced; The DDI graph is used to model drug interactions. The GCN algorithm is used to learn the complex interactions between drugs and effectively identify drug combinations that may conflict. This method can not only prevent common drug incompatibilities, but also discover drug pairing patterns that are not widely known but actually pose safety risks. More importantly, when generating drug recommendations, the system will automatically avoid these high-risk combinations to ensure that the options presented to doctors are relatively safe. By extracting key information from the EHR to form dynamic prompts, LLM can generate customized drug recommendations for specific cases. This approach not only takes into account the patient's current health status, but also their past medical experience, which helps doctors understand the condition more comprehensively and make more scientific and reasonable treatment decisions. The one-stop drug recommendation platform provided greatly simplifies the doctor's workflow. Through simple operations, doctors can obtain professional drug recommendations based on the patient's specific conditions without spending too much time looking up information or exchanging opinions with other experts, which greatly improves work efficiency. In addition, the system also supports continuous updates and can reflect the latest medical research results in a timely manner, so that doctors are always at the forefront of information; It helps reduce the side effects and secondary visits caused by incorrect medication, improves the treatment effect, and reduces the physical and mental burden on patients. In addition, the introduction of the intelligent recommendation system allows doctors to have more time and energy to focus on communicating with patients, enhancing the doctor-patient relationship, and thus improving the overall medical experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 is a flow chart of the method of the present invention; Figure 2 is a detailed flow chart of step 1 of the method of the present invention; Figure 3This is the detailed flowchart of step 2 of the method of the present invention; Figure 4 This is the detailed flowchart of step 3 of the method of the present invention; Specific embodiments
[0012] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0013] Please refer to Figures 1-4 , the present invention is a large language model drug recommendation method based on prompts, and the method includes the following steps: Step 1: Construct a drug interaction graph and encode it through a non-transitive graph convolutional network to generate an embedded representation of the DDI graph; Step 2: Compare the patient's electronic health record with the current health condition to generate dynamic prompts, where the dynamic prompts are generated by calculating the similarity between the patient's current health condition and historical medical records; Step 3: Input the DDI graph embedded representation and the dynamic prompts into a pre-trained large language model to generate drug recommendations for the patient.
[0014] In this solution, step 1 includes the following steps: S1: Collect drug and its interaction information, and establish an undirected graph, where each drug entity is used as a node in the graph, and the interaction existing between each pair of drugs is used as an edge connecting the two nodes; S2: For each pair of drugs, assign corresponding edge weights according to their interaction types; S3: Store the DDI graph using a graph data structure and uniquely identify each drug node to obtain a graph; S4: Initialize the feature representation of each drug node; S5: Use the attention mechanism to calculate the aggregated representation of the neighbor nodes of each drug node; S6: Use a custom update function to update each node so that the GCN can effectively capture the mutual exclusion relationship between drugs; S7: Aggregate the embedded representations of all drug nodes to form the embedded representation of the entire DDI graph.
[0015] In this solution, step 2 includes the following steps: S1: Obtain the patient's current status, including the current diagnosis and treatment procedures. Extract the patient's historical visit information from the EHR, including historical diagnosis records, historical treatment procedures, and historical prescription medications; S2: Use embedding matrices (such as embedding tables for diagnosis, procedures, and medications) to generate corresponding encoded vectors for the historical records and the current health status using a Transformer; S3: Calculate the similarity at the diagnosis level. Using the encoded historical data and current data, calculate the similarity between each historical visit and the current visit of the patient; S4: Calculate the similarity at the medication level. For the medication combinations of each historical visit, use the encoded vector representations to calculate their medication-level similarity to the current health status; S5: Sort all the historical medications according to the calculated similarity scores and filter out the medications most relevant to the current health status.
[0016] In this solution, step 3 includes the following steps: S1: Input the DDI graph embedding representation and dynamic prompts into a pre-trained large language model, keeping the pre-trained parameters of the large language model unchanged; S2: Design an input template and input the integrated DDI graph embedding representation and current health status information into the large language model; S3: Generate a list of drug recommendations for the patient through the large language model.
[0017] In this solution, the large language model is a pre-trained model in a frozen state, and this model has been pre-trained on a medical literature dataset.
[0018] In this solution, the drug recommendation also includes converting the generated drug codes into specific drug names or combinations through an embedding matrix and outputting the final drug recommendation advice to medical professionals.
[0019] In this embodiment, a drug interaction graph is constructed and encoded by a graph convolutional network to generate an embedded representation of the DDI graph. Information about drugs and their interactions is collected to establish an undirected graph, where each drug entity serves as a node in the graph, and each interaction between a pair of drugs serves as an edge connecting the two nodes. For each pair of drugs, an appropriate edge weight is assigned according to their interaction type. The DDI graph is stored using a graph data structure, and each drug node is uniquely identified. The graph convolutional network algorithm is applied to process the DDI graph to obtain a low-dimensional dense vector representation for each node. In the GCN, the node update function is modified so that the drug nodes can not only capture information about adjacent drugs but also reflect the complexity of drug-drug interactions. The embedded representations of all drug nodes are aggregated to form an embedded representation of the entire DDI graph. The diagnosis set, examination set, and drug set are encoded using a multi-head attention mechanism, and the features at each position are mapped and transformed using a position-based feed-forward network. Dynamic prompts are generated based on the patient's electronic health record. Personal information, disease diagnosis information, past treatment records, laboratory test results, etc. of the patient are extracted from the EHR, and the extracted information is preprocessed, such as encoding, standardization, etc., to facilitate processing by machine learning models. Natural language processing techniques, such as word embedding or sequence-to-sequence models, are used to transform the processed information into dynamic prompts for guiding the subsequent large language model generation process. The dynamic prompt generation embeds and encodes the patient's diagnosis codes, procedure codes, and drug codes to generate corresponding embedded representations, calculates the similarity between the historical visit and the current visit, and selects appropriate drugs as prompts based on the similarity. The DDI graph embedded representation and the dynamic prompt are input into a pre-trained large language model to generate drug recommendations for the patient. The DDI graph embedded representation and the dynamic prompt are input into a pre-trained large language model, keeping the pre-trained parameters of the large language model unchanged. An input template is designed, and the DDI graph embedded representation is integrated with the current health status information and then input into the large language model. A list of drug recommendations for the patient is generated through the large language model. The large language model is a pre-trained model in a frozen state, and this model has been pre-trained on a medical literature dataset. The drug recommendations also include converting the generated drug codes into specific drug names or combinations through an embedding matrix, and outputting the final drug recommendation suggestions to medical professionals. The most similar historical visit record is selected by calculating the similarity between each visit and the current visit, and the drugs for the prompt are determined by comprehensively considering the visit-level similarity and the drug-level similarity. The visit-level health status is encoded by aggregating all accessed diagnosis and procedure representations through a gated aggregation layer.
[0020] Figure and are the EHR graph and the DDI graph respectively, where is all possible drug combinations in (Electronic Health Records), and is the known DDI. In terms of form, we use an adjacency matrix to represent the EHR graph and the DDI graph. represents that the 𝑖-th and 𝑗-th drugs appear in the same treatment, and represents that the 𝑖-th and 𝑗-th drugs interact with each other. and are the same for all patients.
[0021] Some drugs contain DDI and cannot be used simultaneously. When recommending drugs, the LLM should avoid conflicts with previously recommended drugs. Modeling this relationship can help recommend safe and effective drug combinations. We constructed an undirected graph with drugs as nodes and modeled the interaction relationship between drugs through a Graph Convolutional Network (GCN). However, traditional GCNs have limitations in processing DDI graphs because they cannot effectively capture the mutually exclusive relationship between drugs. Therefore, we modified the update function so that the representations of drugs connected in the DDI graph have significant differences in the low-dimensional embedding space, thus better reflecting their mutual exclusivity. Finally, the embedding representation of the DDI graph will be used as one of the input prompts to guide the model to generate safe and effective drug recommendations.
[0022] The DDI graph is an undirected graph. For the DDI graph, the conventional encoding process is: where represents the set of neighbor nodes of node, and represents the aggregation function, which uses the attention mechanism for aggregation in this paper. Specifically, for node, information is obtained from its neighbors: where is the attention weight, which is obtained by calculating the similarity between node and its neighbor nodes. Specifically where is a trainable weight matrix, is a trainable attention vector, represents the concatenation operation, and is an activation function.
[0023] However, since the drugs connected in the DDI graph are actually mutually exclusive, their representations in the low-dimensional embedding space should be very different. Therefore, the traditional UPD(·) function is ineffective because it forces neighbors to be close in the embedding space. Therefore, we modify the update function to: where γ is a hyperparameter that regulates the balance between a drug and its neighborhood. After multiple layers of aggregation and update, a set of embedding representations of all drug nodes is obtained. Take the average of all node embeddings to generate the embedding representation of the DDI graph: The embedding of the DDI graph will be used as one of the prompts to input into the LLM to guide the LLM to generate drug recommendations according to the patient's situation.
[0024] Historical visit prompt The historical medical visit information of the patient is utilized to guide the model to generate drug recommendations. Specifically, the model first represents the input using an embedding table, then encodes the health conditions in the historical records, and calculates the similarity between each visit and the current visit. Next, the similarity is calculated along the drug dimension, and finally, the appropriate drugs are prompted by integrating the visit-level similarity and the drug-level similarity.
[0025] First, the model uses three embedding tables, where each row is an embedding vector of different diagnostic codes, examination codes, or drug codes. For each set of diagnoses, we first convert each element of it into a -dimensional vector through the embedding matrix, and then we can obtain the representation of the diagnosis set. For each set of examinations and drug sets, use the embedding matrix and to obtain their representations and.
[0026] Then, use the Transformer encoder to encode the diagnosis set, examination set, and drug set. The Transformer encoder has two sub-layers, the multi-head attention sub-layer and the position-based feed-forward network. The purpose of the multi-layer attention sub-layer is to capture the relationships between all drugs in the same drug recommendation. Given three input matrices,,, this attention function is defined as: The multi-head attention layer will further project the input into multiple representation sub-spaces and capture interaction information from multiple views.
[0027] The position-based feed-forward network maps and transforms the features at each position, thereby improving the expressiveness and generalization ability of the model. This sub-layer consists of two linear projections with an activation function in the middle.
[0028] where are trainable parameters.
[0029] Then, use two gated aggregation layers to encode the health conditions at the visit level by aggregating all accessed diagnosis and procedure representations respectively: where, and are all trainable parameters. Then, by measuring the similarity between the th diagnosis in the past and the th diagnosis currently, calculate its visit-level selection score ().
[0030] After obtaining the calculation of the visit-level similarity, calculate the calculation of the drug-level similarity. First, comprehensively encode the diagnoses and examinations to obtain latent variables to facilitate determining which historical medications are reusable in the current situation.
[0031] Then, we use the hidden state as the query vector to calculate the selection score along the drug dimension. The selection score of the th drug in the th visit is: where is a learnable parameter. is the drug-level selection score.
[0032] Finally, the drugs to be prompted are determined by comprehensively considering the scores of the medical treatment level and the drug level. In addition, since a drug may be used in multiple past prescriptions, its final probability is: where is an indicator function that takes the value of 1 when and 0 otherwise.
[0033] The probability that all drugs are used as prompts is. A threshold is set, and when, the drug is used as a prompt to guide the LLM to recommend drugs.
[0034] The core component of the model is the pre-trained LLM, which can utilize unstructured text data. Instead of training our own domain-specific LLM, we utilize the state-of-the-art publicly pre-trained base models. Previous studies have shown that models trained on a large amount of general data can significantly outperform specialized models. Therefore, our goal is to utilize their capabilities in the medical field. To retain the language understanding ability obtained through pre-training and minimize computational requirements, we use the LLM in a frozen state without fine-tuning its parameters. We do not limit our framework to a specific LLM. Instead, it can be used with any current LLM architecture, and the prompts we proposed are general.
[0035] The overall drug recommendation process is shown in Table 1. Specifically, first, the input to the frozen pre-trained LLM is the encoded current diagnosis set and examination set, as well as the generated prompts. The designed input template is "Please recommend relevant drugs based on the patient's symptoms. The patient's current medical visit situation is ⊕. The drug interaction graph is, and the drugs prescribed in the patient's most similar previous medical visits are." Finally, the LLM will output the recommended drug vector, and we use the embedding matrix to convert it into the corresponding drug combination.
[0036] Table 1 A Prompt-based Large Language Model Drug Recommendation Method Input: Patient representation, DDI graph 1 Encode the DDI graph according to formulas (2)-(5) 2 Obtain the representation of the current health status,, through and the embedding table 3 Obtain the health status of the medical visit according to formula (6) 4 Obtain the medical visit level score according to formula (11) 5 Obtain the drug level score according to formula (13) 6 Obtain the drug level prompt according to formula (14) 7 Input and the current health status into the LLM according to the template 8 Obtain the drug recommendation for the patient Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A large language model drug recommendation method based on prompts, characterized in that: The following steps are involved: Step 1: Construct a drug interaction graph and encode it through a non-transitive graph convolutional network to generate an embedded representation of the DDI graph; Step 2: Generate a dynamic prompt based on the patient's electronic health record and current health condition, wherein the dynamic prompt is generated by calculating the similarity between the patient's current health condition and historical medical records; Step 3: Input the DDI graph embedding representation and the dynamic prompt into a pre-trained large language model to generate drug recommendations for the patient.
2. The large language model drug recommendation method based on prompts according to claim 1, characterized in that: The step 1 comprises the following steps: S1: Collect information on drugs and their interactions and build an undirected graph, where each drug entity is a node in the graph and the interaction between each pair of drugs is an edge connecting the two nodes; S2: For each pair of drugs, the corresponding edge weights are assigned according to their interaction types; S3: Use the graph data structure to store the DDI graph, and uniquely identify each drug node to obtain a graph S4: Initialize feature representation for each drug node m; S5: Use the attention mechanism to calculate the aggregate representation of the neighbor nodes of each drug node m, the formula is: Among them, α um is the attention weight, which is obtained by calculating the similarity between node m and its neighboring nodes. The formula is: Among them, W is a trainable weight matrix, a is a trainable attention vector, ∥ represents the connection operation, and LeakyReLU is an activation function. S6: Use a custom update function to update each node m so that GCN can effectively capture the mutually exclusive relationship between drugs. The update function is: in Represents the embedded representation of drug node m at the k-1th layer, which is the node representation between updates and represents the current state of drug node m. The set of neighbor nodes of drug node m in layer k The aggregation result of the embedding representation of . γ is a hyperparameter that adjusts the balance between drug m and its neighborhood, which affects the degree to which drug nodes are separated from each other in the embedding space; S7: Aggregate the embedding representations of all drug nodes to form the embedding representation of the entire DDI graph. The formula for the embedding representation is:
3. The large language model drug recommendation method based on prompts according to claim 1, characterized in that: The step 2 comprises the following steps: S1: Obtain the patient's current status, including current diagnosis and treatment procedures. Extract the patient's historical medical information from the EHR, including historical diagnosis records, historical treatment procedures, and historical prescription drugs; S2: Use an embedding matrix (e.g., an embedding table of diagnoses, procedures, and medications) to generate corresponding encoding vectors for historical records and current health status using Transformer; S3: Calculate the similarity at the diagnosis level, using the encoded historical data and current data to calculate the similarity between each historical visit of the patient and the current visit; S4: Calculate the similarity of the drug level. For each drug combination of the historical visit, use the encoded vector representation to calculate its drug level similarity with the current health status; S5: According to the calculated similarity scores, all historical drugs are sorted and the drugs most relevant to the current health condition are screened out.
4. The method for drug recommendation based on a large language model based on prompts according to claim 3, characterized in that: The S2 comprises the following steps: S1: Using three embedding tables, E d ,E p ,E m Embed the patient’s diagnosis code, examination code, and drug code to generate the corresponding embedding representation D i , P i and M j ; S2: The diagnostic set D after embedding encoding i , check set P i and drug set M j As input, it is encoded through the Transformer encoder; the Transformer encoder includes a multi-head attention mechanism and a position-based feedforward network to capture the complex interactive relationship between diagnosis, examination and drug data; S3: Using the multi-head attention mechanism, the encoded representations of diagnosis, examination and medicine are projected in multiple dimensions to generate the interactive information between different data in the drug recommendation process; the formula is: S4: Through the output results of the multi-head attention mechanism, the input data is projected into multiple representation subspaces, and the interactive information of multiple views is calculated. The formula is: MH(Q,K,V)=[head1;...;head h ] W O in represents the attention calculation result of the i-th head, W O is a trainable projection matrix; S5: The features of each position are nonlinearly mapped and transformed through a position-based feedforward network to improve the expressiveness and generalization ability of the model; the calculation formula of the feedforward network is as follows: Among them, W1, W2, b1, b2 are trainable parameters; S6: For the drug embedding representation output by the Transformer encoder, the drug representation is extracted using residual connection and layer normalization function LayerNorm(·), as shown below: M j ′=Enc d (M j )=LayerNorm(H+FFN(H)) Where H = LayerNorm (M j +MH(M j ,M j ,M j )) Using the same encoder structure, we can get the diagnostic and inspection representation D i ′,P′ i .
5. The method for drug recommendation based on a large language model based on prompts according to claim 3, characterized in that: The S3 comprises the following steps: S1: Diagnosis representation of each historical visit by gate-like aggregation layer D i ′ and check the representation P′ i Row coding is performed to obtain the health status representation at the diagnosis level and procedure level, and the formula is as follows: in, and All are trainable parameters; S2: Use coded historical diagnosis-level and procedure-level health status representation and The similarity score between each historical visit and the current visit is calculated using the following formula:
6. The method for drug recommendation based on a large language model based on prompts according to claim 3, characterized in that: The S4 comprises the following steps: S1: Comprehensive coding diagnosis and examination data, calculate the latent variable M″ j , used to evaluate which historical medications are reusable in the current situation, the formula is as follows: M j ″=LayerNorm(M′′ j +MH(M′ j ,D′ j ,D′ j )+MH(M′′ j ,P′ j ,P′ j )) S2: Use hidden state M j ″ is used as a query vector, and a drug-level selection score is calculated to determine the relevance of each historical medication. The formula is as follows: Among them, W c is a learnable parameter, s is a scaling factor, M′ j,k is the embedding representation of the kth drug in the jth visit.
7. The large language model drug recommendation method based on prompts according to claim 3, characterized in that: The S5 comprises the following steps: S1: Combine the visit-level and drug-level similarity scores to calculate the final probability of each drug as a prompt and calculate the drug Probability of prompt The formula is as follows: in is an indicator function if The value is 1 when it is, otherwise the value is 0; S2: Determine the drug prompt and set the threshold τ. When the drug m i It is input into the large language model as a prompt to guide the model to generate drug recommendations.
8. The large language model drug recommendation method based on prompts according to claim 1, characterized in that: The step 3 comprises the following steps: S1: embed the DDI graph representation and dynamic prompts into the pre-trained large language model, keeping the pre-trained parameters of the large language model unchanged; S2: Design an input template to embed the DDI graph into a representation and integrate it with the current health status information and then input it into the large language model; S3: Generate a list of drug recommendations for patients through a large language model.
9. The method for drug recommendation based on a large language model based on prompts according to claim 1, characterized in that: The drug recommendation also includes converting the generated drug code into a specific drug name or combination through an embedding matrix, and outputting a final drug recommendation suggestion to a medical professional.
Citation Information
Patent Citations
Drug recommendation method based on attention mechanism and global retrieval
CN116153528A
Drug information generation method and terminal
CN118230897A
Drug combination recommendation method and system based on comparative learning and label attention
CN118522403A
Cited By
Drug recommendation method and system based on drug mapping and diagnosis enhancement
CN121096523A
Boundary perception drug recommendation method based on deep model and large language model collaboration
CN121905583A