Learning to Compose Skills

Himanshu Sahni, Saurabh Kumar, Farhan Tejani, Charles L. Isbell Jr.arXiv 2017

Abstract

Reinforcement learning (RL) agents often struggle with tasks requiring long-term dependencies and simultaneous multi-objective behaviors. Traditional hierarchical RL (HRL) methods typically sequence subgoals, which is insufficient for tasks requiring parallel skill execution. We present ComposeNet, a differentiable framework that allows agents to logically compose skills. By utilizing a shared policy layer and trainable composition layers, ComposeNet blends skill-state embeddings to perform complex tasks defined by Linear Temporal Logic (LTL). Our results demonstrate that ComposeNet achieves faster convergence and superior performance in simultaneous tasks compared to standard meta-controllers, while also enabling zero-shot generalization to unseen task combinations.

Introduction

A significant challenge in Reinforcement Learning is the ability to handle complex, long-horizon tasks. While Hierarchical RL has made strides by decomposing tasks into sequences of subgoals, many real-world scenarios—such as a robot navigating a crowded room while balancing a tray—require simultaneous, multi-objective behaviors. Existing "options" frameworks or meta-controllers often switch between skills, which can lead to sub-optimal behavior when conflicting objectives arise.

ComposeNet addresses this by introducing a richer "algebra" of skills. Instead of switching, it learns to blend behaviors using logical operators. This approach allows for the creation of sophisticated policies without the need to retrain from scratch for every new combination of objectives.

The ComposeNet Architecture

The authors propose a multi-stage architecture designed for recursive skill blending. The system consists of three primary components:

  1. Skill Trunks and Shared Policy: Base skills (e.g., "evade red") are learned using individual neural network "trunks." Crucially, these trunks feed into a single, shared Policy Layer. This architecture forces the trunks to produce standardized skill-state embeddings that the policy layer can interpret universally.
  2. The Composition Layer: Once base skills are mastered, their trunks are frozen. For composed tasks, embeddings from multiple skills are concatenated and processed by a trainable Composition Layer. This layer maps multiple embeddings into a single representation of the combined task.
  3. Recursive Hierarchy: The output of a Composition Layer maintains the same dimensionality as the original embeddings. This allows the system to be recursive; the output of one composition can serve as the input for another, enabling deep hierarchies of behavior.
ComposeNet architecture: (A) Skill trunks generate embeddings; (B) Composition layers blend embeddings; (C) Recursive hierarchy allows for deep task composition.

Experimental Evaluation

ComposeNet was evaluated in a 15x15 grayscale grid world environment. Six base skills were pre-trained: collecting or evading objects of three colors (Red, Green, Blue). Tasks were defined using Linear Temporal Logic (LTL) operators, providing a structured framework for "while" ($U$), "eventually" ($\diamond$), "always" ($\square$), and "or" ($\vee$) relationships.

The agent was tested on four specific logical compositions:

  • Until ($\neg p U q$): Collect $q$ while evading $p$.
  • Or ($\diamond p \vee \diamond q$): Collect $p$ or $q$.
  • Always Not ($\square \neg p \wedge \square \neg q$): Always evade both $p$ and $q$.
  • Sequence ($\diamond(p \wedge \diamond q)$): Collect $p$, then collect $q$.

Results and Key Insights

ComposeNet demonstrated significant advantages over training from scratch and traditional meta-controllers.

Blending vs. Switching

A key finding is the superiority of blending embeddings over switching between skills. Meta-controllers that switch between "evade Red" and "evade Green" often fail because they may move toward one danger while fleeing another. ComposeNet learns to find paths that satisfy both constraints simultaneously.

Performance and Generalization

As shown in the experimental results, ComposeNet reached near-optimal rewards faster than all baselines. Notably, in tasks requiring simultaneous evasion, ComposeNet succeeded where meta-controllers failed due to their inability to arbitrate between competing signals.

Episodic reward and length across four LTL-defined tasks, comparing ComposeNet to 'from scratch', 'metacontroller', and 'transfer' baselines.

Furthermore, the model exhibited impressive zero-shot generalization. After learning the logic for "Collect X or Y" using Red and Green, the model achieved a reward of 0.79 on the Blue/Green combination without any specific training on that pair. This suggests the Composition Layer successfully learns the underlying logic of the operator rather than just the specific skill instances.

Conclusion

ComposeNet provides a scalable method for building complex hierarchies in RL. By treating skills as embeddings in a shared latent space, it enables a flexible "logic" of behavior. While currently limited to discrete grid worlds and pre-defined LTL structures, future work could extend this to high-dimensional continuous control and autonomous discovery of skill compositions.

Summary updated

BibTeX
@misc{sahni2017learning,
  author = {Himanshu Sahni and Saurabh Kumar and Farhan Tejani and Charles L. Isbell Jr.},
  title = {{Learning to Compose Skills}},
  year = {2017},
  eprint = {1711.11289},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.11289},
}
Figure