Differentiable Evolutionary Reinforcement Learning

Sitao Cheng, Tianle Li, Xuhan Huang, Xunjian Yin, Difan Zou

TL;DR

This paper introduces Differentiable Evolutionary Reinforcement Learning (DERL), a novel bi-level framework that automates the discovery of optimal reward functions. By treating reward generation as a differentiable optimization problem, DERL learns a "meta-gradient" to guide the reward discovery process, leading to state-of-the-art performance and improved out-of-distribution generalization across various complex reasoning tasks.

What Problem Does This Paper Address?

Crafting effective reward signals is a major bottleneck in Reinforcement Learning (RL), especially for complex tasks requiring reasoning. Manually designing rewards is time-consuming and prone to "reward hacking," where agents exploit loopholes in the reward function. Existing automated methods often treat the reward function as a black box, using derivative-free heuristics that fail to learn the causal relationship between reward structure and policy performance. This leads to sample inefficiency and a lack of understanding of why certain reward modifications improve performance. The authors aim to bridge this gap by developing a method that can autonomously discover optimal reward structures in a differentiable and interpretable way.

Methods

The core innovation is the Differentiable Evolutionary Reinforcement Learning (DERL) framework, which operates on a bi-level optimization principle:

  • Inner-Loop (Policy Optimization): A standard RL algorithm (GRPO is used) trains a policy model using a reward function generated by the outer-loop.
  • Outer-Loop (Meta-Optimizer): This is the novel component. A "Meta-Optimizer" learns to generate reward functions. Instead of arbitrary generation, it composes reward functions from a set of predefined atomic primitives (e.g., checking for correct formatting, step counts, outcome correctness). The Meta-Optimizer is trained using RL itself, where its "reward" is the validation performance of the inner-loop policy. Crucially, DERL makes this meta-optimization differentiable by using policy gradients derived from the inner-loop's validation performance. This allows the Meta-Optimizer to learn a "meta-gradient" – how changes in reward structure affect task success – enabling it to iteratively refine the reward function.

This approach contrasts with traditional methods by:

  • Structured Reward Composition: Using atomic primitives to create a structured and interpretable search space for rewards, rather than generating arbitrary code.
  • Differentiable Meta-Optimization: Employing policy gradients to update the Meta-Optimizer, allowing it to learn from performance feedback directly, unlike black-box evolutionary methods.

Datasets

The paper evaluates DERL on three distinct domains:

  • Robotic Agent: ALFWorld [13] - a benchmark for embodied household tasks.
  • Scientific Simulation: ScienceWorld [14] - an interactive text environment for scientific reasoning.
  • Mathematical Reasoning: GSM8K [15] and MATH [16] - datasets for grade-school and advanced math problems, respectively.

The experiments also define generalization levels (L0, L1, L2) based on in-distribution/out-of-distribution and seen/unseen data splits, inspired by RLVMR [23].

Key Insights and Ideas

  • Learning the "Meta-Gradient": The most significant insight is that by using validation performance as feedback for the Meta-Optimizer, DERL can learn a "meta-gradient." This allows it to understand how reward structure modifications influence policy performance, leading to more efficient and effective reward discovery.
  • Atomic Primitives Enable Generalization: The use of structured atomic primitives, rather than arbitrary reward functions, allows DERL to discover reward structures that generalize well to unseen scenarios and out-of-distribution data. The framework learns to compose these primitives in a way that captures the intrinsic logic of tasks.
  • Implicit Discovery of Reward Design Principles: The Meta-Optimizer, through gradient feedback, implicitly learns principles of good reward design, such as numerical stability and boundedness, without explicit human programming. This is demonstrated by the evolution towards "stable structures" in reward functions.
  • DERL-pop for Efficiency: The DERL-pop variant, which initializes inner-loop policies from the best performing checkpoint of previous generations, shows exceptional performance and significantly reduces computational cost by allowing more frequent outer-loop updates.

Key Results

  • State-of-the-Art Performance: DERL achieves state-of-the-art results on ALFWorld and ScienceWorld benchmarks across all generalization levels. For instance, DERL-pop achieved 91.8% on ALFWorld (L0) and 98.2% on ScienceWorld (L0).
  • Superior OOD Generalization: DERL significantly outperforms baselines in out-of-distribution (OOD) scenarios, more than doubling the performance of outcome reward baselines on ALFWorld and ScienceWorld (e.g., achieving 65.0% on ALFWorld L2).
  • Effective in Sparse Reward Settings: Even in mathematical reasoning tasks where outcome rewards are strong but sparse, DERL discovers non-trivial reward compositions that provide denser feedback and outperform baselines, achieving 62.9% on MATH with the regression-based Meta-Reward.
  • Robustness to Primitive Vocabulary: Ablation studies show that DERL is not overly sensitive to the specific set of atomic primitives, even with arbitrary removals or the introduction of "toxic" signals, indicating its ability to find useful reward functions within a limited vocabulary.

Limitations and Future Work

  • Reliance on Atomic Primitives: A limitation is that the framework relies on a predefined set of atomic primitives. While empirically shown to be robust, defining these primitives still requires some human design. Future work could explore methods for automatically discovering or generating these primitives.
  • Computational Cost: The bi-level optimization process is computationally intensive due to multiple inner-loop rollouts. DERL-pop offers an efficiency improvement, but further research into more sample-efficient outer-loop algorithms and simpler inner-loop requirements (e.g., using REINFORCE++ or proxy tasks) is suggested to make DERL accessible with lower computational budgets.
  • Interpretability of Evolved Rewards: While DERL discovers stable and robust reward structures, ensuring that these generated rewards do not incentivize unintended behaviors in long-horizon tasks requires further interpretability analysis.

Summary updated

BibTeX
@inproceedings{cheng2026differentiable,
  author = {Sitao Cheng and Tianle Li and Xuhan Huang and Xunjian Yin and Difan Zou},
  title = {{Differentiable Evolutionary Reinforcement Learning}},
  booktitle = {RSI @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=uXTXcZ615k},
}
Figure