$R^2E$: A Role-driven Reward Evolutionary Framework for Automated Reward Function Design

ChangShouhao, Xuan Liu, Hongye Zhu, Xinning Chen, Shigeng ZhangNeurIPS 2026

TL;DR

Teaching robots complex physical skills via Reinforcement Learning (RL) usually requires painstakingly hand-crafting mathematical "reward functions." While Large Language Models (LLMs) can automate this coding process, asking a single, unguided LLM to guess and check often leads to erratic progress and forgotten breakthroughs. $R^2E$ solves this by turning a single LLM into a specialized, collaborative engineering team—complete with a creative Explorer, a cautious Guardian, and a genetic Evolver—backed by a shared memory bank that guarantees steady, ratcheting progress across complex robotic tasks.

What Problem Does This Paper Address?

In Reinforcement Learning, a robot learns by chasing a mathematical carrot: the reward function. Designing this carrot for intricate movements—like spinning a pen or coordinating two robotic hands to swing a cup—traditionally requires immense human trial-and-error.

Recently, frameworks like Eureka showed that LLMs can write and iteratively refine reward code using environment feedback. However, existing LLM-driven methods suffer from two major blind spots:

  1. Undifferentiated Sampling: They treat the LLM as a monolithic random generator, relying on pure luck (temperature sampling) rather than structured search to balance wild new ideas (exploration) with careful tuning (exploitation).
  2. Evolutionary Amnesia: Most frameworks only pass the best reward from iteration $T$ into iteration $T+1$. Because LLM generation is stochastic, iteration $T+1$ might actually perform worse than iteration $T$, causing the system to permanently forget a great historical design and regress.
Figure 1: Comparison of reward design paradigms. (Eureka) generates homogeneous rewards and lacks memory. If iteration T + 1 regresses, the LLM references only T + 1 for T + 2, discarding high-performing rewards from T. (Our Method) populates a Global Elite Pool via initial exploration. Specialized roles query historical elites from the pool to iteratively evolve diverse reward candidates.

Methods

The authors introduce $R^2E$ (Role-driven Reward Evolutionary framework). Instead of standard monolithic prompting, $R^2E$ orchestrates an outer evolutionary loop around standard inner-loop RL training (using Qwen3-Max as the LLM backbone) via three novel components:

  • Explicit Role Specialization: After an unconstrained initial brainstorm (Iteration 1) to map out the space, reward generation is divided among three distinct LLM personas:
  • The Explorer: Queries the best reward and a random elite reward, then deliberately diverges from them to invent unconventional reward terms and escape local optima.
  • The Guardian: Queries only the single best reward and makes conservative tweaks—smoothing scales and balancing weights—to stop action oscillations and stabilize training.
  • The Evolver: Acts as a genetic operator, querying two parent rewards from memory to merge complementary traits (crossover) and introduce controlled variations (mutation).
  • Global Elite Pool: A fixed-capacity memory bank ($K=5$) storing the all-time best reward functions discovered across all iterations. New candidates only enter if they beat the pool's worst performer, creating a strict, monotonically rising performance floor.
  • Dynamic Scheduling Strategy: With a fixed budget of $N=16$ candidates per iteration across $T=5$ iterations, $R^2E$ shifts its staffing over time—allocating $(12, 2, 2)$ to (Explorer, Guardian, Evolver) in Iteration 2, and smoothly transitioning to $(0, 8, 8)$ by Iteration 5 to focus purely on stability and recombination.
Figure 2: Overall architecture of R2E. The framework operates in three main stages: (Stage 1 Initial Iteration): Reward candidates are generated through a broad exploration phase based on the environment code and task descriptions, and then trained on IsaacGym or Bi-DexHands tasks to initialize the Global Elite Pool with the Top 5 functions. (Stage 2 Dynamic Role-driven Iterations): In each iteration, a total of N = 16 candidates are generated through dynamic scheduling by the Explorer, Guardian, and Evolver roles. After RL training and evaluation, the pool is dynamically updated by replacing the worst-performing reward. (Stage 3 End of Iterations): After the search concludes, the Top 1 reward is selected and re-evaluated across five random seeds to produce the final output. (Global Elite Pool): A fixed-capacity memory (K = 5) that stores and ranks the best-performing reward functions across iterations.

Datasets

Rather than static datasets, this work evaluates on 14 physics simulation benchmarks (no new benchmarks are introduced):

  • IsaacGym (6 tasks): Classic locomotion and single-arm/hand manipulation (Ant, Anymal, Quadcopter, AllegroHand, FrankaCabinet, ShadowHand), evaluated via task-specific metrics (like forward speed).
  • Bi-DexHands (8 tasks): Complex bimanual (two-handed) dexterous manipulation (CatchAbreast, DoorCloseOutward, Kettle, LiftUnderarm, Pen, PushBlock, ReOrientation, SwingCup), evaluated via binary task success rates.

Key Insights and Ideas

  • LLMs genuinely embody statistical personas: On AllegroHand, the authors measured the output distributions of each role. Explorers yielded low mean reward ($\mu = 4.9$) with massive variance; Guardians achieved the highest mean ($\mu = 18.8$) with razor-thin variance; and Evolvers landed squarely in between ($\mu = 17.7$). Prompting roles structurally alters search behavior.
  • Bootstrapping from total failure: In LiftUnderarm, initial unconstrained exploration yielded a 0.0000 success rate. Yet, by reading those failed attempts stored in the Elite Pool, the Explorer diagnosed the bad logic to get off the ground, the Guardian stabilized it to 0.6319, and the Evolver pushed it to 0.9186.
  • Memory size is a Goldilocks problem: Ablations showed pool size $K=5$ is optimal. Too small ($K=3$) starves diversity; too large ($K=16$) dilutes the pool with mediocre rewards, causing the Evolver to breed weak parents.

Key Results

$R^2E$ consistently outperforms human-engineered rewards and automated baselines (Eureka, REvolve, and MCTS-based RF-Agent) across all 14 tasks:

  • IsaacGym: $R^2E$ achieved an average human-normalized score of 2.4908, outperforming RF-Agent (2.1512), REvolve (1.8500), and Eureka (1.4578). Notably, it hit a perfect 1.0000 $\pm$ 0.0000 on FrankaCabinet (vs. Human's 0.1230 and Eureka's 0.3816).
  • Bi-DexHands: $R^2E$ achieved the highest mean success rate across every bimanual task, shining on complex coordination like Pen (0.8967 success rate vs. fixed-schedule ablation's 0.7277) and CatchAbreast.
  • Ablations: Removing the Guardian role on the delicate ShadowHand task caused a massive 37.13% performance drop, proving conservative refinement is crucial for high-dimensional control.
Figure 3: Performance Comparison on Bi-DexHands Tasks. Bars and error bars denote the mean and standard deviation of success rates over 5 random seeds, respectively. R2E achieves the highest mean success rate and maintains competitive stability across all environments.

Limitations and Future Work

  • Forgetting Failures: Because the Global Elite Pool only retains top performers, $R^2E$ discards failed reward functions once the pool fills up. Consequently, later iterations might accidentally re-invent broken reward structures. Retaining a persistent memory of failures alongside successes is an open next step.
  • Fixed Search Budgets: Both the iteration horizon ($T=5$) and candidate batch size ($N=16$) are hardcoded in advance. Developing adaptive stopping criteria and dynamic budget sizing during the search remains future work.

Summary updated

Abstract

Designing effective reward functions is a critical challenge in Reinforcement Learning (RL), which traditionally requires costly manual trial-and-error. While Large Language Model (LLM)-based methods have shown promise in reward design, undifferentiated sampling and limited use of historical feedback often lead to insufficient exploration of the reward space and optimization instability. To address these challenges, we propose $R^2E$, a Role-driven Reward Evolutionary framework for automated reward function design that structures the process through explicit role specialization. $R^2E$ employs multiple LLM roles with complementary objectives: an Explorer that promotes novelty to expand the search space, a Guardian that performs conservative refinements to improve training stability, and an Evolver that recombines high-performing rewards via crossover and mutation to integrate effective structures. A dynamic scheduling strategy coordinates these roles, progressively shifting the search from broad exploration to focused exploitation. To mitigate optimization instability and provide a medium for cross-role collaboration, $R^2E$ incorporates a Global Elite Pool that retains the best-performing rewards to guide subsequent generations, thereby enabling coordinated interaction among roles and ensuring a reliable and consistent refinement process. Extensive experiments on multiple robotic tasks demonstrate the effectiveness of our method.
BibTeX
@inproceedings{changshouhao2026r,
  author = {ChangShouhao and Xuan Liu and Hongye Zhu and Xinning Chen and Shigeng Zhang},
  title = {{$R^2E$: A Role-driven Reward Evolutionary Framework for Automated Reward Function Design}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=1cF9AZ8yjY},
}
Figure