$\pi$2vec: Policy Representation with Successor Features

Gianluca Scarpellini, Ksenia Konyushkova, Claudio Fantacci, Thomas Paine, Yutian Chen, Misha Denil

Evaluating reinforcement learning (RL) policies on physical robots is a notorious bottleneck. It’s expensive, slow, and risks damaging hardware. While offline RL allows us to train policies without a live robot, we still face the "Offline Policy Selection" (OPS) problem: how do we pick the best policy from a batch of candidates using only historical data?

In their ICLR 2024 paper, $\pi$2vec: Policy Representation with Successor Features, researchers from Google DeepMind and the Istituto Italiano di Tecnologia propose a clever way to turn complex, "black-box" policies into simple feature vectors. By representing what a policy does to its environment rather than just the actions it takes, $\pi$2vec enables accurate performance prediction without ever touching a robot.

TL;DR

$\pi$2vec represents reinforcement learning policies as fixed-length vectors by combining visual foundation models with the successor feature framework. This allows researchers to accurately predict and rank the performance of unseen policies using only offline data, significantly reducing the need for costly real-world robot evaluation.

The high-level $\pi$2vec workflow: combining foundation models and offline data to create comparable policy embeddings.

What Problem Does This Paper Address?

The standard way to compare two policies offline is to look at the actions they take on a set of "canonical" states. If two policies take similar actions, we assume they behave similarly. However, this assumption often fails. For example, two policies might both output "random" actions; an action-based representation would see them as different, even though their actual impact on the environment (their behavior) is identically useless.

The authors argue that we should represent policies based on their behavioral footprint—specifically, how they change the state of the environment over time. The challenge is doing this "black-box" style, without needing to know the internal architecture of the policy or running it in a live simulator.

Methods

The $\pi$2vec method follows a three-step pipeline to transform a policy $\pi$ into a vector $\Psi^\phi_\pi$:

  1. Policy-Agnostic State Features ($\phi$): The system uses a pretrained foundation model (like CLIP, ViT, or TAP) to extract high-level features from camera images. This turns raw pixels into a meaningful vector $\phi(s)$ representing the current state.
  2. Policy-Specific Successor Features ($\psi$): This is the core innovation. Using an offline algorithm called Fitted Q Evaluation (FQE), the authors train a model to predict the discounted future sum of these state features if the policy $\pi$ were to run from state $s$.
The intuition behind successor features: capturing the expected future evolution of environment features.
  1. Aggregation: To get a single "fingerprint" for the policy, these successor features are averaged over a set of "canonical states" sampled from the offline dataset.

The resulting vector $\Psi^\phi_\pi$ represents the policy's expected long-term impact on the environment. Finally, a simple linear regressor is trained to map these vectors to known performance values (returns), allowing it to predict the performance of entirely new, unseen policies.

Datasets

The authors evaluated $\pi$2vec across five diverse domains involving both simulation and real hardware:

  • Simulated: Metaworld (4 manipulation tasks), Franka-Kitchen (5 multi-stage tasks), and a simulated Gear Insertion task.
  • Real-World: A challenging Gear Insertion task on a physical robot and RGB Stacking.

The datasets consisted of a mix of human demonstrations and trajectories from previously trained policies.

Key Insights and Ideas

  • Behavior > Actions: By focusing on the evolution of features (Successor Features) rather than raw actions, $\pi$2vec captures the "intent" and "outcome" of a policy more effectively than previous baselines.
  • Foundation Models are Essential: The choice of the underlying vision model ($\phi$) matters. Semantic models like CLIP work well for high-level tasks, while geometric models like TAP (Track-Any-Point) excel at precision tasks like gear insertion.
  • Robustness to Distribution Shift: Because $\pi$2vec relies on general-purpose foundation models, it generalizes better to out-of-distribution scenarios (like different camera angles) than methods trained from scratch.
  • Linearity in Feature Space: Surprisingly, even though RL rewards are rarely linear, the authors found that linear regression on $\pi$2vec embeddings was sufficient to rank policies accurately.

Key Results

$\pi$2vec consistently outperformed the standard "Actions" baseline across almost all metrics:

  • Real-World Gear Insertion: $\pi$2vec achieved a Rank Correlation of 0.618, while the baseline actually had a negative correlation (-0.545), meaning the baseline was worse than random at picking the best policy.
  • RGB Stacking: Using a ViT-based representation, $\pi$2vec reduced "Regret@1" (the performance gap between the predicted best and actual best policy) by 51% compared to the baseline.
  • Efficiency: The method works entirely offline, meaning researchers can filter out hundreds of poor policy candidates before ever taking up valuable robot time.

Limitations and Future Work

While powerful, $\pi$2vec has some hurdles:

  • Encoder Selection: There is no "one size fits all" foundation model. Users must still choose an encoder that matches the nature of their task (e.g., semantic vs. geometric).
  • Requirement for "Known" Policies: To train the final performance predictor, you still need a small set of policies with already-measured real-world or sim-world returns.
  • Future Directions: The authors suggest that fine-tuning foundation models specifically for policy representation or integrating $\pi$2vec into automated "Active" policy selection frameworks could further boost efficiency.

Summary updated

BibTeX
@inproceedings{scarpellini2024pi,
  author = {Gianluca Scarpellini and Ksenia Konyushkova and Claudio Fantacci and Thomas Paine and Yutian Chen and Misha Denil},
  title = {{$\textbackslash\{\}pi$2vec: Policy Representation with Successor Features}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=nunOF6jSXd},
}
Figure