Gradient-Based Co-Design of Systems and Reinforcement Learning Policies with Differentiable Simulators

Akhil S. Anand, Xun Shen, Marc Peter Deisenroth, Sebastien GrosarXiv 2026

TL;DR

This paper introduces a gradient-based framework for co-design, the simultaneous optimization of a physical system’s parameters and the reinforcement learning (RL) policy that controls it. By leveraging differentiable simulators and the Implicit Function Theorem, the authors derive a method to calculate how design changes affect the optimal policy, allowing for efficient, high-dimensional optimization that significantly outperforms traditional black-box methods like Bayesian Optimization.

What Problem Does This Paper Address?

In engineering, "co-design" is the art of building a system (like a robot's limb lengths or a power grid's capacity) while simultaneously deciding how to control it. These two factors are inextricably linked: a great robot design is useless with a poor controller, and a controller's performance is limited by the physical constraints of the design.

Traditionally, this is treated as a bilevel optimization problem. The "inner loop" trains a policy for a specific design, and the "outer loop" evaluates that design's performance to suggest a better one. Because RL training is often seen as a "black box," the outer loop usually relies on zero-order search methods like Bayesian Optimization (BO) or Evolution Strategies (ES). However, these methods scale poorly as the number of design parameters increases and ignore the rich gradient information available in modern differentiable simulators.

Methods

The authors propose a fully gradient-based approach to co-design by exploiting Differentiable Simulators and Pathwise Derivative (PD) RL methods (specifically Stochastic Value Gradients and Short-Horizon Actor-Critic).

The core technical contribution is the derivation of the co-design policy gradient. They decompose the gradient of the design objective into two parts:

  1. The Direct Effect: How changing the design affects the objective while keeping the current policy fixed.
  2. The Indirect Effect (Policy Sensitivity): How changing the design shifts the optimal policy itself.

To calculate this indirect effect without the prohibitive cost of differentiating through an entire RL training run, the authors apply the Implicit Function Theorem (IFT) to the stationarity condition of the policy gradient. This allows them to compute the sensitivity of the converged policy to design changes using a damped linear solve involving the policy Hessian. They implement this in a practical algorithm (Algorithm 1) that uses warm-started policy updates to track the design as it evolves.

Datasets

The researchers evaluated their method on a newly developed, scalable benchmark: a fully differentiable inventory-routing network.

  • The Task: A graph-based system where nodes represent warehouses with stochastic demand and edges represent transport links.
  • Design Parameters: The capacities of supply, service, and routing links (ranging from 15 to 150 dimensions).
  • Control Policy: A neural network determining how much stock to draw, serve, and route at each time step.
  • Significance: Unlike standard RL benchmarks (like MuJoCo), this environment allows for high-dimensional design spaces, making it a rigorous test for scalability.

Key Insights and Ideas

  • The "Aha" Moment for Sensitivity: The authors point out that if the design objective and policy objective are perfectly aligned, the "indirect effect" vanishes at the optimum (the Envelope Theorem). However, in real-world co-design, objectives are often misaligned (e.g., the design objective includes a capital cost that the controller doesn't care about). In these cases, accounting for policy sensitivity is crucial for finding the true optimum.
  • Scalability via Gradients: While BO and ES only receive a single scalar "score" per design evaluation, the gradient-based approach provides a specific signal for every design parameter simultaneously.
  • Warm-Starting is Sufficient: The convergence analysis proves that you don't need to fully re-train the RL policy from scratch for every design update. A "tracking" approach, where the policy is updated slightly alongside the design, is enough to reach an approximately stationary point.

Key Results

  • Outperforming Black-Boxes: The gradient-based method consistently outperformed BO and ES across all tested dimensions.
  • Dimensionality Advantage: The performance gap widened significantly as the design space grew. At 150 design parameters, the gradient method achieved results that black-box methods couldn't approach within the same evaluation budget.
  • Sensitivity Gains: In "misaligned" scenarios, including the IFT-based sensitivity term led to 58%–99% better performance compared to a "direct-only" gradient approach that ignores how the policy adapts.
  • Refinement Capability: The method proved highly effective at "refining" designs already optimized by ES, finding significant further improvements that zero-order search had missed.

Limitations and Future Work

  • Simulator Requirements: The method requires a differentiable simulator. While these are becoming more common (e.g., Brax, DiffTaichi), systems with "hard" non-differentiable logic or discrete design choices still require smooth relaxations to work with this framework.
  • Computational Overhead: Calculating the policy sensitivity requires second-order derivatives (Hessians) and a linear solve. While the authors use matrix-free methods to mitigate this, it is still more computationally intensive per iteration than standard RL.
  • Local Optima: As a gradient-based method, it is susceptible to local optima. The authors suggest a hybrid approach: using a black-box method to find a good global starting point, then using their gradient method for high-dimensional refinement.
  • Stiff Dynamics: Very stiff or chaotic systems can lead to exploding gradients in differentiable simulators, which remains a general challenge for pathwise derivative methods.

Summary updated

Abstract

Co-design is the problem of jointly optimizing the design of a system and the policy that operates it. Neither can be chosen independently: a system design is only as good as the policy trained for it, and the optimal policy changes with the design. When that policy is learned by reinforcement learning (RL), evaluating a candidate design requires a full policy training run, and the design is usually optimized by black-box search such as Bayesian optimization (BO) or evolution strategies (ES). These methods scale poorly with the design dimension and ignore the differentiable structure of modern simulators and, in particular, the sensitivity of the optimal policy with respect to the design. We instead derive a gradient-based co-design method, where the design gradient decomposes into a direct effect of changing the design at a fixed policy and an indirect effect through the design-dependent optimal policy. The indirect effect requires the sensitivity of the converged policy to the design, which we obtain by applying the implicit function theorem to the stationarity condition of the policy gradient. Based on this sensitivity, we develop a proof-of-concept co-design algorithm with stochastic value gradient (SVG)-style policy optimization, prove that it converges to an approximately stationary design, and demonstrate on a differentiable networked-system benchmark with high-dimensional design spaces that it consistently outperforms BO and ES.
BibTeX
@misc{anand2026gradient,
  author = {Akhil S. Anand and Xun Shen and Marc Peter Deisenroth and Sebastien Gros},
  title = {{Gradient-Based Co-Design of Systems and Reinforcement Learning Policies with Differentiable Simulators}},
  year = {2026},
  eprint = {2611.19329},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.19329},
}
Figure