Multi-turn Conversation and Prompt Design for Small Molecule Drug Pharmacovigilance

Pharmacovigilance data for small molecule drugs originates from clinical trial reports, real-world studies, post-market surveillance, spontaneous

Data Characteristics

Pharmacovigilance data for small molecule drugs originates from clinical trial reports, real-world studies, post-market surveillance, spontaneous reports from physicians and patients, and regulatory safety information. This data updates frequently, especially during new drug launches or when new adverse event signals emerge. Document structures vary, including structured Case Report Forms (CRFs), semi-structured medical texts (e.g., medical record summaries, adverse event reports), and unstructured academic papers and regulatory announcements. Data fields cover patient demographics, medical history, comorbidities, adverse event descriptions, onset time, severity, outcome, and drug causality assessments. Units typically involve dosage (mg, g), frequency (times/day, week), duration (days, months), and laboratory indicators (e.g., mg/dL, U/L). Data is characterized by large volume, heterogeneity, and a high concentration of specialized medical terminology and non-standardized natural language descriptions.

Constraints Imposed by Data Characteristics on Multi-turn Conversations and Prompts

The diversity and high update frequency of small molecule drug pharmacovigilance data require multi-turn dialogue systems to have strong information extraction and semantic understanding capabilities. Identifying and standardizing specialized terminology in unstructured text is critical, as adverse event descriptions may involve synonyms, abbreviations, or colloquial expressions. High update frequency means the knowledge base must quickly synchronize with the latest data to ensure the timeliness and accuracy of dialogue results. Multi-turn conversations need to handle complex causal relationships and time-series information, such as tracing the association between adverse events and drug exposure, or evaluating drug interactions. Additionally, due to patient privacy and drug safety concerns, the dialogue system must be highly accurate to avoid misleading information. For prompt design, this requires guiding the model to perform precise fact extraction, logical reasoning, and effectively handle ambiguous or incomplete information while avoiding hallucinations.

Configuration Guidelines

Configuration ItemRecommended ValueRationale
Chunk size (Chunk Size)500-800 characters (characters)Balances semantic completeness and RAG retrieval efficiency, preventing excessive truncation of key information.
Recall count (Recall Count)8-12 entries (items)Ensures coverage of sufficient relevant adverse event cases and drug information while controlling the context window.
Similarity threshold (Similarity Threshold)0.75-0.85Filters out irrelevant document snippets, improving recall precision and reducing noise.
Rerank result count (Reranked Return Count)3-5 entries (items)Further refines the context by selecting the most relevant items from the recalled results based on the current dialogue intent.
maxContext8192-16384 tokenAccommodates multi-turn dialogue history, user queries, system prompts, and recalled document content to support complex reasoning.
promptTemplateIncludes keywords like "Identify Drugs、adverse reactions、dosage、time、relevance" (identify drug, adverse event, dosage, time, causality)Guides the model to focus on core pharmacovigilance elements, ensuring comprehensive and accurate information extraction.

Three Common Mistakes

  • The dialogue contains extensive medical terminology, but the system fails to correctly identify or understand its meaning, leading to inaccurate responses. This is due to a lack of a corresponding medical dictionary or terminology mapping in the knowledge base, and the model not being sufficiently fine-tuned for the specialized domain.
  • The user repeatedly asks about different manifestations or timelines of the same adverse event, but the system cannot integrate contextual information and answers from scratch each time. This occurs if maxContext is insufficient to maintain a long enough dialogue history, or if the dialogue management logic fails to effectively utilize the memory module.
  • The system cites outdated or withdrawn drug safety information in its responses, causing serious misinformation. This happens when the knowledge base update mechanism is incomplete, failing to synchronize with the latest pharmacovigilance data in a timely manner, leading to Similarity threshold (Similarity Threshold) recalling expired content.

How to Verify Configuration

  • Construct complex multi-turn dialogues involving different adverse event types, drug dosages, and time series to verify if the system can accurately extract key information and provide reasonable responses.
  • Check if the system can correctly parse and map specialized medical terminology and abbreviations to standardized concepts, or provide corresponding explanations.
  • Simulate scenarios of new drug launches or safety updates. Observe if the system can immediately reflect the latest pharmacovigilance information in dialogues after the knowledge base update.
  • Compare system responses with expert opinions to evaluate the accuracy and professionalism of the dialogue results, especially regarding drug causality judgments and risk assessment conclusions.

The values provided are common starting points and should be measured against the reader's own samples.

Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-21.