π2vec: Policy Representation with Successor Features

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

TL;DR

This paper introduces π2vec, a novel method for representing "black-box" policies as comparable feature vectors. By combining successor features with powerful visual foundation models, π2vec can predict policy performance from offline data, significantly reducing the need for costly real-world robot testing.

What Problem Does This Paper Address?

Evaluating the performance of reinforcement learning (RL) policies, especially in real-world robotics, is a major bottleneck. It's time-consuming and expensive to deploy policies on robots to measure their success. While methods like simulation and offline policy evaluation (OPE) exist, they don't fully address the problem of efficiently selecting the best policy from a set of candidates without extensive real-world testing. Existing approaches to represent policies for performance prediction often rely on assumptions that are violated in practice, or they don't allow for direct comparison between policies. This paper tackles the challenge of creating a representation that captures a policy's behavior in a way that is comparable across different policies, enabling accurate performance prediction from offline data.

Methods

The core of π2vec lies in combining two key ideas:

  • Successor Features (SFs): Traditionally used to factorize value functions, SFs can represent the expected future states a policy will visit, independent of the specific task reward. The paper adapts the Fitted Q Evaluation (FQE) algorithm to learn these SFs from offline data.
  • Visual Foundation Models: These are powerful, pre-trained models (like CLIP, ViT, TAP) that can extract rich, semantic, or geometric features from raw sensory inputs (e.g., images). π2vec uses these as a "policy-agnostic state-feature encoder" to represent individual states.

The process involves:

  1. State Encoding: Using a pre-trained foundation model to convert raw states (images) into feature vectors.
  2. Policy-Specific State Features: Training a network to learn how a specific policy changes the environment's state features over time, effectively capturing the policy's behavior from a given state. This is done using the FQE algorithm on offline trajectories.
  3. State-Agnostic Policy Features: Aggregating these policy-specific state features over a set of "canonical" states to create a single, comparable vector representation for the entire policy. This vector, Ψ, summarizes the policy's overall behavior.

Finally, a simple linear regression model is trained to predict policy performance (e.g., return) from these π2vec feature vectors.

Datasets

The paper uses existing datasets for training and evaluation, including:

  • Human Demonstrations: For domains like Metaworld and Kitchen.
  • Held-out Policy Trajectories: For domains like RGB Stacking and Insert Gear.

No new benchmarks are introduced, but the experiments are conducted across a variety of simulated and real-world robotics environments.

Key Insights and Ideas

  • Behavior over Actions: The paper argues that representing a policy by how it changes the environment (via successor features) is more robust than simply looking at the actions it takes in specific states, especially when policies might exhibit similar actions in different states or vice-versa.
  • Foundation Models as Feature Extractors: Leveraging pre-trained visual foundation models is crucial. The choice of foundation model (semantic vs. geometric) impacts performance, suggesting that the "best" representation depends on the task's nature.
  • Generalization: π2vec demonstrates good generalization capabilities, performing well even in out-of-distribution scenarios and when policies are very similar to each other. This suggests that the learned representations capture fundamental aspects of policy behavior.
  • Robustness to Random Policies: Random policies are represented closely together in the π2vec feature space, indicating that the representation effectively distinguishes between meaningful policies and random exploration.

Key Results

  • Outperforms Baselines: π2vec consistently outperforms the "Actions" baseline (representing policies by their actions on canonical states) across various tasks and environments, particularly in terms of predicting policy performance (higher correlation, lower regret@1).
  • Real-World Performance: The method shows strong results in challenging real-world robotics tasks like Insert Gear (Real) and RGB Stacking. For instance, in Insert Gear (Real), π2vec achieved a significant improvement in correlation over the Actions baseline.
  • Foundation Model Impact: Different foundation models yield varying results. CLIP (semantic) often performs well in harder tasks with high policy variance, while ViT (geometric/visual) excels in more predictable environments. The "BEST-φ" configurations, which select the best foundation model for a given task, consistently achieve top performance.
  • Offline Policy Selection: π2vec is effective for Offline Policy Selection (OPS), accurately ranking policies even when their exact performance values are unknown.

Limitations and Future Work

  • Linear Reward Assumption: While the paper adapts SFs to avoid a strict linear reward assumption for performance prediction, it still relies on a linear model for the final prediction step.
  • Foundation Model Choice: The optimal foundation model is task-dependent, and finding the best one requires experimentation.
  • Future Work: The authors suggest exploring diverse foundation models, advanced offline learning algorithms for SF training, and investigating the impact of different dataset choices. They also mention the potential for end-to-end fine-tuning of feature encoders and integrating π2vec with existing frameworks like AOPS for enhanced policy selection.

Summary updated

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