Paper deep dive
MedRLM: Recursive Multimodal Health Intelligence for Long-Context Clinical Reasoning, Sensor-Guided Screening, Evidence-Grounded Decision Support, and Community-to-Tertiary Referral Optimization
Aueaphum Aueawatthanaphisut
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 94%
Last extracted: 6/21/2026, 5:12:23 AM
Summary
MedRLM is a recursive multimodal health intelligence framework designed for long-context clinical reasoning and decision support. Unlike standard LLMs that use single-step prompting, MedRLM treats patient data (EHR, images, sensor streams, clinical notes) as an external environment that is recursively decomposed and inspected by specialized agents. The framework features a Clinical Evidence Graph Memory to link patient observations with medical guidelines and a sensor-guided triggering mechanism that initiates deeper reasoning upon detecting abnormal physiological patterns. It aims to optimize the transition from community-based care to tertiary-level medical services through auditable, risk-aware, and uncertainty-gated decision-making.
Entities (8)
Relation Signals (5)
Clinical Evidence Graph Memory → connects → Patient Observations
confidence 100% · connect patient-specific observations with retrieved evidence, standardized definitions, sensor-derived biomarkers, and referral criteria.
MedRLM → coordinates → Specialized Agents
confidence 100% · The framework coordinates specialized agents for clinical text, longitudinal EHR, medical imaging, physiological sensor signals...
MedRLM → uses → Clinical Evidence Graph Memory
confidence 100% · It further introduces a Clinical Evidence Graph Memory to connect patient-specific observations with retrieved evidence...
Recursive Clinical Controller → manages → Specialized Agents
confidence 90% · The core of MedRLM is a recursive clinical controller that determines whether a clinical task can be answered directly... or should be decomposed into smaller subtasks.
Sensor-Guided Recursive Triggering → activates → Recursive Clinical Controller
confidence 85% · A sensor-guided recursive triggering mechanism activates deeper reasoning when abnormal physiological or behavioral patterns are detected.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Real-world clinical decision support requires reasoning over heterogeneous and longitudinal patient information rather than answering isolated medical questions. However, current medical large language models and retrieval-augmented generation systems often rely on single-step prompting or retrieval, which can be fragile when clinical evidence is distributed across long electronic health records, medical images, sensor streams, guidelines, and referral constraints. This paper proposes MedRLM, a Recursive Multimodal Health Intelligence framework for long-context clinical reasoning, sensor-guided screening, and community-to-tertiary referral support. Instead of compressing all patient information into one prompt, MedRLM treats the patient case as an external clinical environment that can be recursively inspected, decomposed, retrieved, verified, and synthesized. The framework coordinates specialized agents for clinical text, longitudinal EHR, medical imaging, physiological sensor signals, guideline retrieval, uncertainty auditing, and referral planning. It further introduces a Clinical Evidence Graph Memory to connect patient-specific observations with retrieved evidence, standardized definitions, sensor-derived biomarkers, and referral criteria. A sensor-guided recursive triggering mechanism activates deeper reasoning when abnormal physiological or behavioral patterns are detected, while uncertainty-gated refinement supports clinician review for high-risk or low-confidence cases. We also outline a real-data evaluation design using public and credentialed clinical datasets spanning EHR, radiology, ECG, ICU time series, and referral-proxy outcomes. MedRLM aims to move medical AI from static question answering toward auditable, multimodal, and workflow-aware clinical decision support.
Tags
Links
- Source: https://arxiv.org/abs/2606.20164v1
- Canonical: https://arxiv.org/abs/2606.20164v1
Trouble viewing inline? Open PDF directly →
Full Text
45,213 characters extracted from source content.
Expand or collapse full text
MedRLM: Recursive Multimodal Health Intelligence for Long-Context Clinical Reasoning, Sensor-Guided Screening, Evidence-Grounded Decision Support, and Community-to-Tertiary Referral Optimization Aueaphum Aueawatthanaphisut1 Abstract Real-world clinical decision support requires reasoning over heterogeneous and longitudinal patient information rather than answering isolated medical questions. However, current medical large language models and retrieval-augmented generation systems often rely on single-step prompting or retrieval, which can be fragile when clinical evidence is distributed across long electronic health records, medical images, sensor streams, guidelines, and referral constraints. This paper proposes MedRLM, a Recursive Multimodal Health Intelligence framework for long-context clinical reasoning, sensor-guided screening, and community-to-tertiary referral support. Instead of compressing all patient information into one prompt, MedRLM treats the patient case as an external clinical environment that can be recursively inspected, decomposed, retrieved, verified, and synthesized. The framework coordinates specialized agents for clinical text, longitudinal EHR, medical imaging, physiological sensor signals, guideline retrieval, uncertainty auditing, and referral planning. It further introduces a Clinical Evidence Graph Memory to connect patient-specific observations with retrieved evidence, standardized definitions, sensor-derived biomarkers, and referral criteria. A sensor-guided recursive triggering mechanism activates deeper reasoning when abnormal physiological or behavioral patterns are detected, while uncertainty-gated refinement supports clinician review for high-risk or low-confidence cases. We also outline a real-data evaluation design using public and credentialed clinical datasets spanning EHR, radiology, ECG, ICU time series, and referral-proxy outcomes. MedRLM aims to move medical AI from static question answering toward auditable, multimodal, and workflow-aware clinical decision support. I Introduction Artificial intelligence is increasingly being explored as a decision-support layer for healthcare systems, particularly in clinical question answering, medical image interpretation, patient triage, and evidence-based recommendation. Recent medical large language models (LLMs) and biomedical foundation models have demonstrated strong capability in medical knowledge encoding, expert-level medical question answering, and multimodal biomedical reasoning [8, 9, 10, 11]. However, real-world clinical decision support is rarely a single-turn question-answering task. A patient case often contains long and heterogeneous information, including clinical notes, longitudinal electronic health records (EHRs), medical images, wearable or embedded sensor signals, guideline documents, and referral constraints. Compressing these data into a single prompt can lead to context loss, hallucination, weak traceability, and unreliable clinical reasoning. A key limitation of current long-context LLMs is that larger context windows do not necessarily imply reliable use of all relevant evidence. Prior studies show that language models can suffer from long-context degradation, where information hidden in the middle of long inputs is underutilized, and benchmark performance declines as context length and task complexity increase [4, 5]. Recursive Language Models (RLMs) address this issue by treating long prompts as an external environment that can be inspected, decomposed, and processed through recursive model calls [1]. Follow-up studies further suggest that recursion should be structured and uncertainty-aware to avoid inefficient or semantically weak reasoning trajectories [2, 3]. These advances provide a promising foundation for clinical AI, where patient information is naturally distributed across multiple sources and often requires iterative evidence gathering. In parallel, retrieval-augmented generation (RAG) has become a practical approach for grounding LLM outputs in external knowledge [6]. In medicine, RAG is particularly important because clinical recommendations must be factual, traceable, and aligned with up-to-date medical evidence. Medical RAG benchmarks and graph-based medical RAG systems have shown that retrieval can improve medical question answering and reduce unsupported generation [12, 14]. Multimodal medical RAG has also improved factuality in medical vision-language models by integrating external medical references with image understanding [13]. Nevertheless, most existing medical RAG systems remain retrieval-centric: they retrieve evidence for a query but do not fully model the clinical workflow as a recursive process that integrates long patient history, sensor-derived biomarkers, multimodal evidence, uncertainty estimation, and referral decision-making. This paper proposes MedRLM, a Recursive Multimodal Health Intelligence framework for long-context clinical reasoning, sensor-guided screening, and community-to-tertiary referral support. Unlike conventional medical LLM or RAG pipelines, MedRLM treats heterogeneous patient data as an external clinical environment rather than a monolithic prompt. The system recursively decomposes a clinical query into modality-specific subtasks, invokes specialized agents for text, EHR, image, sensor, guideline, and referral reasoning, constructs an auditable Clinical Evidence Graph Memory, and synthesizes a risk-aware referral recommendation. This design is particularly suited for resource-limited healthcare settings, where community hospitals may require early screening support and structured referral guidance before escalating cases to tertiary care. The main contributions of this paper are as follows: • We introduce MedRLM, a recursive multimodal clinical intelligence framework that extends RLM-style long-context inference to healthcare decision support. • We propose a Clinical Evidence Graph Memory that connects patient-specific observations, sensor-derived biomarkers, medical evidence, clinical definitions, and referral criteria into an auditable reasoning structure. • We introduce sensor-guided recursive triggering, where abnormal physiological or behavioral signals initiate deeper reasoning over symptoms, longitudinal records, images, guidelines, and referral rules. • We formulate uncertainty-gated recursive refinement and referral-utility optimization to support safe escalation from community care to specialist or tertiary-care pathways. By combining recursive long-context inference, multimodal clinical reasoning, evidence-grounded retrieval, sensor-based screening, and referral optimization, MedRLM aims to move medical AI beyond static question answering toward auditable, workflow-aware, and deployment-oriented clinical decision support. I Related Work I-A Long-Context Reasoning and Recursive Language Models Long-context reasoning has become a central challenge for LLM-based systems. Although modern LLMs can accept increasingly long inputs, prior work shows that they may fail to robustly use relevant information when it appears in the middle of a long context [4]. LongBench further formalizes long-context evaluation across document question answering, summarization, few-shot learning, synthetic retrieval, and code tasks, showing that long-context understanding remains difficult even for strong models [5]. These findings suggest that simply increasing the context window is insufficient for reliable reasoning over large and heterogeneous clinical data. Recursive Language Models provide an inference-time alternative by externalizing long prompts and allowing the model to programmatically examine, decompose, and recursively process smaller pieces of information [1]. SRLM improves this direction by incorporating uncertainty-aware self-reflective program search, while λ-RLM argues for more structured recursive control using typed functional mechanisms [2, 3]. MedRLM builds on these ideas but shifts the target domain from generic long-context tasks to clinical reasoning. Instead of recursively processing text alone, MedRLM recursively coordinates clinical notes, EHR timelines, medical images, sensor streams, guidelines, and referral rules. I-B Medical Large Language Models and Biomedical Foundation Models Medical LLMs have shown strong potential for clinical knowledge encoding and medical question answering. Med-PaLM demonstrated that LLMs can be aligned toward medical question answering using domain-specific prompting and evaluation [8], while Med-PaLM 2 further improved expert-level medical QA performance through stronger reasoning and grounding strategies [9]. Biomedical vision-language systems such as LLaVA-Med extend instruction-following capabilities to biomedical images [10]. Generalist biomedical AI systems such as Med-PaLM Multimodal further demonstrate the potential of unified models that handle clinical language, imaging, genomics, and other biomedical modalities [11]. Despite this progress, most medical LLMs are still primarily evaluated as answer-generation systems rather than workflow-level clinical reasoning systems. They often lack explicit mechanisms for long patient histories, sensor-triggered reasoning, referral pathway optimization, and auditable evidence synthesis. MedRLM addresses this gap by positioning the LLM as a recursive clinical controller that coordinates specialized agents and external clinical memory rather than acting as a single monolithic answer generator. I-C Retrieval-Augmented Generation and Medical Evidence Grounding RAG combines parametric language models with external non-parametric memory, improving factuality, updateability, and source traceability [6]. ReAct further shows that interleaving reasoning and action can help language models retrieve information, update plans, and interact with external environments [7]. In medical settings, retrieval is essential because clinical decisions require evidence-based grounding rather than plausible but unsupported generation. MEDRAG and MIRAGE provide systematic evaluation of medical RAG systems and demonstrate the importance of selecting appropriate corpora, retrievers, and backbone models for medical QA [12]. Recent medical graph-based RAG methods improve evidence grounding by linking user documents to credible medical sources and definitions [14]. Multimodal medical RAG further addresses factual hallucination in medical vision-language models by using domain-aware retrieval and adaptive retrieved-context selection [13]. However, these systems largely focus on improving answer factuality for medical QA or vision-language tasks. MedRLM extends this line of work by integrating retrieval into a recursive clinical workflow, where retrieved evidence is not only used to answer a question but also to update risk estimation, uncertainty assessment, sensor interpretation, and referral planning. I-D Longitudinal EHR, Multimodal Patient Data, and Referral Support Longitudinal EHR modeling is critical for realistic clinical AI because patient risk often emerges from temporal patterns rather than isolated observations. EHRSHOT highlights the need for benchmarks and foundation models that evaluate few-shot clinical prediction over longitudinal structured EHR data [15]. However, EHR-only modeling does not fully address real-world community screening scenarios, where decisions may depend on symptoms, low-cost sensors, smartphone images, clinical guidelines, and local referral capacity. Existing multimodal biomedical AI systems demonstrate the value of integrating multiple medical data types [10, 11], but few frameworks explicitly connect multimodal reasoning with community-to-tertiary referral decisions. MedRLM fills this gap by combining longitudinal patient representation, sensor-derived digital biomarkers, multimodal evidence retrieval, and referral utility optimization within a single recursive reasoning framework. This makes the proposed framework distinct from prior medical LLM, RAG, and multimodal AI systems: its core objective is not only to answer clinical questions, but to produce auditable, risk-aware, and context-sensitive referral support. I Methodology This section presents MedRLM, a recursive multimodal health intelligence framework for long-context clinical reasoning, sensor-guided screening, and community-to-tertiary referral support. The main methodological principle is that heterogeneous patient data should not be compressed into a single long prompt. Instead, patient records, clinical notes, images, sensor streams, guidelines, and referral protocols are treated as an external clinical environment that can be recursively inspected, decomposed, retrieved, verified, and synthesized. This design is motivated by recursive language modeling, uncertainty-aware recursive search, structured recursive control, retrieval-augmented generation, reasoning–acting agents, medical large language models, multimodal biomedical foundation models, medical graph retrieval, multimodal medical RAG, and longitudinal EHR benchmarks [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]. MedRLM: Recursive Multimodal Health IntelligenceLong-context clinical reasoning → sensor-guided screening → community-to-tertiary referral support1. External clinical environment2. Recursive controller + agents3. Evidence graph memory4. Referral outputPatient data as external memory Clinical text symptoms, notes, chief complaint Longitudinal EHR visits, labs, diagnosis timeline Medical / phone images lesion, radiology, wound, oral scan Sensor streams wearable, embedded, digital biomarkers Guidelines + literature evidence, definitions, protocols Health-system context community resources, referral capacity Recursive Clinical Controller decompose ⋅· retrieve ⋅· call agents ⋅· synthesize f(q,ℰp)⇒f(qj,ℰp,j)j=1kf(q,E_p) \f(q_j,E_p,j)\_j=1^k Specialized modality agents Text entity extraction EHR timeline temporal risk Image VLM abnormality map Sensor encoder biomarker trigger Clinical RAG guideline match Referral agent pathway utility Safety + uncertainty auditor self-consistency, confidence, conflict, harm check Clinical Evidence Graph Memory patient observations ↔ sources ↔ definitions Obs.BiomarkerGuidelineSourceRed flag Si=λssim+λrrel+λccred−λhharmS_i= _ssim+ _rrel+ _ccred- _hharm auditable triples: observation – source – clinical definition Clinician-facing output Risk score calibrated screening probability Evidence explanation traceable cited findings Referral decision observe, follow-up, teleconsult, refer Audit trail retrieved sources + agent steps Human-in-the-loop review high-uncertainty cases CommunityclinicTele-consultTertiarycenteruncertainty-gated recursionself-reflective refinement dp∗=argmaxd∈[B−C−ηD]d_p^*= _d [B-C-η D] Novelty: recursive clinical decomposition + multimodal evidence graph + sensor-triggered reasoning + uncertainty-gated referral optimization Figure 1: Architecture of the proposed MedRLM framework. The system treats heterogeneous patient data as an external clinical environment, recursively decomposes clinical queries into modality-specific subtasks, constructs an auditable evidence graph, and produces risk-aware community-to-tertiary referral recommendations. Figure 2: Embedded MedRLM architecture for RTOS-enabled edge AI and IoT-based clinical support. The proposed implementation pipeline begins with real-time sensing and acquisition from physiological, imaging, environmental, wearable, and clinical-text inputs. These data streams are managed by an embedded controller through RTOS-based task orchestration, including sensing, preprocessing, AI inference, communication, watchdog safety, and local storage tasks. The edge intelligence layer performs signal preprocessing, feature extraction, TinyML inference, multimodal fusion, risk scoring, and local explanation before transmitting structured outputs through secure IoT protocols such as BLE, Wi-Fi, MQTT, HTTP/REST, and TLS. The clinical application layer converts device-level intelligence into risk scores, triage alerts, evidence summaries, audit trails, teleconsultation support, and community-to-tertiary referral recommendations. Fig. 2 illustrates the engineering-level deployment architecture of MedRLM, where heterogeneous physiological and contextual data are acquired by embedded sensors, scheduled through an RTOS layer, processed by on-device TinyML inference, transmitted through secure IoT interfaces, and converted into auditable clinical decision and referral-support outputs. I-A Clinical Environment Formulation For each patient case p, MedRLM constructs an external clinical environment rather than a single input sequence. The environment is defined as ℰp= _p=\ Xptext,Xpehr,Xpimg,Xpsens, X^text_p,X^ehr_p,X^img_p,X^sens_p, (1) ,ℛ,ℋ, ,R,H\, where XptextX^text_p denotes free-text symptoms, clinical notes, and patient narratives; XpehrX^ehr_p denotes longitudinal structured electronic health record events; XpimgX^img_p denotes medical or smartphone-acquired images; XpsensX^sens_p denotes wearable or embedded sensor streams; G denotes clinical guideline knowledge; ℛR denotes referral rules; and ℋH denotes local healthcare-system constraints, such as community-hospital capability, specialist availability, and tertiary-care accessibility. Given a clinical query q, the objective of MedRLM is to produce a clinically useful output Yp=(y^p,rp,dp,p,Up),Y_p=( y_p,r_p,d_p,A_p,U_p), (2) where y^p y_p is the predicted clinical interpretation, rpr_p is the estimated risk score, dpd_p is the recommended referral or care-pathway decision, pA_p is the evidence audit trail, and UpU_p is the uncertainty and safety score. The system is designed as a clinician-support tool, not as an autonomous diagnostic authority. I-B Recursive Multimodal Clinical Controller The core of MedRLM is a recursive clinical controller that determines whether a clinical task can be answered directly from retrieved evidence or should be decomposed into smaller subtasks. Let κ(q,ℰp)κ(q,E_p) be a context-complexity function that measures the length, heterogeneity, evidence dispersion, and clinical risk level of the case. The recursive controller is defined as Φ(q,ℰp)=M(q,ρ(q,ℰp)),κ(q,ℰp)≤K,Ω(Φ(qj,ℰp,j)j=1k),κ(q,ℰp)>K, (q,E_p)= (3) where M is the base medical language or vision-language model, ρ(⋅)ρ(·) is the evidence retrieval function, K is the maximum safe context threshold, qjq_j is a decomposed clinical subquery, ℰp,jE_p,j is the corresponding sub-environment, k is the number of recursive branches, and Ω(⋅) (·) is the synthesis operator. This recursion allows MedRLM to process long patient histories and distributed clinical evidence without relying on lossy one-shot summarization. The complexity score is computed as κ(q,ℰp)= κ(q,E_p)= γ1L(q,ℰp)+γ2V(ℰp)+γ3D(ℰp) _1L(q,E_p)+ _2V(E_p)+ _3D(E_p) (4) +γ4Rrisk(p)+γ5Cconflict(ℰp), + _4R_risk(p)+ _5C_conflict(E_p), where L(⋅)L(·) measures context length, V(⋅)V(·) measures modality diversity, D(⋅)D(·) measures evidence dispersion across the environment, Rrisk(p)R_risk(p) represents preliminary clinical risk, and Cconflict(⋅)C_conflict(·) measures contradiction among available evidence. I-C Recursive Clinical Task Decomposition A complex clinical query is decomposed into modality-aware and decision-aware subtasks: p=Dec(q,ℰp)= _p=Dec(q,E_p)=\ qtext,qehr,qimg,qsens, q^text,q^ehr,q^img,q^sens, (5) qguide,qref,qsafety. q^guide,q^ref,q^safety\. For example, a referral query is decomposed into symptom extraction, longitudinal risk-history analysis, image abnormality interpretation, sensor-biomarker estimation, guideline matching, red-flag verification, and referral feasibility analysis. This design directly addresses long-context degradation, where relevant evidence may be hidden in the middle of long inputs or distributed across several data sources [4, 5]. Each modality-specific subtask is handled by a specialized clinical agent: zpm=Fm(Xpm,qm,ρ(qm,ℰp)), z_p^m=F_m (X_p^m,q^m,ρ(q^m,E_p) ), (6) m∈text,ehr,img,sens,guide. m∈\text,ehr,img,sens,guide\. Here, the text agent extracts symptoms and clinical entities, the EHR agent models longitudinal coded events, the image agent interprets medical or smartphone-acquired images, the sensor agent computes digital biomarkers, and the guideline agent retrieves and verifies evidence-based recommendations. I-D Clinical Evidence Graph Memory To ensure traceability and reduce unsupported generation, MedRLM builds a Clinical Evidence Graph Memory ℳp=(p,ℰpg),M_p=(V_p,E^g_p), (7) where nodes vi∈pv_i _p represent patient observations, clinical entities, abnormal image findings, sensor biomarkers, guideline statements, or referral criteria. Edges eij∈ℰpge_ij ^g_p represent temporal, semantic, causal, or guideline-based relationships. Each evidence node is represented as a clinical triple τi=(oi,si,δi), _i=(o_i,s_i, _i), (8) where oio_i is the patient-specific observation, sis_i is the supporting source or guideline statement, and δi _i is the standardized clinical definition. The evidence relevance score is S(ei|q,p)= S(e_i|q,p)= λ1sim(hq,hei)+λ2rel(ei,p) _1\,sim(h_q,h_e_i)+ _2\,rel(e_i,p) (9) +λ3cred(ei)−λ4age(ei) + _3\,cred(e_i)- _4\,age(e_i) −λ5conflict(ei), - _5\,conflict(e_i), where sim(⋅)sim(·) measures semantic similarity, rel(⋅)rel(·) measures patient-specific relevance, cred(⋅)cred(·) measures source credibility, age(⋅)age(·) penalizes outdated evidence, and conflict(⋅)conflict(·) penalizes contradiction. The retrieved evidence representation is obtained using normalized evidence weights: αi=exp(S(ei|q,p))∑j=1Nexp(S(ej|q,p)), _i= (S(e_i|q,p)) _j=1^N (S(e_j|q,p)), (10) zprag=∑i=1Nαihei.z^rag_p= _i=1^N _ih_e_i. (11) This graph memory extends medical RAG by linking patient-specific multimodal evidence with guideline statements and referral rules, rather than retrieving isolated passages only [6, 12, 13, 14]. I-E Sensor-Guided Recursive Screening A key novelty of MedRLM is sensor-guided recursive triggering. Given a physiological or behavioral sensor stream Xpsens=x1,x2,…,xT,X^sens_p=\x_1,x_2,…,x_T\, (12) a temporal encoder extracts window-level digital biomarkers: bt=Gθ(xt−w:t),b_t=G_θ (x_t-w:t ), (13) where w is the temporal window and btb_t is the biomarker embedding at time t. Patient-specific abnormality is measured using a baseline-adjusted distance: at=(bt−μp)TΣp−1(bt−μp),a_t=(b_t- _p)^T _p^-1(b_t- _p), (14) where μp _p and Σp _p denote the baseline distribution of patient p. If ata_t exceeds a predefined threshold, the sensor signal activates deeper recursive reasoning: qtsens=Trigger(at,,ℛ),ifat>ϵ. q^sens_t=Trigger(a_t,G,R), a_t>ε. (15) Thus, an abnormal sensor pattern is not treated as a standalone classification result. It becomes a reasoning trigger that asks MedRLM to re-check symptoms, longitudinal history, image findings, guideline criteria, and referral rules. I-F Multimodal Risk Estimation After recursive processing, MedRLM obtains modality-level representations and forms a fused patient state: Zp=[ Z_p=[ zptext‖zpehr‖zpimg z^text_p\|z^ehr_p\|z^img_p (16) ∥zpsens∥zprag], \|z^sens_p\|z^rag_p], where ∥\| denotes concatenation. The risk score is estimated as rp=σ(WrZp+br),r_p=σ(W_rZ_p+b_r), (17) where σ(⋅)σ(·) is the sigmoid function. For multi-class screening, the probability of class c is P(y=c|p)=exp(WcZp+bc)∑c′=1Cexp(Wc′Zp+bc′).P(y=c|p)= (W_cZ_p+b_c) _c =1^C (W_c Z_p+b_c ). (18) The final clinical interpretation is selected as y^p=argmaxcP(y=c|p). y_p= _cP(y=c|p). (19) I-G Uncertainty-Gated Recursive Refinement MedRLM uses uncertainty to decide whether to answer, retrieve more evidence, recursively refine the reasoning path, or route the case to human review. The uncertainty score is defined as Up= U_p= β1(1−maxcP(y=c|p)) _1 (1- _cP(y=c|p) ) (20) +β2Var(rp(l)l=1L) + _2\,Var (\r_p^(l)\_l=1^L ) +β3(1−c¯p)+β4Γp, + _3(1- c_p)+ _4 _p, where the first term captures predictive uncertainty, the second term captures self-consistency variance across L recursive trajectories, c¯p c_p is the average verbalized confidence, and Γp _p is the evidence-conflict score. If UpU_p exceeds a safety threshold δ, MedRLM performs recursive refinement: (q′,ℰp′)=Refine(q,ℰp,p,Up),(q ,E _p)=Refine(q,E_p,A_p,U_p), (21) or routes the case to clinician review. This mechanism follows the insight that recursion alone is not sufficient for difficult semantic reasoning, and should be guided by uncertainty and self-reflection [2, 3]. I-H Community-to-Tertiary Referral Optimization The referral module models the care pathway as a constrained decision problem. The decision space is =d1,d2,d3,d4,D=\d_1,d_2,d_3,d_4\, (22) where d1d_1 denotes self-care education, d2d_2 denotes follow-up at primary care, d3d_3 denotes specialist teleconsultation, and d4d_4 denotes tertiary-care referral. The optimal referral decision is selected by maximizing expected clinical utility: dp∗=argmaxd∈[ d_p^*= _d [ B(d,rp,Up,ℱp) B(d,r_p,U_p,F_p) (23) −C(d,ℋ)−ηD(d,rp)], -C(d,H)-η D(d,r_p) ], where B(⋅)B(·) is the expected clinical benefit, C(⋅)C(·) is the resource or system burden, ℱpF_p denotes red-flag findings, and D(⋅)D(·) penalizes delayed referral under high-risk conditions. This makes the framework suitable for community-to-tertiary referral support because it explicitly considers both patient risk and real-world healthcare constraints. I-I Training Objective MedRLM can be optimized using supervised labels, weak evidence labels, retrieval relevance annotations, and clinician-preference feedback. The total objective is ℒ= = ℒcls+λrefℒref+λragℒrag _cls+ _refL_ref+ _ragL_rag (24) +λalignℒalign+λuncℒunc+λsafetyℒsafety. + _alignL_align+ _uncL_unc+ _safetyL_safety. The classification and referral losses are ℒcls=−∑c=1CyclogP(y=c|p),L_cls=- _c=1^Cy_c P(y=c|p), (25) ℒref=−∑d∈ydreflogP(d|p).L_ref=- _d y_d^ref P(d|p). (26) The retrieval ranking loss is ℒrag=−logexp(S(e+|q,p))exp(S(e+|q,p))+∑e−exp(S(e−|q,p)), _rag=- (S(e^+|q,p)) (S(e^+|q,p))+ _e^- (S(e^-|q,p)), (27) where e+e^+ denotes clinically relevant evidence and e−e^- denotes irrelevant or weakly supported evidence. The modality-alignment loss is formulated as ℒalign=−logexp(sim(zpm,zpn)/τ)∑jexp(sim(zpm,zjn)/τ), _align=- (sim(z_p^m,z_p^n)/τ) _j (sim(z_p^m,z_j^n)/τ), (28) where zpmz_p^m and zpnz_p^n are paired representations from two modalities, and τ is a temperature parameter. The safety loss penalizes recommendations that are unsupported by evidence or inconsistent with referral rules: ℒsafety=[dp∉ℛ(q,p)]+ξ[p=∅].L_safety=I[d_p (q,p)]+ξ\,I[A_p= ]. (29) I-J Inference Algorithm Algorithm 1 summarizes the recursive inference process. The algorithm begins by initializing the external clinical environment, decomposes the input query into modality-specific subtasks, retrieves evidence, invokes specialized agents, recursively refines uncertain branches, builds a graph memory, estimates risk, and selects a referral decision using utility optimization. Algorithm 1 MedRLM Recursive Clinical Inference 1:Clinical query q, patient environment ℰpE_p, context threshold K, safety threshold δ 2:Prediction y^p y_p, risk rpr_p, referral decision dpd_p, audit trail pA_p 3:Initialize external clinical environment ℰpE_p 4:Decompose q into subtasks pQ_p 5:for each subquery qj∈pq_j _p do 6: Retrieve evidence ρ(qj,ℰp)ρ(q_j,E_p) 7: if κ(qj,ℰp)>Kκ(q_j,E_p)>K then 8: Split qjq_j into smaller clinical subtasks 9: Invoke MedRLM recursively on each subtask 10: else 11: Invoke the corresponding modality agent FmF_m 12: end if 13:end for 14:Construct Clinical Evidence Graph Memory ℳpM_p 15:Estimate risk score rpr_p and evidence weights αi _i 16:Compute uncertainty UpU_p 17:if Up>δU_p>δ then 18: Perform recursive refinement or route to clinician review 19:end if 20:Select dp∗d_p^* using Eq. (23) 21:return (y^p,rp,dp∗,p,Up)( y_p,r_p,d_p^*,A_p,U_p) I-K Methodological Novelty The methodological novelty of MedRLM is fourfold. First, it extends recursive language modeling from generic long-context reasoning to clinically grounded multimodal decision support. Second, it introduces a Clinical Evidence Graph Memory that links patient-specific observations, standardized clinical definitions, retrieved medical evidence, and referral criteria. Third, it proposes sensor-guided recursive triggering, where abnormal physiological or behavioral signals initiate deeper reasoning over symptoms, patient history, image findings, and guidelines. Fourth, it combines uncertainty-gated recursion with referral-utility optimization, allowing the system to decide when to answer, when to retrieve more evidence, when to defer to clinicians, and when to escalate from community care to tertiary care. Unlike conventional medical LLM, medical RAG, or multimodal AI systems, MedRLM treats the patient case as a structured external environment and treats reasoning as a recursive clinical workflow. Therefore, the framework is scalable to long patient histories, robust to distributed evidence, compatible with multimodal health data, and auditable for safety-critical screening and referral support. IV Experiments and Results IV-A Real Non-Synthetic Dataset Coverage Can MedRLM be evaluated on real clinical data without relying on synthetic patient cases? To answer this question, we selected datasets that are either public or available through credentialed research access, and that collectively cover the core inputs required by MedRLM: long-context EHR, radiology images and reports, physiologic time series, ECG waveforms, multi-center ICU records, and referral-relevant risk outcomes. Table I summarizes the real datasets used for the benchmark design. All sample sizes are taken from official dataset documentation or the corresponding dataset papers; no synthetic records are introduced. TABLE I: These datasets provide a non-synthetic evaluation basis for MedRLM across long-context EHR reasoning, image-report grounding, sensor-guided screening, and referral-relevant triage. Dataset Source Real scale used in Modality Role in MedRLM evaluation MIMIC-IV v3.1 Beth Israel Deaconess Medical Center, PhysioNet 364,627 individuals, 546,028 hospitalizations, and 94,458 ICU stays reported in the dataset documentation EHR, ICU, emergency care Long-context patient-history reasoning, diagnosis/procedure/lab retrieval, and risk-aware triage [16, 17]. MIMIC-CXR-JPG v2.1.0 Beth Israel Deaconess Medical Center, PhysioNet 377,110 chest radiographs associated with 227,827 imaging studies Chest X-ray, radiology reports Multimodal evidence grounding between image findings, reports, and patient context [18, 19]. CheXpert Stanford Hospital 224,316 chest radiographs from 65,240 patients with uncertainty-aware labels Chest X-ray, reports External radiology benchmark for uncertainty labels and abnormality detection [20]. eICU-CRD v2.0 Philips eICU program, PhysioNet Over 200,000 ICU admissions from over 139,000 unique patients across 335 units and 208 US hospitals Multi-center ICU EHR External validation for ICU risk, tele-ICU workflow, and referral-proxy decisions [21, 22]. PTB-XL v1.0.3 Physikalisch-Technische Bundesanstalt, PhysioNet 21,799 clinical 12-lead ECGs from 18,869 patients with cardiologist annotations ECG waveform Sensor-guided recursive screening and abnormal cardiac-signal triggering [23, 24]. PhysioNet/CinC Challenge 2012 PhysioNet/Computing in Cardiology 12,000 adult ICU stays; set A provides 4,000 labeled training records with up to 42 variables in the first 48 hours ICU vital-sign time series Mortality-risk prediction, calibration, and clinically meaningful risk stratification [25, 26]. The result is positive: the selected benchmark covers every major evidence channel required by MedRLM. MIMIC-IV and eICU-CRD support long-context clinical history and external ICU validation; MIMIC-CXR-JPG and CheXpert support image-report grounding; PTB-XL and the PhysioNet/CinC 2012 challenge support physiologic signal and time-series screening. The main remaining limitation is that direct community-to-tertiary referral labels are uncommon in public datasets. Therefore, referral experiments should use clinically defensible proxy outcomes such as ICU admission, in-hospital mortality, acute deterioration, readmission, specialist escalation, or tele-ICU intervention until a referral-labeled regional dataset is available. record scale10410^410510^510610^6MIMIC-IV546k hospitalizationsMIMIC-CXR377k radiographsCheXpert224k radiographseICU>>200k admissionsPTB-XL21.8k ECGsCinC 201212k ICU stays Bar length is proportional to log10(N)−3.9 _10(N)-3.9; labels show the real dataset scale. Figure 3: The chart visualizes the practical evaluation breadth available without synthetic cases. IV-B Benchmark Tasks and Metrics Table I maps the real datasets to measurable evaluation tasks. The design intentionally separates three claims: (i) dataset availability and coverage, which is reported in this section; (i) published benchmark anchors, which are cited from the original benchmark pages; and (i) future MedRLM performance, which should only be reported after a full run of Algorithm 1 on the protected datasets. TABLE I: benchmark tasks, labels, and metrics grounded in real datasets. Evaluation task Dataset(s) Target label or output Primary metric(s) Clinical interpretation Long-context EHR risk reasoning MIMIC-IV, eICU-CRD Mortality, ICU admission, readmission, length of stay, diagnosis/procedure events AUROC, AUPRC, calibration error, decision-curve net benefit Tests whether recursive retrieval improves risk estimation over compressed one-shot summaries. Image-report grounding MIMIC-CXR-JPG, CheXpert Radiology abnormality labels, uncertain findings, image-report consistency Mean AUROC, macro-F1, unsupported-claim rate, evidence precision Tests whether the evidence graph links image findings to report statements and clinical context. Sensor-guided screening PTB-XL, PhysioNet/CinC 2012 ECG diagnostic statements, abnormal vital-sign trajectories, in-hospital death Macro-F1, AUROC, sensitivity at fixed specificity, under-triage rate Tests whether abnormal signals trigger deeper recursive reasoning rather than isolated classification. Referral-proxy decision support MIMIC-IV, eICU-CRD, PhysioNet/CinC 2012 ICU escalation, mortality risk, deterioration proxy, tele-ICU intervention proxy Referral utility, over-referral rate, under-referral rate, calibration within risk deciles Evaluates whether referral recommendations balance patient safety and resource burden. Auditable evidence synthesis Linked MIMIC-IV/MIMIC-CXR and retrieved medical evidence Evidence triples, source attribution, conflict flags, final recommendation rationale Evidence recall, citation precision, conflict-detection rate, clinician review rate Tests whether MedRLM produces traceable reasoning instead of unsupported free-text answers. IV-C Published Benchmark Anchors Because the complete MedRLM pipeline has not yet been executed on the credentialed datasets, Table I reports published real-data anchors rather than invented MedRLM accuracy. These values define minimum comparison points for future experiments. On the PhysioNet/CinC 2012 mortality benchmark, the official challenge page reports that the best Event 1 score on the hidden validation set C was 0.5353, SAPS-I scored 0.3125, and a random predictor scored 0.1386. For calibrated risk estimation in Event 2, lower is better: the best published score was 17.88, SAPS-I scored 68.58, and a random predictor scored 10137.7 [25]. These anchors are important because they make the results section falsifiable: a future MedRLM implementation should be compared against established real-data baselines, not against synthetic case studies. TABLE I: Published real-data anchors from PhysioNet/CinC Challenge 2012. These are not claimed as MedRLM results; they are comparison points for future MedRLM experiments. Benchmark anchor Event 1 score Event 2 score Best published participant 0.5353 17.88 SAPS-I reference model 0.3125 68.58 Random predictor 0.1386 10137.7 References [1] A. L. Zhang, T. Kraska, and O. Khattab, “Recursive Language Models,” arXiv preprint arXiv:2512.24601, 2026. [Online]. Available: https://arxiv.org/abs/2512.24601 [2] K. Alizadeh, P. Shojaee, M. Cho, and M. Farajtabar, “Recursive Language Models Meet Uncertainty: The Surprising Effectiveness of Self-Reflective Program Search for Long Context,” arXiv preprint arXiv:2603.15653, 2026. [Online]. Available: https://arxiv.org/abs/2603.15653 [3] A. Roy, R. Tutunov, X. Ji, M. Zimmer, and H. Bou-Ammar, “The Y-Combinator for LLMs: Solving Long-Context Rot with λ-Calculus,” arXiv preprint arXiv:2603.20105, 2026. [Online]. Available: https://arxiv.org/abs/2603.20105 [4] N. F. Liu, K. Lin, J. Hewitt, A. Paranjape, M. Bevilacqua, F. Petroni, and P. Liang, “Lost in the Middle: How Language Models Use Long Contexts,” Transactions of the Association for Computational Linguistics, vol. 12, p. 157–173, 2024. [Online]. Available: https://arxiv.org/abs/2307.03172 [5] Y. Bai, X. Lv, J. Zhang, H. Lyu, J. Tang, Z. Huang, Z. Du, X. Liu, A. Zeng, L. Hou, Y. Dong, J. Tang, and J. Li, “LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding,” arXiv preprint arXiv:2308.14508, 2023. [Online]. Available: https://arxiv.org/abs/2308.14508 [6] P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Kuttler, M. Lewis, W. Yih, T. Rocktaschel, S. Riedel, and D. Kiela, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks,” Advances in Neural Information Processing Systems, vol. 33, p. 9459–9474, 2020. [Online]. Available: https://arxiv.org/abs/2005.11401 [7] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao, “ReAct: Synergizing Reasoning and Acting in Language Models,” in Proc. International Conference on Learning Representations, 2023. [Online]. Available: https://arxiv.org/abs/2210.03629 [8] K. Singhal et al., “Large Language Models Encode Clinical Knowledge,” Nature, vol. 620, p. 172–180, 2023. [Online]. Available: https://doi.org/10.1038/s41586-023-06291-2 [9] K. Singhal et al., “Toward Expert-Level Medical Question Answering with Large Language Models,” Nature Medicine, vol. 31, p. 943–950, 2025. [Online]. Available: https://doi.org/10.1038/s41591-024-03423-7 [10] C. Li et al., “LLaVA-Med: Training a Large Language-and-Vision Assistant for Biomedicine in One Day,” arXiv preprint arXiv:2306.00890, 2023. [Online]. Available: https://arxiv.org/abs/2306.00890 [11] T. Tu et al., “Towards Generalist Biomedical AI,” arXiv preprint arXiv:2307.14334, 2023. [Online]. Available: https://arxiv.org/abs/2307.14334 [12] G. Xiong, Q. Jin, Z. Lu, and A. Zhang, “Benchmarking Retrieval-Augmented Generation for Medicine,” arXiv preprint arXiv:2402.13178, 2024. [Online]. Available: https://arxiv.org/abs/2402.13178 [13] P. Xia et al., “MMed-RAG: Versatile Multimodal RAG System for Medical Vision Language Models,” in Proc. International Conference on Learning Representations, 2025. [Online]. Available: https://arxiv.org/abs/2410.13085 [14] J. Wu, J. Zhu, Y. Qi, J. Chen, M. Xu, F. Menolascina, and V. Grau, “Medical Graph RAG: Towards Safe Medical Large Language Model via Graph Retrieval-Augmented Generation,” arXiv preprint arXiv:2408.04187, 2024. [Online]. Available: https://arxiv.org/abs/2408.04187 [15] M. Wornow, R. Thapa, E. Steinberg, J. A. Fries, and N. H. Shah, “EHRSHOT: An EHR Benchmark for Few-Shot Evaluation of Foundation Models,” arXiv preprint arXiv:2307.02028, 2023. [Online]. Available: https://arxiv.org/abs/2307.02028 [16] A. Johnson, L. Bulgarelli, T. Pollard, B. Gow, B. Moody, S. Horng, L. A. Celi, and R. Mark, “MIMIC-IV,” PhysioNet, version 3.1, 2024, doi: 10.13026/kpb9-mt58. [17] A. E. W. Johnson, L. Bulgarelli, L. Shen, A. Gayles, A. Shammout, S. Horng, T. J. Pollard, S. Hao, B. Moody, B. Gow, L. H. Lehman, L. A. Celi, and R. G. Mark, “MIMIC-IV, a freely accessible electronic health record dataset,” Scientific Data, vol. 10, no. 1, 2023, doi: 10.1038/s41597-022-01899-x. [18] A. Johnson, M. Lungren, Y. Peng, Z. Lu, R. Mark, S. Berkowitz, and S. Horng, “MIMIC-CXR-JPG - chest radiographs with structured labels,” PhysioNet, version 2.1.0, 2024, doi: 10.13026/jsn5-t979. [19] A. E. W. Johnson, T. J. Pollard, S. J. Berkowitz, N. R. Greenbaum, M. P. Lungren, C.-Y. Deng, R. G. Mark, and S. Horng, “MIMIC-CXR: A large publicly available database of labeled chest radiographs,” arXiv preprint arXiv:1901.07042, 2019. [20] J. Irvin et al., “CheXpert: A large chest radiograph dataset with uncertainty labels and expert comparison,” arXiv preprint arXiv:1901.07031, 2019. [21] T. Pollard, A. Johnson, J. Raffa, L. A. Celi, O. Badawi, and R. Mark, “eICU Collaborative Research Database,” PhysioNet, version 2.0, 2019, doi: 10.13026/C2WM1R. [22] T. J. Pollard, A. E. W. Johnson, J. D. Raffa, L. A. Celi, R. G. Mark, and O. Badawi, “The eICU Collaborative Research Database, a freely available multi-center database for critical care research,” Scientific Data, vol. 5, 180178, 2018, doi: 10.1038/sdata.2018.178. [23] P. Wagner, N. Strodthoff, R.-D. Bousseljot, W. Samek, and T. Schaeffter, “PTB-XL, a large publicly available electrocardiography dataset,” PhysioNet, version 1.0.3, 2022, doi: 10.13026/kfzx-aw45. [24] P. Wagner, N. Strodthoff, R.-D. Bousseljot, D. Kreiseler, F. I. Lunze, W. Samek, and T. Schaeffter, “PTB-XL, a large publicly available electrocardiography dataset,” Scientific Data, vol. 7, 154, 2020, doi: 10.1038/s41597-020-0495-6. [25] I. Silva, G. Moody, D. J. Scott, L. A. Celi, and R. G. Mark, “Predicting in-hospital mortality of patients in ICU: The PhysioNet/Computing in Cardiology Challenge 2012,” Computing in Cardiology, vol. 39, p. 245–248, 2012. [Online]. Available: https://physionet.org/content/challenge-2012/1.0.0/ [26] A. L. Goldberger et al., “PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals,” Circulation, vol. 101, no. 23, p. e215–e220, 2000, doi: 10.1161/01.CIR.101.23.e215.