DERL tunes the reward proposer itself with its trials and their scores. A small proposer composes a reward from task primitives, an inner policy trains with that reward, and the inner policy's validation score updates the proposer by policy gradient. The project page has the full results and an interactive analysis: https://sitaocheng.github.io/derl/
This repository contains the code for the paper. It is built on veRL and uses GRPO in both loops. We implement the training loop that couples the two loops. The outer-loop group-relative advantage and the inner-loop training are adapted from the veRL code.
Three ways to design a reward. A human revises the reward after every RL run. A static proposer (a frozen LLM) reads earlier scores in its prompt, but its weights never change. In DERL, every validation score updates the proposer by policy gradient. The curves are the mean GSM8K test accuracy of the inner policies trained from each outer step's proposals, and the reward programs in the animation are illustrative.
The proposer reads a fixed task instruction and samples n reward programs. Each program trains one inner policy with GRPO, and the policy's validation score is the reward of that program. The group-normalized scores update the proposer with GRPO.
- Clone the repository.
git clone https://github.com/sitaocheng/DERL cd DERL - Install the dependencies.
pip install -r requirements.txt
- Set the paths and settings in
grpo_coordinator.pyandrun_qwen2_5_3b_llm_math_meta_llm_rl.shfor your environment. - Download the base model for the inner-loop policy (for example,
Qwen/Qwen2.5-3B) and setmodel_pathin the script. - Download the initial outer-loop proposer from our Hugging Face organization and set
INITIAL_MODEL_PATHingrpo_coordinator.py. - Put your training, validation and test data in
./dataset/and set the data paths ineval_vllm.py. The scripts in./examples/data_preprocessare a good starting point. - Define your primitives in
./verl/utils/reward_score/meta_reward_grpo.pyand set the dataset information in./verl/utils/reward_score/__init__.py. - Run the coordinator.
python grpo_coordinator.py
| File | Role |
|---|---|
grpo_coordinator.py |
Coordinates the outer and inner loops for DERL-base. |
grpo_coordinator_population.py |
Coordinates the outer and inner loops for the round-based variant (DERL-pop in the code, DERL-full on the project page). |
eval_vllm.py, eval.sh |
Evaluate validation and test performance with vLLM (eval.sh is called by the coordinator). |
constrained_rollout.py |
Generates reward programs with constrained decoding. |
expression_check.py |
Checks that a generated reward program is a valid arithmetic expression. |
verl/utils/reward_score/meta_reward_grpo.py |
Defines the primitives. |
verl/utils/reward_score/__init__.py |
Applies the generated reward (custom_fn). |
verl/trainer/ppo/ray_trainer.py |
Outer-loop GRPO update (fit_outer()). |
examples/grpo_trainer/run_qwen2_5_3b_llm_math_meta_llm_rl.sh |
Inner-loop training script. |
examples/grpo_trainer/run_qwen2_5_3b_llm_math_meta_llm_rl_population.sh |
Inner-loop training script for the round-based variant. |
examples/grpo_trainer/run_qwen2_5_05b_instr_math_meta_rl.sh |
Outer-loop training script. |
If you find this repository useful, please cite our paper:
@misc{cheng2026dualevolvingreinforcementlearningautomated,
title={Dual-Evolving Reinforcement Learning for Automated Reward Design},
author={Sitao Cheng and Tianle Li and Xuhan Huang and Xunjian Yin and Difan Zou},
year={2026},
eprint={2512.13399},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2512.13399},
}

