Abstract
Training recurrent reinforcement learning (RL) agents is notoriously unstable due to the autoregressive nature of recurrent architectures, where small updates to weights can lead to amplified changes in output over long sequences. This paper introduces RESeL (Recurrent Off-policy RL with Context-Encoder-Specific Learning Rate), a simple yet effective strategy that decouples the learning rates of the recurrent context encoder and the rest of the network. By applying a significantly lower learning rate to the context encoder, RESeL achieves state-of-the-art results across a wide range of partially observable tasks, meta-RL benchmarks, and long-term credit assignment challenges.
Introduction
In real-world applications, agents rarely operate with full observability. Robots and autonomous systems typically navigate Partially Observable Markov Decision Processes (POMDPs), where sensor noise, occlusions, or hidden environmental parameters (like friction or gravity) obscure the true state of the world. To mitigate this, agents must utilize "memory"—typically implemented via Recurrent Neural Networks (RNNs) or Transformers—to encode historical observations into a representative context.
However, integrating recurrent architectures into off-policy RL has historically been difficult. The authors identify a fundamental "Learning Rate Paradox": the learning rate required for an MLP-based policy to learn efficiently is often too high for a recurrent encoder to remain stable. This instability stems from the autoregressive property of RNNs, where the hidden state at one timestep is fed into the next, causing gradient updates to compound and blow up as sequence lengths increase.
The Stability Challenge: The Amplification Factor
The core theoretical contribution of this work is the identification of the "amplification factor." The paper mathematically demonstrates (Proposition 1) that the variation in an RNN's output following a weight update is bounded by a factor that grows exponentially with the sequence length.
Empirical observations support this theory: when using uniform learning rates across the entire architecture, action variations were observed to increase by as much as 400% by only the 20th step of a rollout. This volatility makes it nearly impossible for off-policy algorithms to converge on optimal policies in complex, long-horizon environments. To maintain stability with a single learning rate, one would have to set it so low that the rest of the network (the policy and value functions) would fail to learn in a reasonable timeframe.
The RESeL Method
To resolve this paradox, the authors propose RESeL. The strategy is characterized by three primary components:
1. Dual-Learning Rate Strategy
The core innovation is the decoupling of learning rates:
- Context Encoder ($LR_{CE}$): This module uses a very low learning rate (e.g., $1 \times 10^{-5}$ or $2 \times 10^{-6}$) to ensure the stability of the recurrent hidden states.
- Other Layers ($LR_{other}$): The MLP pre-encoders and policy/value layers use a standard, higher learning rate (e.g., $3 \times 10^{-4}$) to maintain learning efficiency.
2. Efficient Architecture with Mamba
While the dual-learning rate strategy is compatible with traditional RNNs like GRUs, RESeL primarily utilizes Mamba, a State Space Model (SSM). Mamba offers superior parallelization and handles long sequences significantly faster than traditional RNNs. For a sequence of 1,000 steps, Mamba’s update time is approximately 25% of that required for a GRU, making it ideal for high-throughput RL training.
3. Robust Value Estimation
RESeL integrates with the REDQ algorithm, utilizing an ensemble of eight Q-functions. This ensemble helps stabilize value estimates, which is particularly beneficial when training on full-length trajectories rather than the truncated segments typically used to hide RNN instability.
Experimental Evaluation
The authors evaluated RESeL across 23 diverse environments, categorized into four main benchmarks:
- Classic POMDPs: PyBullet locomotion tasks where critical information (velocity or position) is hidden.
- Meta-RL (Dynamics-Randomized): MuJoCo tasks with unobservable randomized gravity.
- Classic Meta-RL: Tasks like
AntDirandCheetahVelrequiring adaptation to changing goals. - Long-Term Credit Assignment: The
Key-to-Doortask, requiring memory of an action taken hundreds of steps prior to a reward.
Key Results
- SOTA Performance in POMDPs: RESeL outperformed the previous state-of-the-art (GPIDE) by an average of 24.6% across classic POMDP benchmarks.
- Meta-RL Breakthroughs: In gravity-randomized tasks, RESeL exceeded the performance of the previous best method (ESCP) by 43.4%.
- Superior Memory: In the
Key-to-Doortask, RESeL achieved higher success rates than Transformer-based models (such as MF-GPT) on 500-step sequences, demonstrating robust long-term dependency handling. - Generalization to MDPs: Surprisingly, RESeL also outperformed standard non-recurrent methods like SAC in fully observable MDPs, suggesting that recurrent memory helps smooth noise or better estimate system momentum even when not strictly required for state estimation.
Discussion and Limitations
While RESeL provides a significant performance boost, it introduces a new hyperparameter: the specific learning rate for the context encoder ($LR_{CE}$). Currently, the optimal ratio between $LR_{CE}$ and $LR_{other}$ must be determined through manual tuning, though the authors provide a recommended range that works across most tasks.
Furthermore, while the benefits in POMDPs are clear, the mechanism by which RESeL improves performance in fully observable MDPs remains a subject for further investigation. Future work may focus on automated strategies for dynamically adjusting these decoupled learning rates during the training process.
Conclusion
RESeL demonstrates that the primary barrier to efficient recurrent off-policy RL is not the choice of architecture alone, but the optimization strategy. By acknowledging the unique stability requirements of recurrent context encoders and applying a specific, lower learning rate, RESeL enables stable, high-performance learning across a vast array of challenging, partially observable environments.
Summary updated