TL;DR
LaRes is a novel hybrid framework that combines Evolutionary Reinforcement Learning (ERL) with Large Language Models (LLMs) to automatically search for optimal reward functions. By introducing a shared experience buffer with reward relabeling and stability mechanisms like reward scaling, LaRes achieves state-of-the-art performance and significantly higher sample efficiency than previous LLM-based reward design methods.
What Problem Does This Paper Address?
Reinforcement Learning (RL) is notoriously sensitive to the quality of the reward function. Designing these functions manually is a "black art" that requires deep domain expertise and tedious trial-and-error. While recent works like Eureka have used LLMs to automate reward design, they suffer from two major flaws:
- Sample Inefficiency: They often discard historical data when the reward function changes, leading to excessive environment interactions.
- Instability: Drastic changes in reward scales or logic between iterations can cause "policy collapse," where a previously competent agent suddenly forgets how to perform the task.
LaRes aims to bridge the gap between high-level reward evolution and low-level policy learning, making the process both stable and highly data-efficient.
Methods
LaRes operates on a dual-loop architecture: a high-level Evolutionary Reward Search and a low-level Policy Learning process.
- LLM-based Reward Evolution: An LLM (like GPT-4) generates a population of candidate reward functions in Python code. It iteratively refines these based on performance feedback (e.g., success rates) from the RL agents.
- Shared Replay Buffer & Relabeling: To maximize sample efficiency, all policies share a single experience buffer. Crucially, when the LLM updates the reward functions, LaRes relabels the rewards of historical transitions in the buffer. This allows the agents to "reuse" old experiences to learn about new reward structures.
- Thompson Sampling Interaction: Instead of giving every reward function equal environment time, LaRes uses Thompson sampling to prioritize interaction for the most promising "elite" reward-policy pairs, balancing exploration and exploitation.
- Stability Mechanisms: To prevent policy collapse when the "goalposts" move, the authors introduce:
- Reward Scaling: Aligning the mean and variance of new reward functions with the previous elite ones.
- Parameter Constraint Loss: A regularization term that keeps the parameters of new policies close to the current best-performing policy in the parameter space.
Datasets
The authors evaluated LaRes across 20 diverse tasks:
- MetaWorld: 12 robotic manipulation tasks (e.g., Hammer, Coffee-Pull, Soccer).
- ManiSkill3: 4 complex manipulation tasks leveraging GPU parallel sampling.
- MinAtar: 4 discrete-control tasks (Breakout, Asterix, etc.) to test generality with DQN.
- Locomotion: MuJoCo-based Ant and Humanoid tasks for testing "from scratch" reward design (no human initialization).
Key Insights and Ideas
- Reward Design as Evolution: The paper treats reward functions as "individuals" in an evolutionary population. The LLM acts as the mutation/crossover operator, while the RL agent's performance serves as the fitness function.
- Relabeling is the "Secret Sauce": By relabeling historical data, LaRes avoids the "cold start" problem every time a reward function is updated. This is a significant departure from previous LLM-reward methods that essentially restarted training or ignored the data-reuse potential.
- Stability via Constraints: The insight that reward changes are a form of non-stationarity led to the use of parameter constraints. By forcing new policies to stay "near" the previous best, they ensure that the agent doesn't lose its basic motor skills when the reward logic is tweaked.
Key Results
LaRes consistently outperformed strong baselines, including standard RL (SAC), traditional ERL, and previous LLM-based reward searchers (Eureka, R*).
- MetaWorld: In tasks like
HammerandBasketball, LaRes achieved near 100% success rates while baselines often plateaued below 40%. - Sample Efficiency: LaRes reaches high success rates in ManiSkill3 tasks much faster than standard SAC, demonstrating the power of its shared replay buffer and relabeling techniques.
- Zero-Shot/No-Init: Even without a human-designed reward to start with, LaRes outperformed Eureka and Text2Reward. For example, in the
Antlocomotion task, LaRes achieved a speed of 4.44 m/s compared to Eureka's 1.49 m/s.
Limitations and Future Work
- Computational Overhead: Training a population of policies in parallel increases resource requirements, though the authors note a manageable ~20% time overhead due to communication.
- Theoretical Guarantees: The work is primarily empirical; there is currently no formal theory regarding the optimality or convergence of this specific hybrid approach.
- LLM Diversity: The framework relies on the inherent randomness of LLMs for population diversity. The authors suggest that more explicit diversity-promoting mechanisms (common in EAs) could be integrated in the future.
Summary updated