Goals as reward-producing programs

Guy Davidson, Graham Todd, Julian Togelius, Todd M. Gureckis, Brenden M. Lake

TL;DR

This paper proposes that human goals are best understood as symbolic, executable programs rather than simple target states. By representing goals as reward-producing code, the authors developed a generative model that synthesizes novel, "playful" goals (like mini-games) which human evaluators found indistinguishable from those created by people.

What Problem Does This Paper Address?

In standard Reinforcement Learning (RL), goals are usually narrow and state-based: "reach coordinate X" or "put block A on block B." However, human behavior—especially in play—is far more complex and idiosyncratic. We invent goals like "throw the ball so it hits the wall and then catch it" or "park in every single spot in this parking lot."

The authors argue that current AI models lack the "richness of everyday human goals." There is a significant gap in understanding how humans represent, create, and reason about these complex objectives. To bridge this, the paper moves away from seeing a goal as a destination and instead views it as a program that monitors an agent's behavior and emits a reward signal based on specific temporal and logical constraints.

Methods

The researchers developed a framework for Goal Program Synthesis consisting of three main pillars:

  1. A Domain-Specific Language (DSL): Inspired by PDDL and LISP, the authors created a symbolic language to represent goals. It uses predicates (e.g., agent_holds, on, in_motion) and temporal modals (e.g., once, hold, then, until) to describe complex sequences of events.
  2. A Learned Fitness Function: To distinguish "human-like" goals from nonsensical ones, they trained a model using contrastive learning. The model learns to assign high scores to real human-generated goals and low scores to "corrupted" versions (created via random tree-regrowth of the program's syntax).
  3. Quality-Diversity Search (MAP-Elites): Instead of just searching for one "perfect" goal, they used the MAP-Elites algorithm to fill a multi-dimensional archive of diverse goals. This ensures the model generates a wide variety of objectives (e.g., some focused on throwing, others on stacking) while optimizing for the learned fitness score.

The environment used was AI2-THOR, a 3D simulation of a room filled with interactive objects like toys, furniture, and blocks.

Datasets

  • Human-Generated Playful Goals: A new dataset of 98 games described by humans in natural language, which were then manually translated into the DSL.
  • Behavioral Traces: 382 state-action traces of humans attempting to play their own invented games.
  • Contrastive Negatives: Over 100,000 "corrupted" programs used to train the fitness function.
  • Evaluation Dataset: A subset of 30 real human games, 30 "matched" model games (from the same niche), and 30 "unmatched" novel model games.

Key Insights and Ideas

  • Compositionality is King: By representing goals as programs, the model can reuse "motifs." For example, the logic for "throwing a ball" can be composed with "hitting a target" or "catching," allowing for exponential creativity from a finite set of symbols.
  • Common Sense via Data: The model doesn't just learn syntax; it learns "physical common sense." By checking goals against a database of human interaction traces, the fitness function learns that "stacking blocks" is a valid goal, while "stacking balls" is physically improbable and thus a "low-quality" goal.
  • Goals as Reward Machines: The authors treat these programs as "reward machines"—interpreters that can take any sequence of actions and output a score. This makes the goals computationally executable and evaluatable.

Key Results

  • The Turing Test for Goals: In human evaluations, participants could not distinguish between "real" human-created games and "matched" model-generated games. Both were rated similarly for being understandable, fun to play, and human-like.
  • Predictive Fitness: The model’s internal fitness score was a strong predictor of human judgments. High-fitness programs were consistently rated as more "fun" and "understandable" by human raters.
  • Diversity vs. Quality: While the model could generate entirely "unmatched" (novel) goals, these were often rated lower than human-like goals. This suggests that while the model is creative, human-likeness occupies a specific, coherent region of the possible program space.

Limitations and Future Work

  • Manual Translation: The current pipeline relies on humans to translate natural language descriptions into the DSL. The authors suggest using Large Language Models (LLMs) to automate this "Natural Language to DSL" step in the future.
  • Subjectivity: The model struggles with highly abstract or subjective goals (e.g., "make the room look pretty"). Representing these as formal programs remains a challenge.
  • Social Goals: The current work focuses on single-player, physical goals. Expanding this to social goals (like "playing tag" or "sharing") would require incorporating Theory of Mind into the program representation.
  • Scaling: The authors hope to use these "goal generators" to train more flexible RL agents that can propose and pursue their own diverse, human-like objectives in open-ended environments.

Summary updated

BibTeX
@inproceedings{davidson2025goals,
  author = {Guy Davidson and Graham Todd and Julian Togelius and Todd M. Gureckis and Brenden M. Lake},
  title = {{Goals as reward-producing programs}},
  booktitle = {Nature Machine Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=t6ryAcniJ7},
}
Figure