RF-Agent: Automated Reward Function Design via Language Agent Tree Search
Organizations: Beihang University, 37 Xueyuan Road, Haidian District, Beijing
Abstract
Designing efficient reward functions for low-level control tasks is a challenging problem. Recent research aims to reduce reliance on expert experience by using Large Language Models (LLMs) with task information to generate dense reward functions. These methods typically rely on training results as feedback, iteratively generating new reward functions with greedy or evolutionary algorithms. However, they suffer from poor utilization of historical feedback and inefficient search, resulting in limited improvements in complex control tasks. To address this challenge, we propose RF-Agent, a framework that treats LLMs as language agents and frames reward function design as a sequential decision-making process, enhancing optimization through better contextual reasoning. RF-Agent integrates Monte Carlo Tree Search (MCTS) to manage the reward design and optimization process, leveraging the multi-stage contextual reasoning ability of LLMs. This approach better utilizes historical information and improves search efficiency to identify promising reward functions. Outstanding experimental results in 17 diverse low-level control tasks demonstrate the effectiveness of our method. The source code is available at https://github.com/deng-ai-lab/RF-Agent.
Figures & tables
| task | locomotion | manipulation | Avg norm score | |||||
| Ant | Anymal | Humanoid | Quadcopter | AllegroHand | FrankaCabinet | ShadowHand | ||
| Sparse | 0 | |||||||
| Human | 1 | |||||||
| LLM-based Reward Function Design with GPT-4o-mini | ||||||||
| Eureka | 0.63 | |||||||
| Revolve | 0.67 | |||||||
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| IsaacGym Environments |
| Environment (obs dim, action dim) |
| Task description |
| Task evaluation score function |
| Ant (60,8) |
| To make the ant run forward as fast as possible |
| cur_dist - prev_dist |
| Bi-DexHands Environments |
| Environment (obs dim, action dim) |
| Task description |
| Task evaluation score function |
| Over (398, 40) |
| This class corresponds to the HandOver task. This environment consists of two shadow hands with palms facing up, opposite each other, and an object that needs to be passed. In the beginning, the object will fall randomly in the area of the shadow hand on the right side. Then the hand holds the object and passes the object to the other hand. Note that the base of the hand is fixed. More importantly, the hand which holds the object initially can not directly touch the target, nor can it directly roll the object to the other hand, so the object must be thrown up and stays in the air in the process |
| 1[dist < 0.03] |
| Ant | Prefill Tokens | Decode Tokens | Total Cost ($) |
|---|---|---|---|
| Eureka | 82458 | 54505 | 0.1802868 |
| Revolve | 162348 | 43973 | 0.202944 |
| Ours-total | 257564 | 69704 | 0.321828 |
| Ours-action | 203282 | 53462 | - |
| Ours-others | 54282 | 16242 | - |
| Humanoid | Prefill Tokens | Decode Tokens | Total Cost ($) |
|---|---|---|---|
| Eureka | 78940 | 60021 | 0.191414 |
| Revolve | 169545 | 44118 | 0.20761 |
| Ours-total | 254555 | 66557 | 0.31247 |
| Ours-action | 204283 | 50270 | - |
| Ours-others | 50272 | 16287 | - |
| Task | Sparse | Eureka | Revolve | Ours |
|---|---|---|---|---|
| Lie Down | 0.12 0.03 | 0.64 0.08 | 0.59 0.11 | 0.73 0.08 |
| Patrol and Return | 0.05 0.02 | 0.52 0.07 | 0.63 0.05 | 0.82 0.06 |
| Action Combination | Ant | Allegro Hand |
|---|---|---|
| a w/ mutation | 5.13(-18%) | 18.76(-16%) |
| b w/ mutation + crossover | 5.77(-7%) | 21.90(-3%) |
| c w/ mutation + reasoning | 5.94(-4%) | 21.26(-5%) |
| d w/ crossover + reasoning | 4.85(-22%) | 19.21(-15%) |
| e w/ mutation + crossover + reasoning | 6.08(-2%) | 22.19(-2%) |
| Full Version (w/ all actions) | 6.22 | 22.52 |
| Task | w/ full thought align | w/o first design thought | w/o second thought align | w/o all |
|---|---|---|---|---|
| ant | 6.22 | 5.08(-18%) | 5.94(-4%) | 4.96(-20%) |
| allegro hand | 22.52 | 18.07(-19%) | 18.55(-17%) | 14.64(-35%) |
| Resources | Type | License | URL |
| Eureka [ 28 ] | Codes for Baseline | MIT | https://github.com/eureka-research/Eureka |
| Revolve [ 17 ] | Codes for Baseline | Available Online | https://github.com/RishiHazra/Revolve/tree/main |
| IsaacGym [ 31 ] | Codes for Benchmark | BSD 3-Clause License | https://github.com/isaac-sim/IsaacGymEnvs |
| Bi-DexHands [ 9 ] | Codes for Benchmark | Apache 2.0 | https://github.com/PKU-MARL/DexterousHands |
| RL-games [ 30 ] | Codes for Algorithm | MIT | https://github.com/Denys88/rl_games |
Reward Design for RL
Reward design for reinforcement learning studies how to specify, learn, and adapt signals that guide agents toward intended behavior.
See all 250 papers