Automated Reward Design for Gran Turismo

Michel Ma, Takuma Seno, Kaushik Subramanian, Peter R. Wurman, Peter Stone, Craig Sherstan · DOI

TL;DR

This paper introduces an automated reward design system for reinforcement learning (RL) agents in the Gran Turismo 7 racing game. By leveraging large language models (LLMs) and vision-language models (VLMs), the system can generate effective reward functions from text-based instructions, producing agents competitive with state-of-the-art AI and even generating novel behaviors, significantly reducing the need for manual reward engineering.

What Problem Does This Paper Address?

Designing effective reward functions is a critical but challenging bottleneck in reinforcement learning. While desired agent behaviors can often be easily described in natural language (e.g., "win races while maintaining good sportsmanship"), translating these into precise numerical reward signals is difficult, especially in complex, high-fidelity environments like autonomous racing. This manual process is time-consuming, requires significant RL expertise and domain knowledge, and often involves tedious trial-and-error. Existing automated methods either rely on expensive fitness metrics or extensive human feedback, which scales poorly. This paper aims to automate this reward design process, making RL more accessible and efficient.

Methods

The core of the proposed system is an iterative LLM-based reward design framework.

  • Reward Generation: An LLM is prompted with the environment description (state and action space) and the task goal (e.g., "win races while maintaining good sportsmanship") to generate multiple candidate reward functions. These functions are initially separated into simpler components, with the LLM also suggesting weights for their combination. The generated code is validated for executability.
  • Trajectory Alignment Filter (TAC): To reduce computational cost, a trajectory alignment coefficient is used to filter out reward functions that are likely to be misaligned with learned preferences. This filter leverages a dataset of pairwise preferences between agent trajectories.
  • RL Training: The filtered reward functions are used to train RL agents using a standard RL algorithm (QR-SAC).
  • Agent Selection: Instead of a human fitness metric, a VLM is used to evaluate and rank the trained agents based on their trajectories and video footage. This pairwise preference elicitation helps select the best-performing agent and its corresponding reward function for the next iteration.
  • Iterative Improvement: The selected agent and feedback (optional human feedback) are used to refine the prompt for the next iteration, allowing the LLM to generate improved reward functions.

Datasets

  • Gran Turismo 7 Environment: The system is evaluated within the Gran Turismo 7 racing simulator. The environment provides state and action space descriptions (GTObs and Course objects) for the LLM.
  • Preference Datasets: The system generates and utilizes datasets of pairwise preferences between agent trajectories. These preferences are initially collected from a VLM and can be augmented with human feedback. For evaluation, a subset of these preferences is used to test the accuracy of the TAC.

Key Insights and Ideas

  • LLMs as Reward Function Designers: Foundation models (LLMs) can effectively translate high-level, natural language goals into executable reward functions, demonstrating their potential beyond code generation to complex task specification.
  • VLM for Preference Elicitation: VLMs can serve as a scalable proxy for human evaluation, providing preferences that are surprisingly aligned with human judgment, thus automating a crucial step in the reward design loop.
  • Trajectory Alignment Filter's Data Dependency: The effectiveness of the TAC is highly dependent on the size of the preference dataset. It becomes reliable only after a substantial number of preferences are collected, suggesting that efficient data collection is key for its utility.
  • Novelty vs. Performance Trade-off: While LLM-generated reward functions can achieve high performance, their novelty with respect to human-designed rewards is not always guaranteed, and tuning reward weights can be more impactful than qualitative changes to the reward components themselves.
  • Automated Generation of Novel Behaviors: The system can be used to generate entirely new and unexpected agent behaviors by providing novel text-based task descriptions, opening doors for creative exploration in RL.

Key Results

  • Competitive Performance: The proposed "Ours" method produced agents that were competitive with, and sometimes surpassed, the state-of-the-art GT Sophy agent, achieving better average final placements.
  • Improved Consistency: Compared to a baseline "Text2Reward" approach (which generates only one reward per iteration without filtering or iterative refinement), the proposed method showed improved consistency in producing valid agents that met sportsmanship and rule-abiding thresholds.
  • VLM Accuracy: The VLM's preference elicitation showed a high agreement rate with human preferences, suggesting its viability as a replacement for human evaluation. The accuracy dropped when only video data was provided, highlighting the importance of trajectory data.
  • Novel Behaviors: The system successfully generated agents capable of performing novel behaviors, such as racing in reverse or intentionally drifting, based on specific text prompts.

Limitations and Future Work

  • Computational Cost: The iterative nature of the system, involving training multiple RL agents per iteration, is computationally expensive.
  • Human-in-the-Loop: While significantly reduced, the system still relies on human feedback for optimal results.
  • TAC Data Dependency: The Trajectory Alignment Filter's effectiveness is limited by the size of the preference dataset, requiring further work on efficient data collection strategies.
  • Reward Weight Tuning: The paper suggests that tuning reward weights can be more effective than qualitative changes to reward components, indicating that more advanced weight optimization techniques could further improve performance.
  • Generalizability: While the components are designed to be environment-agnostic, the system's broader applicability in other domains remains to be explored.

Summary updated

BibTeX
@inproceedings{ma2025automated,
  author = {Michel Ma and Takuma Seno and Kaushik Subramanian and Peter R. Wurman and Peter Stone and Craig Sherstan},
  title = {{Automated Reward Design for Gran Turismo}},
  booktitle = {LAW @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=cmN54vPKsz},
}
Figure