RLx2: Training a Sparse Deep Reinforcement Learning Model from Scratch

Yiqin Tan, Pihe Hu, Ling Pan, Longbo Huang

RLx2: Training a Sparse Deep Reinforcement Learning Model from Scratch

Introduction

Deep Reinforcement Learning (DRL) has demonstrated remarkable success in complex tasks, from robotics to strategic gaming. However, these achievements often rely on massive, over-parameterized dense networks that impose a significant "compute tax." While model compression is common for deploying agents on edge devices, it typically requires training a large dense model first, saving no resources during the training phase. RLx2 (Rigged Reinforcement Learning Lottery) addresses this by enabling the training of ultra-sparse networks (90%+ sparsity) from scratch, delivering up to 20x training acceleration and 50x inference speedups with minimal performance loss.

The Challenge: Why Sparse RL is Hard

In supervised learning, training sparse networks from scratch is relatively straightforward. In RL, however, the process is complicated by non-stationarity. The agent's learning target (the TD target) shifts as it explores the environment. Sparse networks, with their limited hypothesis space, often struggle to track these moving targets, frequently leading to learning collapse.

The RLx2 Framework

RLx2 introduces a framework where agents are "born sparse" and maintain that sparsity throughout their lifecycle. The method is built on three core innovations:

  1. Gradient-Based Topology Evolution: RLx2 periodically "prunes" connections with minimal weights and "grows" new ones in regions with high gradients. This allows the network to dynamically search for an optimal architecture during training.
  2. Delayed Multi-step TD Targets: To stabilize value estimation, RLx2 utilizes multi-step returns. The transition from 1-step to multi-step targets is delayed until the policy shows signs of stabilization, preventing early-stage instability from disrupting the sparse network.
  3. Dynamic-Capacity Replay Buffer: Instead of a fixed-size memory, RLx2 uses a buffer that adjusts based on "policy distance." By shrinking or growing the buffer according to how much the agent's strategy has changed, the system ensures the sparse network is not misled by outdated data.
The RLx2 architecture featuring topology evolution for both actor and critic, alongside a dynamic-capacity replay buffer.

Performance and Efficiency

The researchers evaluated RLx2 using the MuJoCo suite, a benchmark for continuous control. RLx2 was integrated with popular off-policy algorithms like TD3 and SAC.

Key findings include:

  • Extreme Compression: RLx2 maintains performance within 3% of dense models while being 7.5x to 25x smaller.
  • Superior Scaling: Unlike static sparse methods or previous evolution algorithms like SET and RigL, RLx2 maintains high performance even at extreme sparsity levels (e.g., >95%).
  • Automated Feature Selection: In complex environments like Ant-v3, the pruning process naturally eliminated redundant input dimensions, effectively performing feature selection as a byproduct of learning.
Performance vs. Sparsity across Walker2d-v3 and Ant-v3 environments. RLx2 (brown) consistently outperforms other sparse training methods at high sparsity levels.

Conclusion

RLx2 demonstrates that the "compute tax" of DRL is not an inevitability. By stabilizing value estimation and allowing for dynamic topology evolution, RLx2 enables efficient training of sparse models from scratch. This paves the way for deploying and training sophisticated RL agents on resource-constrained hardware, such as mobile phones and autonomous robots, without the need for expensive dense pre-training.

Summary updated

BibTeX
@inproceedings{tan2023rlx,
  author = {Yiqin Tan and Pihe Hu and Ling Pan and Longbo Huang},
  title = {{RLx2: Training a Sparse Deep Reinforcement Learning Model from Scratch}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=DJEEqoAq7to},
}
Figure