TL;DR
Policy Mirror Descent (PMD) offers elegant theoretical convergence guarantees for regularized reinforcement learning, but practical deep RL implementations must approximate its policy update, leading to optimization errors and instability. StaQ resolves this by storing a finite stack of the last $M$ neural Q-functions and applying a novel weight-correction scheme that provably converges to the optimal regularized policy without residual error. By replacing policy gradient optimization with an exact, frozen network "stack," StaQ drastically stabilizes learning and delivers competitive performance across discrete MuJoCo and MinAtar benchmarks.
What Problem Does This Paper Address?
Entropy and Kullback-Leibler (KL) divergence regularization are standard ingredients in modern deep RL (e.g., SAC, TRPO) that promote exploration and prevent overly aggressive policy updates. In theory, regularized policy iteration is governed by Policy Mirror Descent (PMD), where the optimal policy update at step $k$ has a closed-form solution: the policy logits are a decaying, weighted average of all historical Q-functions back to step 0.
In practice, when using non-linear function approximators like deep neural networks, summing Q-functions cannot be done simply by summing network weights. As a result, previous algorithms either:
- Approximated the policy update via gradient steps (e.g., TRPO, MDPO), introducing optimization errors that break theoretical guarantees, or
- Truncated the history to a small fixed window (e.g., storing the last 10 networks), which introduces an irreducible approximation error.
Methods
StaQ introduces two main contributions: a theoretically convergent finite-memory PMD formulation and an efficient neural network implementation.
-
Weight-Corrected Finite-Memory EPMD: Naively truncating the logit sum to the last $M$ Q-functions leaves an irreducible asymptotic error proportional to the decay factor $\beta^M$. The authors devise a weight-corrected update rule: $$\xi_{k+1} = \frac{\alpha}{1 - \beta^M} \sum_{i=0}^{M-1} \beta^i Q^{k-i}_\tau$$ This rescales historical weights so they sum to 1 and corrects for the removed $(k-M)$-th network. They prove that when $M$ is chosen large enough ($M > \mathcal{O}(\log(1/\epsilon))$), this scheme converges to the true optimal Q-function $Q^*_\tau$ with zero residual error.
-
Stacked Neural Networks (SNN): Rather than updating a separate policy network with policy gradients, StaQ maintains a FIFO "stack" of $M$ frozen Q-network snapshots. Evaluating the policy logits $\xi_k$ requires a forward pass through the stack, which is batched and parallelized on GPU.
- Computational Speedups: To avoid repeated forward passes through the full stack during Q-learning, the logits $\xi_k$ for replay buffer transitions are pre-computed once at the start of each policy evaluation phase.
- $\epsilon$-Softmax Exploration: Instead of strictly following the softmax policy $\pi_k$, StaQ collects data using an $\epsilon$-softmax mixture to prevent actions from being completely suppressed, which guards against catastrophic forgetting in the Q-function.
[ Learn Current Q-Network: Q^k ]
│ (Freeze & Push)
▼
┌─────────────────────────────────────────┐
│ Stacked Neural Networks (SNN Policy) │
│ [Q^k] -> [Q^{k-1}] -> ... -> [Q^{k-M}] │ ==> Logits: ξ_{k+1}
│ (FIFO Queue) │ ==> Policy: π ∝ exp(ξ)
└─────────────────────────────────────────┘
Datasets
The authors evaluated StaQ across 14 discrete-action environments:
- Gymnasium Classic Control (4): CartPole-v1, Acrobot-v1, LunarLander-v2, MountainCar-v0.
- MinAtar (5): Asterix-v1, Breakout-v1, Freeway-v1, Seaquest-v1, SpaceInvaders-v1.
- Discretized MuJoCo (5): Hopper-v4, Walker2d-v4, HalfCheetah-v4, Ant-v4, and Humanoid-v4, using a "bang-bang" action space discretization ($2d + 1$ actions).
No new benchmarks were introduced.
Key Insights and Ideas
- Optimization-Free Policy Improvement: Stacking frozen networks completely removes gradient-based policy optimization. Because the policy update step is exact, policy-update errors drop to zero.
- Memory Size Matters: Prior heuristics used $M \approx 10$. The authors show theoretically and empirically that harder tasks require significantly larger memory buffers (e.g., $M = 300$). For instance, on Humanoid-v4, $M = 50$ and $M = 100$ fail to stabilize learning, whereas $M = 300$ succeeds.
- GPU Batching Makes Large Stacks Free: Storing $M = 300$ small neural nets adds negligible wall-clock overhead when forward passes are batched across networks on modern GPUs. Training 5 million steps on Hopper-v4 took 9.8 hours for $M=1$ vs. 10.3 hours for $M=300$.
- Parameter Isolation as Continual Learning: The paper draws an explicit link between regularized policy updates and continual learning: rather than regularizing parameters or replaying data, StaQ uses parameter isolation (freezing past learners), preventing past knowledge from being overwritten.
Key Results
- Performance: StaQ matches or outperforms deep RL baselines (DQN, M-DQN, PPO, TRPO, PQN) across the 14 environments. It achieved substantial gains on high-dimensional MuJoCo environments:
- Humanoid-v4: StaQ reached 5,273, compared to 2,965 (PQN), 2,887 (DQN), and 700 (TRPO).
- Walker2d-v4: StaQ scored 3,550, outperforming TRPO (3,010) and PQN (2,585).
- HalfCheetah-v4: StaQ achieved 3,061 vs. 2,850 (PQN) and 1,731 (TRPO).
- Reduced Performance Oscillation: Tracking seed-level deviation across training showed that StaQ exhibits far less within-run performance collapse than Approximate Value Iteration methods (DQN, PQN), confirming that multi-Q averaging acts as a powerful variance reducer.
Limitations and Future Work
- Discrete Actions Only: Computing softmax probabilities directly over the stack requires explicit enumeration over all actions. Extending StaQ to continuous action spaces will require projecting the soft policy back into a parameterized actor network (similar to SAC), which reintroduces an optimization step.
- Vulnerabilities in Policy Evaluation: While the policy update is exact, learning the individual Q-functions via temporal difference errors is still susceptible to overestimation and forgetting, requiring tricks like $\epsilon$-softmax exploration and twin-Q networks.
- Hard Exploration: On sparse-reward tasks like MountainCar-v0, high-entropy objectives act as attractors that trap the policy in a uniform distribution. The authors had to incorporate a "sticky action" mechanism to enable initial exploration.
- Memory Scaling: While stacking works efficiently for lightweight MLPs and small CNNs, keeping 300 full network checkpoints in memory will become prohibitive for large visual or transformer-based backbones without weight-sharing or compression.
Summary updated