Rank-Matched Online Adapters for Neural Kalman Filters

A Kalman filter tracks a hidden state, such as a robot's position, by blending a motion model with noisy sensor readings. The blend depends on how noisy the sensors are believed to be. When sensor quality changes mid-run, for example when one GPS axis degrades or two sensors start picking up correlated interference, a filter tuned in the lab trusts bad data and drifts. Neural Kalman filters, such as KalmanNet, replace the hand-derived blending weight (the "Kalman gain") with a small network. They handle imperfect motion models well, but they are trained for one noise level and are brittle when it shifts.

We propose to adapt such a filter online by attaching a low-rank adapter to its gain network. A low-rank adapter (LoRA) is a small trainable correction, the product of two thin matrices, added to frozen weights. The adapter is trained at every step on the filter's own one-step-ahead prediction errors, so it needs no ground-truth states and no oracle noise level. The idea rests on a simple fact. When the measurement noise covariance changes by a rank-$k$ perturbation, the ideal gain changes by a matrix of rank at most $k$. The adapter's rank is therefore not a hyperparameter to guess. It should match the number of independent directions in which sensor noise changed, and we can test that prediction directly.

Core Claim

Under structured, multivariate noise drift, online LoRA on a frozen neural gain network, trained with a cheap self-supervised prediction loss, should do three things. It should approach the accuracy of a filter that knows the true noise at least as fast as full-network online adaptation. It should avoid that approach's long-horizon drift. It should beat per-channel scale-and-shift modulation whenever the shift rotates or correlates noise directions rather than simply rescaling them. The accuracy-versus-rank curve should bend at the rank of the true covariance change.

The claim is deliberately narrower than "LoRA for adaptive filtering." We expect that for scalar, isotropic noise changes a simpler method will do just as well, and the experiments are built to show where that boundary lies.

Why the Rank Should Be Small

For a linear measurement model, the gain is

$$K = P H^\top (H P H^\top + R)^{-1},$$

where $P$ is the prior state covariance, $H$ maps state to measurement, and $R$ is the measurement noise covariance. Suppose the noise changes to $R' = R + U D U^\top$, where $U$ is an $m \times k$ matrix of changed noise directions and $D$ is $k \times k$. Let $S = HPH^\top + R$ denote the innovation covariance, the expected spread of the gap between predicted and actual measurements. The Woodbury identity then gives

$$K' - K = -P H^\top S^{-1} U (D^{-1} + U^\top S^{-1} U)^{-1} U^\top S^{-1},$$

which has rank at most $k$ for a fixed $P$.

Two caveats apply. The prior covariance $P$ itself re-equilibrates after the shift, so the steady-state gain change is only approximately rank-$k$. KalmanNet's gain is also produced by a nonlinear network, not by this formula. We therefore treat the bound as a hypothesis about where adapters should sit (the gain-producing output layers) and what rank they need, and we test it empirically rather than assume it.

Research Program

The base model is a KalmanNet-style gain network pretrained on stationary noise, as in Adaptive KalmanNet. That work freezes a 330k-parameter gain network and modulates it with a 6k-parameter hypernetwork. The hypernetwork outputs per-channel gains and shifts, but it is driven by an externally supplied noise ratio, and the authors name online estimation of that ratio as future work. We keep the frozen base and the parameter efficiency. We replace oracle-driven affine modulation with low-rank directional corrections that are learned online.

The adapters, $\Delta W = BA$ with $B$ zero-initialized so the pretrained filter is unchanged at step zero, sit in the gain network's output layers. A variant places them in all layers. At each timestep the filter predicts the next measurement from its current state estimate. The adapter takes a few gradient steps on the squared prediction error over a short sliding window, plus a weak penalty pulling $BA$ toward zero so the correction decays when noise returns to nominal.

This loss choice is deliberate. For linear systems, the filter that minimizes one-step prediction-error variance is the Kalman filter, so this loss identifies the right gain without state labels. It is also far cheaper than the entropic optimal-transport alignment in Differentiable Adaptive Kalman Filtering via Optimal Transport. That method (OTAKNet) updates full filter weights online by matching predicted-state and innovation distributions through iterative transport solves, and it reports initialization instability that requires learning-rate warm-up when the residual buffer is small. Zero-initialized low-rank updates may remove that instability by construction, which we will test directly.

Our proposal also relates to work that runs the Kalman machinery in the opposite direction. LO-FI and KOALA++ use Kalman updates with low-rank covariance structure to train network weights, but they hold the filter's own noise constants fixed. Kalman Filter for Online Classification of Non-Stationary Data tracks only a readout layer with a learned forgetting factor. These papers motivate treating adapter weights as quantities that drift, but they supply no mechanism for sensor-noise adaptation.

Two further papers constrain our design. LoRA-EnVar shows that rank-2 adapters on a weather-assimilation model stayed stable over 30 days while full fine-tuning forgot, though it adapts in 6-hour batches inside a variational solver rather than recursively. Online-LoRA shows that streaming LoRA needs some regularization or reset to avoid drift, which motivates our decay penalty. Its loss-plateau heuristic is one alternative reset rule we will compare against.

Baselines

The naive reference is the frozen pretrained KalmanNet with no adaptation. The model-based reference is an extended Kalman filter given the true time-varying covariances. We report the gap between the two as the headroom any method can recover, and we measure every method by the fraction of that gap it closes.

The strongest existing method is OTAKNet. It is the only prior work that adapts a neural Kalman filter online from innovations without labels. On the Lorenz benchmark it reportedly approaches the true-covariance EKF within "about 25 timesteps" after a sudden noise shift, and it outperforms VBAKF, SWVAKF, KalmanNet, AKNet and MAML-KalmanNet. We found no reported MSE value on Lacuna for OTAKNet on Lorenz or NCLT, so we will reimplement it on the same pretrained base, window length, and per-step compute budget, with its warm-up schedule tuned on the same grid we use for our own learning rate. Beating it means lower time-averaged MSE after the shift, recovery faster than its roughly 25 steps, and no warm-up schedule.

The second strong competitor is AKNet driven by an online-estimated noise ratio. Here a Sage-Husa-style innovation estimator (as in Ye et al.) replaces the oracle input. This is the most obvious fix for AKNet's stated limitation. It gets the same pretraining data across noise regimes.

A classical baseline is Sage-Husa covariance matching inside an EKF that uses the nominal model. In the supervisory calibration study, Supervisory Measurement-Guided Noise Covariance Estimation, innovation-based estimation reached test MSE 0.33 against 0.21 for bilevel analytical gradients. That shows innovation methods are competitive but beatable.

Three ablations isolate the key ingredient. The first uses the same online loss to train only per-channel gains and shifts, isolating low-rank directional change from rescaling. The second fine-tunes the full network online with the same loss, isolating the low-rank constraint itself. The third fixes the adapter rank at 1, 2, 4 and 8 across shifts of known rank.

Why not just…?

Why not just estimate the noise ratio with Sage-Husa and feed it to AKNet? This is a real threat. For shifts that are a single global rescaling of noise, which is exactly the regime AKNet was built for, we expect it to match us. It cannot represent a change in which one sensor channel degrades or two channels become correlated, because its input is one scalar and its output rescales channels. The shift-structure experiment below settles the question. If AKNet with an estimated ratio matches LoRA on rank-1 and rank-2 correlated shifts too, our directional argument fails.

Why not just run a classical adaptive EKF that estimates the full $R_t$ directly? When the motion model is known and linear, this should win, and we will say so. The case for a neural gain arises only under model mismatch, where KalmanNet-style filters beat model-based ones. We therefore report results separately on the matched linear benchmark and on the mismatched Lorenz and NCLT settings. We will also include an EKF with an online low-rank correction to $R$, fitted by the same prediction loss. It is the honest model-based twin of our method.

Why not just fine-tune the whole network online, as OTAKNet does? Full updates carry 330k free parameters chasing a noise change that may have only a few degrees of freedom. LoRA-EnVar and Online-LoRA both report drift or forgetting under long streaming full updates. We test this with long alternating-regime streams that return to nominal noise, where forgetting shows up as degraded nominal accuracy.

Why not just adapt only the last layer? That is close to our output-layer placement, and the rank bound suggests it may suffice. We run output-only against all-layer adapters. If output-only wins everywhere, that is a useful simplification rather than a failure.

Proposed Experiments

We use three benchmarks: the 10×10 linear state-space benchmark from AKNet, the Lorenz attractor with model mismatch from OTAKNet, and the NCLT robot dataset fusing IMU, wheel odometry and GPS, also from OTAKNet. On each we inject three families of measurement-noise shifts: a global isotropic rescaling, a variance jump on a single channel (rank 1), and a newly correlated noise component across channel pairs (ranks 1 to 4). On NCLT these are added on top of the dataset's natural drift. Metrics are post-shift time-averaged MSE, timesteps to reach within 10% of the true-covariance EKF, nominal MSE after the noise returns, per-step wall-clock time, and trainable parameter count.

Three checks decide the proposal. The first is the rank sweep. If accuracy saturates at adapter rank near the shift rank $k$ on the linear benchmark, and approximately on Lorenz, the Woodbury argument is supported as a practical rule for choosing rank. If the elbow is unrelated to $k$, the argument is wrong. The second is the structure split. LoRA must beat online-learned gain-and-shift modulation, and AKNet with an estimated ratio, on correlated and single-channel shifts while tying them on isotropic shifts; if it does not beat them there, the directional claim fails. The third is the stability comparison against OTAKNet. We require equal or faster recovery without warm-up, and nominal accuracy after a return to baseline noise that full-network adaptation cannot match. If OTAKNet restricted to LoRA parameters matches our cheaper prediction loss, we will report that the adapter, not the loss, is the contribution.