Forging a Dynamic Memory: Retrieval-Guided Continual Learning for Generalist Medical Foundation Models

Zizhi Chen, Yizhen Gao, Minghao Han, Yizhou Liu, Zhaoyu Chen, Dingkang Yang, Lihua Zhang

TL;DR

The paper introduces PRIMED (Precision Retrieval-Infused model for MEDical), a novel framework that pioneers the integration of Retrieval-Augmented Generation (RAG) into Continual Learning (CL) for medical Vision-Language Models (VLMs). By leveraging a massive 18-million multimodal medical database, PRIMED dynamically retrieves contextually relevant knowledge during fine-tuning, successfully mitigating catastrophic forgetting while bridging massive cross-domain gaps.

What Problem Does This Paper Address?

Medical Vision-Language Models (VLMs) hold massive potential for clinical AI, but updating them incrementally with new tasks or domains triggers catastrophic forgetting—where the model loses its previously learned skills or its baseline zero-shot capabilities.

Standard continual learning strategies designed for natural images fail in medical scenarios due to a fundamental difference in data topology. As illustrated in the paper, natural images are intra-domain diverse but cross-domain similar (forming a continuous, mesh-like distribution). Medical images, conversely, exhibit minimal intra-domain variation but are separated by massive cross-domain gaps due to entirely different imaging principles (e.g., a CT scan vs. a dermoscopic skin image vs. a fundus photograph). This creates a highly discrete, clustered data distribution topology:

Natural vs. Medical Image Topology

Because original pretraining data is typically inaccessible due to privacy and scale, and standard uniform data replay fails to capture these distinct clusters, medical VLMs struggle to maintain fine-grained feature memory while adapting to new clinical tasks.

Methods

The authors propose the PRIMED framework, which acts as a dynamic external memory system to guide the model's fine-tuning process in real time. The architecture consists of three core components:

  1. Dynamic Multi-stage Retrieval Mechanism: Using an 18-million multimodal retrieval database built from PubMed papers and a curated 3,000-question medical pool, the system performs dense retrieval (via Qwen3-Embedding-8B), cross-modal reranking (via BiomedCLIP), and lexical filtering (via BM25). A Dynamic Siphon mechanism then partitions these queries into three distinct bags: Task-specific, Domain-related, and General-purpose, ensuring a balanced mix of historical and current context.
  2. Distillation and Alignment: To preserve the model's zero-shot capabilities, the framework applies Contrastive Knowledge Transfer (CKT) and Cross-Modality Consistency (CMC) losses. These ensure that the student model's image-text alignment matches the previous iteration (teacher model) without decoupling cross-modal knowledge.
  3. Dynamic Fisher Weight Guard: Rather than using standard static regularization ($L_2$ or standard EWC), PRIMED computes the Fisher Information Matrix (FIM) dynamically during gradient backpropagation. This allows the model to adaptively protect critical parameters based on real-time distillation and alignment shifts.
PRIMED Framework Overview

Datasets

To rigorously evaluate medical continual learning, the authors introduced the Medical Generalist Task Incremental Learning (MGTIL) benchmark, which is split into two distinct sub-benchmarks:

  • HieraMedTransfer: Curated from 9 datasets (including RANZCR, CheXoNet, Breakhis, Eyepacs, and AIROGS) spanning three primary domains: X-ray, pathology, and fundus images. It evaluates both intra-domain fine-grained feature retention and large-scale inter-domain transfers.
  • MedXtreme: A highly challenging benchmark spanning 6 distinct medical domains (X-ray, fundus, pathology, endoscopy, dermoscopy, and cell) across datasets like AOD, NCT100K, PITVIS, and ISIC2024, featuring limited training data and up to 33 classes per task.

Key Insights and Ideas

  • RAG as a Privacy-Preserving Replay Buffer: Instead of storing actual patient data from previous tasks (which violates clinical privacy and data governance), PRIMED uses open-access scientific literature (PubMed) via RAG to dynamically reconstruct the necessary feature space distribution.
  • The "Review Plan" Concept: By dynamically shifting the retrieval distribution from uniform to real-time multimodal based on ongoing fine-tuning performance, the framework creates a personalized "review plan" for the VLM, focusing recall on the domains most vulnerable to forgetting.
  • Keyword Pitfalls Avoided: Pure lexical matching (like BM25) often creates spurious medical matches (e.g., pairing a pathology image and an endoscopy image simply because both captions contain the word "colon"). Combining dense embedding retrieval with cross-modal reranking ensures domain-context integrity.

Key Results

PRIMED achieved stable State-of-the-Art (SOTA) performance across all evaluated metrics on both benchmarks, outperforming competitive baselines like ZSCL, MoE-CL, and GIFT:

  • HieraMedTransfer: On the randomized task sequence (Order II), PRIMED achieved a +14.4% improvement in the 'Last' metric (final average performance across all tasks) compared to the baseline, and a +4.1% improvement in overall average accuracy.
  • MedXtreme: PRIMED achieved SOTA accuracy and significantly reduced backward transfer degradation, maintaining a stable accuracy curve on early tasks even as new, highly distinct domains were introduced sequentially.
Figure 4. ACC of 1st task (AOD) in MedXtreme Order I and II

Limitations and Future Work

The authors note that a detailed discussion regarding the specific limitations and broader ethical considerations of deploying such dynamically updated foundation models in real-world clinical settings is deferred to the Appendix of the paper.

Summary updated

BibTeX
@inproceedings{chen2026forging,
  author = {Zizhi Chen and Yizhen Gao and Minghao Han and Yizhou Liu and Zhaoyu Chen and Dingkang Yang and Lihua Zhang},
  title = {{Forging a Dynamic Memory: Retrieval-Guided Continual Learning for Generalist Medical Foundation Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=09e184OIYC},
}
Figure