Many planning and control problems are "reach the goal as cheaply as possible" tasks with no fixed time limit: a robot crossing a warehouse, a packet finding its route, a cart swinging up a hill. The standard model for these is the stochastic shortest path problem (SSP), in which an agent pays a cost at every step and the episode lasts until the goal is reached, however long that takes. Learning algorithms for SSPs are now well understood when the world stays fixed. The real world does not stay fixed. A door closes, a corridor becomes slippery, a shortcut opens. Such changes are usually local: they affect a handful of states while the rest of the environment behaves as before. Existing methods for changing SSPs handle drift globally. They forget all old experience on a schedule or after a detected change, and in goal-reaching problems this is very costly, because relearning the whole map means exploring again, and exploration is exactly what can trap an SSP agent in long loops.
We propose to detect change separately for each state and action, forget only the data where change was detected, and keep a running check on whether the agent's "get me to the goal" fallback policy still reaches the goal. The key observation is that, once we condition on a particular state and action, the distribution of the next state does not depend on which policy the agent is running. A test on that conditional distribution can therefore separate genuine environment change from the large, abrupt shifts in visited states that SSP algorithms cause themselves when they switch policies. It also needs no delayed labels, because every transition supplies its own ground truth.
Core Claim
In goal-reaching tasks where the transition dynamics change only in a small region, an agent should do three things. It should run a sequential change test on the next-state distribution of each state–action pair. When a test fires, it should reset the counts and exploration bonuses of that pair alone. It should also certify online that its fallback policy is still proper, meaning it still reaches the goal with probability one. We expect such an agent to achieve dynamic regret that grows with how often the optimal policy visits the changed region, not with the total amount of change anywhere. Here dynamic regret means the agent's cost minus the cost of the best policy for each episode's environment. We further expect it to never do meaningfully worse than a global restart when drift is in fact global. The last condition is what makes the claim falsifiable. If local reset loses badly to global restart under global drift, or fails to beat simple per-pair sliding windows under local drift, the idea is not worth pursuing.
Where This Sits
The closest work is Near-Optimal Goal-Oriented Reinforcement Learning in Non-Stationary Environments. It lets costs and transitions vary arbitrarily across episodes and proves a lower bound of order $(B_* S A T_* (\Delta_c + B_*^2 \Delta_P))^{1/3} K^{2/3}$, where $B_*$ is the largest optimal cost-to-go, $T_*$ the largest optimal time to the goal, $\Delta_c$ and $\Delta_P$ the total cost and transition variation, $S$ and $A$ the numbers of states and actions, and $K$ the number of episodes. It matches this bound with two sliding windows of different lengths, one for costs and one for transitions, plus a meta-algorithm called MASTER that works without knowing the drift budgets. This paper motivates our proposal in two ways. The $B_*^2$ factor shows that transition drift is the expensive kind, so wasted transition data is the thing to avoid. The paper also records that its drift-adaptive machinery is uniform over the state space. Our proposal differs in exactly one design choice: forgetting is triggered and scoped per state–action pair instead of globally in time. We do not claim to beat its worst-case lower bound. Our aim is instance-dependent gains on locally drifting instances, which that bound does not rule out because it is built from worst-case instances.
The adversarial SSP line constrains the design. Adversarial Stochastic Shortest Path handles adversarially changing costs over the set of achievable state–action visit frequencies, but it assumes fixed transitions and compares against the best single policy in hindsight. Stochastic Shortest Path with Sparse Adversarial Costs shows that when only $M \ll SA$ cost entries are nonzero, suitably chosen regularizers make regret scale with $\log M$. It also proves that with unknown transitions, polynomial dependence on $SA$ cannot be avoided. That negative result tells us that "local" savings must come from not re-exploring stable regions, not from avoiding exploration altogether. We take the spirit of sparsity from it and apply it to transitions, which it leaves stationary.
The method borrows from three sources. Variance-aware bonuses and slight goal optimism come from EB-SSP (Stochastic Shortest Path: Minimax, Parameter-Free and Towards Horizon-Free Regret), which is minimax optimal for stationary SSPs. The idea of switching to a fast fallback policy when an attempt runs too long comes from UC-SSP (No-Regret Exploration in Goal-Oriented Reinforcement Learning). The idea that drift is regional and that flushing everything wastes stable knowledge comes from streaming classification (Regional Concept Drift Detection and Density Synchronized Drift Adaptation). That work measures local density change in input space. We instead test conditional next-state distributions, which is both cheaper in the tabular case and immune to policy-induced shift.
The confound we avoid is the one named by Debiased Offline Representation Learning for Fast Online Adaptation in Non-stationary Dynamics. In that work, a context encoder confuses changes in the behavior policy with changes in the environment, and the authors fix it offline with an information-bottleneck objective. In the tabular SSP setting, conditioning on the state and action removes the confound by construction, so no learned debiasing is needed. Unsupervised monitors of the visited-state stream, such as the incremental Kolmogorov–Smirnov test of Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test, do not have this protection. They will fire whenever the agent switches to its fallback policy, which is the failure we will demonstrate.
Research Program
The algorithm, which we call LR-SSP, keeps for every pair $(s,a)$ a list of observed next states since that pair's last reset. After each new sample it runs a windowed change test. For every split point $t$ of the recent history into an "older" segment of $n_1$ samples and a "newer" segment of $n_2$ samples, it compares the two empirical next-state distributions $\hat P_1$ and $\hat P_2$:
$$ Z_{s,a} = \max_{t} \; \sqrt{\tfrac{n_1 n_2}{n_1+n_2}}\, \big\| \hat P_1(\cdot \mid s,a) - \hat P_2(\cdot \mid s,a) \big\|_1 , $$
The test fires when $Z_{s,a}$ exceeds a threshold. The threshold is set by a union bound over pairs and split points, so the false-alarm rate is controlled over the whole run. The $\sqrt{n_1 n_2/(n_1+n_2)}$ scaling is the standard two-sample normalization under which the $\ell_1$ distance between empirical multinomials concentrates. When the test fires, the pair keeps only the newer segment, and its EB-SSP bonus reverts to the large value appropriate for that smaller count. Optimism then sends the agent back to re-explore that pair and nothing else. Costs get their own per-pair test on a separate, faster scale, following the two-scale lesson of the non-stationary SSP paper.
The second component is a properness monitor for the fallback policy. The fallback is recomputed on a pessimistic version of the current model and comes with a predicted expected time to goal $\hat T(s)$ from each state. Each time the fallback is executed, we record its realized hitting time. A one-sided sequential test compares these times against $\hat T$, using a Markov-type tail bound so that no variance knowledge is needed. If the fallback overshoots too often, two things follow. The pairs on its support are force-tested with a lowered threshold, and an emergency policy that minimizes worst-case time to goal under the confidence set is used until the model is repaired. This addresses the problem that a previously safe fallback can silently become a trap after drift, which no existing SSP method checks.
The analysis target is a dynamic regret bound in which the global $\Delta_P$ is replaced by a localized quantity. For each change, this quantity counts the drifted pairs weighted by the optimal policy's expected visits to them. Drift in a region the optimal policy never enters costs only the detection-and-exploration overhead needed to learn that the region is still unattractive. We expect a clean bound to be achievable in the piecewise-stationary case, with a bounded number of local switches. Gradual drift is harder, and we will treat it empirically first.
Baselines
The naive reference is stationary EB-SSP (Stochastic Shortest Path: Minimax, Parameter-Free and Towards Horizon-Free Regret) and PSRL-SSP (Posterior Sampling-based Online Learning for the Stochastic Shortest Path Model), run with no drift handling at all. These methods should degrade permanently after a change, because accumulated counts make their confidence sets overconfident about the old dynamics. LR-SSP must beat them after the first change and match them before it.
The strongest existing competitor is the drift-aware two-scale sliding-window algorithm of Near-Optimal Goal-Oriented Reinforcement Learning in Non-Stationary Environments. It is the only method in the file with dynamic-regret guarantees for drifting SSP transitions. We will run it in two forms: with window lengths set from the true drift budgets, which is favorable to it, and in its parameter-free MASTER form. All methods get the same environments, the same random seeds, the same number of episodes, and the same grid of confidence-scaling constants, with each method taking its best setting. No reported result was found on Lacuna for this algorithm on any benchmark, and the file also contains no scalar regret numbers for PSRL-SSP or UC-SSP on GridWorld, RandomMDP or SSP-MountainCar. Every number in this study will therefore come from our own runs. Beating this baseline means lower cumulative dynamic regret, with non-overlapping 95% intervals across at least 30 seeds, on the local-drift suites. It also means being within 10% of it on the global-drift suite.
Global restart on detection is a second strong competitor: EB-SSP plus the same per-pair test, where any firing resets all pairs. This is the "one-cut" strategy criticized in Regional Concept Drift Detection and Density Synchronized Drift Adaptation, and it isolates the value of local scope. We also include an oracle that is told when and where each change happens and resets exactly those pairs. It is an upper reference that shows how much of the gap is due to detection delay.
Two ablations isolate the proposal's ingredients. The first replaces detection-triggered local reset with a per-pair sliding window of fixed length. It uses the same exploration bonuses and a window tuned on the same budget, and it isolates whether detection matters or merely local scope. The second removes the properness monitor and isolates the monitor's contribution on the trap-emergence suite. A time-limit baseline, which runs finite-horizon EB-SSP-style learning with a sliding window and a tuned cap $H$, stands in for the truncation shortcut.
Why not just…?
Why not just use a per-pair sliding window and skip change detection? This is the most serious threat, because it is also local. Its weakness is specific to SSPs: visit counts are driven by the agent's policy. A window measured in episodes leaves rarely visited pairs with almost no data, even though they never changed. A window measured in samples per pair reacts slowly for rarely visited pairs that did change. Detection lets stable pairs keep all their history and reset changed pairs immediately. The fixed-window ablation settles this directly. If a tuned per-pair window matches LR-SSP on the local-drift suites, we will report that the change test adds nothing and simplify the proposal to "local windows plus properness monitoring."
Why not just restart everything when a change is detected? Restarting resets every count. Posterior Sampling-based Online Learning for the Stochastic Shortest Path Model builds its epoch-stopping rules precisely because low counts send SSP agents into long exploratory trajectories, and the $B_*^2$ factor on transition drift in Near-Optimal Goal-Oriented Reinforcement Learning in Non-Stationary Environments means relearning transitions is the expensive part. We expect global restart to win only when drift really is global, and the global-drift suite is included so that this case is measured, not assumed away.
Why not just cap episodes at a time limit and use finite-horizon non-stationary RL? Time Limits in Reinforcement Learning shows that time limits break the Markov property and bias agents toward nearby, worse goals, as in its Two-Goal Gridworld. Truncation also makes regret depend on the worst-case horizon instead of $T_*$. There is a subtler problem under drift. A capped agent never notices that its fallback has become a trap, because the cap hides the loop. The time-limit baseline and the trap suite will show whether this matters in practice.
Why not just monitor the stream of visited states with a fast unsupervised drift test? The incremental Kolmogorov–Smirnov test of Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test is fast. However, the stream of visited states changes every time the agent changes its policy, which SSP algorithms do constantly. This is the confusion documented by Debiased Offline Representation Learning for Fast Online Adaptation in Non-stationary Dynamics. The policy-switch-only check below measures its false-alarm rate against ours.
Proposed Experiments
We build drifting versions of the benchmarks in the file: multi-room GridWorld and RandomMDP (Posterior Sampling-based Online Learning for the Stochastic Shortest Path Model), Two-Goal Gridworld (Time Limits in Reinforcement Learning), and the 126-state SSP-MountainCar. Four drift suites are defined. In local blockage, one door closes. In local slip, the transitions of a few cells become noisy. In shortcut opening, a better path appears that the agent can only find by re-exploring. In trap emergence, a zero-cost loop appears on the old fallback path, which is the zero-cost failure mode SSP theory worries about. A fifth suite perturbs every row of the transition matrix. Each suite is run in piecewise-constant and gradual versions. Metrics are cumulative dynamic regret against the per-episode optimal cost, computed from the true model. We also report the maximum and 99th-percentile episode length, the fraction of episodes in which the fallback fails to reach the goal within ten times its predicted hitting time, the delay and false-alarm rate of each pair's test, and the number of stable-pair samples discarded.
Four checks decide the proposal. On local blockage and local slip, LR-SSP must beat both the two-scale sliding-window baseline and global restart, and it should approach the oracle. On the global suite, it must stay within 10% of global restart; failing this falsifies the "no downside" claim. In a policy-switch-only control, the environment is fixed while the agent is forced to alternate between exploratory and fallback policies. There, LR-SSP's per-pair tests must hold their nominal false-alarm rate, while a Kolmogorov–Smirnov monitor on state features fires repeatedly. On trap emergence, the version with the properness monitor must keep maximum episode length bounded, while the ablation without it and all global baselines show at least one episode that runs far beyond the fallback's predicted time. Shortcut opening is the honest weak spot: local detection cannot see change in pairs the agent no longer visits. We will report how much of the gain survives there, relying on the residual optimism of the goal-biased model.
References
- Near-Optimal Goal-Oriented Reinforcement Learning in Non-Stationary Environments
- Stochastic Shortest Path with Adversarially Changing Costs
- Stochastic Shortest Path with Sparse Adversarial Costs
- Stochastic Shortest Path: Minimax, Parameter-Free and Towards Horizon-Free Regret
- No-Regret Exploration in Goal-Oriented Reinforcement Learning
- Regional Concept Drift Detection and Density Synchronized Drift Adaptation
- Debiased Offline Representation Learning for Fast Online Adaptation in Non-stationary Dynamics
- Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test
- Posterior Sampling-based Online Learning for the Stochastic Shortest Path Model
- Time Limits in Reinforcement Learning