Open Source Robotics

A curated collection of high-quality open source robotics projects, tools, and software to propel the robotics community forward.

LocoFormer: Generalist Locomotion via Long-context Adaptation

Authors: Min Liu, Deepak Pathak, Ananye Agarwal · CoRL 2025

Licences

  • Open Access
  • Paper: CC BY 4.0

Everything below draws on the full paper under its CC BY 4.0 licence; its figure is credited to the authors.

TL;DR

LocoFormer trains one long-context Transformer-XL policy with RL on about 100k procedurally generated robots; it controls unseen robots zero-shot and improves across trials.

Why it matters

A single model that adapts in context could remove per-robot tuning and system identification, and keep a damaged robot moving. In real tests the same weights ran a Unitree G1, H1, Go2 and Go2-W, including the Go2 walking on its two rear legs, without retraining.

Problem

Locomotion controllers are usually trained for one robot with narrow domain randomization and only a few hundred milliseconds of history. Such policies do not transfer to new bodies, fail under large changes such as burnt-out motors or broken legs, and often need painstaking system identification for each robot.

Proposed solution

The authors procedurally generate bipeds and quadrupeds, with and without wheels, randomize their kinematics and dynamics aggressively, and train with PPO in simulation using a unified joint space for observations and actions. The policy is a Transformer-XL whose segment-level recurrence extends memory to as many as 896 steps (about 18 s at 50 Hz) across trial boundaries, and reward is maximized over several trials within one episode. A KV-cache keeps inference cost linear in time.

Key insights

  • A wide task distribution needs long context: short-history policies cannot identify the robot well enough to adapt.
  • Memory that spans episode boundaries lets the policy learn from earlier falls and do better on later trials.
  • Internal representations for different humanoid variants start similar and separate into distinct clusters within about 5 seconds, without any explicit morphology input.
  • Architecture matters: a GRU policy trained the same way averages 0.37, against 0.96 zero-shot for the Transformer-XL policy.
  • Training took 500 times the compute of one specialist policy but covered 100,000 robots, about 0.005 day per robot vs 1 day for a specialist.

Main results

  • Across 10 unseen robots in simulation (1,000 environments each), normalized displacement toward the goal averages 0.96 zero-shot and 0.98 after 5 s of adaptation, vs 0.99 for per-robot expert policies, 0.78 for a morphology-conditioned Transformer and 0.37 for a GRU.
  • On LimX Dynamics TRON1, a biped without ankle joints, 5 s of adaptation raises the score from 0.87 to 0.96.
  • Zero-shot real-robot deployment on Unitree G1, H1, Go2 and Go2-W, with the Go2 and Go2-W also run as bipeds on their rear legs.
  • With a knee locked on the Go2, the policy shifts weight onto three legs and walks after 2–3 s; with the lower legs cut off, it walks on its knees after 7–8 s. Neither case was in training.
  • On the Go2-W, when the wheels are locked in software the policy switches to a walking gait, and returns to rolling when they are unlocked.
  • With domain randomization doubled beyond the training ranges, survival over 6-second rollouts improves with longer adaptation time for all four morphology types.

Limitations

  • Training is highly resource-intensive compared with a specialist policy; the authors note that algorithmic improvements in massively parallel RL may be possible.
  • The procedurally generated task space is hand-crafted and may be hard to design in general; the authors suggest automated task generation from LLMs or other web-scale sources.
  • The procedural generation does not cover all real designs, e.g. Berkeley Humanoid's anhedral angles in both hip roll and yaw joints, or the G1's joint axes offset along the x-axis.
  • In very unstable set-ups the first trials can fail: run as a biped with no ankle motor, the robot fell in the first trial and walked stably only by the third.
  • Only locomotion is demonstrated; extending the recipe to other skills is proposed but not tested.

Field impact

Finalist for the CoRL 2025 Best Paper and Best Student Paper awards, with 39 citations. The paper links videos at generalist-locomotion.github.io; it does not state a code or model release.

Abstract

Modern locomotion controllers are manually tuned for specific embodiments. We present LocoFormer, a generalist omni-bodied locomotion model that can control previously unseen legged and wheeled robots, even without precise knowledge of their kinematics. LocoFormer is able to adapt to changes in morphology and dynamics at test time. We find that two key choices enable adaptation. First, we train massive scale RL on procedurally generated robots with aggressive domain randomization. Second, in contrast to previous policies that are myopic with short context lengths, we extend context by orders of magnitude to span episode boundaries. We deploy the same LocoFormer to varied robots and show robust control even with large disturbances such as weight change and motor failures. In extreme scenarios, we see emergent adaptation across episodes, LocoFormer learns from falls in early episodes to improve control strategies in later ones. We believe that this simple, yet general recipe can be used to train foundation models for other robotic skills in the future. Videos at http://generalist-locomotion.github.io.

Links

  • arXiv 2509.23745: https://arxiv.org/abs/2509.23745
  • DOI 10.48550/arXiv.2509.23745: https://doi.org/10.48550/arXiv.2509.23745
  • PDF: https://arxiv.org/pdf/2509.23745v1
  • Project page: https://generalist-locomotion.github.io/

This website requires JavaScript to function properly. Please enable JavaScript to explore our collection of open source robotics projects.