Abstract
This page proves two mechanisms by which a SOFA-based reinforcement-learning state can encode prior treatment, and states precisely what those proofs do and do not imply about whether a model actually exploits that encoding — a question this page treats as open and empirical, not settled by the mathematics alone.
Terminology — confounding, not ML-sense leakage
$A_{t-1} \to S_t \to A_t$ — prior treatment shaping the current state, which then informs the next decision — is ordinary sequential decision-making, not leakage. True leakage would be $A_t \to S_t \to \hat{A}_t$: the state containing information about the same action epoch it's used to predict, or information not yet available at decision time. Both theorems below are the first pattern — real, provable, and still a genuine problem for offline-RL state design (Proposition 2 shows $S_t$ is formally a descendant of $A_{t-1}$), but a post-treatment-bias / bad-control pathology from causal inference, not a target/temporal leakage pathology from machine learning. This project's own action label was verified to have zero overlap with the state window it follows (analysis notebook, §"Build State Variants A–E and Action Labels") — the second pattern does not occur anywhere in this pipeline. Full derivation: FORMAL_ANALYSIS.md §1.1.
What is actually proven?
Proven
- Treatment-dose non-identifiability of σ_cardio
- Exact reconstructibility of σ_cardio from the total
- Monotonicity of absolute window overlap
- Non-monotonicity of fractional overlap
- S_t is a descendant of A_(t-1) in the causal graph
Empirical
- Frequency of nonzero dose in the cohort (32.3% / 28.6%)
- AUROC values for variants A–E
- Window-overlap percentages
- Offset-decay curve shape
Open / testable
- Whether the definitional pathway materially explains next-action predictability
- Whether the AUROC gap survives controlling for treatment persistence
Theorem 1 — Treatment-dose non-identifiability of σcardio
ProvenOnce any vasopressor is running, the cardiovascular SOFA score stops reading blood pressure at all — it becomes purely a readout of the drug and dose.
The cardiovascular SOFA subscore (Vincent et al., 1996) is scored by checking dose thresholds from highest to lowest, falling through only if the higher tier doesn't apply:
$$ \sigma_{cardio}(\text{MAP}, D) = \begin{cases} 0 & \text{if } D=\emptyset \text{ AND MAP} \geq 70 \\ 1 & \text{if } D=\emptyset \text{ AND MAP} < 70 \\ 4 & \text{if } \text{dopa}>15 \text{ OR epi}>0.1 \text{ OR norepi}>0.1 \\ 3 & \text{else if } \text{dopa}>5 \text{ OR } 0{<}\text{epi}{\leq}0.1 \text{ OR } 0{<}\text{norepi}{\leq}0.1 \\ 2 & \text{else if } 0{<}\text{dopa}{\leq}5 \text{ OR dobutamine}>0 \end{cases} $$
Branches are checked in the order shown (nested, not independent) — this resolves the OR/AND ambiguity precisely, and matches the audited implementation exactly.
Corrected example. Fix $D=$ dopamine at 6 mcg/kg/min (no epi/norepi active). The first branch (dopa>15) is false; the second (dopa>5) is true — score $=3$. For any $\text{MAP}\in\{40,55,70,90,\dots\}$, $\sigma_{cardio}(\text{MAP},\text{dopa}{=}6)=3$ identically.
Corollary 1.1 — "100% of treated timesteps" is proven, not observed
ProvenIt's not a coincidence that every treated timestep in the data turned out dose-determined — the definition guarantees it.
The empirical content is separate: how often $D\ne\emptyset$ occurs at all in this cohort — 32.3% (4h window) / 28.6% (24h window) of all eligible timesteps. That frequency is a dataset fact; the 100%-conditional-on-treatment claim is a proof.
Theorem 2 — Exact reconstructibility under naive feature removal
ProvenDeleting the cardiovascular score from the feature list doesn't delete the information — it's still recoverable by subtracting the other five scores from the total.
$$\text{SOFA}_{total} = \sigma_{cardio} + \sum_{i\ne cardio}\text{subscore}_i$$
Proposition 1 — Window overlap: absolute monotone, fractional not
ProvenA bigger lookback window can only see more treatment-hours, never fewer — but the fraction of the window that overlaps treatment can go either way.
Fractional overlap — exact derivative. With $c(w)=O(w)/w$, the quotient rule gives, wherever $O$ is differentiable:
$$c'(w) = \frac{w\,O'(w) - O(w)}{w^2} = \frac{O'(w) - c(w)}{w}$$
So $c'(w)>0 \iff O'(w)>c(w)$ — the fractional overlap rises exactly when the marginal treatment density in the newly-added slice exceeds the average density accumulated so far. This is the same relationship as a marginal-cost curve crossing an average-cost curve, and it correctly predicts the counterintuitive empirical reversal this project measured: the 4-hour window showed a higher overlap rate than the 24-hour window.
Causal structure — why non-identifiability isn't the same as leakage
Theorem 1 is a fact about a scoring function. Whether that fact lets a model predict the next action is a separate, empirical question — this section makes precisely why.
An AUROC computed for a classifier predicting $A_t$ from $S_t$ cannot, from the number alone, attribute its performance between these two paths. This is a structural fact about what AUROC measures — a marginal association — not a limitation specific to this dataset. State containing treatment information does not, by itself, prove predictive leakage of the next action.
H3 — run, with the proper statistical test
H3 — does the definitional pathway materially explain next-action predictability?
Run — Prediction ALet $\text{AUROC}(k)$ be the offset-decay AUROC at offset $k\in\{0,1,2,4,8\}$ decision bins, and $\Delta=\text{AUROC}(0)-\text{AUROC}(8)$.
Recommended procedure: a paired cluster bootstrap — resample patients (not timesteps) with replacement, and on each resample compute both $\text{AUROC}(0)$ and $\text{AUROC}(8)$ using the same resampled patient set, then record $\Delta$ for that resample. Repeat many times; report the resulting bootstrap CI for $\Delta$ directly. A DeLong-type paired test for correlated ROC curves, or a permutation test that permutes offset-labels within patient, are valid alternatives.
Prediction A (definitional pathway dominates): $\Delta$'s bootstrap CI excludes a value near 0 and $\Delta\ge0.10$. Prediction B (persistence dominates): $\Delta$'s CI includes 0, or $\Delta<0.10$. Neither outcome would falsify Theorems 1–2 — only their practical contribution to the measured gap would be smaller under Prediction B.
References
Vincent, J.-L. et al. (1996). The SOFA score. Intensive Care Medicine, 22(7), 707–710.
Hernán, M. A. & Robins, J. M. Causal Inference: What If. Chapman & Hall/CRC, 2020.
DeLong, E. R. et al. (1988). Comparing the areas under two or more correlated ROC curves. Biometrics, 44(3), 837–845.
Komorowski, M. et al. (2018). The Artificial Intelligence Clinician. Nature Medicine, 24(11), 1716–1720.