LatentMimic: Terrain-Adaptive Locomotion via Latent Space Imitation

Zhiquan Wang, Yunyu Liu, Dipam Patel, Ayush Kumar, Aniket Bera, Bedrich BenesarXiv 2026

TL;DR

LatentMimic is a novel quadruped locomotion framework that decouples a robot's motion style from the geometric constraints of its environment by performing imitation learning entirely within a latent space. This allows robots to preserve natural, biological gaits (like trotting or pacing) while dynamically adapting their feet to traverse challenging terrains like stairs and uneven ground—all without requiring terrain-specific motion capture data.

What Problem Does This Paper Address?

When training quadruped robots to walk, engineers typically face a frustrating trade-off. You can either use reinforcement learning (RL) to craft highly stable, terrain-adaptive policies that often look robotic and unnatural, or you can use imitation learning to mimic real animal motion capture (mocap) data.

The issue with imitation learning is an underlying optimization conflict. Standard adversarial imitation methods (like Adversarial Motion Priors, or AMP) enforce strict kinematic matching in the physical observation space. Because almost all high-quality animal mocap data is recorded on flat ground, forcing a robot to strictly track these exact joint angles on rough terrain is a recipe for failure. For example, to climb a stair, a robot must deviate from flat-ground data by lifting its feet higher. Standard tracking objectives penalize these necessary geometric deviations, causing the robot to trip and fall. Collecting mocap data for every possible complex terrain is highly impractical, leaving terrain-agnostic style imitation an unsolved challenge.

Methods

LatentMimic resolves this conflict with a key mathematical insight: decomposing the full-kinematic imitation objective into two parts:

  1. Marginal Latent Divergence: Captures the high-level "topological essence" of the gait (e.g., phase variations and footfall sequences).
  2. Conditional Geometric Divergence: Enforces strict, joint-by-joint physical alignment.

By explicitly truncating the conditional geometric divergence term, LatentMimic relaxes the rigid pose-tracking requirements, allowing the robot to alter its physical joint configurations to clear obstacles without incurring a style penalty.

The architecture consists of a two-stage training pipeline:

Fig. 2: Overview of LatentMimic: a) We first pretrain a motion encoder to encode the motion transitions into a latent space and a motion predictor to predict the future motion transitions based on a mocap dataset. These two networks together form our Latent Prior Module. b) We then perform imitation policy learning using a mimic reward that measures the KL-divergence between the simulated and target transition in the latent space to learn the desired motion style. c) We introduce an anchor reward and a terrain adaptation replay buffer to enhance terrain traverse while preserving the desired motion style. These components aid learning and enable effective adaptation across diverse terrains. Note: The latent prior module is trained in both b) and c).
  • Stage 1: Latent Space Imitation Learning: The authors pretrain a Latent Prior Module consisting of a Motion Encoder (which maps physical states to a latent space $Z$) and a Motion Predictor (which forecasts future frames). A control policy is then trained via Proximal Policy Optimization (PPO) using a Latent Mimic Reward that measures the KL-divergence between simulated and target transitions purely within this latent space.
  • Stage 2: Terrain Adaptation Learning: To prevent the robot from abandoning its stylish gait for a messy, "greedy" survival strategy on rough terrain, the framework introduces a Style Anchor Reward. This reward penalizes deviations from the policy learned in Stage 1. Furthermore, a Terrain Adaptation Replay Buffer continuously saves the top 10% of successful transitions on rough terrain to fine-tune the motion predictor, resolving the state distribution shifts caused by uneven geometry.

Datasets

The authors utilized a widely recognized public dog motion capture dataset to build their reference distribution. Because the original data was captured exclusively on flat ground and featured a different morphology than the target robot, the data was retargeted to a Unitree Go1 quadruped robot using inverse kinematics. The framework was evaluated across four distinct motion styles: pace, pace backwards, trot, and trot backwards.

Key Insights and Ideas

  • The Power of Truncation: The core "aha moment" is that dropping the conditional geometric constraint acts as a conditional relaxation. The robot is incentivized to keep the rhythm and style of a dog, but is given the freedom to change its foot clearance to survive.
  • Style Anchoring: Without an explicit anchor policy during the terrain adaptation phase, reinforcement learning naturally degrades the motion style in favor of stability. The style anchor reward acts as a regularizer that keeps the gait biologically plausible even under stress.
  • Dynamic Latent Updates: Rough terrain inherently causes out-of-distribution states. By using a secondary replay buffer of highly rated terrain transitions, the latent prior dynamically adapts its support set, preventing the motion predictor from generating invalid targets (such as foot trajectories that clip stairs).

Key Results

LatentMimic was benchmarked against two state-of-the-art baselines: Learned Initialized Actuators (LIA) and Adversarial Motion Priors (AMP) across three procedurally generated terrains (Stairs, Waves, and Noise) scaled up to 64 difficulty levels.

  • Stylistic Fidelity: On flat ground, LatentMimic achieved significantly lower tracking errors (Mean Squared Error) for base position, joint angles, and joint velocities across almost all gaits compared to LIA and AMP.
  • Terrain Traversal Success: On complex terrains, LatentMimic consistently reached much higher difficulty levels. For instance, on Stair terrain with a success rate $\ge 90\%$, LatentMimic reached level 9 for the pacing gait, while LIA failed at level 0 and AMP reached level 3.
  • Ablation Performance: Ablation studies proved the necessity of the adaptation module; without it, the maximum level achieved on stairs dropped from 45 down to 18.

Limitations and Future Work

While highly effective, the authors note a few limitations:

  • Command-Control Decoupling: The framework slightly weakens direct velocity and directional command inputs, as the robot's movement remains tightly correlated with the underlying mocap data.
  • Mocap Dependency: The policy's ultimate capability is still bounded by the initial quality of the flat-ground mocap data; some animal gaits are inherently unsuited for specific extreme terrains.

For future work, the team aims to expand the framework to accept more scalable and diverse input sources, such as raw video clips or hand-crafted target frames, eliminating the strict dependency on specialized mocap setups.

Summary updated

BibTeX
@misc{wang2026latentmimic,
  author = {Zhiquan Wang and Yunyu Liu and Dipam Patel and Ayush Kumar and Aniket Bera and Bedrich Benes},
  title = {{LatentMimic: Terrain-Adaptive Locomotion via Latent Space Imitation}},
  year = {2026},
  eprint = {2604.16440},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.16440},
}
Figure