Abstract
This paper describes $\pi2\text{vec}$, a method for representing behaviors of black box policies as feature vectors. The policy representations capture how the statistics of foundation model features change in response to the policy behavior in a task agnostic way, and can be trained from offline data, allowing them to be used in offline policy selection. This work provides a key piece of a recipe for fusing together three modern lines of research: Offline policy evaluation as a counterpart to offline RL, foundation models as generic and powerful state representations, and efficient policy selection in resource constrained environments.
Introduction
In robotics, "robot time" is the ultimate bottleneck. Evaluating a new reinforcement learning (RL) policy on a physical machine is slow, wear-inducing, and expensive. While Offline Policy Evaluation (OPE) aims to estimate performance using historical data, we often need to compare many candidate policies to select the best one—a challenge known as Offline Policy Selection.
Existing methods often represent policies by the actions they take on a fixed set of "canonical" states. However, this "Actions" baseline is flawed: two policies might take different actions but achieve the same environmental outcome, or take similar actions that lead to wildly different results. $\pi$2vec addresses this by characterizing a policy by how it changes the environment over time, rather than just its immediate actions.
Methodology
The $\pi$2vec framework transforms a black-box policy into a comparable feature vector through a three-step pipeline.
- State Encoding: A pretrained visual foundation model (e.g., CLIP, ViT, or TAP) acts as a policy-agnostic state-feature encoder ($\phi$), converting raw images into rich semantic or geometric feature vectors.
- Successor Feature Training: For a specific policy $\pi$, a Successor Feature (SF) network is trained. Unlike standard value functions that predict a scalar reward, SFs predict the expected future discounted sum of the state features ($\phi$) the policy will encounter. This captures the long-term "behavioral signature" of the policy and is trained offline using Fitted Q Evaluation (FQE).
- Aggregation: To ensure state-independence, the successor features are averaged over a set of "canonical states" sampled from historical trajectories.
The resulting vector, $\Psi^\phi_\pi$, serves as a compact summary of the policy's behavior. A simple linear regressor then maps these vectors to known policy returns, enabling performance prediction for entirely new policies.
Experimental Evaluation
The authors evaluated $\pi$2vec across five diverse environments involving both simulation and real hardware:
- Simulated Domains: Metaworld (tasks like assembly and drawer opening), Franka-Kitchen, and a simulated "Insert Gear" task.
- Real-World Domains: A physical "Insert Gear" platform and "RGB Stacking" (colored block manipulation).
- Data Sources: Training utilized offline datasets consisting of human demonstrations and trajectories from various previously trained policies.
Results and Discussion
$\pi$2vec consistently outperformed action-based baselines by capturing the consequences of actions rather than the actions themselves.
- Superior Performance: In the real-world RGB Stacking task, $\pi$2vec improved the "Regret@1" metric (the performance gap between the best policy and the predicted best) by 51%.
- Real-World Success: In the challenging real-robot Insert Gear task, the "Actions" baseline failed with a negative correlation (-0.545), while $\pi$2vec achieved a strong positive correlation of +0.618.
- Foundation Model Synergy: Off-the-shelf vision models proved to be powerful bases. Semantic models like CLIP excelled at high-level tasks, while geometric/tracking models like TAP were better for precision tasks.
- Robustness: The method showed resilience to distribution shifts, such as evaluating policies from camera angles not present during training.
Conclusion
While $\pi$2vec is sensitive to the choice of the underlying visual encoder ($\phi$) and currently assumes a linear relationship between features and rewards, it offers a highly efficient path for policy selection in resource-constrained environments. Future work may involve end-to-end fine-tuning of encoders and integration into active learning frameworks to further optimize real-world testing.
Summary updated