TL;DR
Reinforcement learning (RL) controllers can manage Type 1 diabetes remarkably well in simulation, yet they operate as opaque black boxes in a domain where a single miscalculated dose can be dangerous. This paper introduces XRL4T1D, an evaluation framework that opens up pretrained RL insulin-dosing policies without retraining them, revealing which historical glucose and insulin signals drive each decision—and rigorously testing whether those post-hoc explanations actually hold water.
What Problem Does This Paper Address?
Managing Type 1 diabetes requires an endless, delicate balancing act of exogenous insulin delivery. Automated RL controllers promise to take the burden off patients, and researchers routinely benchmark them using aggregate clinical metrics like "Time in Range" (the percentage of the day blood sugar stays between 70 and 180 mg/dL).
Here is the catch: two RL policies can achieve the exact same Time in Range while relying on completely different physiological cues under the hood. In safety-critical healthcare AI, knowing that a controller works isn't enough; clinicians and engineers need to know how it uses recent history to pick a dose. Furthermore, simply slapping a standard explainability tool onto time-series data can produce plausible-looking charts that don't reflect actual model sensitivity—especially when adjacent 5-minute sensor readings are heavily correlated.
Methods
The authors examine two pretrained RL controllers—standard PPO and a planning-augmented variant called G2P2C—that take 60 minutes of continuous glucose monitor (CGM) readings and administered insulin (12 five-minute steps each, totaling 24 inputs) to output the next insulin dose.
While using KernelSHAP to compute feature importance is standard, the novelty of XRL4T1D lies in its domain-tailored aggregation and strict validation pipeline:
- Channel & Temporal Summarization (A-IOB): First, the framework splits total attribution between CGM history and insulin history. Next, inspired by the clinical concept of insulin-on-board (how much prior insulin is still active in the body to prevent dangerous "insulin stacking"), it groups the 12 insulin lags into three 20-minute windows: recent (0–20 min), middle (20–40 min), and older (40–60 min).
- Sensitivity & Explainer Validation: Rather than trusting SHAP blindly, the authors actively intervene. They swap out top-ranked, bottom-ranked, and random features (as well as entire 20-minute windows) with background averages to verify if the policy's output actually shifts as predicted. They also cross-check KernelSHAP against TimeSHAP, a sequential explainer, and test explanation stability under simulated sensor noise and missing data.
Datasets
Instead of static clinical datasets, evaluation takes place in closed-loop in-silico trials using the FDA-accepted UVA/Padova Type 1 Diabetes simulator (via Simglucose). The authors evaluate pretrained policies across 20 virtual patients (10 adolescents, 10 adults) over 24-hour simulations (288 decision steps each), testing one stochastic baseline meal protocol alongside two fixed meal disturbance protocols.
Key Insights and Ideas
- Both controllers are massively glucose-dominated: Despite having full access to recent insulin delivery, both RL policies base their decisions overwhelmingly on CGM history—especially G2P2C, which assigns 98.9% of its total SHAP importance to glucose (versus 92.2% for PPO).
- Normalization creates an optical illusion for minor channels: Because G2P2C places only 1.1% of its total weight on insulin history, normalizing that tiny sliver into recent/middle/older percentages makes small numerical fluctuations look like dramatic shifts across explainers or hyperparameter settings. You cannot interpret temporal insulin profiles without looking at overall channel share first.
- Three distinct bars for explainability: Showing that an explanation tracks model sensitivity (do top features move the output?) does not guarantee that fine-grained comparisons between two controllers will hold steady across different patient cohorts or explainer algorithms.
Key Results
XRL4T1D demonstrates strong validation fidelity while exposing subtle fragilities in finer controller comparisons:
- Feature-level fidelity: Across all 80/80 tested cases, masking the top-$m$ SHAP-ranked inputs alters the normalized insulin dose far more (mean change
0.01090) than masking random (0.00391) or bottom-$m$ (0.000086) inputs. - Temporal window fidelity: The highest-attributed 20-minute insulin window matches the most output-sensitive window under direct replacement in 115/120 configurations (mean Spearman $\rho = 0.913$), and agrees with TimeSHAP's top window in 111/120 cases.
- Subtle controller nuances: While PPO and G2P2C achieve similar median Time in Range (e.g., 58.85% vs. 58.16% in adolescents; 64.76% vs. 67.53% in adults), their pooled KernelSHAP recent-insulin shares are nearly indistinguishable (55.7% vs. 54.1%). Yet switching to TimeSHAP bumps G2P2C's recent-window share to 64.2% while leaving PPO at 56.2%.
- Sensor corruption stability: Global 24-feature attribution rankings remain highly stable when explanations are computed on counterfactual histories corrupted with 10 mg/dL Gaussian noise or 10% missing values.
Limitations and Future Work
The study is confined to 20 virtual patients and two pretrained RL architectures inside a simulator that omits real-world curveballs like exercise, illness, and infusion-site failures. Technically, replacing masked features with empirical background means can create physiologically implausible combinations of correlated time-series readings, making this an intervention-specific check rather than true causal validation. Furthermore, the authors emphasize that Attribution-based Insulin-on-Board (A-IOB) reflects policy attention, not actual pharmacokinetic residual insulin. Future work points toward replacement strategies that preserve realistic temporal dependencies, alongside prospective clinical and clinician-centered evaluations.
Summary updated