TL;DR
Teaching a humanoid robot to hit a tennis ball using standard reinforcement learning usually results in bizarre, unnatural flailing—because rewarding where the ball lands says nothing about how to swing. This paper introduces Flow-Matching Motion Prior (FMP), a method that takes a robot's clumsy training movements and continuously "spell-checks" them into smooth, context-appropriate human motions. The result is a single controller that plays autonomous forehand and backhand tennis on a real humanoid robot, without needing any reference clips or motion models at deployment.
What Problem Does This Paper Address?
In reinforcement learning (RL), it is easy to write a reward function for an outcome—like placing a box on a mark or hitting a ball over a net. However, outcome rewards leave the intermediate whole-body motion completely unspecified. Without heavy, tedious reward engineering, RL policies find grotesque, jerky shortcuts that would tear real hardware apart.
To get human-like movement, researchers usually rely on two paradigms, each with a catch:
- Motion Tracking: You reward the robot for mimicking a pre-recorded human clip frame-by-frame. The tracking error is explicit and easy to tune, but someone (or a separate planner) has to select the exact right clip and align it in time for every situation.
- Learned Motion Priors: Methods like Adversarial Motion Priors (AMP) or Score-Matching Motion Priors (SMP) score how "human-like" the robot's recent movement looks overall. No clip selection is needed, but you lose an explicit reference pose, and unconditional priors don't know when a motion makes sense—a gorgeous tennis swing three seconds too early still misses the ball.
The authors ask: can we build a reusable motion prior that generates an explicit, context-aware reference trajectory on the fly from the robot's own actions?
Methods
FMP bridges motion tracking and generative priors in two stages. First, a lightweight transformer (0.7M parameters) is pretrained using flow matching—a generative technique similar to diffusion that learns a straight velocity field transporting Gaussian noise into clean data. Here, the data consists of short, 0.2-second (10-frame) windows of human motion, optionally conditioned on task context (like where a tennis ball is headed and time-to-contact). Once trained, this model is frozen.
During standard PPO policy training, FMP generates a "style reward" at every 50 Hz control step using a clever projection trick inspired by SDEdit (an image-editing technique):
- Take the robot's actual recent 0.2-second motion window.
- Partially corrupt it with noise up to a chosen "projection time" $\tau_s$, erasing high-frequency jitters while keeping coarse posture and intent.
- Integrate the frozen flow model forward (in just 4 Euler steps) under the current task condition to land back on the manifold of natural human motion.
This produces an explicit reference window—essentially, "what a human doing roughly what you're doing right now, in this exact task scenario, would look like." The robot is simply rewarded for minimizing the gap between its actual motion and this projected reference. At deployment, the flow model is thrown away; the lightweight policy runs autonomously using only onboard sensors and task commands.
Datasets
FMP is evaluated across four tasks using human motion datasets retargeted to the 29-joint Unitree G1 humanoid:
- Locomotion: Unconditional walking and running clips from LAFAN1 and 100STYLE.
- Stylized Locomotion: 6.7 hours of forward walking across 100 distinct styles from 100STYLE, conditioned on a style label.
- Box Carrying: 56 clips (5 minutes) of loco-manipulation from OmniRetarget, conditioned on box and goal positions.
- Tennis: A newly reconstructed dataset of 500 tennis strokes (24 minutes, including mirrored clips) extracted from video, conditioned on the hitting target (contact point, outgoing ball direction, and time until contact).
Key Insights and Ideas
- Task conditioning unlocks sparse-reward timing: In tennis, the task reward only fires within ~0.1 seconds of ball contact. Random exploration almost never stumbles into a good return. Because FMP is conditioned on time-to-contact and target location, its projected reference actively guides the robot through the footwork, backswing, and follow-through long before the ball arrives.
- Explicit references mean modular body control: Unlike adversarial discriminators that output a single opaque score, FMP outputs a full kinematic pose. Without retraining the prior, you can mask the reward to apply a wacky walking style strictly to the robot's upper body while letting the legs walk normally (or vice versa).
- Projection time ($\tau_s$) is a "compliance dial": Injecting lots of noise (small $\tau_s$) washes out the robot's current motion, forcing the reference to strictly obey the task command (crucial for making the robot switch between forehand and backhand). Injecting less noise (large $\tau_s$) preserves whatever motion the robot is already doing while gently smoothing out exploration jitter.
Key Results
- Tennis: Policies trained with task rewards alone—or with unconditional priors—completely fail to play tennis (strike rates of 2%–8%). Task-conditioned FMP achieves an 81% strike rate, 98% net clearance, and a 0.44 m landing error, outperforming conditioned AMP (59% strike rate, 0.82 m error) and matching conditioned SMP while offering an explicit, tunable reference.
- Box Carrying: Adding task conditioning boosts successful box placement from 43% (task-only) and 55% (unconditional FMP) to 83%.
- Cross-Task Reuse: A single frozen running prior transfers seamlessly between goal-reaching and steering tasks, reducing motion unnaturalness (measured via Fréchet distance to human data) by over 40x compared to task-only baselines—whereas freezing and reusing an AMP discriminator causes catastrophic failure.
- Zero-Shot Sim-to-Real: All policies transfer directly to a physical Unitree G1 humanoid without fine-tuning, smoothly switching between 14 walking styles, lifting randomized boxes, andrallying real tennis balls with both forehands and backhands.
Limitations and Future Work
- Per-task tuning of $\tau_s$: The projection time $\tau_s$ must be chosen per task to balance preserving the robot's current trajectory against enforcing task conditions.
- Mode collapse: Because the reference is projected from the robot's own recent motion, the reward creates a self-reinforcing loop. Even if the prior knows multiple ways to solve a problem, the policy can get stuck in one mode—for instance, some tennis policies at higher $\tau_s$ values fall in love with the forehand and refuse to hit backhands. Encouraging multi-modal exploration remains an open avenue for future work.
Summary updated