Letting the filter measure its own memory: probe-tuned lags for score estimation in nested particle filters

When a model's hidden state is tracked with a particle filter (a cloud of random samples that approximates the belief over the state), the gradient of the log-likelihood with respect to model parameters can be estimated cheaply by looking back only a fixed number of steps $L$. The justification is that noisy dynamics forget their past, so information older than $L$ steps barely matters. In practice $L$ is picked by hand. This matters most in online Bayesian experimental design. There, a nested filter (an outer filter over parameter hypotheses, with an inner filter over states for each hypothesis) uses these gradients to choose the next experiment. The chosen experiments control how informative the observations are, and so they control how fast the system forgets. A lag tuned under random designs can therefore be wrong under the optimized design, and wrong again whenever the design shifts.

We propose to have the filter measure its own forgetting rate while it runs. Alongside the usual gradient recursion, the method runs a cheap "probe": two copies of the derivative recursion that share every particle and random number but start from different initial derivative values. Their gap shrinks at the rate at which the derivative forgets its initial condition. From that measured rate the method sets the lag that balances truncation bias against Monte Carlo variance. The estimator stays linear in the number of particles, needs no hand-tuned lag, and adapts as the design changes observation informativeness.

Core Claim

Bias of Particle Approximations to Optimal Filter Derivative proves an assumption, a bound, and a remaining term. The assumption is strong mixing, meaning the transition density is bounded above and below on a compact space, so the chain forgets its start exponentially fast. The bound says the bias of the particle filter derivative is at most $M(1+\rho^n\|w_0\|)/\sqrt{N}$, where $N$ is the number of particles, $n$ the time index, and $w_0$ the initial derivative. The remaining term, $\rho^n\|w_0\|$, is the part of the error that the dynamics must forget, with $\rho\in(0,1)$ the forgetting rate of the initial derivative. That paper treats $\rho$ as an unknown constant. Our observation is that $\rho$ is directly observable at $O(N)$ cost. Take two tangent recursions driven by the same particle system, one started at $w_0$ and one at $w_0'$. Their difference after $k$ steps estimates $\rho^k\|w_0-w_0'\|$, and fitting a log-linear decay over a short window gives a running estimate $\hat\rho_t$.

The rate $\hat\rho_t$ then sets the lag. Truncating the look-back at $L$ leaves a bias of order $\rho^L$. Uniform Stability of a Particle Approximation of the Optimal Filter Derivative shows that tracking derivatives along particle paths makes variance grow linearly with the length of history tracked. The mean squared error of a lag-$L$ score estimate therefore behaves roughly as

$$\mathrm{MSE}(L) \approx C_1\,\rho^{2L} + C_2\,\frac{L}{N},$$

where $C_1$ and $C_2$ are model-dependent constants. Minimizing over $L$ gives $L^\star \approx \log(N)/(2\log(1/\rho))$, up to a term involving $\log(C_1/C_2)$. We use $L_t = \lceil \log N / (2\log(1/\hat\rho_t)) \rceil$ with a small safety offset, and cap it at a memory budget. Under the strong mixing assumption we aim to prove that the resulting estimator has mean squared error of order $\log N/N$ uniformly in time. The $\log N$ factor comes from the lag growing logarithmically with $N$. The rest of the argument comes from the Tadic–Doucet forgetting bound together with a concentration result for the probe estimate $\hat\rho_t$.

The new object is the tangent-forgetting probe and its use inside a nested filter whose design policy changes the mixing rate. Adaptive lags and fixed lags already exist separately.

Relation to Prior Work

Three papers motivate the gap by showing that existing derivative estimators pay either in cost or in instability. Uniform Stability of a Particle Approximation of the Optimal Filter Derivative proves time-uniform stability, but only with an $O(N^2)$ backward kernel. It also shows that the $O(N)$ path-space alternative has variance growing linearly over 20,000 steps of a stochastic volatility model. The two Tadic–Doucet records (record 1, record 2) supply the geometric-forgetting form our probe exploits. They are purely theoretical and contain no algorithm that uses $\rho$. Stability of Optimal Filter Higher-Order Derivatives extends the forgetting argument to Hessians, which suggests the same probe could later set lags for second-order methods.

Two lines of work supply method and constrain the design. The first line uses fixed-lag gradients and Hessians inside Metropolis–Hastings proposals (Second-order Particle MCMC for Bayesian Parameter Inference, Particle Metropolis-Hastings using gradient and Hessian information); we reuse this estimator and replace its hand-chosen $L$. The second line is Particle-Based Adaptive-Lag Online Marginal Smoothing in General State-Space Models. It adapts the lag by tracking the empirical variance of per-state statistics, but only for state smoothing, and it pays per-state bookkeeping. Our criterion targets the bias side directly, through a forgetting rate, rather than the variance side, and it applies to the score. Recursive Learning of Asymptotic Variational Objectives tracks tangent filters in $O(N)$ with AdaSmooth and explicitly leaves the bias of that approximation unanalyzed. Our probe gives a way to measure that bias empirically.

The application regime is nested filtering for design. Online Bayesian Experimental Design for Partially Observed Dynamical Systems (BAD-PODS) runs outer parameter particles and inner state filters, perturbing ("jittering") the parameters each step and computing gradients of the expected information gain through Fisher's identity. It gives no forgetting-rate or variance analysis for the inner score. Recursive Nested Filtering for Efficient Amortized Bayesian Experimental Design (IO-NPF) and Nesting Particle Filters for Experimental Design in Dynamical Systems (IO-SMC²) use full backward passes and MCMC rejuvenation respectively, which trade cost for accuracy. We do not change their outer structure. We change how the inner score is truncated.

On the forgetting theory itself, the contraction and coupling results of Del Moral et al. ( Stability of Feynman–Kac formulae with path-dependent potentials) and Douc et al. ( Forgetting of the initial condition for the filter in general state-space hidden Markov chain: a coupling approach) show that weakly informative observations push contraction factors toward 1. This is exactly the mechanism by which a design policy changes the needed lag. Our probe is a synchronous coupling (two runs sharing all randomness), turned from a proof device into a runtime estimator.

One constraint must be stated plainly. Every guarantee here, like those it builds on, uses compact state spaces. Our non-compact experiments are empirical tests, not covered by the theory.

Research Program

The first component is the estimator. We implement the lag-$L$ score, with lag set by the probe, in a flat particle filter and inside the BAD-PODS inner filters. The probe runs on a small subset of outer particles, namely the few with highest weight, and is refreshed every few steps, so overhead stays under a fixed fraction of filter cost. Because $\rho$ depends on the parameter and the current design, we report both a per-particle variant and a shared variant.

The second component is the theory. Under the Tadic–Doucet assumptions we bound the probe's estimation error and derive the time-uniform $\log N/N$ bound for the probe-tuned estimator. We also characterize what happens when $\hat\rho_t$ underestimates $\rho$: the lag becomes too short and bias appears, and we check whether the safety offset makes this failure mode graceful.

The third component is an interaction study with jittering. Parameter jittering in BAD-PODS and IO-NPF acts as an artificial forgetting of old data at the outer level. We measure whether the inner lag chosen by the probe should also be bounded by the effective memory that the jitter scale implies. This part is exploratory, and we will report it as such.

Baselines

The naive reference point is path-space derivative tracking in $O(N)$ with no truncation. It is what one gets by default, and Uniform Stability of a Particle Approximation of the Optimal Filter Derivative reports only qualitatively that its variance increases linearly. No reported numeric error was found on Lacuna for this baseline.

The strongest practical competitor is fixed-lag score estimation with $L$ grid-searched in hindsight on each task, as in the particle Metropolis–Hastings gradient papers. We give it an oracle advantage: the best $L$ is chosen on held-out runs using ground truth where available. Beating it means matching its time-averaged error in stationary settings and strictly improving on it when the design or regime changes.

The accuracy ceiling is the $O(N^2)$ backward-kernel estimator of Del Moral, Doucet and Singh, and inside nested filters the full backward sampling of IO-NPF. These are run at equal wall-clock budget, which means fewer particles for them. Beating them means lower error per second, not lower error per particle.

The adaptive competitor is the variance-stopping rule of Particle-Based Adaptive-Lag Online Marginal Smoothing in General State-Space Models, transplanted to the score with the same tolerance-tuning budget as our safety offset.

For the design tasks, BAD-PODS as published is the system-level baseline. The file reports it as 2.5x faster than a static baseline on the two-group SIR model at $T=150$, using 10GB versus 25GB of GPU memory, in Online Bayesian Experimental Design for Partially Observed Dynamical Systems. For information gain on the pendulum, the reported reference is IO-SMC²'s EIG of 3.72 versus iDAD's 3.01, from Nesting Particle Filters for Experimental Design in Dynamical Systems. We aim to match that information gain at IO-NPF-like cost.

Two ablations isolate the key ingredient. The first replaces the tangent probe with a probe on the state filter (coupled state filters rather than coupled derivatives), which tests whether derivative-specific forgetting matters. The second freezes $\hat\rho$ at its value from an initial burn-in, which tests whether tracking changes in the forgetting rate over time matters.

Why not just…?

Why not just tune a fixed lag by grid search? In stationary models with fixed designs this is a real threat, and we expect near-parity there. We will report that result honestly rather than hide it. The argument for the probe is that in design problems the policy changes observation informativeness, and with it the contraction rate. The decisive linear-Gaussian experiment below tracks the exact optimal lag over time and asks whether any single fixed $L$ stays within a factor of the optimal mean squared error throughout. If a fixed $L$ does, the contribution shrinks to the theory, and we will say so.

Why not just use the adaptive-lag variance rule? That rule stops looking back when a statistic's variance is small. Variance falling below a tolerance is not the same as bias being negligible: a truncated statistic can be low-variance and still biased. The rule also needs per-state bookkeeping. Head-to-head comparison at matched memory, on stochastic volatility periods where volatility spikes and the Adaptive-Lag Smoother paper reports that fixed lags incur the most bias, will show which criterion tracks the true error.

Why not just pay for the $O(N^2)$ backward kernel or full backward sampling? It is stable, but inside a nested filter the quadratic cost multiplies across every outer particle. BAD-PODS already lists outer-times-inner cost as its bottleneck. The equal-wall-clock comparison settles whether the extra accuracy per particle survives the particle reduction.

Why not just shrink the jitter instead of touching the inner score? Jitter controls outer-level bias, while the lag controls inner-level bias. They are different error sources, and the interaction study measures them separately. We do not claim the probe fixes jitter-induced asymptotic bias.

Proposed Experiments

The decisive check uses a linear-Gaussian state-space model in which the "design" sets the observation gain. This gives exact Kalman scores and an exact, design-dependent forgetting rate. We switch among designs on a schedule and also under a learned policy. We then measure three things: how closely $\hat\rho_t$ tracks the true rate, how the probe-chosen $L_t$ compares with the exact optimal lag, and the score mean squared error against all baselines across particle counts spanning an order of magnitude, testing the predicted $\log N/N$ scaling.

Next is the stochastic volatility model over 20,000 steps, following Del Moral, Doucet and Singh. We run recursive maximum likelihood with each score estimator and report parameter error trajectories and the stability of variance over time. The same study is repeated on the Poisson autoregressive polio counts, with the semiGA-PIS setup from Parameter estimation in state space models using particle importance sampling as an additional baseline. That paper reports vanilla online gradient ascent failing in 16 of 20 runs on its degenerating-trend model, and we report failure counts on that model with the same protocol.

For design, we plug the probe-tuned inner score into BAD-PODS on the two-group SIR and moving-source tasks, and into IO-NPF on the stochastic pendulum. The metrics are realized information gain, sensor pointing error, wall-clock time, and GPU memory. Success means information gain at least equal to full backward sampling at close to jittered-filter cost, and a visible lengthening of the lag exactly when the policy selects less informative experiments.

A negative outcome would also be informative. Suppose the probe's estimated rate is too noisy at practical $N$ to beat a hindsight-tuned lag, even in the switching-design model. That would indicate that forgetting rates can be exploited in proofs but not measured cheaply at runtime, which would redirect effort toward the backward-kernel route.