PDM

Concept of PDM

The tracking reward moves the expert state distribution toward the reference state distribution, while distribution matching draws the state distribution of the downstream task policy toward the evolving expert state distribution over the training iterations.

PDM: Improved Adversarial Imitation Learning for Legged Robots via Parallel-Policy Distribution Matching

1The University of Hong Kong 2EngineAI
HKU EngineAI
*Equal contribution †Corresponding author

Video

Introduction to PDM (method and simulation results), followed by the hardware demonstrations. Sound on.

Abstract

Adversarial imitation learning enables agents to acquire skills from expert demonstrations, but early discriminator saturation can leave policies with uninformative rewards. We introduce Parallel-Policy Distribution Matching (PDM), a multi-task reinforcement learning framework with separate tracking and downstream policies. Both policies are trained concurrently from scratch with distinct tracking and task objectives. The tracking policy follows reference motions and generates physically feasible trajectories online. Stochastic rollouts from both policies provide samples for discriminator training. We couple the policies through occupancy-measure matching and derive discriminator-based matching rewards for both. Simulation experiments show that the generated trajectories improve downstream tracking accuracy and that stochastic training samples help mitigate early discriminator saturation. In real-world experiments, the downstream policy preserved the desired motion style during locomotion, recovered from disturbances, climbed obstacles of varying heights, and executed a flip on command.

Motivation

In adversarial imitation, a discriminator separates reference transitions from policy transitions, and its logit serves as the style reward. Reference motions usually come from kinematic retargeting, which introduces artifacts such as foot sliding, ground penetration, and actuation-limit violations. The discriminator exploits these artifacts, so the logits separate early and the style reward becomes uninformative. This failure mode is known as early discriminator saturation.

Key Idea

PDM replaces the fixed reference dataset with rollouts from a tracking expert trained concurrently with the downstream policy. These samples are physically realizable and evolve with the expert, and stochastic sampling of both policies keeps the discriminator from overfitting, which mitigates early saturation.

Method

Overview of PDM
  • Two policies, one simulator. The expert policy \(\pi_E\) and the downstream task policy \(\pi_D\) share the robot's dynamics and action space, but keep separate rewards and PPO updates. Both are trained from scratch at the same time.
  • Expert: tracking. \(\pi_E\) follows the reference motion with a dense tracking reward. Its rollouts contain only states that the simulated robot actually reached.
  • Discriminator: one for both. Stochastic rollouts of both policies train a single discriminator \(D_\varphi\) to tell the expert states from the downstream states.
  • Objectives: return + KL regularizer. Each policy maximizes its own expected return while a KL term keeps its state distribution close to that of the other policy. The discriminator logit estimates this KL term as a distribution-matching reward:
\[ \max_{\pi_E}\; \mathbb{E}_{\tau_E\sim\pi_E}\!\left[\sum_{t=0}^{\infty}\gamma_E^t\, r_t^{\mathrm{track}}\right] - \beta_E\,\mathrm{KL}\!\left(\rho_E \,\Vert\, \rho_D\right), \qquad \max_{\pi_D}\; \mathbb{E}_{\tau_D\sim\pi_D}\!\left[\sum_{t=0}^{\infty}\gamma_D^t\, r_t^{\mathrm{task}}\right] - \beta_D\,\mathrm{KL}\!\left(\rho_D \,\Vert\, \rho_E\right). \]
The return term determines what each policy should accomplish, and the KL term regularizes how it executes the behavior. Only the downstream policy is deployed.

Simulation Results

We evaluate single-clip motion imitation on 12 motion clips across three platforms (Humanoid, G1, and Go2) and compare PDM with two adversarial baselines implemented in MimicKit:

  • AMP uses the kinematically retargeted clip as its fixed expert dataset.
  • AMP-Rollout is a GAIL-style (collect-then-imitate) variant of AMP: a DeepMimic tracking policy is trained first and executed once, and this single robot-executable rollout is the fixed expert dataset.
  • PDM (Ours) trains the tracking and downstream policies concurrently; part of the latest expert rollout replaces the expert data at each refresh.

The comparison examines two factors: AMP uses kinematically retargeted expert data, whereas AMP-Rollout and PDM use expert data executed by the robot; AMP-Rollout records the expert motion with deterministic action sampling, whereas PDM generates expert rollouts online with stochastic action sampling. Each configuration is trained with three random seeds.

Simulation videos

Downstream policies of PDM on the Humanoid and G1 motion clips, trained with only the distribution-matching reward.

Tracking accuracy

Tracking error versus logit gap

Tracking position error versus the symmetric-KL logit-gap diagnostic for AMP, AMP-Rollout, and PDM (Ours) on 12 motion clips across three platforms after about 2 billion training samples. The horizontal axes use logarithmic scales. PDM achieved lower tracking error than AMP on 7 of the 12 clips, and AMP-Rollout on 6 of the 12. Both reduced the error most on Cartwheel and Kick Combo, where AMP-Rollout was the most accurate but requires a separate tracking-policy training stage; on Run and Walk, the retargeted trajectories were already within the robot's capabilities and executable references helped little. PDM yielded the smallest logit gap on all 12 clips, consistent with stronger distribution matching. Because each policy is trained against its own discriminator, this gap is only a relaxed comparison across methods.

Discriminator logits without early saturation

Discriminator logits during training

Demo (solid) and agent (dashed) discriminator logits of AMP, AMP-Rollout, and PDM during training on each motion clip. With the AMP baselines, the demo and agent logits stay separated, indicating early saturation. In PDM, the logits approach equilibrium as both policies generate evolving samples for discriminator training.

The biggest change is in the discriminator logits, and why

  • Change: with AMP and AMP-Rollout, the demo and agent logits stay on opposite sides and saturate early. With PDM, the expert and downstream logits approach the equilibrium value implied by the discriminator loss.
  • Reason 1, stochastic rollouts (the main factor): action noise in both policies' rollouts increases the overlap between the expert and downstream distributions and the diversity of the expert samples. This prevents the discriminator from overfitting to the expert samples. When the same expert checkpoint samples deterministically, the logits diverge as in standard AMP; from \(\sigma = 0.01\) to \(0.05\), they stabilize progressively closer to zero.
  • Reason 2, no shortcut features: saturation occurs when the discriminator relies on a few features that readily separate the two sample sets. With deterministic rollouts, the SHAP importance shows sharp peaks; with more action noise, it becomes lower and more evenly distributed across features.
  • Reason 3, a target that evolves with the robot: both sample sets come from policies that use the same robot model and physics simulator, and the expert distribution updates during training, so the discriminator compares two current policy distributions instead of a fixed dataset. Physically feasible trajectories alone, as in AMP-Rollout, only slightly reduced the logit gap.

State-transition distributions

UMAP of the state transitions of the PDM expert and downstream policies during training on the G1–Run clip. (a), (b) Expert and downstream samples at iterations 500, 1k, 2k, 5k, and 40k, together with the reference motion (Demo). (c)–(f) Samples of both policies and of the reference motion at iterations 500, 1k, 2k, and 5k. The distributions of the two policies move closer during training, while the tracking reward guides the expert toward the reference transitions; using only the matching reward, the downstream policy follows the evolving expert distribution and eventually reproduces the reference trajectory.

UMAP projections of state transitions

Stochastic action noise

Logits and loss for different action noise levels

(a) Demo (solid) and agent (dashed) discriminator logits and (b) discriminator loss of PDM when the expert resumes from the same 20k-iteration checkpoint and samples actions with standard deviation \(\sigma \in \{0, 0.01, 0.02, 0.03, 0.05, 0.1\}\); \(\sigma = 0\) is deterministic sampling. The 0.05 (scratch) curve is an expert trained from scratch with \(\sigma = 0.05\). With deterministic sampling, the logits first approach equilibrium, then diverge before stabilizing, as in standard AMP. From \(\sigma = 0.01\) to \(0.05\), the logits stabilize progressively closer to zero and the loss reaches higher plateaus; both \(\sigma = 0.05\) runs end near a loss of 0.69 regardless of expert initialization.

Effect of the expert action noise

Effect of the expert's action standard deviation \(\sigma\) on the G1–Run clip. (a)–(f) PCA projections of the state occupancy of rollouts from the same expert, overlaid on the reference motion (Demo). (g)–(l) Absolute SHAP importance of the discriminator input features over the horizon. (m) Success rate of the expert. (n) Final tracking error of the downstream policy. As \(\sigma\) increases, the expert covers more of the state space around the reference and the SHAP importance spreads more evenly across features up to \(\sigma = 0.05\). The expert success rate declines, with no successful tracking at \(\sigma \geq 0.1\), and the downstream tracking error is lowest at \(\sigma = 0.03\). Even a well-trained expert can limit matching performance if its samples are generated deterministically.

Real-World Experiments

Flat-ground locomotion

Walking

Turning

Crawling

Two-leg jumping

Blind stair locomotion and box climbing

Blind stair locomotion

Box climbing

Get-up and push recovery

Get-up

Push recovery

Forward flip