Auxiliary task discovery through generate and test

Banafsheh Rafiee, Sina Ghiassian, Jun Jin, Richard S. Sutton, Jun Luo, Adam White

In reinforcement learning (RL), agents often learn faster and develop better internal representations when they are trained to solve "auxiliary tasks" alongside their main objective. For example, an agent might predict pixel changes or try to reach subgoals while simultaneously maximizing an overall game score. This phenomenon is known as the auxiliary task effect.

Historically, these tasks have been hand-designed by human experts, requiring significant domain knowledge and trial-and-error. While end-to-end meta-learning approaches exist to discover these tasks automatically, they are notoriously computationally expensive, data-inefficient, and difficult to tune. This paper asks a critical question: how can an RL agent autonomously discover, evaluate, and retain useful auxiliary tasks on the fly without the heavy computational overhead of meta-learning?

To address this, the authors introduce a "generate-and-test" method. By continually proposing new tasks and keeping only those whose induced features directly benefit the main task, the approach removes the need for human-designed auxiliary objectives.

The Generate-and-Test Framework

The proposed framework consists of two main components: a generator that proposes new auxiliary tasks, and a tester that evaluates them. Every $T$ steps, the tasks with the lowest utility are discarded and replaced with new ones. To make this work, the authors introduce several clever mechanisms:

The Tester & Master-User Architecture To evaluate a task, the tester looks at how useful the features induced by that task are to the main objective. To solve the credit assignment problem of "which task created which feature?", they use a "Master-User" network strategy. In the forward pass, all tasks use all features. In the backward pass, gradients from a specific auxiliary task only update a specific, isolated subset of features.

Master-User Architecture

Utility Metric A feature's utility is calculated by multiplying its activation trace by the magnitude of its outgoing weights to the main task's action-value (Q) function. An auxiliary task's overall utility is simply the sum of the utilities of the features it modifies. Measuring the magnitude of weights connecting a feature to the main task's output serves as a highly effective, computationally cheap proxy for task usefulness.

The Generators The authors test two types of task generators:

  1. Random subgoal-reaching: Randomly selects states from the observation space as subgoals.
  2. Feature-attainment: Instead of targeting states, this novel generator creates tasks that aim to maximize specific internal neural network features that the main task already finds useful. This operates in the agent's learned representation space rather than the raw environment space, offering a highly scalable path forward for task discovery.

Experimental Setup and Key Results

The authors evaluate their method on three episodic RL environments: Four-rooms (a standard discrete gridworld), Maze (a larger, more complex discrete gridworld), and Pinball (a continuous state-space environment with simplified ball physics).

The generate-and-test method demonstrated several key successes:

  • Accurate Evaluation: In the Four-rooms environment, the tester successfully assigned much higher utility scores to hand-designed "good" tasks (reaching bottlenecks/hallways) than "bad" tasks (reaching dead-end corners).
  • Improved Performance: The method (using random subgoals) learned faster and achieved better final performance than baselines with no auxiliary tasks across all three environments.
  • Better than Random: The method also outperformed a baseline using fixed random auxiliary tasks. This proves that the testing and pruning mechanism actively curates a better, more helpful set of tasks than random chance.
Four-rooms environment and utility evaluation

Furthermore, the feature-attainment variant successfully improved learning over the no-auxiliary-task baseline, proving its viability as a scalable alternative to random state subgoals.

Limitations and Future Work

The authors note a few limitations. First, the feature-attainment generator struggles slightly in the very early episodes of training; because the network's features are initially random, the early auxiliary tasks it generates are somewhat arbitrary until the main task begins shaping the network. Second, the random subgoal generator scales poorly to high-dimensional observation spaces.

For future work, the authors suggest sampling subgoals from a replay buffer (similar to Hindsight Experience Replay) rather than generating them purely at random. They also propose combining this lightweight generate-and-test approach with heavier meta-learning techniques, using generate-and-test to discover a rough set of good tasks, and meta-learning to fine-tune them.

Summary updated

BibTeX
@inproceedings{rafiee2023auxiliary,
  author = {Banafsheh Rafiee and Sina Ghiassian and Jun Jin and Richard S. Sutton and Jun Luo and Adam White},
  title = {{Auxiliary task discovery through generate and test}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=z4g0Vpf5Zki},
}
Figure