Composing Task Knowledge with Modular Successor Feature Approximators

Wilka Carvalho, Angelos Filos, Richard L. Lewis, Honglak lee, Satinder Singh

TL;DR

This paper introduces Modular Successor Feature Approximators (MSFA), a novel reinforcement learning architecture that enables agents to combine and transfer knowledge across tasks without relying on hand-designed features. By integrating modular state representations with the Successor Features and Generalized Policy Improvement (SF&GPI) framework, MSFA discovers useful environment features for prediction and achieves superior zero-shot transfer in visually diverse, procedurally generated environments.

What Problem Does This Paper Address?

Imagine a household robot trained to pick up dishes and, separately, to clean up spills. When it encounters a table with both a spill and dirty dishes, we want it to combine these skills seamlessly. The Successor Features and Generalized Policy Improvement (SF&GPI) framework is a powerful tool for this kind of behavioral composition.

However, SF&GPI has two major Achilles' heels:

  1. Hand-Design Dependency: It requires "cumulants"—state features that the agent learns to predict. In most research, these are manually engineered for every new environment, which doesn't scale.
  2. Generalization Gap: Standard monolithic architectures for SFs struggle to generalize to novel environment configurations, such as new room layouts or object appearances.

This paper tackles the challenge of reward-driven discovery of cumulants while simultaneously improving generalization to out-of-distribution environment settings.

Methods

The authors propose MSFA, which replaces the standard monolithic neural network with a set of independent modules.

  • Modular Architecture: MSFA consists of $n$ modules, each maintaining its own module-state. These modules communicate via a sparse attention mechanism (based on the FARM architecture), allowing them to share information while maintaining specialized computations.
  • Decoupled Learning: Each module learns its own modular cumulants ($\phi$) and modular successor features ($\psi$). Crucially, a module's predictions depend only on its own internal state and a subset of the task description.
  • Reward-Driven Discovery: Instead of using human-provided features, MSFA discovers them by regressing the dot-product of its learned cumulants and a task vector to the actual environment reward.
  • Loss Functions: The model is trained using a combination of three losses: a standard Q-learning loss ($L_Q$), an SF learning loss ($L_\psi$), and a cumulant discovery loss ($L_\phi$).

The architectural shift from a monolithic "one-size-fits-all" network to specialized modules is the key innovation, as shown in the comparison below:

Conceptual comparison: (1) FARM uses modules for state but lacks task composition; (2) USFA uses a monolithic block for SFs but relies on hand-designed features; (3) MSFA combines both, using modules to discover features and predict SFs.

Datasets

The authors evaluated MSFA across three increasingly difficult benchmarks:

  1. BabyAI: A gridworld where agents must navigate to and interact with objects. Tasks involve linear combinations of training goals (e.g., "get apples and milk while avoiding knives").
  2. Procgen (Fruitbot): A visually diverse, procedurally generated environment that tests generalization to unseen layouts and object appearances.
  3. Minihack: A complex environment based on NetHack, used here to test the combination of heterogeneous skills like avoiding monsters, navigating traps, and dealing with limited visibility.

Key Insights and Ideas

  • Modularity as an Inductive Bias: The core "aha moment" is that modularity itself acts as a powerful inductive bias for feature discovery. By forcing different modules to attend to different parts of the state, the agent naturally learns disentangled features (like "apple-ness" or "knife-ness") that are much easier to compose for new tasks.
  • Disentanglement is Critical: The authors found that learning modular functions for both cumulants and SFs is essential. If the functions are "entangled" (i.e., every output depends on every module's state), generalization performance collapses.
  • Zero-Shot Transfer to "Task Space": MSFA can generalize to tasks that are far away from training tasks in "task space" (e.g., training on single objects and testing on complex combinations of four objects).
High-level diagram of MSFA transfer. Modules learn specific features (like apples or forks) during training. At test time, these are combined via dot-products with a new task vector to compute Q-values for zero-shot transfer.

Key Results

  • Matching Oracle Performance: In BabyAI, MSFA matched the performance of USFA, a baseline that was given "cheating" access to hand-designed oracle features. When USFA had to learn its own features (USFA-Learned-$\phi$), its performance degraded significantly compared to MSFA.
  • Superior Generalization: In the visually complex Fruitbot environment, MSFA outperformed all baselines, including modular architectures that lacked the SF framework (like FARM).
  • Heterogeneous Task Mastery: In Minihack, SF-based methods (including MSFA) were the only ones capable of achieving high success rates (up to 75% in large rooms) by successfully combining disparate survival skills learned during training.

Limitations and Future Work

  • Simple Task Encodings: The current work uses relatively simple vector-based task encodings. The authors suggest extending this to more expressive formats, such as natural language embeddings.
  • Avoidance Challenges: While MSFA is better at avoiding "negative reward" objects than baselines, it still struggles in environments where avoiding an object requires complex maneuvering (like in Fruitbot, where agents often hit walls while trying to steer away from obstacles).
  • Integration with Other Discovery Methods: The authors used a simple reward-regression method for feature discovery. Future work could explore integrating MSFA with more sophisticated discovery techniques like meta-gradients or mutual information objectives.

Summary updated

BibTeX
@inproceedings{carvalho2023composing,
  author = {Wilka Carvalho and Angelos Filos and Richard L. Lewis and Honglak lee and Satinder Singh},
  title = {{Composing Task Knowledge with Modular Successor Feature Approximators}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=DrtSx1z40Ib},
}
Figure