TL;DR
LocoFormer is a single, generalist locomotion policy capable of zero-shot and few-shot control across radically different, unseen robots—including bipeds, quadrupeds, and wheeled variants. By pairing massive-scale reinforcement learning over procedurally generated robots with a long-context Transformer-XL architecture that retains memory across episodes, the policy discovers how to walk, balance, and adapt to severe hardware failures entirely in-context.
What Problem Does This Paper Address?
Traditional robot locomotion controllers are embodiment-specific "specialists." They are trained tabula rasa on a specific CAD model, tuned with narrow domain randomization, and rely on short observation histories (typically a few hundred milliseconds). Consequently, these controllers fail catastrophically when faced with unmodeled physical shifts, damaged actuators, or new morphologies. Deploying them on a new robot usually demands extensive, error-prone system identification.
LocoFormer asks: Can we train a single "omni-bodied" foundation policy that transfers zero-shot to completely unseen robots and adapts in real time to physical damage or morphological changes without requiring explicit kinematic models?
Methods
LocoFormer approaches cross-embodiment locomotion as an in-context learning problem, drawing inspiration from how large language models adapt at test time:
- Procedural Robot Generation & Unified Action Space: Rather than training on commercial robot specifications, the authors procedurally synthesize a wide universe of bipeds, quadrupeds, and wheeled variants (~100,000 procedural robots). Control is unified via a superset joint space covering the maximum motor count across common legged platforms.
- Long-Context Memory via Transformer-XL: Standard policies are myopic. LocoFormer uses a segment-recurrent Transformer-XL (TXL) backbone (e.g., 6 layers with segment length 128), yielding an effective receptive field of ~896 timesteps (around 18 seconds of interaction at 50 Hz). A stop-gradient between segments keeps memory tractable, and KV-caching guarantees linear runtime during real-time deployment.
- Multi-Trial In-Context RL ($RL^2$ formulation): Training spans across trial boundaries within an allocated adaptation budget $u \sim \text{Uniform}(0, U)$. If the robot falls in an early trial, the failure trajectory remains in the TXL cache. PPO rewards the cumulative return across the entire multi-trial episode, teaching the network to use earlier failures to inform subsequent control strategies.
[ Trial 1 (falls) ] ──(cached hidden states)──> [ Trial 2 (adapts & walks) ]
Datasets
The authors do not use static real-world offline datasets. Instead, they leverage:
- Training Distribution: Massive procedural simulation consisting of ~100k generated robot variants across 4 morphological families (legged bipeds, wheeled bipeds, legged quadrupeds, and wheeled quadrupeds) trained with aggressive domain randomization in simulation.
- Evaluation Benchmark: 10 simulated digital twins of real-world commercial and research robots: 5 bipeds (Unitree G1, H1, Fourier GR1, LimX TRON1, Berkeley Humanoid BK-H), 3 quadrupeds (Unitree A1, Boston Dynamics Spot, ETH AnyMal C), and 2 wheeled platforms (LimX TRON1-W, Unitree Go2-W).
- Physical Hardware Deployments: Unitree G1, H1, Go2, and Go2-W.
Key Insights and Ideas
- Emergence of Embodiment Representations: Tracking internal embeddings (the second TXL layer) reveals that tokens for distinct humanoid variants start identically at second 0, but cleanly diverge into embodiment-specific clusters within 5 seconds. LocoFormer infers its own morphology online purely through closed-loop interaction dynamics.
- Learning from Falls Across Episodes: For inherently unstable, out-of-distribution platforms (e.g., a biped lacking ankle actuation), the policy cannot adapt within a single 2-second rollout before falling. By allowing the context to persist into the next trial, the agent utilizes prior failure data to stabilize and walk by trial 3 or 4.
- Spontaneous Gait Transitions: When actuators are disabled or altered in real time, the policy rapidly renegotiates its gait:
- Locking a quadruped knee causes it to balance within a triangular support polygon (tripedal gait) within 2–3 seconds.
- Locking wheels on a hybrid robot causes it to switch seamlessly from rolling to stepping.
- Ziptying robot calves forces it to invent a wide-amplitude knee-walking gait after 7–8 seconds.
Key Results
- Simulation Benchmark (Table 1): Across 10 unseen robots in 1,000 randomized environments each, LocoFormer achieved a normalized displacement score of 0.96 (zero-shot) and 0.98 (with a 5-second adaptation window). It dramatically outperformed a recurrent GRU baseline (0.37) and an explicit kinematic-conditioning baseline (0.78), nearly matching per-robot specialist "Expert" models (0.99).
- Out-of-Distribution Stress Test: When domain randomization ranges were doubled beyond training bounds, LocoFormer improved survival significantly with longer context, enabling 15.4% more robots to reach high-reward regimes ($R > 6$).
- Real-World Zero-Shot Transfer: Deployed without any fine-tuning on Unitree G1, H1, Go2, and Go2-W (even executing bipedal locomotion on Go2 by disabling its front legs). It demonstrated active recovery under sudden knee motor freezes, software wheel locks, and physical constraints (ziptied limbs).
Limitations and Future Work
- Heavy Compute Burden: Training across 100k procedurally generated morphologies with a long-context transformer requires roughly 500× more compute than training a single specialist policy (though the amortized cost per robot family is much lower).
- Handcrafted Procedural Rules: The morphological generator relies on predefined structural assumptions (e.g., joint orderings and limits). Truly open-ended embodiment learning may require automated task/morphology generation guided by LLMs or evolutionary design.
Summary updated