[Paper Review] Low-Precision Reinforcement Learning: Running Soft Actor-Critic in Half Precision
This paper demonstrates that Soft Actor-Critic (SAC) agents can be trained in half-precision (bfloat16/fp16) without performance degradation by introducing six numerical stability techniques. The proposed methods—such as storing the square root of the second moment in Adam and reordering arithmetic operations—enable full performance with reduced memory and compute, matching full-precision rewards in continuous control environments without hyperparameter tuning.
Low-precision training has become a popular approach to reduce compute requirements, memory footprint, and energy consumption in supervised learning. In contrast, this promising approach has not yet enjoyed similarly widespread adoption within the reinforcement learning (RL) community, partly because RL agents can be notoriously hard to train even in full precision. In this paper we consider continuous control with the state-of-the-art SAC agent and demonstrate that a naïve adaptation of low-precision methods from supervised learning fails. We propose a set of six modifications, all straightforward to implement, that leaves the underlying agent and its hyperparameters unchanged but improves the numerical stability dramatically. The resulting modified SAC agent has lower memory and compute requirements while matching full-precision rewards, demonstrating that low-precision training can substantially accelerate state-of-the-art RL without parameter tuning.
Motivation & Objective
- To enable low-precision reinforcement learning in continuous control tasks using the state-of-the-art SAC algorithm.
- To address the numerical instability that prevents direct adaptation of supervised learning low-precision techniques to RL.
- To develop a set of simple, plug-and-play modifications that maintain full-precision performance while reducing memory and compute.
- To demonstrate that low-precision RL is feasible without retraining or hyperparameter adjustment.
- To provide a reproducible codebase and methodology to accelerate future research in low-precision RL.
Proposed method
- Propose storing the square root of the second moment in Adam optimizer to reduce dynamic range and improve numerical stability in low precision.
- Reorder arithmetic operations to minimize cancellation errors and improve precision in gradient updates.
- Apply loss scaling and NaN/infinity handling strategies adapted for RL, though these alone are insufficient.
- Use mixed-precision training with fp16 for weights and activations, but only when combined with the proposed stability techniques.
- Employ qtorch for simulation of various low-precision formats, including bfloat16 and 8-bit fixed-point, to validate robustness.
- Introduce a modified training loop that maintains full-precision statistics for key components (e.g., target network) while training in low precision.
Experimental results
Research questions
- RQ1Can standard low-precision training techniques from supervised learning be directly applied to SAC in reinforcement learning?
- RQ2What specific modifications are required to achieve numerical stability in fp16 training for SAC?
- RQ3Can low-precision SAC match full-precision performance without hyperparameter tuning?
- RQ4What are the memory and compute savings when training SAC in half precision with the proposed methods?
- RQ5How robust are the proposed methods across different hyperparameter settings and environments?
Key findings
- Naïve application of supervised learning low-precision techniques, such as loss scaling and mixed precision, fails to achieve competitive performance in SAC training.
- The proposed six modifications enable fp16 training of SAC to match full-precision performance on both state-based and pixel-based continuous control environments.
- Memory usage is reduced by approximately 50% and compute time is significantly accelerated when training in half precision with the proposed methods.
- The method is robust across random hyperparameter settings, indicating stability beyond tuned configurations.
- Ablation studies confirm that each proposed technique contributes to numerical stability, with the square root of the second moment storage being particularly impactful.
- The code and implementation are released to support reproducibility and future research in low-precision RL.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.