Variational Inverse Control with Events: A General Framework for Data-Driven Reward Definition

Justin Fu, Avi Singh, Dibya Ghosh, Larry Yang, Sergey Levine

TL;DR

VICE (Variational Inverse Control with Events) shifts reinforcement learning from dictating "how to do a task" to specifying "what the result should look like." By re-framing reinforcement learning as probabilistic inference, VICE allows agents to learn complex behaviors—such as moving a robotic arm based on raw pixels—using only a few examples of successful goal states, rather than requiring full expert demonstrations.

The Challenge of Reward Design

Reinforcement learning (RL) typically relies on a reward function, but designing an effective one is notoriously difficult. If a reward is too simple or sparse, the agent may never discover it. Conversely, if it’s too complex, the agent might exploit loopholes—known as "reward hacking" (like a vacuum robot that dumps dirt back out just so it can get points for picking it up again).

Inverse Reinforcement Learning (IRL) attempts to solve this by learning the reward directly from an expert. However, IRL requires full "how-to" demonstrations (complete trajectories), which are expensive and difficult to collect in the real world. This paper addresses a critical gap: How can we train an agent when we only know what the final success looks like, but lack a step-by-step guide on how to achieve it?

VICE vs IRL: VICE requires only goal state supervision, allowing the agent to discover its own path, unlike IRL which requires full trajectory demonstrations.

Variational Inverse Control with Events (VICE)

The authors tackle this problem using the "Control as Inference" framework, which treats an agent's actions as a problem of finding the most likely path in a graphical model.

Key innovations of the VICE framework include:

  • Event-based Queries: Instead of relying on a continuous reward, the authors define "events" ($e$). They introduce the ANY query, where the goal is to maximize the probability that an event happens at least once during an episode. This is a significant mathematical departure from standard RL, which typically sums rewards over every single timestep (the ALL query).
  • The VICE Algorithm: To learn the probability of an event from data, VICE employs a discriminator-based approach. A neural network is trained to distinguish between states reached by the current agent and the "success states" provided by the user.
  • Automated Shaping: The log-probability output from this discriminator serves as the reward. Because the discriminator is continuously updated as the agent learns, it provides a "shaping" effect—creating a smooth gradient that guides the agent toward the goal even before it successfully reaches it.
VICE uses a neural network discriminator to predict the probability of a success event directly from high-dimensional inputs like raw pixels.

Experimental Setup

The researchers evaluated VICE on several continuous control tasks, focusing specifically on high-dimensional observations where manual reward specification is nearly impossible:

  • MuJoCo Environments: Modified versions of HalfCheetah, Ant, and Pusher.
  • Maze from Pixels: A point-mass navigating a maze where the agent only receives 64x64 RGB images as input.
  • Pusher from Pixels: A 7-DoF robotic arm pushing a cylinder to a goal, also relying solely on 64x64 RGB images.
  • Supervision: Depending on the task, the only supervision provided was between 500 and 10,000 "success states" (static images or state vectors of the goal).

Key Insights and Results

VICE effectively generalizes IRL. While IRL assumes the expert triggers a "success event" at every single step of a demonstration, VICE allows for the event to happen only at the end. This "what" vs. "how" distinction makes it much more practical for real-world robotics. Furthermore, the ANY query allows the agent to take longer, more complex paths to reach a goal because it only cares about hitting the target once, avoiding the "cautious" behavior often seen in standard RL.

Empirical results demonstrated significant advantages:

  • Outperforming Sparse Rewards: In the Pusher and Ant tasks, standard RL with a binary "success/fail" reward failed completely. VICE successfully solved these tasks by learning a shaped reward that actively guided the agent.
  • Matching Hand-Engineered Rewards: In the Pusher task, VICE achieved performance comparable to a "perfect" hand-engineered reward that had access to the exact XYZ coordinates of the block—even though VICE only saw raw pixels.
  • Robustness: VICE significantly outperformed a "naive classifier" baseline. By actively sampling "negative" examples from the agent's own failures during training, VICE avoids the overestimation issues that typically plague static offline classifiers.

Limitations and Future Work

While VICE reduces the need for expert demonstrations, it still requires a significant number of environment interactions for the agent to learn the policy (sample efficiency). Additionally, the "Control as Inference" framework can sometimes lead to "optimistic" or risk-seeking behavior in highly unpredictable environments, as the agent assumes it will get "lucky" and trigger the event. Future research directions include extending this framework from specific goal states to more abstract events (e.g., "don't crash") and multi-stage tasks.

Summary updated

BibTeX
@inproceedings{fu2018variational,
  author = {Justin Fu and Avi Singh and Dibya Ghosh and Larry Yang and Sergey Levine},
  title = {{Variational Inverse Control with Events: A General Framework for Data-Driven Reward Definition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=HJWAltb_-S},
}
Figure