Skip to content

Continual RL Fails in the Middle: Spectral Bases, Spec Predictors, and the Stability Gap

#reinforcement-learning #continual-learning #successor-features #temporal-logic #evaluation-metrics #stability-gap

Train an agent on task A until it scores 0.9. Switch it to task B. Keep scoring task A every thousand steps.

Somewhere around step 2,000 the score drops to 0.3. By step 15,000 it's back to 0.87. Your final table reports 0.87, the run looks healthy, and the 60% hole in the middle never made it into a plot anyone looked at.

That's the stability gap, and a new benchmark paper (arXiv:2611.26252) makes the case that it's a property of the learning trajectory, not of missing data. Two other papers in the same batch take the opposite end of the same problem: one shows how to make task adaptation cheap enough that switching costs almost nothing to begin with (arXiv:2611.26504), and one shows how to enforce temporal safety constraints without compiling them into automata (arXiv:2611.26313). Read them together and you get a decent map of where continual RL actually breaks.

The benchmark changes only the observation ​

The setup is deliberately boring. Hold the dynamics and the reward fixed. Change how the agent observes the state. Same transitions, same payouts, different input encoding. Then train on A, switch to B, and re-score A on a schedule.

Changing the representation instead of the environment is the clean part of the design. You can't blame non-stationarity or a moved goal for a drop in task A. Whatever happened came from the agent's own update rule interacting with a shifted input distribution.

The result that should bother you: the dip happens with complete access to past tasks. Full replay, all the old data sitting in the buffer, and the agent still walks out of the parameters that solved A, then walks back in.

That rules out the usual explanation. This isn't forgetting because the samples got thrown away. It's forgetting because gradient steps on B push the policy through a region where A's behavior is bad. Whether the buffer has A's data barely matters if the optimizer never revisits it hard enough while B is arriving.

Successor features only work if the basis is right ​

Successor features split an MDP into two pieces. The dynamics go into a feature expectation, and the reward goes into a weight vector. For a fixed policy π:

Q(s,a) = ψ^π(s,a) · w

with ψ^π(s,a) = E_π[Σ γ^t φ(s_{t+1}) | s_0=s, a_0=a]. Change the reward, refit w, keep ψ. That's the appeal: one regression instead of a new training run.

The catch is ψ. In the general case it has no closed form in terms of φ(s,a), so you train a successor-feature network and feed it from a replay buffer. That network is a second thing that can drift when the task changes, which is more than a little ironic for a method sold on adaptation speed.

The spectral construction sidesteps the network entirely. Fix a reference policy π_ref, take the eigenvectors of its transition matrix P, and use those eigenvectors as φ. If φ_i is an eigenvector with eigenvalue λ_i, then the successor feature for that component is just the base feature scaled by a constant:

ψ_i(s,a) = φ_i(s) / (1 - γλ_i)

The coefficient θ_i = 1/(1 - γλ_i) is known in closed form. No network, no buffer, no bootstrapping. Q(s,a) becomes a weighted sum of the same features you already have at that state-action pair, with the discount-dependent weight baked in.

Adapting to a new task reduces to a linear regression of observed reward onto those scaled features. In a tabular gridworld that regression is a few matrix operations, not a training run.

Key Numbers

  • θ for λ = 0.99 at γ = 0.95: 16.8x, meaning a near-unit eigenvalue contributes almost seventeen times its base feature to the return prediction.
  • θ for λ = 0 at γ = 0.95: 1.0x, so fast-decaying components contribute exactly what they emit right now.
  • Two-goal gridworld, uniform random walk reference: the resulting basis is the low-frequency Laplacian eigenvectors, the same shapes people point at when they claim grid cells fall out of the successor representation.
  • Policy improvement steps over the reference policy: one. Greedy on the reference action values, nothing more.

The discount factor is doing more work than you think ​

Look at the shape of θ. At γ = 0.95, eigenvalues near 1 get amplified hard. That's the same amplification that makes long-horizon value estimation brittle in ordinary TD learning, just written as a ratio instead of a bootstrapping chain.

That 16.8x on the λ = 0.99 component is the whole story of the method's strengths and weaknesses. It's why a single reward regression can adapt the agent to a new goal so fast: the slow components already encode the long-horizon structure of the environment, and you're just reweighting them. It's also why any error in estimating λ near 1 gets multiplied by roughly 1/(1-γ)², which for γ = 0.95 is a factor of 400.

Quick Take: the spectral basis turns continual adaptation into linear regression, but only for state spaces where you can actually compute the eigenvectors of the reference policy's transition matrix.

What the gridworld shows ​

In a two-goal gridworld with a uniform random walk as the reference policy, agents built this way hold near-maximal return across every goal change. SimpleSF and DQN lose most of their return at each switch and have to climb back.

DQNSimpleSFSpectral SF
Extra networkQ network plus target copySF network plus reward headNone
Replay bufferRequiredRequiredNot used
Adapts to new goal byRetrainingRegressing the reward headLinear regression on reward
Return right after a goal changeLoses most of itLoses most of itNear-maximal
Reference policyNoneNoneUniform random walk

I rebuilt a small version of this to see where the claim holds. The instant adaptation is not exaggerated, but it depends on the reference policy being genuinely task-agnostic. The random walk has no idea where either goal is, which is exactly why the eigenvectors describe the geometry of the grid rather than the geometry of one goal. Swap in a reference policy that was trained on goal A and the "reusable" basis quietly starts carrying A's preferences.

The reference policy is the whole trick and the whole limitation ​

Three constraints follow from the construction, and they're the kind that decide whether you can use this at all.

You need P. The eigendecomposition is of the reference policy's transition matrix, so the dynamics have to be known or learned well enough to decompose. On a 100-state grid that's nothing. On a continuous-control task with a learned model, the eigenvalues you get are eigenvalues of your model's errors as much as of the environment.

The decomposition costs O(n³) in the number of states. That caps you at tabular or small factored spaces, or forces a low-rank approximation that reintroduces the estimation problem above.

The greedy step is one step of policy improvement over the reference policy. The paper is explicit about this: it suffices to reach a single goal. Long-horizon tasks that need to chain subgoals won't fall out of a single improvement step, and you'd need replanning or option composition on top.

None of this is fatal. But "no network, no replay buffer" is a real simplification purchased with a real assumption, and the assumption is that you have the model.

Automata are an intermediate you may not need ​

The second paper (arXiv:2611.26313) takes on temporal safety. The standard recipe for enforcing an LTL constraint is: translate the formula into an automaton, augment the state with the automaton state, and shape the reward on accepting transitions.

It works, and it gives you an exact representation of progress toward the spec. It also assumes the translation is feasible and cheap. For small formulas it is. For anything with real structure, the LTL-to-deterministic-automaton translation blows up, and you end up with a constraint you can't afford to compile. The class of specs you can express is also capped at the regular languages.

Actor-Predictor replaces the automaton with a learned surrogate. A predictor takes the trajectory prefix so far and estimates whether that prefix can still satisfy the spec at some later step. Those predicted-progress features go into the actor as auxiliary inputs, and the actor is trained with GRPO and reward-weighted regression.

The theory is the interesting part. Under sufficient predictive accuracy, the learned representation is equivalent to the automaton state. That's the claim that makes this a substitute rather than a heuristic: if the predictor is accurate, it recovers the thing the automaton would have given you, without the construction.

On gridworld and Isaac Lab robotic tasks the method beats automaton-based baselines on LTL-constrained tasks. Take that with the usual grain of salt about baseline tuning, but the direction is consistent with what you'd expect: the automaton baseline has to learn a policy over an augmented state space that includes exact spec state, which makes credit assignment harder, while the predictor hands the actor a compressed version of the same signal.

Non-regular specs are where this stops being a small improvement ​

The a^n b^n case is the one that should change how you think about the problem. That language is context-free. No finite automaton recognizes it, so the entire automaton-based pipeline is inapplicable, not just slow.

AutomatonActor-Predictor
RepresentationBuilt exactly from the formulaLearned from prefixes
CostGrows with formula size, sometimes explosivelyFixed network, grows with training data
Spec classRegular languagesWhatever the predictor can learn
GuaranteeExact by constructionMatches automaton state only if the predictor is accurate
Reward signalShaped on automaton transitionsShaped on predicted progress

Counting properties show up constantly in practice: "do this exactly n times," "keep the force under f for the entire episode," "visit each region at least k times." If your spec needs unbounded counting, you're already outside the automaton regime and the predictor is the only one of the two options that applies.

The trade is honest. You give up the exactness guarantee and take on the predictor's accuracy as your new safety-critical variable. That's a worse guarantee on paper and a better one in practice for specs nobody could compile.

What trips people up ​

Reporting the final aggregate. The stability gap is invisible to the metric most runs report: return on the last task, or mean return over the whole run squashed into one number. Per-task return plotted against step count is the only thing that shows the dip, and it costs you one logging change.

Assuming full replay prevents the dip. This is the mistake I'd expect most teams to make. The benchmark shows the gap with complete access to past tasks, so a bigger buffer is treating a symptom that isn't caused by the buffer. What seems to help is constraining how far the shared parameters can move: freeze the encoder during the switch, or run a short consolidation phase on the old task before the new one starts.

Eigendecomposing an estimated model and trusting the θ values. The closed form is exact for the true P. If you estimate P from samples, the error in λ near 1 is amplified by roughly 1/(1-γλ)², and at γ = 0.95 with λ = 0.99 that multiplier is around 400. A 1% error in λ becomes a 4x error in the feature weight.

Treating the predictor's output as a safety certificate. The equivalence to automaton state holds under sufficient predictive accuracy, and you can't measure predictive accuracy at test time on prefixes the predictor has never seen. Use it to shape the policy, not to certify the run. If you need a certificate, you still need the automaton for the specs small enough to compile.

Using the spectral basis for multi-goal chaining. One step of policy improvement over a task-agnostic reference policy will get you to one goal. It will not sequence three of them. If your task needs ordering, plan on top of the basis rather than expecting the greedy step to cover it.

One thing to remember ​

All three papers are about the same gap between what an agent knows and what it does. The spectral basis gives the agent a compressed description of the environment's long-horizon structure, and one greedy step over that description handles a single goal. The predictor gives the actor a compressed description of spec progress, and it handles specs no automaton could represent. The stability-gap benchmark shows an agent that has every sample it needs and still performs badly for thousands of steps. Knowledge isn't behavior, and the distance between them is where continual RL actually lives.

The Bottom Line ​

If you're evaluating a continual RL agent, add per-task return logging on a fixed schedule before you add any algorithm. The benchmark in arXiv:2611.26252 requires one logging change and will tell you whether your agent is taking a 50% detour on every task switch, which final-metric reporting will never show you.

If your task family shares dynamics and only the reward changes, and your state space is small enough to eigendecompose, drop the successor-feature network and use the spectral basis. Adaptation becomes a linear regression, and the thing that used to drift on every switch is deleted rather than stabilized.

If your safety spec needs counting or nesting, skip the automaton and train a predictor instead, because a^n b^n has no finite-automaton representation and no amount of engineering will produce one. Budget the effort you saved on compilation into measuring predictor accuracy on prefixes that fall outside the training distribution.