Reinforcement Learning with Automated Auxiliary Loss Search

Tairan He, Yuge Zhang, Kan Ren, Minghuan Liu, Che Wang, Weinan Zhang, Yuqing Yang, Dongsheng Li

Introduction

Reinforcement Learning (RL) agents often struggle to learn effective representations when faced with high-dimensional observations, such as raw pixels, particularly when reward signals are sparse or delayed. To mitigate this, researchers frequently employ auxiliary losses—secondary tasks like state reconstruction or reward prediction—to provide additional supervision. However, these losses are typically handcrafted based on human intuition, which may lead to sub-optimal performance or poor generalization across diverse environments. This paper introduces Automated Auxiliary Loss Search (A2LS), a framework designed to discover superior auxiliary losses through evolutionary optimization.

The A2LS Framework

A2LS utilizes a bi-level optimization approach to automate the design of auxiliary losses. The framework consists of an inner loop for RL training and an outer loop for evolutionary search.

Overview of the A2LS bi-level optimization framework, illustrating the interaction between the RL training inner loop and the evolutionary outer loop.

In the inner loop, a candidate auxiliary loss is used to train an RL agent. The performance of this agent, measured by the Area Under the Learning Curve (AULC), serves as the fitness score for the evolutionary process. In the outer loop, a population of loss functions is evolved over multiple generations. The top-performing candidates (the top 25%) are selected for mutation and crossover to generate the next generation of loss functions. To ensure computational feasibility, the framework incorporates a "loss rejection" protocol to filter out invalid or non-differentiable candidates before training.

Search Space and Methodology

The search space for A2LS is defined by breaking down auxiliary losses into three atomic components:

  1. Horizon ($k$): The number of future time steps considered.
  2. Input Elements ($\mathcal{I}$): The specific combinations of states ($s$), actions ($a$), and rewards ($r$) used as source and target sequences.
  3. Operator ($f$): The mathematical function (e.g., Mean Squared Error) used to compare the predicted and target representations.

The search space encompasses approximately $7.5 \times 10^{20}$ possible configurations. Through preliminary analysis, the authors found that Mean Squared Error (MSE) is generally the most effective operator, allowing them to focus the search on the horizon and input element combinations.

Experimental Results

The search was initially conducted on a subset of environments from the DeepMind Control (DMC) suite, including Cheetah-Run, Reacher-Easy, and Walker-Walk. The evolutionary process demonstrated a steady improvement in population fitness, with many discovered candidates quickly surpassing established handcrafted baselines.

Evolutionary progress in the Walker-Walk environment, showing the distribution of AULC scores across four stages of evolution compared to SAC and CURL baselines.

The search yielded a specific loss function termed A2-winner. When evaluated on a broad range of tasks, A2-winner demonstrated significant performance gains:

  • DMC Suite: On image-based tasks, A2-winner consistently outperformed CURL. For instance, in the Reacher-Easy task, it achieved a score of 778 compared to CURL's 538.
  • Atari 100k Benchmark: In discrete control environments, A2-winner achieved a Mean Human-Normalized score of 0.568, surpassing CURL (0.381) and DrQ (0.357).
  • Generalization: Despite being discovered in image-based environments, A2-winner generalized effectively to vector-based observations and Partially Observable Markov Decision Processes (POMDPs).

Key Insights

Statistical analysis of the search results provided several insights into effective representation learning. First, "predictive density" is crucial; auxiliary losses are most effective when they use a minimal set of source elements to predict a larger, denser set of target elements. Second, the utility of specific tasks varies by observation type. For example, state reconstruction is highly beneficial for image-based RL but can be detrimental for vector-based RL, explaining why certain popular techniques do not transfer well between these domains.

Conclusion

A2LS demonstrates that automated search can discover auxiliary losses that significantly outperform handcrafted alternatives in terms of sample efficiency and generalization. While the initial search is computationally intensive, the resulting A2-winner loss provides a robust, general-purpose objective for representation learning in RL. Future work will focus on improving search efficiency and exploring more complex loss architectures.

Summary updated

BibTeX
@inproceedings{he2022reinforcement,
  author = {Tairan He and Yuge Zhang and Kan Ren and Minghuan Liu and Che Wang and Weinan Zhang and Yuqing Yang and Dongsheng Li},
  title = {{Reinforcement Learning with Automated Auxiliary Loss Search}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=ZPpmNSCFuT},
}
Figure