Learning Rational Subgoals from Demonstrations and Instructions

Zhezheng Luo, Jiayuan Mao, Jiajun Wu, Tomás Lozano-Pérez, Joshua B. Tenenbaum, Leslie Pack Kaelbling

Abstract

Long-horizon planning in robotics and artificial intelligence remains a significant challenge due to the vast state-action spaces involved in complex tasks. While humans naturally decompose these tasks into hierarchical subgoals, automated discovery of such milestones typically requires dense supervision or perfectly segmented data. This paper presents the Rational Subgoals (RSGs) framework, which learns to identify and utilize state-based subgoals from unsegmented demonstrations and high-level text descriptions. By treating subgoals as binary classifiers and leveraging a rationality-based learning objective, the framework enables agents to generalize to novel task compositions and plan efficiently in both discrete and continuous environments.

Introduction

In complex domains, a single high-level command—such as "craft a boat"—can translate into thousands of low-level motor primitives. Traditional imitation learning and reinforcement learning often struggle with these long-horizon dependencies. The core difficulty lies in subgoal discovery: identifying the intermediate milestones (e.g., "collect wood," "craft axe") that bridge the gap between initial states and final goals.

Existing methods for hierarchical learning often rely on manually segmented demonstrations or struggle to generalize when subgoals are presented in new sequences. The RSG framework addresses these limitations by learning modular subgoal classifiers that can be dynamically composed to solve novel, complex tasks.

The Rational Subgoals (RSG) Framework

The RSG framework is built on the premise that subgoals should be defined by the state conditions they satisfy rather than the specific policies used to reach them. This modularity allows for robust planning even when environmental dynamics change.

1. FSM-Augmented Planning

To bridge high-level language and low-level execution, the system converts task descriptions (e.g., "A then B or C") into Finite State Machines (FSMs). The agent’s underlying planning algorithm—such as A* for discrete grids or Rapidly-exploring Random Trees (RRT) for continuous spaces—is "augmented" by the FSM. This allows the planner to track progress through the high-level instruction and focus on satisfying the current required subgoal.

2. Rationality-Based Learning

A key innovation of RSG is its ability to learn from unsegmented demonstrations. The model employs a "rationality objective," assuming that the human demonstrator acts efficiently. Using dynamic programming, the system identifies the most likely segmentation of a demonstration by finding the sequence of subgoals that makes the observed actions appear nearly optimal. This allows the agent to learn what a completed subgoal looks like (a state-based classifier) without needing a human to mark the exact moment a milestone was reached.

3. Dependency Discovery

Beyond following explicit instructions, the framework can discover the inherent structure of a domain. By building a statistical dependency matrix, the system learns that certain subgoals are preconditions for others (e.g., "having wood" is a prerequisite for "crafting a plank"). This enables the agent to plan effectively even when provided only with a final goal and no step-by-step instructions.

Experimental Evaluation

The researchers evaluated the RSG framework in two distinct environments designed to test different aspects of planning and generalization:

  • Crafting World: A Minecraft-inspired 2D grid world featuring 26 primitive tasks. This environment tests the model's ability to handle complex logical compositions and long sequences of up to five subgoals.
  • Playroom: A 2D continuous domain involving a robotic arm interacting with objects like bells, balls, and light switches. This environment tests the framework's compatibility with geometric constraints and continuous motion planners.

Key Results and Discussion

The RSG framework demonstrated significant improvements over traditional baselines such as Behavior Cloning (BC) and Inverse Reinforcement Learning (IRL).

Superior Success Rates and Generalization

In the Crafting World, RSGs achieved a 99.6% success rate on compositional tasks. More importantly, the model achieved 97.8% success on novel tasks—sequences of subgoals that were never seen during training. In contrast, BC and IRL baselines struggled, often hovering below 12% and 40% success, respectively, as they failed to capture the underlying hierarchical structure.

Planning Efficiency

When the agent was tasked with reaching a final goal without a provided instruction, the discovered dependency matrix proved crucial. The RSG-informed search was 4.5x more efficient than a blind search, as the agent could prune irrational paths that violated learned preconditions.

Zero-Shot Compositionality

Because the subgoals are learned as independent state classifiers, the agent exhibits strong zero-shot capabilities. It can interpret and execute long, complex instructions by simply re-composing the FSM, even if the specific sequence of events is entirely new to the agent.

Conclusion

The Rational Subgoals framework provides a robust method for learning hierarchical task structures from weak supervision. By focusing on state-based classifiers and the principle of rationality, the system achieves high levels of generalization and planning efficiency. Future work may extend this framework to stochastic environments and explore fully unsupervised subgoal discovery, where the agent identifies milestones without any linguistic input.

Summary updated

BibTeX
@inproceedings{luo2023learning,
  author = {Zhezheng Luo and Jiayuan Mao and Jiajun Wu and Tomás Lozano-Pérez and Joshua B. Tenenbaum and Leslie Pack Kaelbling},
  title = {{Learning Rational Subgoals from Demonstrations and Instructions}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i10.26423},
}
Figure