TL;DR
Designing reward functions for reinforcement learning (RL) in complex environments usually requires extensive manual trial-and-error by human experts. This paper introduces an automated reward design framework that leverages Large Language Models (LLMs) and Video Language Models (VLMs) to iteratively generate and optimize reward functions for Gran Turismo 7 using only text-based instructions. The resulting agents not only outperform human experts but achieve performance competitive with the superhuman, hand-tuned baseline agent, GT Sophy.
What Problem Does This Paper Address?
Reinforcement learning has achieved remarkable success in high-fidelity simulations, exemplified by Sony's GT Sophy outracing world-class human drivers in Gran Turismo. However, these breakthroughs rely heavily on meticulously engineered reward functions. Translating a high-level goal like "win the race while maintaining good sportsmanship" into a scalar mathematical formula is notoriously difficult, even for domain experts.
While recent frameworks like Eureka use LLMs to automate reward generation, they typically require a predefined, ground-truth "fitness metric" to evaluate the generated rewards. Designing this fitness metric can be just as challenging as designing the reward function itself. Other methods rely entirely on human feedback, which scales poorly. This paper addresses the challenge of automating reward design in complex, continuous environments without requiring a ground-truth numerical fitness metric.
Methods
The authors propose a scalable, iterative framework that replaces the traditional numerical fitness metric with multimodal foundation models and sparse human feedback.
The architecture consists of four main components executed in a loop:
- Reward Generation: An LLM (GPT-4o) receives the environment description (Python dataclass API of state/action spaces) and the high-level text prompt. It generates $M$ candidate reward functions composed of weighted sub-components.
- Trajectory Alignment Filter (TAC): To avoid training poorly aligned rewards, a filter calculates a trajectory alignment coefficient based on a dataset of historical preferences ($D_{pref}$). Only the top $N$ aligned reward functions proceed to training.
- RL Training: The selected reward functions are trained using a modified Soft Actor-Critic algorithm (QR-SAC). To accelerate training, the system utilizes a secondary replay buffer seeded with experiences from the previous iteration's best agent.
- Agent Selection: Instead of a fitness metric, a VLM (GPT-4) evaluates the trained agents. The VLM reviews 15-second video clips alongside raw trajectory data for pairs of agents, outputting pairwise preferences. These preferences are ranked using a Bradley-Terry model to select the best agent, which is then presented to a human for high-level text feedback before the next iteration.
Datasets
The framework was evaluated within the Gran Turismo 7 simulation environment.
- Track & Car Configuration: All experiments were conducted on the Lake Maggiore - Full Course track using a Mercedes-AMG GT3 '16.
- Preference Dataset ($D_{pref}$): The system dynamically builds its own dataset of pairwise agent preferences over the course of the iterations to power the Trajectory Alignment Filter.
Key Insights and Ideas
- VLMs as Proxy Judges: Current vision-language models can successfully replace manual fitness metrics. When prompted with a combination of video footage and raw trajectory data, the VLM's alignment with human expert preferences reached 74.14%, approaching the human-to-human agreement rate of 78.54%.
- Multimodal Input is Crucial: Giving the VLM only video data caused a significant drop in evaluation accuracy (62.96%), highlighting that current foundation models still struggle to judge precise physical behaviors (like car collisions or track boundaries) from video alone.
- Human Intuition $\neq$ Optimal Performance: The authors found no strong correlation ($r = -0.177$) between how closely an LLM-generated reward function correlated with a human-engineered reward function and the agent's actual final race placement. This suggests that automated search can discover non-intuitive, highly effective reward structures that humans might overlook.
Key Results
The framework was evaluated against a human expert (top 5% globally) and the hand-crafted GT Sophy baseline.
- Competitiveness: The proposed method ("Ours") successfully generated valid, rule-abiding agents in 10 out of 10 seeds. The best-performing seed achieved an average final placement superior to the human expert and highly competitive with GT Sophy.
- Baseline Comparison: "Ours" outperformed Text2Reward (which lacks the VLM selection and trajectory filtering steps) in both consistency and peak performance. A completely closed-loop variant ("No feedback"), which replaced human feedback with LLM self-evaluation, suffered from performance divergence due to a lack of real-world grounding.
- Novel Behaviors: The system successfully generated entirely new racing styles from simple text prompts, such as training an agent to "race as fast as possible in reverse" or "drift as much as possible" while still respecting motorsport rules.
Limitations and Future Work
- Computational Cost: Training multiple RL agents in the inner loop of an evolutionary algorithm remains highly expensive, even with the training speedups provided by the secondary replay buffer.
- Filter Data Requirements: The Trajectory Alignment Filter (TAC) requires a relatively large baseline dataset (~100+ preferences) before its predictive accuracy comfortably beats random guessing. In short iteration cycles, its utility is limited.
- Lack of Qualitative Diversity: The LLM tended to generate structurally similar reward components across iterations, primarily shifting the weights rather than inventing novel mathematical formulations. The authors note that improving automated weight tuning remains an open challenge for future research.
Summary updated