Skip to main content
QUICK REVIEW

[Paper Review] Reward Design with Language Models

Minae Kwon, Sang Michael Xie|arXiv (Cornell University)|Feb 27, 2023
Reinforcement Learning in RoboticsComputer Science21 citations
TL;DR

The paper proposes using a large language model as a proxy reward function to train RL agents from natural language prompts, enabling few-shot or zero-shot specification of user objectives, and demonstrates competitive alignment across Ultimatum Game, Matrix Games, and DealOrNoDeal negotiations.

ABSTRACT

Reward design in reinforcement learning (RL) is challenging since specifying human notions of desired behavior may be difficult via reward functions or require many expert demonstrations. Can we instead cheaply design rewards using a natural language interface? This paper explores how to simplify reward design by prompting a large language model (LLM) such as GPT-3 as a proxy reward function, where the user provides a textual prompt containing a few examples (few-shot) or a description (zero-shot) of the desired behavior. Our approach leverages this proxy reward function in an RL framework. Specifically, users specify a prompt once at the beginning of training. During training, the LLM evaluates an RL agent's behavior against the desired behavior described by the prompt and outputs a corresponding reward signal. The RL agent then uses this reward to update its behavior. We evaluate whether our approach can train agents aligned with user objectives in the Ultimatum Game, matrix games, and the DealOrNoDeal negotiation task. In all three tasks, we show that RL agents trained with our framework are well-aligned with the user's objectives and outperform RL agents trained with reward functions learned via supervised learning

Motivation & Objective

  • Motivate easier, intuitive reward specification beyond handcrafted rewards or labeled data.
  • Propose a general RL framework that uses an LLM as a proxy reward function, without requiring RL algorithm changes.
  • Show that LLM-based rewards can better align agents with user objectives than SL-learned rewards.
  • Evaluate the method on single- and multi-shot prompting across multiple interactive tasks.

Proposed method

  • Formalize the problem as an MDP where the reward is produced by an LLM given a task prompt and episode description.
  • Construct a prompt rho by concatenating a task description, user-specified objective (examples or description), an episode outcome, and a question about objective satisfaction.
  • Parse the LLM output with a task-specific parser g to obtain a scalar reward for RL updates.
  • Train RL agents with any RL algorithm using the LLM-derived rewards.
  • Evaluate labeling accuracy of the LLM reward signals and the downstream RL agent performance against ground-truth rewards.
  • Conduct pilot human user studies to assess subjective alignment with user objectives.
Figure 1: Depiction of our framework on the DealOrNoDeal negotiation task. A user provides an example and explanation of desired negotiating behavior (e.g., versatility) before training. During training, (1) we provide the LLM with a task description, a user’s description of their objective, an outc
Figure 1: Depiction of our framework on the DealOrNoDeal negotiation task. A user provides an example and explanation of desired negotiating behavior (e.g., versatility) before training. During training, (1) we provide the LLM with a task description, a user’s description of their objective, an outc

Experimental results

Research questions

  • RQ1Q1: Can LLMs produce reward signals consistent with user objectives from few-shot prompting?
  • RQ2Q2: Can LLMs produce objective-consistent rewards in zero-shot prompting for well-known objectives?
  • RQ3Q3: Can LLMs provide objective-aligned rewards in longer-horizon tasks like negotiations?

Key findings

  • LLMs provide reward signals consistent with user objectives from few-shot prompts, with explanations significantly aiding accuracy.
  • In matrix games, zero-shot prompting yields objective-aligned rewards for well-known concepts, improving labeling accuracy over a No Objective baseline.
  • In DealOrNoDeal, LLM-based rewards improve RL agent accuracy by 46% on average and approach true-reward performance within 4%.
  • Pilot user study shows agents aligned with user-specified styles are rated significantly more aligned (p<0.001).
  • Compared to SL baselines, LLM rewards are more data-efficient; SL requires hundreds more labeled examples to reach similar accuracy.
  • Prompt design robustness analysis indicates explanations are a key factor for higher accuracy, and prompts can be relatively robust to wording variations.
Figure 2: Ultimatum Game, Few-shot . (Top) Accuracy of reward signals provided by LLM and SL during RL training when prompted with/trained on $10$ vs $1$ example. (Bottom) Corresponding accuracy of RL agents after training. LLM is able to maintain a high accuracy when prompted with a single example
Figure 2: Ultimatum Game, Few-shot . (Top) Accuracy of reward signals provided by LLM and SL during RL training when prompted with/trained on $10$ vs $1$ example. (Bottom) Corresponding accuracy of RL agents after training. LLM is able to maintain a high accuracy when prompted with a single example

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.