Abstract
Deploying continuous-control reinforcement learning policies on embedded hardware requires meeting tight latency and power budgets. Small FPGAs can deliver these, but only if costly floating point pipelines are avoided. We study quantization-aware training (QAT) of policies for integer inference and we present a learning-to-hardware pipeline that automatically selects low-bit policies and synthesizes them to an Artix-7 FPGA. Across five MuJoCo tasks, we obtain policy networks that are competitive with full precision (FP32) policies but require as few as 3 or even only 2 bits per weight, and per internal activation value, as long as input precision is chosen carefully. On the target hardware, the selected policies achieve inference latencies on the order of microseconds and consume microjoules per action, favorably comparing to a quantized reference. Last, we observe that the quantized policies exhibit increased input noise robustness compared to the floating-point baseline.
Introduction
Deep Reinforcement Learning (RL) has demonstrated significant potential in controlling complex systems, yet deploying these policies on embedded systems remains a challenge. High-speed control requires minimal latency, while battery-powered devices demand extreme power efficiency. Standard Field-Programmable Gate Arrays (FPGAs) are highly efficient for integer arithmetic but struggle with the floating-point (FP32) math standard in AI. While post-training quantization often degrades RL policy performance, this research introduces a pipeline to train policies specifically for low-power integer hardware using as little as 2 or 3 bits for weights and activations.
Methodology: Quantization-Aware Training
The core of the proposed "learning-to-hardware" pipeline is Quantization-Aware Training (QAT). Instead of post-hoc rounding, the researchers insert Quantize/De-Quantize (QDQ) nodes into the neural network during training. These nodes simulate rounding errors and limited integer ranges. To overcome the non-differentiable nature of rounding, a Straight-Through Estimator (STE) is used to approximate gradients during backpropagation.
The pipeline employs a three-step model selection strategy:
- Bitwidth Sensitivity Analysis: Sweeping bitwidths to identify the minimum viable precision for internal "core" layers.
- Width Scaling: Reducing hidden layer sizes to the minimum necessary width.
- Input Precision Tuning: Separately optimizing the precision of sensor inputs, which are more sensitive to quantization than internal layers.
Finally, the FINN compiler is used to synthesize these trained policies into custom hardware logic for a Xilinx Artix-7 FPGA.
Experimental Results
The approach was evaluated using the MuJoCo physics engine across five tasks: Humanoid-v4, Walker2d-v4, Ant-v4, HalfCheetah-v4, and Hopper-v4.
Performance and Efficiency
Across most tasks, quantized models achieved rewards within one standard deviation of the FP32 baseline. On the Artix-7 FPGA, these policies achieved microsecond-scale inference latencies (e.g., 0.2 µs for Hopper) and energy consumption in the microjoule range. Moving from 4-bit to 2-bit or 3-bit cores significantly reduced hardware resource usage (BRAM and LUTs), enabling complex policies to fit on smaller, more affordable chips.
Robustness to Noise
A surprising finding was that quantized policies often outperformed FP32 baselines when random noise was injected into sensors. The "coarseness" of quantization appears to act as a form of implicit regularization, enhancing robustness to real-world jitter.
Discussion and Future Work
While these results are promising, the study was conducted in simulation, leaving a "sim-to-real" gap regarding mechanical wear and sensor delays. Future work will focus on physical robot evaluations and exploring even more extreme binarized (1-bit) policies. Additionally, while MuJoCo is a standard benchmark, extending this pipeline to vision-based RL tasks involving larger architectures like CNNs or Transformers remains an open challenge.
Summary updated