Reinforcement learning (RL) agents that suggest ventilator settings or blood-pressure drugs in intensive care are usually kept safe in soft ways. They are pushed toward what clinicians did before, or they are penalized after something goes wrong. A harder alternative is action masking: a rule removes forbidden actions before the agent chooses, so it can never pick them. Masking works well in games and traffic control, where "forbidden" is known exactly. In a patient it is not known exactly. Cases of vision loss after prone surgery show this. When a patient lies face-down, eye pressure rises and blood drains poorly from the head. A patient with long-standing hypertension can then lose blood flow to the eye at a mean arterial pressure (MAP) that is "normal" by textbook rules (Xu et al., unilateral postoperative visual loss after PCNL). The same raised airway pressure (positive end-expiratory pressure, PEEP) that starves a healthy heart of returning blood can relieve a congested failing one (Lamberti et al.). A single fixed mask is therefore too loose for some patients and too tight for others.
We propose masks that depend on hidden patient traits. The mask is computed from a probabilistic estimate of each patient's perfusion limits: how far their autoregulation has shifted, whether their heart is congested, and how posture affects pressure in their head and eyes. An action is removed only if it is likely to push perfusion below that patient's estimated floor. The mask is also applied inside the agent's value-learning update, not just at deployment. The main claim is testable. Compared with a fixed-threshold mask, a patient-specific mask should cut simulated eye-perfusion deficits in hypertensive prone patients without blocking helpful high-PEEP actions in congested shock. Compared with filtering an unconstrained agent's output after the fact, masking during learning should produce better-calibrated values.
What exists and what is missing
Clinical RL for ventilation and circulation relies on statistical caution rather than hard limits. DeepVent applies conservative Q-learning, which lowers value estimates for actions rarely seen in the data, to a grid of PEEP, tidal volume, and oxygen settings on MIMIC-III (Kondrup et al.). EZ-Vent restricts choices to actions a cloned clinician policy would plausibly take, on eICU and MIMIC-IV, and it tracks MAP (Liu et al.). The sepsis agent of Raghu et al. is unconstrained and gives implausible doses in its sickest patients. The weaning work of Prasad et al. relies on reward penalties. These papers motivate the proposal: none removes actions on physiological grounds, and none represents posture.
The masking literature supplies the method. Huang and Ontañón showed that masking logits is a sound state-dependent operation for policy gradients and that penalties fail as valid actions become rare. Müller et al. showed that masking beats an external override layer in traffic control. Varricchione et al. extended masks to rules about the recent past, such as "no change of type X within k steps of event Y."
The same literature also constrains the design. All of it assumes a deterministic oracle that labels actions valid or invalid. Huang and Ontañón further report that agents never learn the rules themselves and depend on the mask at run time. Our proposal accepts that dependence: the mask is meant to be a permanent part of the deployed system. It replaces the exact oracle with a probabilistic one.
The physiology papers supply the structure of the mask. They describe prone venous impedance and raised eye pressure (Xu et al.). They show that the prone position can unmask hidden cardiac conduction problems (Morimoto/Ogawa et al.). They document that airway pressure reduces cardiac output (Bukoski et al.), and that this effect reverses in congested shock (Lamberti et al.).
Core Claim
Let $\theta$ be a patient's hidden physiological traits: the lower limit of autoregulation $L(\theta)$ and a congestion indicator. Let $h_t$ be the observed history, including posture, chronic hypertension, and recent pressures. The mask allows action $a$ in state $s$ only if
$$M_s[a] = 1 \iff \Pr\big(\mathrm{PP}(s,a) \ge L(\theta) \mid h_t\big) \ge 1-\delta,$$
where $\delta$ is a tolerated risk level. $\mathrm{PP}(s,a)$ is the predicted perfusion pressure at the eye after action $a$. We model it as MAP minus the larger of eye pressure and venous back-pressure, and we raise both terms in the prone position and at high PEEP. This is a modelling assumption, and the experiments probe it.
Because congestion is part of $\theta$, a high-PEEP action can be allowed for a patient who is likely congested and forbidden for one who is not. In an offline Q-learner, the mask enters the learning target as
$$y = r + \gamma \max_{a' : M_{s'}[a']=1} Q(s', a'),$$
where $r$ is reward and $\gamma$ the discount. Values are then learned for the policy that will actually run, rather than for an unconstrained one that is filtered afterwards. Rules about history are layered on top in the style of Varricchione et al. One example is "no PEEP step-down larger than one bin within two steps of a posture change."
Research Program
The work has three parts.
Simulator. The first part is a simulated circulation in which ocular perfusion can actually be observed, which it cannot be in any ICU database. We will extend a lumped-parameter heart–lung–venous model with three additions: posture-dependent pressure offsets and eye-pressure rise in the prone position, PEEP effects on venous return, and a congested-heart regime in which PEEP lowers left-ventricular filling pressure. The one quantitative anchor available in the file is the healthy-swine drop in left-ventricular stroke work from 2593 to 740 mmHg·mL as PEEP rises from 5 to 20 cmH2O (Lamberti et al.). We will calibrate to it, and say openly that this calibration is thin. Simulated patients will be drawn with heterogeneous $\theta$, including right-shifted autoregulation for hypertensive and diabetic profiles.
Mask estimator. The second part is a model that infers $\theta$ from history, using either a small Bayesian filter or an ensemble. It produces $M_s$, and we will check its calibration in the simulator against the true $\theta$.
Agents. The third part is a set of agents with a discrete action space of PEEP bins, oxygen-fraction bins, vasopressor-dose bins, and, in simulation, head and bed position. They will be trained online (PPO) and offline (conservative Q-learning with the masked target).
We then move to MIMIC-IV and eICU. A practical risk is that posture is charted unevenly. The posture-dependent parts of the mask will be used only where posture is recorded, and everywhere else the mask falls back to its hypertension and congestion terms. Postoperative vision loss itself is far too rare to serve as an endpoint, with a reported incidence of 0.0008–0.2% (Xu et al.). Real-data evaluation therefore uses surrogate endpoints, stated as such: time below a baseline-relative MAP floor, kidney injury, and mortality.
Baselines
The naive reference points are the physician policy and behavior cloning. On MIMIC-III, DeepVent reports a Fitted Q Evaluation (FQE, an offline estimate of a policy's value) initial-state value of 0.502 for the physician policy and 0.572 for behavior cloning (Kondrup et al.).
The strongest offline competitor is DeepVent itself, which reports 0.743 on that metric. The strongest constrained competitor is EZ-Vent's batch-constrained Q-learning, which reports estimated hospital mortality of 14.7 ± 0.7% against 18.2% observed in eICU, and 29.1 ± 0.9% against 31.1% observed in MIMIC-IV (Liu et al.). FQE values depend on the reward definition, so we will not compare to these numbers directly. We will re-implement both methods on our cohort, with our reward, state features, action grid, and train/test split, and give every method the same hyperparameter search budget and the same FQE evaluator.
Beating DeepVent means two things. Our method must reach a statistically indistinguishable or higher FQE value. It must also cut the share of recommended actions that breach the patient-specific perfusion floor, as judged by the mask itself and, in simulation, by true perfusion.
Three ablations isolate the key ingredients. The first is a fixed-threshold mask (MAP > 65 mmHg, a PEEP ceiling, no posture term), which isolates personalization. The second is post-hoc filtering, where an unmasked DeepVent's output is restricted to allowed actions only at deployment; this isolates masking inside the learning target. The third is a mask-only policy, where the clinician's action is projected onto the nearest allowed action with no RL at all; this isolates whether RL adds anything beyond the mask.
In online simulation we add two more comparisons: a reward-penalty agent and an external override layer, following the setups of Huang and Ontañón and Müller et al., with matched environment steps and seeds.
Why not just…?
Why not just clamp DeepVent's output with clinical rules at deployment? This is the most serious threat, and the file's evidence does not settle it. Müller et al. found that override layers left 40% of agents unconverged, but that was online exploration, where the mismatch between intended and executed actions corrupts learning. Offline there is no exploration, so the argument transfers only through the learning target: an unmasked learner values states by assuming it can take actions it will never be allowed to take. The post-hoc filtering ablation tests this directly. If filtering matches masked training on FQE and on simulated perfusion, we will report that and present the patient-specific mask as the contribution rather than in-training masking.
Why not just use a personalized blood-pressure protocol with no RL? Setting MAP floors relative to a hypertensive patient's baseline may capture most of the benefit. The mask-only projection baseline is exactly this protocol. If RL inside the mask does not improve on it, the honest conclusion is that the mask is the clinically useful object. That would still be a result, since no such posture-aware rule set exists in the file. The case for RL rests on the PEEP sign reversal (Lamberti et al.): the trade-off between oxygenation and circulation then requires planning over several steps, which a floor alone does not provide.
Why not just rely on reward penalties or conservative Q-learning? Penalties collapsed from a return of 40.00 to 0.50 once valid actions became sparse in μRTS (Huang and Ontañón). Conservative Q-learning keeps the agent near clinician behavior, but clinician behavior is exactly what produced the vision-loss and cardiac-arrest cases (Xu et al., Morimoto/Ogawa et al.). The simulator measures how often each method's policy breaches true perfusion limits in prone hypertensive patients, which is the regime where staying close to the data is least reassuring.
Why not just use a fixed, conservative mask? It would be safe, but it would forbid high PEEP in congested shock, where PEEP helps. The fixed-mask ablation in the simulated congested subgroup measures this lost benefit.
Decisive Checks
Four checks decide whether the proposal works.
First, in simulation, the patient-specific mask must lower minutes of ocular perfusion below $L(\theta)$ relative to the fixed mask in prone hypertensive patients. It must also keep, or improve, return in the congested-shock subgroup, where the fixed mask should lose return by blocking PEEP. If both gains do not appear together, the central idea fails.
Second, masked-target training must beat post-hoc filtering on the gap between FQE estimates and returns actually achieved in the simulator.
Third, the mask must itself be validated in MIMIC-IV and eICU. Patient-time during which clinicians acted outside the patient-specific mask should be more strongly associated with kidney injury and mortality than time spent outside the fixed mask, after adjusting for illness severity. If this association is absent, the probabilistic mask is not capturing real risk, and clinical claims should stop at simulation.
Fourth, the estimate of $\theta$ must be calibrated in simulation. The realized rate of perfusion-floor violations among allowed actions should stay at or below $\delta$.
References
- Unilateral postoperative visual loss after percutaneous nephrolithotomy: a case report
- Combined mechanical ventilatory and mechanical circulatory support aids pulmonary vascular state in cardiogenic shock
- Towards Safe Mechanical Ventilation Treatment Using Deep Offline Reinforcement Learning
- Reinforcement learning to help intensivists optimize mechanical ventilation settings (EZ-Vent): Derivation and validation using large databases
- Deep Reinforcement Learning for Sepsis Treatment.
- A Reinforcement Learning Approach to Weaning of Mechanical Ventilation in Intensive Care Units
- A Closer Look at Invalid Action Masking in Policy Gradient Algorithms
- Safe and Psychologically Pleasant Traffic Signal Control with Reinforcement Learning using Action Masking
- Pure-Past Action Masking
- Cardiac arrest as an unusual complication in transforaminal full-endoscopic spine surgery under local anesthesia:a case report
- Cardiopulmonary effects of apneustic anesthesia ventilation in anesthetized pigs: a new mode of ventilation for anesthetized veterinary species