Stabilizing Q-learning with Linear Architectures for Provable Efficient Learning

Andrea Zanette, Martin J. Wainwright

Introduction

Q-learning is a cornerstone of reinforcement learning (RL) due to its simplicity and computational efficiency. However, it is notoriously unstable when combined with function approximation—using a model to estimate values for unseen states. This instability stems from the "deadly triad": the combination of off-policy learning, function approximation, and bootstrapping.

While researchers have developed other algorithms that are "provably efficient" (mathematically guaranteed to learn the optimal strategy quickly), these often come with a massive caveat: they require storing every single piece of experience ever collected. This $O(K)$ memory requirement, where $K$ is the number of episodes, makes them impractical for long-running systems.

This paper introduces $S^4Q$-LEARNING, the first version of Q-learning with linear function approximation that bridges this gap. It is both provably efficient (achieving near-optimal regret) and memory-efficient, maintaining a constant memory footprint regardless of how long the agent interacts with the environment.

The $S^4Q$-LEARNING Algorithm

To achieve stability without sacrificing memory, the authors propose Sequentially Stabilized Second-order Streaming Q-learning ($S^4Q$-LEARNING). The algorithm relies on three primary "stabilizers":

  1. Second-Order Update Rule: Instead of the standard first-order gradient descent used in basic Q-learning, this algorithm uses a second-order rule akin to Recursive Least Squares. This improves statistical efficiency, allowing the error to drop at a rate of $1/n$ rather than $1/\sqrt{n}$.
  2. Target Networks: Borrowing a highly successful technique from Deep Q-Networks (DQN), the algorithm uses "target networks" that are only updated periodically. This prevents the "moving target" problem, where the values being learned and the values used for bootstrapping change simultaneously and cause oscillations.
  3. Policy Replay (The Secret Sauce): Standard "experience replay" stores all past transitions $(s, a, r, s')$, which consumes massive amounts of memory. Instead, Policy Replay stores a "recipe"—a small set of past policies. To get "replayed" data, the agent simply re-runs these old policies in the environment. This ensures the data distribution remains stationary during updates without needing to store millions of historical transitions.

Theoretical Setting

As a theoretical paper focused on algorithmic foundations, the authors evaluate the algorithm through mathematical proofs rather than empirical datasets like Atari or MuJoCo. The setting is Low-rank (or Linear) Markov Decision Processes (MDPs). In these environments, the transition dynamics and rewards can be perfectly (or near-perfectly) represented as linear functions of specific feature vectors.

Key Insights and Results

The theoretical analysis of $S^4Q$-LEARNING yields several major breakthroughs for streaming RL:

  • Streaming is Possible: The paper proves that agents do not need to store their entire history of transitions to achieve state-of-the-art regret bounds. Storing "policies" is a highly compressed, effective way to handle the distribution shift problem.
  • Instance-Dependent Efficiency: The performance of the algorithm depends not just on the raw number of features ($d$), but on the effective dimension ($\tilde{d}$). If the agent predominantly visits a small subspace of the features, it learns much faster.
  • Graceful Degradation: The authors introduce a more permissive definition of "model misspecification" (transfer error). They demonstrate that if the linear model isn't a perfect fit for the environment, the algorithm's performance degrades gracefully rather than failing catastrophically.
  • Near-Optimal Regret: The algorithm achieves a regret bound of $\tilde{O}(H^2 d^{3/2} \sqrt{K})$, where $H$ is the time horizon, $d$ is the feature dimension, and $K$ is the number of episodes. This is highly competitive with the best-known results for linear MDPs.
  • Constant Memory Footprint: The memory complexity is $O(d^3 H^2)$, which is completely independent of the number of episodes $K$. This is a massive improvement over previous provably efficient algorithms that scaled linearly with time. Furthermore, the per-step computational cost is a manageable $O(|A|d^2)$.

Limitations and Future Work

While a significant step forward, the paper outlines a few areas for future improvement:

  • Sub-optimality in Horizon ($H$): The current regret bound is sub-optimal by a factor of $H$ compared to some computationally heavier, non-streaming algorithms. Closing this gap remains an open challenge.
  • Beyond Linear Models: While linear architectures are a huge step up from tabular RL, modern deep RL relies on non-linear neural networks. The authors suggest their "policy replay" and stabilization techniques might be extendable to models with low "Eluder dimension," paving the way for general non-linear function approximation.
  • Target Network Dependency: The theoretical analysis currently requires target networks to simplify the math. Exploring whether these can be safely removed while maintaining strict guarantees is an interesting open question.

Summary updated

BibTeX
@inproceedings{zanette2022stabilizing,
  author = {Andrea Zanette and Martin J. Wainwright},
  title = {{Stabilizing Q-learning with Linear Architectures for Provable Efficient Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
}
Figure