NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Training Efficient Controllers via Analytic Policy Gradient

Nina Wiedemann, Valentin Wüest, Antonio Loquercio, Matthias Müller, Dario Floreano, Davide Scaramuzza

Abstract

In robotics, choosing a control strategy often involves a trade-off between the high-precision tracking of Model Predictive Control (MPC) and the rapid execution of Reinforcement Learning (RL). This paper introduces the Analytic Policy Gradient (APG) framework, which leverages differentiable simulators to train neural network controllers offline. By incorporating a concurrent training strategy and a curriculum learning approach based on state resets, APG achieves tracking accuracy comparable to MPC while operating over an order of magnitude faster. Furthermore, APG demonstrates superior sample efficiency, requiring significantly less data than traditional model-free RL methods.

Introduction

The deployment of sophisticated control algorithms on resource-constrained hardware, such as small drones, remains a significant challenge. Model Predictive Control (MPC) offers exceptional accuracy by solving optimization problems in real-time but demands substantial computational power. Conversely, Reinforcement Learning (RL) provides fast inference after offline training but often lacks the precision of MPC and suffers from poor sample efficiency.

The authors propose Analytic Policy Gradient (APG) as a solution. APG utilizes "differentiable simulators"—physics engines that allow for the mathematical calculation of gradients through the system's dynamics. This enables direct optimization of a controller's parameters. However, training via APG is traditionally difficult due to issues like vanishing or exploding gradients.

Methodology

The APG framework addresses training instability through two primary innovations:

Concurrent Training Strategy

Standard autoregressive training, where predictions are fed back into the model step-by-step, often leads to exploding gradients over long horizons. The authors found that a concurrent approach—predicting a sequence of $T$ actions simultaneously—stabilizes the gradient chain. This method allows the controller to learn from the entire trajectory's physics without the numerical instability associated with deep backpropagation through time.

Comparison of concurrent APG-based training and Model Predictive Control (MPC).

Curriculum Learning via Resets

To prevent the agent from becoming trapped in local minima or failing early in training, the researchers implemented a curriculum learning strategy. A "divergence threshold" ($\tau_{div}$) is defined; if the robot's state $S$ deviates too far from the reference path $\nu$, the system is reset. As the controller improves, $\tau_{div}$ is gradually increased, forcing the agent to learn recovery from progressively larger errors.

Curriculum learning strategy using a divergence threshold ($\tau_{div}$) and resets to stabilize training.

Experimental Evaluation

The APG framework was tested across three simulated environments:

  • CartPole: Balancing an inverted pendulum.
  • Quadrotor (Flightmare): Tracking 3D polynomial trajectories using a dataset of 10,000 random trajectories.
  • Fixed-wing Drone: Navigating a high-speed aircraft toward 3D targets, a task with constrained maneuverability.

Key Results and Insights

The experiments yielded several critical findings:

  • Efficiency: In quadrotor tasks, APG achieved a runtime of 0.17ms per step, a 30x speedup over MPC's 5.2ms.
  • Precision: APG's tracking error (0.05m) nearly matched MPC (0.03m) and significantly outperformed PPO (0.36m).
  • Sample Efficiency: APG required 1 to 4 orders of magnitude less data than model-free RL. In vision-based tasks, it reached high performance with only 1,000 samples, whereas PPO required 230,000.
  • Adaptability: By training a residual dynamics model, APG controllers could adapt to new physical conditions (e.g., wind drag) with minimal additional data.

Conclusion

Analytic Policy Gradient effectively "compiles" the physics-based optimization of MPC into a fast neural network. While it currently relies on differentiable models and faces challenges with very long planning horizons, its combination of speed, accuracy, and data efficiency marks a significant advancement for real-time robotic control. Future work will focus on extending these results to physical hardware and unpredictable real-world environments.

Summary updated

BibTeX
@inproceedings{wiedemann2023training,
  author = {Nina Wiedemann and Valentin Wüest and Antonio Loquercio and Matthias Müller and Dario Floreano and Davide Scaramuzza},
  title = {{Training Efficient Controllers via Analytic Policy Gradient}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  doi = {10.1109/icra48891.2023.10160581},
}
Figure