A predictive safety shield is a runtime guard that forecasts where a system is heading and blocks actions that the forecast says will cross a danger line. An insulin controller is the standard example: the shield forecasts blood glucose and vetoes a dose that would push the patient into hypoglycemia. Current shields run an ensemble of forecasting models and simply average them. That is a poor choice when a patient's physiology differs from the training patients. Some models go stale, others become overconfident, and averaging hides both problems. This proposal makes the shield's ensemble weights move over time.
Two things drive the weights. The first is a prior over models set by domain experts, which can be biased. The second is how well each model recently predicted the patient's safety margin, meaning the distance to the danger line, with missed hazards penalized more than false alarms. Both inputs are available because in trajectory forecasting the true outcome is not missing. It arrives late: the glucose value a model predicted 60 minutes ago is observed now. Because of this delay, a well-understood online-learning rule gives the blend of expert prior and data a principled form, and in the risk-assessment literature that blend has been heuristic. The question is whether this beats both the unweighted ensemble and the label-free, confidence-weighted ensembles currently proposed for distribution shift.
Core Claim
In a predictive safety shield under patient shift, ensemble members should be weighted by their delayed, hazard-asymmetric error on the safety margin. The weighting should start from an expert prior whose influence provably decays. Three properties should follow. It should reduce hazardous excursions on unseen patients compared with a uniform ensemble at the same false-alarm rate. It should stay safe when the expert prior is deliberately wrong. And it should outperform weighting by model confidence or entropy, which we expect to fail precisely at sudden shifts.
The closest existing system is BA-NODE in Safety Generalization Under Distribution Shift in Safe Reinforcement Learning: A Diabetes Testbed. It shields safe-RL insulin policies with an ensemble of neural ODEs (differential-equation models with learned dynamics) conditioned by a transformer. It uses standard unweighted ensemble outputs and fixed clinical thresholds. Quantitative Predictive Monitoring and Control for Safe Human-Machine Interaction computes continuous best/worst-case robustness intervals from a single Bayesian RNN rather than a weighted ensemble. Both papers motivate this work: they show that continuous, forward-looking margins beat reactive thresholds, but neither adapts which model it trusts. The multi-agent CVaR controller of Risk-aware Safe Control for Decentralized Multi-agent Systems via Dynamic Responsibility Allocation also sets weights from risk, but its weights split control effort between agents, not trust among predictive models.
Research Program
The margin and the loss. For glucose $y$ with clinical range $[70, 180]$ mg/dL, the safety margin is $m(y) = \min(y-70,\ 180-y)$. The margin is negative when the patient is out of range. Let $\hat m_{t,h,k}$ be model $k$'s predicted margin for time $t$ at forecast horizon $h$, and let $m_t$ be the margin actually observed. Each model is scored by
$$\ell_{t,h,k} = \kappa\,\max(0,\ \hat m_{t,h,k} - m_t) + \max(0,\ m_t - \hat m_{t,h,k}),$$
The asymmetry $\kappa > 1$ says how much worse an optimistic margin (a missed hazard) is than a pessimistic one (a false alarm). $\kappa$ is itself a subjective criterion weight of the kind Direction 2 studies. We will elicit it separately for hypoglycemia and hyperglycemia rather than fold it into a single threshold.
The weights. Separately for each horizon $h$, the weights follow exponential weighting from an expert prior $\pi_k$:
$$w_{t,h,k} \propto \pi_k \exp\Big(-\eta \sum_{s \le t-h} \ell_{s,h,k}\Big).$$
Only losses whose outcomes have already been observed enter the sum, so short-horizon weights adapt quickly and 120-minute weights adapt slowly. The standard analysis of exponential weights bounds cumulative loss relative to the best single model. The cost of the prior in that bound is $\ln(1/\pi_{k^*})/\eta$, where $k^*$ is the model that turns out best. Delay adds a term that grows with $h$.
This yields the formal blending rule that Direction 2 says is missing. The expert prior dominates only during the first hours on a new patient, which is the cold-start window when no data exist. It is then overwritten at a known rate. A biased prior, such as trusting the adult-trained model for a child, therefore costs a bounded, computable amount rather than persisting. This contrasts with the static multiplicative AHP×entropy combination of The Research of Electronic Banking Risk Evaluation Based on Comprehensive Assessment AHP-Entropy. There, AHP (expert pairwise-comparison weighting) is multiplied once by entropy weights. That paper's own example shows expert weights can be far off: a 0.910 weight was corrected to 0.614. Operation Risk Assessment of Urban Dense Cable Passageway Based on Fuzzy-Analytic Hierarchy Process shows that passing a consistency check does not remove such bias. Together these constrain the design: the prior must be allowed to be wrong.
Why not use confidence as the objective signal. Direction 2's "objective" correction, the Entropy Weight Method, rewards dispersion. Its ML analogue, used in Cyclic Test Time Augmentation with Entropy Weight Method and in the confidence-driven $\alpha$ of Adaptive Calibrator Ensemble for Model Calibration under Distribution Shift, rewards low predictive entropy. We hypothesize that confidence is precisely the wrong signal near a hazard under sudden shift, because the overconfident model captures the weight. Realized delayed margin error is the replacement objective signal.
Shield rule and guarantee. The shield vetoes an action if the weighted lower quantile of predicted margins, shifted by an online conformal correction, is below zero. Online conformal correction means an offset that is re-tuned from observed misses so that the long-run rate of missed violations tracks a target such as 2%. We adapt the conformal machinery of Learning Robot Safety from Sparse Human Feedback using Conformal Prediction and its codebase from human labels to delayed physical outcomes. This gives a quantitative, per-patient risk statement in the spirit of violation-rate estimation from The #DNN-Verification Problem: Counting Unsafe Inputs for Deep Neural Networks. Here the guarantee is empirical and online rather than a count over input space. We do not claim a formal certificate over changing weights, which the file identifies as open.
Ensemble pool. The pool holds BA-NODE members trained on different age cohorts, a physiological compartment model, and a sliding-window refit model. The sliding-window member follows the multi-resolution idea of Adapting to Online Distribution Shifts in Deep Learning: A Black-Box Approach. The pool is deliberately diverse so that weighting has something to choose between.
Expert priors. We will obtain priors in two ways. The first is a small AHP elicitation from clinicians, if available. The second is a protocol of synthetic priors: uniform, correct (oracle-informed), and deliberately anchored on the wrong cohort. The synthetic set lets us measure bias robustness without depending on panel access.
Baselines
Uniform ensemble shield (naive reference). This is the BA-NODE shield from Safety Generalization Under Distribution Shift in Safe Reinforcement Learning: A Diabetes Testbed, run from the released GlucoSim code on the same PPO-Lag and CPO policies, the same out-of-distribution patient splits, and the same ensemble members as our method. It is the strongest existing method on this exact question. That paper reports Time-in-Range gains of 13–14% for PPO-Lag and CPO across 72 settings, and forecast MAE of 2.82 versus 4.11 for a standard iTransformer. Beating it means fewer hypoglycemic events and a higher clinical Risk-Index improvement on unseen patients, with Time-in-Range and false-veto rate at least matched.
Uniform ensemble with a tightened threshold. This is the same shield with its safety buffer increased until it reaches our method's hypoglycemia rate. It isolates whether weighting adds anything beyond conservatism. We win only if it needs more vetoes, and so loses Time-in-Range, to reach the same safety.
Confidence- or entropy-weighted ensemble. This weights members by inverse predictive spread or entropy, as in Cyclic TTA, or through an ACE-style shift-dependent $\alpha$. It is the strongest label-free adaptive competitor. Its reported results are on ImageNet-C, for example ECE of 4.77% for ACE, and do not transfer. No reported result was found on Lacuna for this method in glucose shielding.
Accuracy-weighted ensemble. This is an AWE-style ensemble weighted by recent symmetric MSE, reported at +3.24% accuracy on FMOW with CORAL. It tests whether the hazard asymmetry $\kappa$ matters or plain accuracy tracking suffices.
Ablations. These cover uniform versus expert versus wrong prior, $\kappa = 1$ versus elicited $\kappa$, single versus per-horizon weights, and removal of the conformal correction. All methods share members, patients, seeds, and a tuning budget of equal grid size over $\eta$ or equivalent parameters, chosen on held-out training patients only.
Why not just…?
Why not just average the ensemble and widen the safety buffer? This is the real threat. A wider buffer may buy most of the safety at a modest cost in Time-in-Range. The tightened-threshold baseline is designed to settle it by comparing both methods on the Time-in-Range versus hypoglycemia-rate curve. If the curves coincide, the weighting is not worth its complexity and we will report that.
Why not just fine-tune one forecaster online per patient? Fine-tuning on a few hours of data from a new patient is noisy exactly during cold start. Unlike weight updates, it offers no bound on how far a bad update can go. We include a single online-fine-tuned BA-NODE member as a baseline. If it matches the weighted pool, the pool is unnecessary.
Why not just weight by confidence, which needs no labels? The labels in this setting are delayed rather than absent, so the main argument for label-free proxies does not apply. The Direction 3 literature already flags that confidence proxies over-allocate weight to miscalibrated models at sudden shifts. Our abrupt-shift experiment (meal and insulin-stacking events) tests this directly.
Why not just use exponential weights with a uniform prior and skip the experts? In the long run the prior washes out, so this may be sufficient. The expert prior can only matter in the first hours on a patient. We measure hazard events in that window separately. If a uniform prior is no worse there, we will drop the expert component.
Proposed Experiments
The main benchmark is GlucoSim's out-of-distribution patient cohorts: child, adolescent, and adult; Type 1 and Type 2; with insulin stacking and non-compliance. We report Time-in-Range, hypoglycemia events per day, Risk Index, false-veto rate, and the realized miss rate against the conformal target. As a replication on a different simulator, we run the FDA-accepted UVA/PADOVA simulator with the STL-U monitor as an additional reference. That work reports 23.9 versus 0.6 minutes of hypoglycemia lead time and Time-in-Range of 96.3% versus 90.9% in adults. Here we compare lead time and Time-in-Range with its single Bayesian RNN replaced by our weighted ensemble.
Four checks decide the proposal. First, the method must beat the tightened-threshold uniform shield on the safety versus Time-in-Range curve for unseen patients. Second, under an anchored wrong prior, excess hazard events must stop accumulating within the time predicted by $\ln(1/\pi_{k^*})/\eta$. Third, confidence weighting must show more missed hypoglycemia than delayed-error weighting around abrupt shifts. Fourth, the realized miss rate must stay near its target across patients. Failing the first check would mean that dynamic weighting does not earn its place in a safety shield.
References
- Safety Generalization Under Distribution Shift in Safe Reinforcement Learning: A Diabetes Testbed
- Quantitative Predictive Monitoring and Control for Safe Human-Machine Interaction
- Risk-Aware Safe Control for Decentralized Multi-Agent Systems via Dynamic Responsibility Allocation
- The Research of Electronic Banking Risk Evaluation Based on Comprehensive Assessment AHP-Entropy
- Operation Risk Assessment of Urban Dense Cable Passageway Based on Fuzzy-Analytic Hierarchy Process
- Cyclic Test Time Augmentation with Entropy Weight Method
- Adaptive Calibrator Ensemble for Model Calibration under Distribution Shift
- Learning Robot Safety From Sparse Human Feedback Using Conformal Prediction
- The #DNN-Verification Problem: Counting Unsafe Inputs for Deep Neural Networks
- Adapting to Online Distribution Shifts in Deep Learning: A Black-Box Approach