Abstract
We propose a new framework for imitation learning---treating imitation as a two-player ranking-based game between a policy and a reward. In this game, the reward agent learns to satisfy pairwise performance rankings between behaviors, while the policy agent learns to maximize this reward. In imitation learning, near-optimal expert data can be difficult to obtain, and even in the limit of infinite data cannot imply a total ordering over trajectories as preferences can. On the other hand, learning from preferences alone is challenging as a large number of preferences are required to infer a high-dimensional reward function, though preference data is typically much easier to collect than expert demonstrations. The classical inverse reinforcement learning (IRL) formulation learns from expert demonstrations but provides no mechanism to incorporate learning from offline preferences and vice versa. We instantiate the proposed ranking-game framework with a novel ranking loss giving an algorithm that can simultaneously learn from expert demonstrations and preferences, gaining the advantages of both modalities. Our experiments show that the proposed method achieves state-of-the-art sample efficiency and can solve previously unsolvable tasks in the Learning from Observation (LfO) setting.
Introduction
Imitation Learning (IL) is traditionally divided into two paradigms: Learning from Demonstrations (LfD), where an agent has access to expert states and actions, and Learning from Observations (LfO), where only expert states are available. While LfO is more practical for real-world applications—such as learning from video demonstrations—it is significantly more challenging because the agent must infer underlying actions and explore high-dimensional state spaces efficiently.
Existing Inverse Reinforcement Learning (IRL) methods typically frame imitation as an adversarial min-max game. In this setup, a reward function (or discriminator) attempts to distinguish the agent's behavior from the expert's, while the agent attempts to maximize the reward. This approach suffers from two primary limitations: it is inflexible, struggling to incorporate suboptimal or ranked data, and it is notoriously unstable due to the difficulties of adversarial optimization.
The Ranking Game Framework
To address these issues, we introduce rank-game, which reformulates imitation learning as a general-sum game. Instead of a binary classification task, the reward agent learns to satisfy a set of pairwise performance rankings.
The Ranking Loss ($L_k$)
The core of our method is a novel regression-based ranking loss ($L_k$). This loss attempts to induce a specific performance gap, $k$, between different behaviors. This formulation allows the reward function to be smoother and more amenable to policy optimization than the "sharp" indicator functions often produced by traditional methods like GAIL.
Data Modalities
The framework is uniquely capable of unifying multiple data sources:
- Vanilla Rankings: Implicit rankings between the current agent's behavior and the expert's demonstrations.
- Automatic Rankings (Auto): A "mixup" technique in trajectory space that generates synthetic intermediate rankings, regularizing the reward function.
- Offline Preferences (Pref): Pre-annotated rankings of suboptimal trajectories, providing critical guidance in complex environments where expert data is sparse.
Optimization and Stability
Rather than standard Gradient Descent-Ascent, we employ a Stackelberg game (leader-follower) formulation to improve training stability. We propose two variants: Policy as Leader (PAL), where the reward agent quickly adapts to the policy's movements, and Reward as Leader (RAL), where the reward agent aggregates history to provide a stable signal for the policy.
As shown in the reward landscape visualizations, the ranking-based approach produces a much smoother gradient compared to the sharp transitions in GAIL. This smoothness prevents policy gradients from stalling and contributes to the method's superior sample efficiency.
Experimental Results
We evaluated rank-game on standard MuJoCo locomotion benchmarks and complex manipulation tasks like Pen-v0 and Door-v0.
- Sample Efficiency: In locomotion tasks, our method reached near-expert performance significantly faster than prior state-of-the-art methods. On the Humanoid task, rank-game achieved a normalized score of ~96%, while baselines remained below 30% at the same timestep limit.
- Solving Complex LfO: In the LfO setting, previous baselines failed entirely on the Pen and Door tasks. By incorporating just 10-50 offline preferences, rank-game successfully solved these high-dimensional manipulation problems.
- Robustness: The method maintained performance even with up to 60% noise in preference data, demonstrating that preferences serve to shape the reward landscape effectively even when imperfect.
Conclusion
By treating imitation as a ranking game, we provide a unified framework for learning from both expert demonstrations and suboptimal preferences. This approach offers improved stability, smoother reward landscapes, and the ability to solve complex tasks that were previously considered unsolvable in the Learning from Observation setting. Future work will focus on automating hyperparameter tuning and improving the reusability of learned reward functions across different agent morphologies.
Summary updated