A reservoir computer, or echo state network, is a recurrent network whose internal weights are random and never trained. Only a linear readout on top of it is fitted, in closed form. Everything the reservoir can represent is set by a handful of global knobs. The spectral radius scales how long the network remembers. The leaking rate sets how fast each unit responds. The input scaling sets how nonlinear the response is. These knobs are tuned once, offline, on a fixed validation set, and some tuning runs take up to 20 hours per dataset. When the incoming signal drifts, its timescale lengthens, or the task moves from needing memory to needing nonlinearity, the knobs stay frozen. The readout then has to compensate for features that no longer fit the data.
We propose to treat the best knob setting as a moving target and to track it online with prediction-correction methods from time-varying optimization. These methods anticipate where an optimum is heading, not only where it was. What makes this practical is that the decision variable has only about three dimensions. Two things become cheap in that setting. The exact gradient of the forecasting loss with respect to the knobs can be computed alongside the running reservoir with a few extra state vectors. The expensive second-order (Newton) prediction step, normally ruled out by Hessian inversion, reduces to solving a 3×3 system.
Core Claim
For a deployed leaky echo state network with nonlinear recurrences, the hyperparameters $\theta_t = (\rho_t, \alpha_t, \sigma_{\text{in},t})$ can be updated at every step with the following loop:
- Run forward-mode sensitivity states $\partial x_t / \partial \theta$ next to the reservoir state $x_t$.
- Differentiate through the closed-form ridge readout to get the gradient of a recency-weighted forecasting loss.
- Apply a prediction-correction update whose prediction term is a finite difference of that gradient over time.
We claim this loop tracks the time-varying optimum $\theta^*(t)$ with lower lag than correction-only updates. We also claim it beats a bank of fixed reservoirs, re-selection from scratch, and time-varying Bayesian optimization at matched compute. Finally, because $\theta$ is low-dimensional, moves slowly, and is kept inside a region where the reservoir contracts (forgets its initial state), it avoids the instability reported for online training of recurrent weights.
The objective at step $t$ is a prequential loss, meaning each prediction is scored on data the readout has not yet seen:
$$L(\theta, t) = \sum_{s \le t} \lambda^{t-s} \left\| y_{s} - W_{\text{out}}^{(s-1)}(\theta)\, x_s(\theta) \right\|^2 .$$
Here $y_s$ is the target at step $s$, and $x_s(\theta)$ is the reservoir state under hyperparameters $\theta$. $W_{\text{out}}^{(s-1)}(\theta)$ is the ridge readout fitted on data up to $s-1$ with forgetting factor $\lambda$. The update is:
$$\theta_{t+1} = \Pi_{\mathcal{C}}\Big[\theta_t - H_t^{-1}\big(g_t + (g_t - g_{t-1})\big)\Big],$$
where $g_t = \nabla_\theta L(\theta_t, t)$ is the gradient with respect to the hyperparameters. $H_t$ is a damped 3×3 Gauss-Newton approximation of the Hessian with respect to $\theta$. The term $g_t - g_{t-1}$ is the finite-difference estimate of how the gradient drifts over time. $\Pi_{\mathcal{C}}$ projects onto a safe set $\mathcal{C}$ in which the reservoir provably contracts.
Why this is not already done
Three prior lines motivate the gap.
- Static analytic selection. Free-Probability Kernels for Zero-Rollout Hyperparameter Selection in Reservoir Computing ranks hyperparameters without simulating the reservoir. It uses the infinite-width kernel of a leaky linear reservoir, fitted on a static pilot sequence. It covers neither $\tanh$ recurrences nor drift.
- Offline black-box search. Locally Connected Echo State Networks for Time Series Forecasting tunes hyperparameters offline with CMA-ES, an evolutionary black-box optimizer, at up to 20 hours per dataset. It adapts only the readout during deployment.
- Manual regime switching. Task-adaptive physical reservoir computing shows that one physical reservoir can be moved between a high-memory phase and a high-nonlinearity phase by changing temperature and magnetic field. On Mackey-Glass the memory phase wins by a factor of 18, and the nonlinear phase wins on sine-to-square. This is direct evidence that the best operating point depends on the task, but the switching is done by hand and offline.
Our proposal is the closed-loop, online version of what that paper did manually, for software reservoirs.
On the optimization side, we reuse the method of Prediction-correction methods for time-varying convex optimization and A Class of Prediction-Correction Methods for Time-Varying Convex Optimization. Both show that anticipating drift reduces tracking error from order $h$ to order $h^2$ with gradient correction, or $h^4$ with Newton correction, where $h$ is the sampling period. They also show that finite-difference estimates of the time derivative keep these rates. Their guarantees assume strong convexity, which our loss does not have. We therefore treat their rates as a hypothesis to test empirically, not as a guarantee that transfers. They identify Hessian inversion as the obstacle in high dimensions. That obstacle largely disappears in our three-dimensional problem.
Event-Triggered Time-Varying Bayesian Optimization tracks drifting black-box optima with Gaussian-process upper-confidence-bound search and resets its data when an error bound is violated. It has never been applied to reservoirs, and it spends a full evaluation per query. We use it as a baseline, not as the method.
One paper constrains the design and appears to contradict us. When Learning Hurts: Fixed-Pole RNN for Real-Time Online Training proves that online gradient updates of recurrent poles cause instability and lag, and that freezing the poles while running least-squares on the readout tracks better. We take this seriously. Our method differs from what they criticize in three ways:
- It never updates individual recurrent weights. It only rescales the fixed random matrix through three scalars.
- It solves the readout exactly at every step, making the problem two-level with an exact inner solution, not joint gradient descent.
- It moves $\theta$ on a slower timescale inside a contraction region.
Differentiable reservoir computing supplies the justification for differentiating reservoir filters. It proves that reservoir filters are Fréchet differentiable, meaning they have well-defined derivatives, and that fading memory can persist locally around trajectories. Whether our three differences suffice is an empirical question, and one ablation below targets it directly.
Research Program
Sensitivity recursion. Differentiating $x_t = (1-\alpha)x_{t-1} + \alpha \tanh(\rho \tilde W x_{t-1} + \sigma_{\text{in}} W_{\text{in}} u_t)$ gives one tangent recursion per hyperparameter. Here $u_t$ is the input and $\tilde W$ is the recurrent matrix normalized to unit spectral radius. Each tangent costs one extra sparse matrix-vector product, so total cost is about four times a plain reservoir.
Readout gradient. The gradient of the recursive-least-squares readout with respect to $\theta$ comes from a matrix-calculus identity applied to the running covariance. It costs $O(n^2)$ per step, the same as recursive least squares itself.
Transient bias. Changing $\theta$ midstream leaves a state that is not the state the new $\theta$ would have produced. We bound the resulting bias by the step size divided by the contraction gap. This bound motivates capping $\|\theta_{t+1}-\theta_t\|$ and projecting onto $\mathcal{C}$. We implement $\mathcal{C}$ with the sufficient condition $\rho\,\alpha\, L_{\tanh} + (1-\alpha) < 1$, a standard contraction test, and relax it in an ablation.
Update rules compared. We compare three variants of our update:
- correction only (a gradient step, the $O(h)$ analogue);
- gradient prediction-correction;
- Newton prediction-correction.
Rate measurement. We measure empirically whether the error-versus-$h$ slopes predicted in the convex setting appear. We vary how often $\theta$ is updated relative to the drift.
Baselines
The naive reference point is a reservoir tuned offline on the first segment of the stream and then frozen. Its readout is updated online by recursive least squares with the same forgetting factor $\lambda$ as our method. This is the fixed-pole recipe from When Learning Hurts. It shares our initial tuning budget, and any gain we show must come from moving $\theta$. The initial tuning is Bayesian optimization with 200 rollouts, used identically for every method.
The strongest competitor is a bank of reservoirs with online selection:
- $K$ reservoirs share the same random $\tilde W$ but are fixed at different $\theta$ values on a coarse grid.
- Each has its own recursive-least-squares readout.
- Their forecasts are combined by exponentially weighted averaging, as in online expert combination.
This is strong because readouts are cheap and averaging reacts to drift with no gradients at all. We run it at matched compute, $K=4$, equal to our state plus three tangents. We also run it at 27 times the compute, $K=27$, a 3×3×3 grid, to give it a generous advantage. Beating it means lower cumulative forecasting error at $K=4$, and error within noise of $K=27$ at four times less cost.
The time-varying black-box baseline is ET-GP-UCB from Event-Triggered Time-Varying Bayesian Optimization:
- Every $M$ steps it proposes $\theta$.
- A shadow reservoir scores the proposal on the recent window.
- The event trigger resets the Gaussian process after abrupt shifts.
$M$ is set so that total reservoir simulation matches ours.
The re-selection baseline re-runs the free-probability selector from Free-Probability Kernels for Zero-Rollout Hyperparameter Selection on a sliding window at fixed intervals. On static synthetic tasks that selector scored 0.772 mean deployment score (1 − normalized root-mean-square error, NRMSE), against 0.774 for 156,600-rollout exhaustive search. It is valid only for linear recurrences, so we run it on a linear-leaky variant and compare it with our method on the same variant.
The key ablation replaces the Newton prediction-correction update with a plain gradient step at a fast rate and no projection. This mirrors the joint online recurrent training criticized in When Learning Hurts. A second ablation removes only the prediction term, which isolates anticipation from simple adaptation.
No reported result found on Lacuna for any method tracking reservoir hyperparameters under drift. Every number in the comparison will be produced here.
Why not just…?
Why not just keep a bank of fixed reservoirs and let online averaging pick the best one? This is the most serious threat. The bank's weakness is that it is confined to grid points and costs grow as $K$ increases. Whether that weakness matters depends on how sharp the optimum is. If the loss is flat across the grid spacing, a four-member bank will match us and our method is not worth its complexity. The matched-compute and 27× comparisons settle this directly. We will report the result either way. If the bank wins, the finding is still useful: it would mean that drift in reservoir hyperparameters is coarse enough to handle with discrete switching.
Why not just periodically re-select hyperparameters from scratch on a recent window? This is the "discrete restart" strategy, which by construction corrects toward where the optimum was. The prediction-correction analysis shows that correction-only tracking in the synthetic scalar problem stalls near $10^{-2}$ error. Prediction-correction reaches $10^{-5}$ with gradient correction and $10^{-10}$ with Newton correction (A Class of Prediction-Correction Methods). Rollout-based re-selection is also costly per window. The free-probability re-selection baseline tests the cheapest version of this idea, and the lag analysis on smooth-drift tasks shows whether anticipation adds anything.
Why not just rely on recursive least squares with forgetting on the readout? The readout can reweight features but cannot create memory the reservoir does not have. The phase results in Task-adaptive physical reservoir computing show that performance ratios between regimes reach 18× on Mackey-Glass. That is far more than readout reweighting plausibly recovers. The frozen-reservoir baseline measures this gap directly. If the gap is small on a benchmark, that benchmark does not need hyperparameter tracking, and we will say so.
Why not just run ET-GP-UCB on the hyperparameters? It needs a full evaluation per query and detects change only at queried points. Our method gets an exact gradient at every step as a by-product of the forward pass. At matched simulation budget we expect it to lag during smooth drift. We also expect its event trigger to beat our method right after abrupt jumps. That is a genuine possible loss for us and will be reported separately for jump segments.
Proposed Experiments
Synthetic streams with known drift. We build non-stationary versions of benchmarks from the file where the optimal $\theta$ is known to move:
- NARMA whose order drifts smoothly from 10 to 30, which pushes the optimal memory, and hence $\rho$ and $\alpha$, upward;
- Mackey-Glass with a slowly increasing delay;
- a stream that alternates between a memory-capacity task and sine-to-square transformation, echoing the memory versus nonlinearity trade-off.
For each stream we compute a reference trajectory $\theta^*(t)$ by dense offline grid search on stationary snapshots. We report two quantities: the tracking error $\|\theta_t-\theta^*(t)\|$, and cumulative NRMSE relative to an oracle that uses $\theta^*(t)$. We also report 1 − NRMSE, for comparability with the 0.772 and 0.774 figures.
Real drift. We stream ETTh1 and ETTm1 in time order, with no shuffling, and report cumulative one-step MSE and throughput in steps per second. The file gives LCESN 1-step inference at 8,361 steps/s versus 107 steps/s for iTransformer. Our method must stay within a small constant factor of plain-reservoir throughput to keep that advantage. We use widths from $n=1{,}000$ to $n=5{,}000$, with five random reservoir draws per setting.
Decisive checks. Five outcomes decide whether the proposal holds.
- On smooth-drift streams, removing the prediction term should raise tracking error. Under shrinking update intervals, the error should fall with a steeper slope for prediction-correction than for correction-only. The expected slopes come from the $O(h)$ versus $O(h^2)$ analysis. Their absence would show that the convex theory does not transfer.
- The fast unprojected gradient ablation should reproduce the instability reported in When Learning Hurts, while the projected Newton variant should not. If both are stable, the fixed-pole warning does not apply at this dimension. If both are unstable, our method fails.
- We must beat the $K=4$ bank at matched compute.
- The frozen reservoir must be clearly worse than the oracle on at least the task-switching stream. Otherwise there is nothing to track.
- On abrupt jumps, we compare recovery time against ET-GP-UCB's event-triggered resets. This tells us whether a reset trigger should be added as a follow-up.
References
- Free-Probability Kernels for Zero-Rollout Hyperparameter Selection in Reservoir Computing
- Locally Connected Echo State Networks for Time Series Forecasting
- Task-adaptive physical reservoir computing
- Prediction-correction methods for time-varying convex optimization
- A Class of Prediction-Correction Methods for Time-Varying Convex Optimization
- Event-Triggered Time-Varying Bayesian Optimization
- When Learning Hurts: Fixed-Pole RNN for Real-Time Online Training
- Differentiable reservoir computing