Many systems must decide before the evidence is complete. A network intrusion detector blocks a connection after seeing its first four packets. A sepsis alarm fires hours before the patient meets the clinical definition. In both settings the model reads a stream that grows over time and at some step commits to an irreversible decision. Nobody currently checks what that commitment rests on. There are three possible grounds:
- Content: what the observations say, such as packet header values or lactate and pH readings.
- Timing: when the observations arrived, such as packet inter-arrival gaps or how often labs were ordered.
- Position: the observation's index in the sequence, a bookkeeping artifact of how the stream was fed to the model.
We propose a test that answers "why did it stop here?" at the moment of commitment. It works by splitting the decision's support into these three parts. We then hypothesize that position-driven early commitments are exactly the ones that fail when the stream is shifted. Such shifts include an attacker prepending dummy packets, or a model moving to a new hospital.
The opportunity exists because two literatures hold complementary halves of the answer. Clinical interpretability work has shown that sequence models over-weight whatever sits at the start of a sequence ("primacy bias"). The same work shows that a position-aware explainer can separate what a measurement is from when it appeared Interpreting Sepsis Prediction through Positional Explanation. Early flow classification, meanwhile, trains models under explicit pressure to decide within the first few packets Dynamic Temporal Positional Encodings for Early Intrusion Detection in IoT. Its main known weakness is that attackers can pad the opening of a flow with benign-looking packets Adversarial Pre-Padding: Generating Evasive Network Traffic Against Transformer-Based Classifiers. Pressure to decide early is a natural amplifier of primacy bias, and pre-padding is a natural probe of it. Nobody has connected the two.
Core Claim
We claim two things. First, at each step where a prefix classifier commits, its support can be decomposed into content, continuous timing and index position. The decomposition uses three perturbations that each alter one factor while holding the others fixed. Second, the index share of that support measured on the training distribution predicts how much the classifier's early decisions degrade under shift. Using that share to gate when the model is allowed to stop should buy robustness at a small cost in earliness.
The gate works as follows. At the step $\tau$ where the model's confidence $c_\tau$ first exceeds a threshold, let $A_v$, $A_t$ and $A_i$ be the attributions to values, timing and index. The model commits only if
$$ c_\tau \ge \gamma \quad \text{and} \quad s_i(\tau) = \frac{A_i}{A_v + A_t + A_i} \le \kappa , $$
where $\gamma$ is the confidence threshold and $\kappa$ is a maximum allowed index share. Both are chosen on source-domain validation data only.
We deliberately do not penalize reliance on timing. Inter-arrival times carry real signal in IoT traffic, per the Dynamic Temporal Positional Encodings paper. Test-ordering frequency carries real signal in sepsis: the Sepsis Multi-Feature XGBoost paper built 62 missingness features Early Prediction of Sepsis Using Multi-Feature Fusion Based XGBoost Learning and Bayesian Optimization. Whether timing reliance transfers across sites is an empirical question we measure, not an assumption.
Relation to Prior Work
Three papers motivate the proposal by exposing the gap.
PaX Interpreting Sepsis Prediction through Positional Explanation swaps the positions of measurements while keeping their values. This separates "what" from "when" and shows that standard LIME falsely elevates Gender because it sits at $t=0$. Our method reuses its perturbation idea. PaX differs from our setting in three ways:
- It explains fixed retrospective windows post hoc, not a growing prefix at the moment of commitment.
- It uses discrete indices, whereas our method splits discrete index position from continuous arrival time.
- It never uses the attribution to change model behavior.
Classifier-Induced Stopping A Policy for Early Sequence Classification trains a stopping policy by supervised imitation of the retroactively optimal stop time. On PTB-XL electrocardiograms it beats a reinforcement-learning stopper (PPO) by 35.3% in Pareto-frontier area. Its policy says when to stop but not why, and the authors report instability at very early prefixes. That early-prefix regime is where we expect position shortcuts to be most attractive.
DeepAISE DeepAISE - An interpretable and recurrent neural survival model for early prediction of sepsis attaches hourly gradient saliency to a recurrent survival model. Saliency on hourly bins cannot separate index from time from value.
Two lines of work constrain the design. The PhysioNet 2019 challenge Early Prediction of Sepsis from Clinical Data: the PhysioNet/Computing in Cardiology Challenge 2019 documents sharp cross-hospital drops for all top models. We treat that as the shift our test must predict. In networking, SPIN-IDS Towards Real-Time Network Intrusion Detection With Image-Based Sequential Packets Representation reports that adversarial evasion reaches 99% against a baseline but stays below 2.04% error against its own model. This warns that robustness can come from representation choices alone. Any claim for our gate must therefore survive comparison with strong representations and with augmentation.
Research Program
The three perturbation families. We first build the commit-time decomposition for continuous-time streams. Each family targets one factor:
- Value perturbation resamples a feature's value from its conditional distribution at the same timestamp and index.
- Timing perturbation warps inter-arrival gaps while preserving order, values and index. For networks this uses jitter drawn from observed benign variability. For the clinic it shifts measurement times within plausible charting delays.
- Index perturbation inserts neutral observations at the front, which changes every index while leaving values and relative times untouched. Neutral observations are benign dummy packets in networks, or carried-forward normal vitals in clinical streams. This is the pre-padding attack recast as a measurement instrument.
We compute attributions with a LIME-style local linear fit over joint samples of the three families, as PaX does for its two. We then validate faithfulness with PaX-style insertion and deletion curves applied separately per factor.
Cost. Attribution at every step is expensive, so we audit only steps where confidence crosses $\gamma$. For line-rate network deployment we additionally distill the gate into a small head that predicts $s_i$ from the classifier's hidden state. Latency is reported against the sub-2 ms figure in the Dynamic Temporal Positional Encodings paper.
Backbones. We apply the test to backbones representative of each field:
- Networking: a Transformer with dynamic temporal encodings and early-detection loss, following the Dynamic Temporal Positional Encodings paper; the 4-packet LUCID pipeline from P4DDLe Introducing Packet-Level Analysis in Programmable Data Planes to Advance Network Intrusion Detection; and SPIN-IDS.
- Clinical: a GRU survival model in the style of DeepAISE, and a causal Transformer.
Each backbone is trained with and without an early-decision penalty. This isolates whether earliness pressure raises the index share.
Justified stopping. We fold the gate into training by modifying Classifier-Induced Stopping. Its supervised target stop time becomes the earliest step that maximizes utility subject to $s_i \le \kappa$. The stopping policy thereby learns to wait until the evidence is carried by content or timing rather than position.
Baselines
The naive reference is a fixed-prefix classifier that commits at the first step where confidence exceeds $\gamma$, with no audit. The clinical version uses the utility-tuned threshold procedure from the Sepsis Multi-Feature XGBoost paper. The network version commits at packet 4, as in P4DDLe. Every method must beat this on the joint earliness–accuracy frontier after shift. Matching it in-domain is not enough.
The strongest clinical competitor is the Sepsis Multi-Feature XGBoost pipeline: an XGBoost ensemble over 168 engineered features, explained with TreeSHAP. It reports a normalized utility of 0.364 on the hidden test set and AUROC 0.847 locally. UCAS_DataMiner Early Sepsis Prediction Using Ensemble Learning with Features Extracted from LSTM Recurrent Neural Network reports 0.313 hidden and 0.401 in cross-validation. The hidden Hospital C set is not publicly available, so we will run hold-one-hospital-out between A and B. We found no reported result on Lacuna for the A→B or B→A splits. We therefore re-run the XGBoost pipeline ourselves with identical features, the same Bayesian-optimization budget and the same threshold search. Beating it means higher out-of-hospital utility at matched median alert lead time.
The strongest stopping competitor is Classifier-Induced Stopping itself, run with the same backbone, the same $\mu$ sweep and the same tuning budget. On PTB-XL it reports a 35.3% Pareto-area gain over PPO. We report our gated variant on PTB-XL as a sanity check that gating does not destroy in-domain earliness.
The network competitors are:
- The Dynamic Temporal Positional Encodings Transformer, at 96.67% accuracy within 4 packets on CICIoT2023.
- P4DDLe, at F1 ≈ 0.93 from 4 packets on CIC-DDoS2019.
- SPIN-IDS, at 97.7–99% accuracy from 4–9 packets on CIC-IDS2017/2018.
Beating them means lower pre-padding attack success and smaller CIC-IDS2017→2018 degradation at no more than one extra packet of median delay.
Three ablations isolate the key ingredient:
- Gating on standard LIME attribution with no factor split, which tests whether the decomposition matters.
- Gating on timing share instead of index share.
- A random gate that delays the same fraction of decisions, which tests whether any delay helps.
Why not just…?
Why not just run PaX post hoc on existing early classifiers? This is the audit half of our proposal, and it is necessary. PaX alone, however, uses discrete positions. It would therefore merge packet index with inter-arrival time, the one signal the IoT results say is genuinely useful. PaX also reports narrowing gains on larger pretrained models, which suggests index and time entangle further at scale. Our decisive check tests whether the three-way share predicts shift better than PaX's two-way share. If it does not, the continuous-time extension is unnecessary and we will say so.
Why not just augment training with random pre-padding and time jitter? This is the most serious threat. The Dynamic Temporal Positional Encodings paper already inserts, drops and jitters packets during training. Such augmentation might remove index reliance outright, making a gate redundant. We therefore run augmentation as a full competitor, alone and combined with gating. If augmentation alone matches the gate on post-shift utility and attack success, the gate's value reduces to diagnosis. In that case the paper's claim narrows to "index share predicts which models need augmentation." That is still useful, but it is smaller, and we will report it as such.
Why not just use gradient-boosted trees on prefix summaries with TreeSHAP? Trees are the empirical winner on PhysioNet 2019. PaX shows, however, that value-only attribution cannot distinguish admission-time artifacts from trajectories. Window summaries also discard order, which SPIN-IDS relies on for 4-packet detection. We include the XGBoost pipeline under the same cross-hospital protocol. If it transfers better than every sequence model, that is itself evidence that ordering-based early decisions are the fragile part.
Decisive Checks
The first check is predictive. Across all backbones, datasets and training settings, we correlate each model's source-domain mean index share at commitment with its post-shift loss. Clinical post-shift loss is the utility drop from hospital A to B. Network post-shift loss is the accuracy or F1 drop from CIC-IDS2017 to 2018 and under pre-padding on CICIoT2023 and CIC-DDoS2019. A rank correlation near zero falsifies the core claim. We also test whether early-decision losses raise the index share relative to plain cross-entropy.
The second check is interventional. Justified stopping should shrink the post-shift gap relative to Classifier-Induced Stopping and augmentation at matched in-domain earliness. We report:
- Pareto-frontier area of accuracy versus earliness.
- Normalized utility.
- Median alert lead time.
- Pre-padding attack success rate.
The third check is face validity on the clinical side. After gating, the features carrying the content share should shift away from $t=0$ demographics toward trajectory variables such as pH and BUN, which PaX found align with clinicians. On the network side, gated commitments should hold up when handshakes are replaced with benign-looking dummy packets.
References
- Interpreting Sepsis Prediction through Positional Explanation
- Dynamic Temporal Positional Encodings for Early Intrusion Detection in IoT
- Adversarial Pre-Padding: Generating Evasive Network Traffic Against Transformer-Based Classifiers
- Early Prediction of Sepsis Using Multi-Feature Fusion Based XGBoost Learning and Bayesian Optimization
- A Policy for Early Sequence Classification
- DeepAISE - An interpretable and recurrent neural survival model for early prediction of sepsis
- Early Prediction of Sepsis from Clinical Data: the PhysioNet/Computing in Cardiology Challenge 2019
- Towards Real-Time Network Intrusion Detection With Image-Based Sequential Packets Representation
- Introducing packet-level analysis in programmable data planes to advance Network Intrusion Detection
- Early Sepsis Prediction Using Ensemble Learning with Features Extracted from LSTM Recurrent Neural Network