arXiv:2412.17113cs.LGmath.OC2024-12NeurIPS被引 13

改进Adam优化器,让强化学习更稳定

Adam on Local Time: Addressing Nonstationarity in RL with Relative Adam Timesteps

  • 用局部时间步替代全局时间步更新参数
  • 在Atari和Craftax上性能提升,避免大更新导致的不稳定
  • 适合做RL训练时想减少调参的开发者

强化学习中常用神经网络和动量优化器,但这些工具主要针对静态监督学习设计,面对强化学习中的非平稳性(如目标网络更新)易引发大梯度更新,影响性能。本文分析发现,目标网络变化会显著增大梯度幅度,从而触发Adam的大幅更新。为此提出Adam-Rel:不使用全局时间步,而是在每个周期内重置为局部时间步,使优化器对目标网络切换更鲁棒。实验表明,该方法在On-policy与Off-policy设置下均提升性能,尤其在Atari和Craftax环境中有效减少异常更新。进一步分析显示,实际训练中梯度范数确实存在上升现象,理论模型与观测数据基本一致。

原文摘要 · Abstract (English)

In reinforcement learning (RL), it is common to apply techniques used broadly in machine learning such as neural network function approximators and momentum-based optimizers. However, such tools were largely developed for supervised learning rather than nonstationary RL, leading practitioners to adopt target networks, clipped policy updates, and other RL-specific implementation tricks to combat this mismatch, rather than directly adapting this toolchain for use in RL. In this paper, we take a different approach and instead address the effect of nonstationarity by adapting the widely used Adam optimiser. We first analyse the impact of nonstationary gradient magnitude -- such as that caused by a change in target network -- on Adam's update size, demonstrating that such a change can lead to large updates and hence sub-optimal performance. To address this, we introduce Adam-Rel. Rather than using the global timestep in the Adam update, Adam-Rel uses the local timestep within an epoch, essentially resetting Adam's timestep to 0 after target changes. We demonstrate that this avoids large updates and reduces to learning rate annealing in the absence of such increases in gradient magnitude. Evaluating Adam-Rel in both on-policy and off-policy RL, we demonstrate improved performance in both Atari and Craftax. We then show that increases in gradient norm occur in RL in practice, and examine the differences between our theoretical model and the observed data.

强化学习优化器Adam改进

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。