Will it Blend? Composing Value Functions in Reinforcement Learning

Benjamin van Niekerk, Steven James, Adam Christopher Earle, Benjamin RosmanarXiv 2018

Introduction

In the quest for "lifelong learning," the goal is to develop agents that do not need to start from scratch every time they encounter a new task. If an agent already knows how to find a "blue square" and a "purple circle," it should ideally be able to find "a blue square OR a purple circle" without hours of retraining. This paper provides a mathematical "recipe" for such zero-shot reinforcement learning (RL) by leveraging the framework of entropy-regularized RL.

Methodology: The Power of Composition

Traditionally, RL is rigid; value functions—which estimate long-term rewards—are tied to specific reward functions. While frameworks like Linearly-solvable MDPs (LMDPs) allow for composition, they have been limited to simple cases with known dynamics. This research brings compositional power to modern deep RL settings where dynamics are unknown and states are complex (e.g., pixels).

The authors build their approach on Entropy-Regularized RL, where agents maximize reward while maintaining policy diversity. The key technical contributions include:

  1. The Desirability Function: Defined as $Z(s, a) = \exp(Q(s, a)/\tau)$, where $Q$ is the value function and $\tau$ is a temperature parameter.
  2. Theorem of Optimal Composition: The authors prove that if a library of tasks differs only in rewards at goal states, the optimal desirability function for a composite task is a linear combination of the base functions.
  3. The "Max" Rule: As temperature $\tau$ approaches zero, the optimal $Q$-function for a union of tasks becomes the maximum of the individual $Q$-functions.

This mathematical "recipe" turns a complex optimization problem into a simple linear algebra problem: while $Q$-functions do not add up linearly, their exponentials (desirability functions) do.

Experimental Setup

The method was evaluated using a custom 2D Grid-World Video Game. The agent learns from raw 84x84 RGB pixel frames, requiring it to navigate based on visual input rather than coordinate lists.

The 2D Grid-World environment features six types of objects (squares and circles in three colors) that serve as targets for base and composite tasks.

Tasks included base objectives (e.g., "collect any purple object") and composite tasks (e.g., "Purple OR Blue").

Key Results and Insights

The experiments demonstrated that any task within the "span" of the learned library can be solved optimally and immediately.

Results demonstrating (a) the multimodal value surface, (b) optimal agent paths toward the nearest valid goal, and (c) average return performance for composite tasks.
  • Multimodality: Composed value functions naturally handle multiple goals. The value surface (panel a) shows multiple peaks, allowing the agent to dynamically choose the nearest or most rewarding target.
  • Optimal Navigation: In "OR" tasks, the agent correctly identifies and navigates to the nearest valid object (panel b).
  • Zero-Shot Generalization: In tasks like PurpleOrBlue, the composed agent achieved rewards identical to an agent trained specifically for that task from scratch (panel c).
  • Temporal Sequences: The agent successfully solved long-term "collect all" tasks by moving greedily from one item to the next until the board was clear.

Limitations and Future Work

The current proof for Theorem 2 assumes deterministic transitions. While experiments suggest the method works in practice, a formal proof for stochastic environments is a necessary next step. Additionally, the "recipe" currently requires tasks to differ only in rewards at goal states. Finally, while "OR" compositions are mathematically optimal, "AND" compositions (intersections) remain approximations that can sometimes lead to local optima.

Summary updated

BibTeX
@misc{niekerk2018will,
  author = {Benjamin van Niekerk and Steven James and Adam Christopher Earle and Benjamin Rosman},
  title = {{Will it Blend? Composing Value Functions in Reinforcement Learning}},
  year = {2018},
  eprint = {1807.04439},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.04439},
}
Figure