Abstract
Metabolic and bariatric surgery (MBS) is a critical intervention for severe obesity, but its long-term success is heavily dependent on patient adherence to complex lifestyle changes. Patients often encounter "information deserts" where reliable medical advice is scarce. While Large Language Models (LLMs) offer a potential solution for patient Q&A, they are limited by knowledge cutoffs and a tendency to hallucinate. This paper presents bRAGgen, an adaptive framework that combines real-time web retrieval with online learning. By monitoring its own confidence and performing on-the-fly parameter updates via LoRA, bRAGgen provides accurate, expert-validated medical advice that evolves with the latest clinical guidelines. Evaluated on the new bRAGq benchmark, the system achieves near-expert performance, significantly outperforming static models and existing RAG baselines.
Introduction
The success of metabolic and bariatric surgery (MBS) relies on years of follow-up and strict adherence to post-operative protocols. However, many patients face significant barriers to accessing timely medical information due to healthcare disparities or logistical hurdles. While LLMs could bridge this gap, their utility in clinical settings is hampered by two primary issues: outdated training data and the risk of generating incorrect medical advice (hallucinations). Standard Retrieval-Augmented Generation (RAG) systems mitigate these issues but often struggle with static databases and context noise. To overcome these limitations, we introduce bRAGgen, an adaptive framework that autonomously updates its knowledge when it detects uncertainty.
The bRAGgen Framework
The bRAGgen system is formalized as $S = (C, R, G, L)$, integrating four core components to ensure accuracy and adaptability:
- Semantic Cache (C): A fast-access memory of medical documents indexed via Faiss, utilizing an eviction policy to maintain relevance.
- Multi-Source Web Retrieval (R): When the cache is insufficient, the system employs a Markov Decision Process (MDP) to crawl authoritative
.govand.edudomains via the DuckDuckGo API. - Adaptive Text Generation (G): Utilizing a Llama3-8B model fine-tuned with Low-Rank Adaptation (LoRA), the system monitors its own perplexity. If uncertainty exceeds a specific threshold ($ au_p = 4.5$), a retrieval and adaptation cycle is triggered.
- Online Learning (L): New evidence is internalized through parametric updates using a regularized cross-entropy loss, allowing the model to learn on the fly without forgetting prior knowledge.
To maintain safety, the framework incorporates constrained decoding, preventing the generation of speculative or unsafe clinical terms.
The bRAGq Dataset
To evaluate the framework, the authors developed bRAGq, a benchmark dataset consisting of 1,302 bariatric surgery-related questions. The dataset includes 611 questions from PubMedQA and 691 synthetic questions based on expert templates and real-world patient interactions.
Every entry in bRAGq was validated by a board-certified bariatric surgeon to ensure clinical relevance across diverse categories such as "Risks & Complications," "Nutrition & Diet," and "Mental Health."
Key Insights and Results
The bRAGgen framework introduces several novel concepts to medical AI:
- Confidence-Triggered Learning: Retrieval is only performed when internal confidence is low, reducing noise and latency compared to standard RAG systems.
- Parametric Updates: Unlike standard RAG, which only uses retrieved documents as context, bRAGgen updates its weights (via LoRA) to internalize new clinical evidence.
- Expert Validation: The study found a high correlation ($ ho = 0.94$) between human expert ratings and ChatGPT-4o, validating the use of high-capability LLMs as evaluation proxies for niche medical domains.
In benchmarks against state-of-the-art models like MedGraphRAG, bRAGgen achieved a superior average expert score of 4.51/5.0. It demonstrated high performance in comprehensiveness (4.76) and clinical relevance (4.58). Furthermore, the framework significantly boosted the performance of smaller models like Phi-3 and Mistral by 0.6–0.7 points, making them more viable for resource-constrained clinical environments.
Limitations and Future Work
While bRAGgen represents a significant step forward, challenges remain. Sequential updates may lead to "capacity saturation," suggesting a need for hierarchical edit graphs to manage many updates. Additionally, while the model excels at factual updates, its complex medical reasoning capabilities are still evolving. Future work will focus on improving explainability and long-term knowledge retention in full continual learning settings.
Summary updated