In classical machine learning, data is a permanent asset. The more observations an agent collects, the more certain its world model becomes. However, this logic assumes a stationary world—one where the rules of the game never change. In real-world scenarios like electronic markets, personalized healthcare, or autonomous driving, the environment is often non-stationary: what was true yesterday may be false today.
In these shifting landscapes, historical data can transform from an asset into a liability. If an agent relies on observations from a previous environmental state, its decisions become biased by "stale" information. To remain agile, agents must learn to forget.
The Logic of the Sliding Window
The most direct mechanism for managing non-stationarity is the sliding window. Instead of aggregating all historical data, the agent maintains a fixed-size buffer of the most recent $W$ observations. As new data arrives, the oldest data is discarded.
This approach was formalized early in computational learning theory by Anthony Kuh, Thomas Petsche, and Ronald L. Rivest in Learning Time-Varying Concepts. They demonstrated that tracking a changing target is feasible if the rate of change is slow relative to the window size, which must be tuned based on the complexity (VC dimension) of the concept being learned.
The intuition is a trade-off between bias and variance:
- High Variance (Small Window): If the window is too short, the agent has too few samples to form a statistically significant estimate, leading to erratic behavior.
- High Bias (Large Window): If the window is too long, the agent’s estimates are "polluted" by data from outdated distributions, making it slow to react to sudden shifts.
Forgetting in Sequential Decision Making
The sliding window has become a cornerstone for algorithms tackling the Multi-Armed Bandit (MAB) problem. In A Sliding-Window Algorithm for Markov Decision Processes with Arbitrarily Changing Rewards and Transitions, Peter Auer, Pratik Gajane, and Ronald Ortner showed that a sliding window (SW-UCRL) allows an agent to achieve tighter regret bounds in environments that change abruptly, outperforming methods that simply "restart" the learning process periodically.
This principle extends to Bayesian methods. Francesco Trovò and colleagues introduced Sliding-Window Thompson Sampling (SW-TS), which restricts posterior updates to recent observations. By intentionally discarding data, the algorithm ensures its probability distributions reflect the current state of the world rather than an average of all past states. This is particularly effective for "rotting" rewards—where an option's value decreases as it is used—as explored by Nir Levine, Shie Mannor, and Koby Crammer in Rotting Bandits.
Scaling to Complex Environments
As we move from simple bandits to Reinforcement Learning (RL) with high-dimensional state spaces, the need for temporal filtering becomes even more acute. In complex environments, agents often use function approximators (like neural networks) to represent the world.
Recent work by Songtao Feng, Yu-Xiang Wang, and others in Non-stationary Reinforcement Learning under General Function Approximation introduced the Dynamic Bellman Eluder (DBE) dimension. Their algorithm, SW-OPEA, uses a sliding window to ensure that the function approximator is only trained on transitions that are relevant to the current environmental dynamics. Similarly, Yuan Cheng and Yingbin Liang applied this to Low-Rank MDPs, proving that maximum likelihood estimation over a sliding window can recover shifting latent structures.
Beyond Fixed Windows: Adaptive Forgetting
While a fixed sliding window is powerful, it requires knowing the "rate of change" to set the window size $W$. Modern research is moving toward more adaptive forms of forgetting:
- Contextual Truncation: In Adapt to Environment Sudden Changes by Learning a Context Sensitive Policy, Fan-Ming Luo and Yang Yu 0001 show that truncating the history used by a context encoder allows agents to adapt to sudden shifts (like a robot moving from carpet to ice) up to 10x faster.
- Filtering and Control: In HyperController, Jonathan Gornet uses Kalman filters to naturally discount outdated performance data, treating hyperparameter optimization as a dynamic control problem.
- Localized Windows: For multi-agent or multi-arm systems, Yu Heng Hung and Ping-Chun Hsieh demonstrate in Non-Stationary Restless Multi-Armed Bandits with Provable Guarantee that maintaining independent sliding windows for each arm allows for more granular adaptation to localized shifts in dynamics.
By treating memory as a finite resource and the past as a decaying signal, these methods enable agents to maintain a "living" model of their environment—one that is defined not by the sum of its experiences, but by the relevance of its most recent ones.