Scoring-Aggregating-Planning: Learning task-agnostic priors from interactions and sparse rewards for zero-shot generalization

Huazhe Xu, Boyuan Chen, Yang Gao, Trevor Darrell

Abstract

It is a long-standing challenge to enable an intelligent agent to learn in one environment and generalize to an unseen environment without further data collection and finetuning. In this paper, we consider a zero-shot generalization problem setup that complies with biological intelligent agents' learning and generalization processes. The agent is first presented with previous experiences in the training environment, along with task description in the form of trajectory-level sparse rewards. Later when it is placed in the new testing environment, it is asked to perform the task without any interaction with the testing environment. We find this setting natural for biological creatures and at the same time, challenging for previous methods. Behavior cloning, state-of-art RL along with other zero-shot learning methods perform poorly on this benchmark. Given a set of experiences in the training environment, our method learns a neural function that decomposes the sparse reward into particular regions in a contingency-aware observation as a per-step reward. Based on such decomposed rewards, we further learn a dynamics model and use Model Predictive Control (MPC) to obtain a policy. Since the rewards are decomposed to finer-granularity observations, they are naturally generalizable to new environments that are composed of similar basic elements. We demonstrate our method on a wide range of environments, including a classic video game -- Super Mario Bros, as well as a robotic continuous control task.

Introduction

Most deep Reinforcement Learning (RL) agents are "tabula rasa" learners: they solve specific tasks from scratch but often fail when environment layouts change slightly. In contrast, biological agents utilize "priors"—understandings of physics, semantics, and affordances—to adapt instantly to new scenarios. The core challenge in artificial intelligence is learning these priors from sparse rewards (e.g., a single score at the end of a level) and imperfect exploration data rather than expert demonstrations.

Standard methods like Behavioral Cloning or model-free RL tend to overfit to specific training configurations. We propose the Scoring-Aggregating-Planning (SAP) framework to address this by decomposing trajectory-level rewards into fine-grained spatial and temporal scores that represent the inherent value of local interactions.

The SAP pipeline: from exploration in World 1-1 to zero-shot generalization in World 2-1.

The SAP Framework

SAP enables zero-shot generalization through a three-stage process:

  1. Scoring (S): Instead of a global reward, a neural network learns to assign scores to "contingency-aware" observations—local regions immediately surrounding the agent. It performs spatial-temporal decomposition, breaking the observation into $K$ sub-regions to learn the value of specific elements (e.g., an enemy or a platform).
  2. Aggregating (A): To train the scoring function, the model aggregates these local, per-step scores over an entire trajectory. It utilizes an $L_2$ loss to ensure the sum (or max) of predicted scores matches the actual sparse terminal reward received during exploration.
  3. Planning (P): At test time, the agent does not follow a fixed policy. Instead, it uses a learned dynamics model to predict future states and Model Predictive Control (MPC) to simulate various action sequences. It selects the sequence that maximizes the sum of the learned local scores.

Experimental Evaluation

We evaluated SAP on two distinct domains:

  • Super Mario Bros: The agent trains on noisy exploration data from World 1-1 and is tested on unseen levels (World 2-1 and World 5-1). Observations are $84 \times 84$ grayscale images.
  • 3D Blocked Reacher: A robotics task involving a 7-DoF arm. The agent must reach a goal while avoiding obstacles in a discretized voxel space. We tested generalization across four different obstacle configurations.

Results and Discussion

SAP demonstrates significant improvements over baselines such as RUDDER (which lacks spatial awareness) and DARLA. In Super Mario Bros, SAP achieved a return of approximately 790 in zero-shot tests on World 2-1, whereas the next best baseline, Model-Based Human Prior (MBHP), scored roughly 588.

Quantitative results on Mario train/test worlds and visualization of learned greedy actions in a new level.

Key Insights

  • Compositionality: By focusing on local sub-regions, the agent learns generalizable rules (e.g., "touching an enemy from the side is negative") that apply regardless of the global layout.
  • Learning from Failure: SAP extracts meaningful priors from sub-optimal exploration data by identifying which local interactions consistently correlate with terminal success or failure.
  • Planning vs. Memorization: The MPC approach allows the agent to "think" through new configurations using its learned understanding of object values and physics, rather than memorizing specific action sequences.

Conclusion and Future Work

SAP successfully bridges the gap between sparse, trajectory-level rewards and local, actionable priors. While highly effective, the model currently cannot generalize to entirely unseen objects (e.g., Piranha Plants if they were absent during training). Future work will explore more flexible, object-centric representations like graph neural networks to further enhance scalability in complex 3D environments.

Summary updated

BibTeX
@misc{xu2019scoring,
  author = {Huazhe Xu and Boyuan Chen and Yang Gao and Trevor Darrell},
  title = {{Scoring-Aggregating-Planning: Learning task-agnostic priors from interactions and sparse rewards for zero-shot generalization}},
  year = {2019},
  eprint = {1910.08143},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.08143},
}
Figure