Deadline-Safe On-Device Learning with Fixed-Cost Closed-Form Updates

Most edge devices can run a neural network but cannot train one. Their chips are built for the forward pass, so models are trained offline on servers and frozen before deployment. When the world drifts away from the training data, there are two usual fixes, and both conflict with real-time operation. The first is to send data to a server for adaptation, which adds network delay and fails outright when the link drops. The second is to run backpropagation on the device. Backpropagation (computing weight gradients by passing errors backward through the network) is slow and memory-hungry on this hardware, and its cost per step varies, so occasional updates produce latency spikes that blow through hard deadlines. A hard deadline is a time limit after which an answer is useless, such as a per-frame budget for a robot's perception loop.

We propose replacing the gradient step with an update whose cost is known in advance. The backbone stays frozen. Its multi-scale features pass through a fixed random expansion, and an output layer on top is learned by recursive least squares: an exact, closed-form ridge-regression update that absorbs one labeled sample at a time. Each such update costs a fixed number of multiply-adds, regardless of the data. That makes it possible to schedule learning the way a real-time system schedules any other task. Each frame, the device computes its leftover time before the deadline and admits exactly as many updates as fit. The question this note sets out to answer is whether this kind of adaptation, which cannot miss a deadline by construction, can match the accuracy of sparse backpropagation and server-assisted tuning once those methods are held to the same hard deadlines.

Core Claim

The obstacle to on-device learning under hard deadlines is not only the average cost of training. It is that training cost cannot be bounded and cannot be split into small pieces. Closed-form recursive updates can be both. Our claim is that a deadline-aware admission scheduler over rank-one least-squares updates achieves zero deadline misses with accuracy comparable to sparse test-time backpropagation, specifically SNAP, on streaming continual-learning benchmarks.

Two existing lines of work come close from opposite sides. TS-ACL supplies the method. It freezes a 1D convolutional encoder, expands multi-scale features through a random hidden layer, and solves the classifier by recursive ridge regression, reaching 93.56% on UWave. It never treats update cost as a timing quantity, never schedules updates against a deadline, and solves its inverse in a form that scales cubically with feature dimension. Deadline-driven edge systems such as Dynamic Compression Ratio Selection and Edge Learning with Timeliness Constraints motivate the problem. They model hard deadlines and queues carefully, but the model itself either sits frozen on a server or is trained through federated rounds over a network. No work in the file combines learning whose cost is bounded in the worst case with deadline-aware admission on the device itself.

Research Program

The learner keeps two quantities. The first is the inverse feature-correlation matrix $P_t \in \mathbb{R}^{d\times d}$, where $d$ is the expanded feature width. The second is an output weight matrix $W_t \in \mathbb{R}^{d\times C}$, where $C$ is the number of classes. When a labeled sample with expanded features $\phi_t$ and one-hot label $y_t$ arrives, the update is

$$P_t = \tfrac{1}{\lambda}\Big(P_{t-1} - \frac{P_{t-1}\phi_t\phi_t^\top P_{t-1}}{\lambda+\phi_t^\top P_{t-1}\phi_t}\Big),\qquad W_t = W_{t-1} + P_t\phi_t\,(y_t - W_{t-1}^\top\phi_t)^\top ,$$

where $\lambda \in (0,1]$ is a forgetting factor; $\lambda = 1$ recovers the cumulative solution TS-ACL relies on. The update costs about $2d^2 + 2dC$ multiply-adds and touches only $P$, $W$ and $\phi_t$. It needs no stored activations, no backward pass and no matrix inversion. This rank-one form also removes the cubic inversion cost that TS-ACL lists as a limitation.

Because the cost is fixed, we measure the worst-case execution time $c$ of one update offline on each target device. At run time, each frame has a deadline $D$ and an inference time $\tau$. The scheduler admits $\lfloor (D-\tau-\epsilon)/c \rfloor$ pending updates from a bounded queue, where $\epsilon$ is a safety margin. When the queue is full, it drops the oldest pending samples or subsamples by class. Labels may arrive late, as with session-level labels in continual learning or deferred confirmations in a deployed system; the queue absorbs that delay.

We will study three design questions. The first is how large $d$ must be before accuracy saturates, since memory for $P$ grows as $d^2$. That growth confines full-precision storage of $P$ to embedded-CPU-class devices such as the Raspberry Pi 4, Jetson Nano and the PULP cluster, and limits microcontrollers to roughly $d \le 256$. The second is whether the recursion stays numerically stable in reduced precision. We compare a plain FP32 recursion with a square-root (Cholesky-factor) form, which keeps the matrix positive definite. The third is whether forgetting ($\lambda<1$) helps under drift without damaging retention. Gated KalmaNet supports trying this: it shows that test-time ridge regression with fading memory works as a network layer, though it targets architecture design rather than deployment adaptation.

For unlabeled test-time shift, labels come from confident predictions. Samples are filtered for representativeness in the way SNAP's exemplar memory selects them. We treat this regime as secondary, because entropy-based confidence is known to fail under severe shift; On-demand Test-time Adaptation relies on that same signal to decide when to adapt.

Baselines

The naive reference is the frozen, offline-trained model running inference only. On CORe50 the file reports a static model at about 69% and a cumulative upper bound near 75%, both from CORe50. On CIFAR-10-C, the non-adapted base model in TinyTTA scores 60.2%. Every adaptive method must beat these numbers without missing deadlines, or it has no reason to exist.

The strongest on-device competitor is SNAP. SNAP runs backpropagation on 1% of the stream and uses normalization from stored statistics in between. It cuts CoTTA's latency by 93.12% on a Raspberry Pi 4 and keeps CIFAR-10-C accuracy at about 77–81%, against 80.4% for full adaptation. It is the strongest competitor because it already minimizes average adaptation cost; its remaining weakness is the latency spike on update frames. We will run SNAP on the same hardware, with the same backbone, data stream and per-frame deadline. We will tune its update rate and learning rate with the same search budget as our $d$ and $\lambda$. It gets two execution modes: updates run when triggered, and updates deferred to slack windows. Beating SNAP means zero deadline misses at accuracy within 1 point of SNAP's at matched utilization, or higher accuracy wherever SNAP's miss rate is nonzero.

For continual learning on CORe50 NICv2-391, the reference is Memory-Latency-Accuracy Trade-Offs on a RISC-V Extreme-Edge Node. With latent replay on MobileNetV1 it reports 77.3% for full retraining (5 hours), 72.5% for retraining from conv5_4 (1.5 hours, 70 MB) and 58% for last-layer retraining (867 ms). Beating this reference means exceeding 58% at a per-update cost compatible with frame-level deadlines, and closing as much of the gap to 72.5% as possible.

On the time-series benchmarks we reproduce TS-ACL with batch-solved updates (93.56% on UWave, 1.22% forgetting on DSA). The aim is to confirm that the rank-one, deadline-scheduled version loses no accuracy against it.

For the server path, we run a MobiLLM-style split. MobiLLM streams quantized activations to a server that trains a side network. We pair it with the queue model from Dynamic Compression Ratio Selection, which reports a 97.5% deadline success rate on MNIST. Both run over channel traces with fading and outages. Beating them means higher task success once outages are included.

The ablations isolate the key ingredient. One keeps the same features and expansion but replaces the recursion with single-pass SGD on the output layer. A second removes the random expansion. A third removes the scheduler and applies updates as they arrive.

Why not just…?

Why not just run SNAP and defer its rare backpropagation steps to idle time? This is the most serious threat. If the system regularly has long idle windows, deferred backpropagation could match our accuracy while also updating the representation. The weakness is that one backward pass is an indivisible job, many times longer than a frame's leftover time. Under high utilization no idle window is long enough, so the updates starve. We will sweep utilization from 30% to 95% of the frame budget and report where deferred SNAP stops adapting. If it keeps pace across the realistic range, our contribution shrinks to the low-utilization corner, and we will say so.

Why not just retrain the last layer with SGD, which is even cheaper per sample? Its cost is also fixed, at about $dC$ per sample against our $d^2$, so deadline safety alone does not separate the two. What separates them is accuracy. Ravaglia et al. show that last-layer retraining falls to 58% on CORe50, and the large gap TS-ACL reports over a gradient-based prior method suggests exact cumulative solutions on expanded features do better. Neither result is a matched comparison, however, so the SGD-head ablation on identical features settles the question. If SGD matches recursive least squares, the expansion carries the benefit, not the closed form.

Why not just offload adaptation to a server over a fast link? With a strong channel this works, and MobiLLM shows server-side tuning fits within device memory. Its failure mode is a dependence on the link. Fine-tuning stalls when the connection degrades, and the queue analysis in Edge Learning with Timeliness Constraints shows completion rates collapsing under congestion. The channel-trace experiment measures directly how often outages occur before offloading loses.

Proposed Experiments

We will run streaming evaluations at fixed frame rates with per-frame hard deadlines on a Raspberry Pi 4, a Jetson Nano and, where $d$ allows, an STM32H747. The benchmarks are CORe50 NICv2-391 for labeled continual learning; UWave, DSA and WISDM for sensor streams; and CIFAR-10-C with pseudo-labels for unlabeled shift. Metrics are accuracy over the stream, deadline-miss rate, maximum and 99.9th-percentile per-frame latency, energy per frame and memory used.

The first decisive check is the accuracy–utilization curve against SNAP, run immediately and run deferred. Our method should show exactly zero misses at every utilization level. The claim stands only if its accuracy curve stays near SNAP's where SNAP misses no deadlines, and above it where SNAP does.

The second check is the representation ceiling on CORe50. If accuracy stays near the 58% last-layer figure even with multi-scale expansion, frozen features are the binding limit. We would then narrow the claim to sensor streams, where TS-ACL's results suggest frozen encoders are sufficient.

The third check is a precision study comparing the plain and square-root recursions in FP32 and FP16. It establishes whether this approach can reach microcontrollers at all.