Streaming Severity Grading from Cached Forward States

Most diagnostic models answer a yes/no question: is something wrong? The question that decides what to do next is harder: what kind of fault is it, and how bad? In battery monitoring, severity grading is much harder than detection. On the CH-BatteryGen electric-vehicle benchmark, classical models that detect faults well fall to 0.50–0.60 F1 when asked to grade severity, because a mild fault looks like sensor noise (Battery Fault). The models that grade well see the whole signal at once. They read the sequence in both directions, so the evidence that a fault is worsening, which often appears after the moment being judged, can inform the judgment. That works offline. It does not fit a battery management unit or charging-station controller that sees voltage as a live stream and has little memory.

This note proposes one sequence model that serves both needs. Its forward-in-time half runs continuously as a cheap fault detector, and each internal state it produces is kept in a small on-device memory. A separate grading step runs only when the detector raises a flag. When that happens, the device reads a short stretch of future signal backwards and combines it with the stored forward state to assign fault type and severity. The detector's own risk score also decides which stored states are worth keeping. The claim is that grading delay then scales with the short lookahead window rather than the full history, while grading accuracy matches full-sequence offline models. The detector's score can also act as a predictive cache policy, keeping what grading will need and beating recency-based eviction under tight memory budgets.

Core Claim

A bidirectional sequence model processes a signal in two passes, one running forward in time and one running backward, and combines their states at each step. We use a linear bidirectional recurrence of the kind introduced in BLUR, which can be computed in time linear in sequence length using parallel scans and which fuses the two directions with a gating layer (Bidirectional Linear Recurrent Models for Sequence-Level Multisource Fusion). Because the forward recurrence is linear and causal, its state $f_t$ at time $t$ can be updated one sample at a time as data arrives. The grading representation is

$$h_t^{(d)} = \big[\, f_t \,\|\, b_t^{(d)} \,\big],$$

where $f_t$ is the cached forward state, $b_t^{(d)}$ is a backward state computed by scanning from $x_{t+d}$ back to $x_t$ over a lookahead of $d$ samples, and $\|$ denotes concatenation. The cost of grading at time $t$ is therefore $O(d)$ rather than $O(t)$, as long as $f_t$ is still in memory when grading is requested.

The design is multi-task in a specific, asymmetric way, and this is what the proposal adds. A detection head reads only $f_t$ and must work causally. A fault-type head and an ordinal severity head read $h_t^{(d)}$. The forward trunk is shared and must serve two masters: it has to be a good streaming detector, and it has to be a good summary of the past for the grader. That is exactly the setting where one task's gradients can damage the other's ("negative transfer"). RotoGrad attributes this to mismatched gradient sizes and conflicting gradient directions, and fixes both with magnitude rescaling and learned per-task rotations of the shared representation (RotoGrad). The detection score also has a second job. Under a fixed memory budget, it ranks which forward states to retain, so memory is spent on windows likely to need grading. This is proactive caching in the sense of PerCache, which precomputes attention tensors for likely future queries during idle time (PerCache). Here, though, the thing being cached is a recurrent diagnostic state, and the predictor of future demand is a head of the same network.

Relation to Prior Work

Three groups of papers motivate the gap. Fine-grained diagnosis papers show that grading is harder than detection and degrades out of domain. The CH-BatteryGen benchmark gets its best grading result from a 2D CNN on voltage rendered as images, an offline, whole-segment method (Battery Fault). Neonatal pulmonary hypertension severity F1 drops from 0.84 in cross-validation to 0.63 on held-out data (Deep Learning Based Prediction of Pulmonary Hypertension in Newborns). None of these asks when the grade becomes available.

Bidirectional sequence papers show that reading backward helps at state boundaries. Examples are mouse sleep staging, where REM is defined partly by how it ends (Evaluating the Influence of Temporal Context on Automatic Mouse Sleep Staging), battery capacity rebounds (CNN-BiLSTM-AM), and outbreak inflection points (FIGI-Net). The sleep-staging study also constrains the design. Gains plateau after roughly 30–44 seconds of context, and longer windows hurt. This is why we expect a short, bounded lookahead $d$ to suffice, and why we make $d$ adaptive rather than large.

Clinical multi-task sequence models supply the multi-task side but not the streaming split. EHRMamba trains one causal state-space model on six outcomes with task prompts (EHRMamba). BiteNet uses bidirectional attention masks but predicts its outcomes in separate pipelines (BiteNet). Neither splits its heads by what time horizon they are allowed to see.

On the caching side, PerCache and ACC (Adaptive Contextual Caching) reuse intermediate tensors or retrieved context for language-model serving. Both use a separate predictor, a query synthesizer or a reinforcement-learning agent. PerCache also notes that its prediction stride is fixed. Our cache predictor is free because it is the detection head, and our lookahead is chosen per event.

One paper points the other way. CMCNet reports that plain multi-head multi-task baselines lose to embedding alignment on fine-grained thyroid features (CMCNet). We take that seriously. It is why gradient homogenization is a tested component here rather than an assumption, and why we include a two-model baseline.

Research Program

We would build the model on a BLUR-style diagonal linear recurrence and run it in two modes. In training mode, full forward and backward scans run in parallel, with the backward scan randomly truncated to lookaheads $d$ drawn from a range. This teaches the grading heads to work from partial future context. In deployment mode, only the forward scan runs continuously. The severity head is ordinal (mild < moderate < severe) and has an abstain option in the spirit of DeepTag's deferral mechanism (DeepTag). At each flagged time, the device first grades with a small $d$. It extends $d$ only if the grader abstains. This replaces a fixed prediction horizon with one set by how confident the grader is.

The retention policy keeps the forward states whose detection risk, discounted by age, is highest, subject to a byte budget. Training combines detection, type, and severity losses under RotoGrad, with the rotation restricted to a subspace as RotoGrad recommends for large hidden sizes.

The main analysis is a curve of grading macro-F1 against grading delay (samples after fault onset) and against device memory. Every method is placed on the same axes.

Baselines

The naive reference point is a reactive system. It stores raw voltage under least-recently-used eviction and runs a full offline model after each segment ends, recomputing everything from scratch. This sets the delay and compute ceiling that any streaming design must improve on.

The strongest existing method is BatteryMultiModalCNN, which converts voltage series into grayscale images and classifies them with a ResNet50. It reports fault classification F1 of 0.9280 and severity grading F1 of 0.8813 on LFP discharging data (Battery Fault). It is the strongest competitor because it is the published best on exactly this grading task. We will retrain it on our splits with the same training data and a matched hyperparameter search budget. Our model at full lookahead must reach at least its grading F1, within the variance across seeds. Beating it means equal grading F1 at a fraction of its delay, or higher F1 at equal delay. The classical random forest and SVM results (0.50–0.60 grading F1) are a floor, not a target.

Three ablations isolate each ingredient. The first replaces the backward scan with a causal model whose output is delayed by $d$. This gives it exactly the same information, so it tests whether bidirectionality adds anything beyond waiting. The second trains separate detector and grader networks, which tests the shared trunk. The third drops RotoGrad for fixed loss weights tuned on validation, which tests gradient homogenization. On the caching side, detector-guided retention is compared against least-recently-used and first-in-first-out eviction at identical byte budgets, and adaptive $d$ against the best single fixed $d$.

Why not just…?

Why not just run the image CNN on each finished segment? It needs the whole segment before it can say anything, and it recomputes from raw data each time. If faults can be graded reliably only after a full segment anyway, our delay advantage disappears. The delay–F1 curve settles this directly. If grading F1 saturates only at full segment length, we will report that streaming grading offers no benefit on this benchmark.

Why not just use a causal model with its decision delayed by the lookahead? This is the most serious threat. A causal model that answers about time $t$ at time $t+d$ has seen the same data as our backward scan. Any advantage of bidirectionality is then only a matter of how the model is structured, and published evidence does not isolate this. The sleep-staging and battery comparisons are against non-matched baselines, and BiteNet's margin over a bidirectional RNN is 0.3357 versus 0.3270 PR-AUC. If the delayed-causal ablation matches us, we will say so. The contribution then narrows to cached shared states, detector-guided retention, and adaptive delay, all of which still apply to a purely causal trunk.

Why not just train a separate detector and grader? Separate models cost two forward passes and two sets of stored states. They also avoid negative transfer by construction, which CMCNet's results suggest may matter. The two-model baseline at matched total parameters tells us whether sharing helps accuracy, or only saves memory while costing some.

Why not just use the detector's confidence as a severity score? On this benchmark, mild faults and noise overlap, which is why grading F1 collapses for confidence-style classical methods (Battery Fault). We include thresholded detector probability as an ordinal predictor to confirm this on our splits.

Proposed Experiments

All experiments use CH-BatteryGen: 1,000 simulated electric vehicles with normal, self-discharge, high-resistance, and low-capacity labels, and three severity levels on the LFP subset. We concatenate each vehicle's segments into continuous streams to simulate live monitoring. This is our construction, and the dataset's currents are partly generated and physically simulated, so conclusions about real vehicles are provisional.

Five checks decide the proposal. First, at full lookahead, our model's grading F1 must reach the retrained CNN's level (reported 0.8813). Second, we measure the lookahead needed to reach 95% of full-context grading F1, compared across our model, the delayed-causal ablation, and the CNN on truncated windows. Third, we compare the fraction of grading requests whose forward state is still in memory, under detector-guided versus recency-based retention, across memory budgets. Fourth, we check whether adding the grading heads lowers detection F1 relative to a detector-only model, and whether RotoGrad removes that drop. Fifth, we train on charging data and test on discharging data, where the benchmark reports roughly a 20% drop, to test whether the shared trunk makes the drop worse or better.

We also report compute per grade and peak memory on a Raspberry-Pi-class device, since the whole argument concerns constrained hardware. No reported result was found on Lacuna for streaming or delay-constrained grading on CH-BatteryGen, so all delay numbers will be new measurements.