Generalizing to New Tasks via One-Shot Compositional Subgoals

Xihan Bian, Oscar Mendez, Simon HadfieldarXiv 2022

TL;DR

CASE (Compositional Adaptive Subgoal Estimation) enables robots to tackle complex, long-horizon tasks by generating "near-future" subgoals on the fly. By using compositional vector arithmetic in a learned latent space, the system can perform one-shot generalization to entirely new tasks using only a single reference trajectory from a different environment, outperforming previous benchmarks by 30%.

What Problem Does This Paper Address?

Teaching robots to perform complex, multi-step tasks (like "make coffee and bring it to the office") is notoriously difficult. In machine learning, these are called long-horizon tasks. They suffer from two main issues:

  1. Sample Inefficiency: Because the reward only comes at the very end, it’s hard for an agent to learn which of the thousands of intermediate steps were actually helpful.
  2. Brittle Generalization: A robot trained to make coffee in one kitchen often fails in a different kitchen because the layout, tools, and specific steps change.

Traditional hierarchical approaches try to break tasks into fixed subgoals (e.g., "Go to kitchen" $\rightarrow$ "Pick up cup"). However, these "hard boundaries" are rigid; if the robot drifts off course or encounters an unexpected obstacle, the whole plan often collapses.

Methods

The authors introduce CASE, which moves away from rigid milestones in favor of a fluid, "adaptive" subgoal approach.

1. Compositional Latent Space

The core idea is to represent tasks as vectors in a latent space where arithmetic actually means something. In this space, a complex task is simply the sum of its parts. If task $A$ is "get coffee" and task $B$ is "bring it back," the embedding for the whole sequence is $A + B$. This commutativity allows the model to understand task components regardless of their specific order.

2. Adaptive Subgoal Estimation

Instead of aiming for a distant final goal, CASE looks at a reference trajectory (an example of the task being done elsewhere) and picks a waypoint in the "near future" (typically $k=4$ steps ahead).

Comparison between traditional fixed subgoals and the proposed adaptive approach.

3. Waypoint Arithmetic

To guide the agent, the model calculates a waypoint embedding $\vec{W}$ using simple subtraction: $$\vec{W} = \text{Progress to Goal (Current)} - \text{Progress to Goal (Reference Subgoal)}$$ This effectively "subtracts" the completed parts of the task to isolate what needs to happen next. The policy network then uses this embedding to decide the immediate action.

Datasets

The researchers evaluated CASE using Craft World, a 2D discrete-action environment inspired by crafting games.

  • Environment: A grid containing resources like trees, rocks, and wheat. Agents must combine items (e.g., use an axe on a tree to get a log, then use a hammer to build a house).
  • Complexity: Tasks involve 2 to 8 different sub-tasks in sequence.
  • Training: The model was trained on 150,000 episodes with randomized maps.
  • Testing: Evaluation was performed on unseen task sequences, requiring the agent to generalize its knowledge to new combinations of actions.
The Craft World environment rendering and its unrendered input state.

Key Insights and Ideas

  • Fluidity beats Rigidity: By recalculating subgoals at every single step, the agent can adapt to "drift" or errors. If it takes a wrong turn, the next "near-future" subgoal automatically adjusts to guide it back.
  • Arithmetic as Logic: Using vector subtraction ($U - V$) to find the next step is a powerful way to leverage imitation learning without requiring the agent to copy the expert's exact coordinates, which would fail in different environments.
  • Scaling with Complexity: Remarkably, the performance gap between CASE and traditional methods widens as the tasks get longer. CASE maintains a success rate above 60% even as the number of tasks in a sequence increases, while baselines drop off significantly.
Fig. 3. A graph of the difference in performance for CASE, and the original & enhanced baselines, as the number of tasks in a sequence increases.

Key Results

The authors compared CASE against the previous state-of-the-art (SOTA) in compositional imitation learning (CPV).

  • Success Rate: CASE achieved a best performance of 71.2% on unseen tasks, compared to only 43.2% for the original SOTA benchmark.
  • Generalization: Even when the SOTA was enhanced with "Goal Guidance," CASE still outperformed it, proving that the adaptive subgoal mechanism is more robust than simply knowing the final destination.
  • Ablation: The study showed that adding specific "assistive losses" (regularization to ensure the latent space stays mathematically consistent) was vital for reaching peak performance.
Table showing performance metrics across different model variants.

Limitations and Future Work

  • Fixed Lookahead: Currently, the "near-future" is defined by a fixed number of steps ($k$). However, Figure 4 shows that performance is sensitive to this value. If a subtask in the training environment is much longer than in the reference environment, a fixed $k$ might point to the wrong part of the task.
  • Adaptive Windows: The authors suggest that future work should involve an adaptive lookahead window that can automatically calculate the optimal $k$ based on the current context and task progress.
Ablation study of the lookahead parameter k.

Summary updated

BibTeX
@misc{bian2022generalizing,
  author = {Xihan Bian and Oscar Mendez and Simon Hadfield},
  title = {{Generalizing to New Tasks via One-Shot Compositional Subgoals}},
  year = {2022},
  eprint = {2205.07716},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.07716},
}
Figure