Teaching LLMs to Recommend and Defer in Underrepresented Epilepsy Care

Shreyas Rajesh, Kartik Sharma, Tonmoy Monsoor, Mehmet Yigit Turali, Richard Idro, Juliana Kayaga, Robert Sebunya, Tracy Tushabe Namata, Jessica Nichole Pasqua, Vwani Roychowdhury, Rajarshi MazumderarXiv 2026

TL;DR

This paper introduces MANANA, a non-parametric prompt-learning framework designed to adapt Large Language Models (LLMs) to local medical prescribing practices in resource-constrained settings without updating model weights. By pairing this framework with a novel Bayesian Prompt Averaging (BPA) technique, the system can generate calibrated confidence scores, allowing it to safely recommend treatment plans for high-confidence cases and defer low-confidence ones to human specialists.

What Problem Does This Paper Address?

While LLMs demonstrate impressive medical knowledge on standardized benchmarks, these benchmarks are heavily biased toward high-income, high-resource clinical settings. When deployed in low- and middle-income countries (LMICs)—such as rural Uganda—standard LLMs often fail. The issue isn't a lack of medical knowledge, but rather the application of the wrong "priors." Standard models default to Western prescribing habits, ignoring local realities like drug stock-outs, specific cost constraints, and distinct follow-up patterns.

Furthermore, in clinical decision support systems, a model must know what it doesn't know. In overburdened healthcare systems where specialist attention is a scarce resource, an AI assistant must be capable of selective prediction: autonomously handling straightforward cases while routing ambiguous or highly uncertain cases to a specialist.

Methods

The authors propose a multi-agent, error-grounded prompt learning framework called MANANA, which operates in an iterative loop across batches of local patient data:

  1. The Predictor: An LLM agent that takes a patient's longitudinal history and proposes three anti-seizure medication (ASM) regimens based on its current "memory state" (prompt context).
  2. The Inspector: Compares the predicted regimens against the actual physician's prescription (the ground truth supervision) and generates structured error reports and candidate lessons.
  3. The Architect: Aggregates these lessons into an append-only evidence buffer. Crucially, it enforces a quorum rule—only lessons backed by multiple distinct cases are consolidated into the next memory state.

MANANA is evaluated in two flavors: MANANA-Single (which maintains a compact, flat list of rules) and MANANA-Multi (which dynamically spawns, edits, or prunes specialized signal-extraction agents).

Figure 1: MANANA workflow. (A) During adaptation, each batch of patient records is processed with the current memory state: the Predictor proposes three regimens, the Inspector compares them with the physician prescription revealed as supervision, and the proposed candidate learnings accumulate in an append-only buffer. Once per batch, the Architect consolidates recurring cross-case signals into the next shared memory, either as a Single correction-rule list or a Multi specialist-prompt population. (B) At inference, the learned memory trajectory is treated as an ensemble of prompt states. Bayesian prompt averaging converts their candidate regimen predictions into prescription probabilities, enabling high-confidence assistance or deferral to a specialist.

To handle uncertainty, the authors introduce Bayesian Prompt Averaging (BPA). Instead of using just the final optimized prompt, BPA treats the entire trajectory of prompts generated during training as an ensemble of local estimators. By evaluating these prompt states on a small validation set, BPA computes a posterior weight for each prompt state. At inference time, it marginalizes predictions over the trajectory to output calibrated prescription probabilities and a reliable deferral signal.

Datasets

The framework was trained and evaluated on real-world, longitudinal, unstructured clinical notes from pediatric epilepsy care in Uganda:

  • Cohort A: 332 patients and 1,040 visits used for training and validation.
  • Cohort B: An independently collected cohort of 367 patients and 1,509 visits used strictly as a held-out transfer evaluation set to test robustness against clinical distribution shift.
  • MIMIC-IV: Used as a secondary, public-data reproducibility check to ensure the framework translates to other clinical text environments.

Key Insights and Ideas

  • The "Wrong Prior" Problem: Neurologist audits revealed that baseline LLM errors were driven by distribution-miscalibrated defaults (e.g., defaulting to expensive or unavailable Western drugs) rather than an inability to comprehend the patient's medical history.
  • Evidence-Gated Regularization: Unlike prompt optimization techniques like TextGrad, which directly rewrite prompts based on individual feedback, MANANA’s Architect acts as a regularizer. By requiring cross-case evidence before committing a rule to memory, it prevents a single unusual patient case from corrupting global prescribing logic.
  • Trajectory as an Ensemble: The prompt evolution path itself contains rich uncertainty information. Early prompts capture conservative or generic practices, while later prompts capture highly specific local adaptations. BPA elegantly exploits this trajectory to quantify model confidence.

Key Results

MANANA consistently outperformed classical machine learning baselines (Naive Bayes, XGBoost), direct prompting, and state-of-the-art prompt optimization frameworks (DSPy, TextGrad, ExpeL) across both monotherapy and complex polytherapy cases.

Table 1: Main EM@3 results by cohort and regimen complexity. Values are top-3 exact match percentages; prompt-optimization rows report mean ± std over independent seeds where applicable. Light green rows mark MANANA variants; darker cells mark the best value in each column.

More importantly, BPA enabled highly effective selective prediction on the held-out Cohort B:

  • 99% Precision: The system achieved near-perfect top-1 exact match accuracy when evaluating the most confident 25% of cases.
  • 95% Precision: It maintained high clinical safety when auto-handling the most confident 50% of cases.
  • Efficient Deferral: Lower-confidence cases were safely flagged for human specialist review, demonstrating a clear path toward safely reducing clinician burnout in underserved areas.

Limitations and Future Work

  • Retrospective Thresholding: The deferral thresholds were calculated retrospectively on held-out data. Real-world deployment will require prospective calibration to handle shifting patient demographics over time.
  • Practice Alignment vs. Optimality: The model optimizes for agreement with local physicians, meaning it learns to mimic existing resource constraints and clinical habits, which may not always align with idealized, textbook clinical optimality.
  • Future Directions: The authors plan to extend this framework to condition prompt learning directly on patient outcomes (e.g., predicting actual seizure reduction or freedom) rather than strictly mimicking physician behavior.

Summary updated

Abstract

Specialist epilepsy expertise is scarce in resource-constrained settings, making LLM-based decision support attractive for frontline clinicians managing longitudinal treatment. Such systems must adapt to local prescribing practice and know when to defer. We study this problem in Ugandan pediatric epilepsy care, predicting anti-seizure medication regimens from longitudinal unstructured clinic notes. Standard prompting achieves non-trivial agreement with physician prescriptions, but neurologist review shows that many errors reflect distribution-miscalibrated prescribing defaults rather than failures to parse the local record. We introduce MANANA, a non-parametric prompt-learning framework that learns local prescribing guidance from a small patient-level training set. MANANA converts observed prescription errors into auditable prompt memories, instantiated in single-agent and multi-agent variants, and improves over classical ML models, direct LLM prompting, and prompt-optimization baselines across two independently collected Ugandan cohorts. We further propose Bayesian prompt averaging, which converts the learned prompt trajectory into prescription likelihoods and an uncertainty-based deferral signal. On the independently collected held-out cohort, this improves visit-level top-3 prescription accuracy by 4-8 percentage points over prompt-optimization baselines and enables selective prediction: the system can auto-handle the most confident half of cases at 95% precision, or the most confident quarter at 99% precision, while deferring lower-confidence cases for specialist review.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Ugandan Cohort B (independently collected held-out cohort), V1Manana + BPAEM@376.5%split: test · version=V1
Source quote
L877: Manana{} + BPA │ 76.5 │ .852 │ 89.8 │ .952 │ 92.8 │ .966
Ugandan Cohort B (independently collected held-out cohort), V2Manana + BPAEM@389.8%split: test · version=V2
Source quote
L877: Manana{} + BPA │ 76.5 │ .852 │ 89.8 │ .952 │ 92.8 │ .966
Ugandan Cohort B (independently collected held-out cohort), V3Manana + BPAEM@392.8%split: test · version=V3
Source quote
L877: Manana{} + BPA │ 76.5 │ .852 │ 89.8 │ .952 │ 92.8 │ .966
Ugandan Cohort B held-out test setBayesian prompt averaging (Beta-Binomial BPA)P@25% (top-1 precision)95%split: test · coverage=25%
Source quote
L1056: Beta-Binomial BPA │ 72% │ 87% │ 0.150 │ 95% │ 86%
Ugandan Cohort B held-out test setBayesian prompt averaging (Beta-Binomial BPA)P@50% (top-1 precision)86%split: test · coverage=50%
Source quote
L1056: Beta-Binomial BPA │ 72% │ 87% │ 0.150 │ 95% │ 86%
BibTeX
@misc{rajesh2026teaching,
  author = {Shreyas Rajesh and Kartik Sharma and Tonmoy Monsoor and Mehmet Yigit Turali and Richard Idro and Juliana Kayaga and Robert Sebunya and Tracy Tushabe Namata and Jessica Nichole Pasqua and Vwani Roychowdhury and Rajarshi Mazumder},
  title = {{Teaching LLMs to Recommend and Defer in Underrepresented Epilepsy Care}},
  year = {2026},
  eprint = {2606.31036},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.31036},
}
Figure