Sampling Patient Futures: Discrete Vital-Sign Tokens for Rolling Surgical Risk

Hospitals still judge surgical risk mostly from a snapshot. A patient's age, comorbidities and anesthesia class are scored once before incision, and the score does not change while their blood pressure, heart rate and oxygen saturation move minute by minute on the monitor. This proposal treats those monitor streams the way recent motion-generation work treats human movement. We cut each few-minute stretch of the multi-channel vital-sign trace into one entry from a learned vocabulary of physiological "words." We then train a GPT-style next-token model over those words, conditioned on the preoperative profile. At any moment during surgery the model can sample hundreds of plausible next-hour futures for this specific patient. The risk of any clinically defined event, such as "mean arterial pressure below 65 for ten minutes while heart rate climbs," is simply the fraction of sampled futures in which that event happens.

The reason to discretize is not that tokens will classify outcomes better than a good continuous network. They probably will not. The reason is that physiological futures are multimodal: a patient may stabilize or may crash. Regression-style forecasters average those branches into a smooth, falsely reassuring middle path, and per-time-step quantile bands cannot say whether two channels fail together. Motion researchers hit exactly this "averaging collapse" and solved it with categorical vocabularies. We test whether the same fix produces calibrated, jointly coherent, continuously updated risk. We pay particular attention to patients a static score calls low risk, because that is where snapshot scores fail most.

Core Claim

We claim that a next-token model over a learned vital-sign vocabulary produces calibrated probabilities for joint, multi-channel intraoperative deterioration events. These include events that were defined only after training. On those events it should beat a continuous quantile forecaster and a generative hidden Markov model. On events it was never trained to predict, it should come within a small margin of a classifier trained separately for each event. Its advantage over static preoperative scores should be largest in the lowest static-risk tertile. The decisive ingredient is the quantized vocabulary, and the design isolates it by keeping a version of the same backbone that predicts continuous mixtures instead of tokens.

Where This Sits

The clinical side motivates the problem. Optimal intensive care outcome prediction over time using machine learning showed on 21,911 UK ICU admissions that APACHE-II's fixed day-one estimate (AUC 0.836) is overtaken by models that accumulate daily trends (AUC 0.895 by day 2). Perioperative blood pressure variability as a risk factor for postoperative delirium found that systolic variability predicts delirium even when mean pressure is normal. That finding shows the signal lives in the shape of the trace, not in its level.

The closest work is Beyond Thresholds (also here; Beyond Thresholds: Learning Perioperative Risk from Intraoperative Physiological Trajectories). On 130,960 INSPIRE operations it fit a 6-state Gaussian hidden Markov model to six vital channels and pooled state occupancy and transitions into a logistic regression. That raised prolonged-ICU-stay AUPRC from 0.244 to 0.339 and gave the biggest gain (+0.223 AUROC) in the lowest-risk tertile. It already discretizes vitals into states. We differ in three ways: our vocabulary is learned and non-linear rather than six unimodal Gaussians, a sequence model replaces pooling, and the product is a sampled distribution over futures rather than a single outcome score.

Two continuous models set the opposite pole. The PO-AKI deep-learning study feeds minute-level vitals to a convolutional network and reaches 0.796 external AUROC, against 0.724 for the static SPARK score. TFT-multi forecasts five ICU vitals jointly with quantile loss. Neither produces joint samples of the future.

The method comes from motion modeling. Trajeglish built a 384-token vocabulary of real vehicle state transitions and beat continuous forecasters on the Waymo Sim Agents interaction metric by 9.9%. TM2T used a 1D-convolutional vector-quantized autoencoder, an encoder that maps each window to its nearest entry in a learned codebook. MeshTalk showed that categorical latents stop facial animation from collapsing to an averaged "zombie face." Ego4o used separate codebooks per body part so that unobserved limbs can be inferred from observed ones. We reuse that idea for missing vital channels.

One result constrains the design. Does Temporal Encoding Matter? found that explicit time tokens add nothing to recurrent models trained on MIMIC-IV event codes. We therefore use no separate time tokens: each token covers a fixed wall-clock window, so duration and slope are built into the token itself.

Research Program

Data and tokenizer. We use INSPIRE, which records intraoperative vitals at 5-minute intervals, and split it temporally by year. Each token covers three consecutive samples (15 minutes). Following Ego4o, there are separate codebooks for two channel groups: hemodynamic (heart rate, arterial pressures) and respiratory (SpO2, FiO2 and the other ventilation channels). A dedicated "missing" code handles disconnection, so a lost arterial line does not corrupt the respiratory token.

We build two versions of the vocabulary. The first is a learned vector-quantized autoencoder in the style of TM2T. The second is a non-learned Trajeglish-style vocabulary: real windows are sampled and greedily pruned at a distance $\epsilon$. Codebook size, roughly 128–512 entries per group, is chosen by reconstruction error on the validation years. We track codebook utilization to detect collapse.

Sequence model. A decoder-only transformer receives preoperative variables and surgery type as prefix tokens and then predicts the next token pair autoregressively. Every 5 minutes it draws $K$ rollouts over horizon $H$ (30–60 minutes). For any event predicate $E$ written over decoded trajectories, the risk estimate is

$$r_t(E) = \frac{1}{K}\sum_{k=1}^{K} \mathbf{1}\big[E(\hat{x}^{(k)}_{t+1:t+H})\big],$$

where $\hat{x}^{(k)}$ is the $k$-th decoded future and $\mathbf{1}[\cdot]$ is 1 if the event occurs. Because decoded tokens can be jagged at window boundaries, which Trajeglish also reports, we measure boundary jumps and apply light smoothing only if they distort event detection.

Postoperative outcomes. For postoperative ICU admission, prolonged stay and mortality, a linear head reads the transformer state together with rollout-derived event probabilities. This lets us compare directly with Beyond Thresholds' arms. Outcome prediction is a secondary result; the primary result is forecasting.

Baselines

The naive reference is a static preoperative logistic regression on age, BMI and ASA class, the analogue of Beyond Thresholds' Arm A. For forecasting, a persistence model that carries the last observed values forward serves as the naive point. Any dynamic model must clear both.

The strongest existing discrete-state method is the 6-state Gaussian hidden Markov model of Beyond Thresholds. We will reproduce it in two forms: as published, with pooled features into logistic regression, and as a generator. Since a hidden Markov model can sample futures, we will sample from it to compute $r_t(E)$, which gives it the same interface as our model. Its reported prolonged-ICU-stay AUPRC is 0.339 and its ICU-admission AUROC is 0.944. On 30-day mortality, the gradient-boosting model in the INSPIRE dataset paper reports AUROC 0.944 against 0.829 for ASA. We will also run a 20–30 state version to check whether simply adding states closes the gap.

The strongest continuous forecaster is TFT-multi. It reports mean blood-pressure error of 6.2 against 10.1 for the original Temporal Fusion Transformer on MIMIC-IV. We will retrain it on INSPIRE and also run our model on its MIMIC-IV vitals setting so that the comparison is anchored to that published number. To turn its per-time-step quantiles into joint event probabilities, we assume channels and time steps are independent; that limitation is exactly the property under test.

The most dangerous competitor is our own backbone with the quantizer removed. This version predicts a Gaussian mixture over the next continuous window and is sampled the same way. Alongside it we train a per-event direct classifier on the same backbone, which serves as a practical ceiling for events known at training time.

All neural models share the same splits, parameter count, GPU-hour budget and number of hyperparameter trials. We count a win as two things together. First, a lower energy score (a proper scoring rule for multivariate forecast distributions) and lower expected calibration error than every other generator on held-out events. Second, AUROC on post-hoc events within 0.01 of the per-event classifier. Gains must hold under bootstrap confidence intervals.

Why not just…?

Why not just use summary statistics and gradient boosting? Beyond Thresholds tested this directly as Arm B, using means, extremes and threshold-breach time. It was beaten by state-sequence features. Breach metrics also cannot fire when patients stay inside normal ranges, which is precisely where the variability findings place the risk. Boosting on summaries does remain competitive for single fixed outcomes; WRSE reaches 0.92 time-dependent concordance on HiRID with LightGBM. We include it for the postoperative outcomes and expect parity there. However, it cannot answer a newly defined joint event without retraining, and that capability is the claim we test.

Why not just train a continuous network on each outcome? For a fixed, known outcome this is a real threat, and the PO-AKI convolutional model shows it works. We do not claim to beat it on its own target. The per-event classifier baseline measures the price of generality. If the token model falls more than 0.01 AUROC short on post-hoc events, the generality is not worth it and we will report that.

Why not just use a continuous autoregressive model with a mixture output? This is the cleanest test of whether discreteness matters, because a mixture density can also represent several modes. The quantizer-removed ablation settles it. If the mixture model matches on energy score and calibration, then the motion-collapse argument does not carry over from MeshTalk and Trajeglish to 5-minute vitals. In that case the only remaining value of tokens is inspectability, and we would say so.

Why not just use a bigger hidden Markov model? Larger hidden Markov models stay first-order and keep unimodal Gaussian emissions within each state. The authors of Beyond Thresholds describe their model as a deliberately simple baseline for this reason. The 20–30 state generative version tests directly whether added states, rather than learned vocabulary plus long context, account for any gain.

Proposed Experiments

The first decisive check is held-out event calibration. Before looking at test data we write a set of composite intraoperative events: hypotension paired with tachycardia, desaturation despite rising FiO2, and sustained variability above a band. None of these is used in training. We then compare reliability diagrams, energy score and AUROC across all generators.

The second check is the lowest static-risk tertile. We measure how early in the case each model's rollout risk separates patients who later deteriorate or are admitted to ICU from those who do not. The comparison is against Beyond Thresholds' +0.223 AUROC gain and its 15-minute post-induction signal.

The third check is the tokenizer ablation: learned codebook versus the $\epsilon$-pruned vocabulary versus no quantization. It tells us whether learning the vocabulary matters or whether any categorical bottleneck suffices.

The fourth check is token interpretability. Anesthesiologists will be shown decoded prototype windows for the tokens most predictive of deterioration and asked whether they correspond to recognizable physiological patterns.

All evaluation is retrospective rolling simulation. Prospective deployment remains out of scope, and we state that limitation explicitly.