Paper commentary
Real-World Humanoid Locomotion with Reinforcement Learning
- Problem Controlling a full-sized humanoid without cameras is hard, and earlier learned legged controllers relied on LSTM or TCN-based estimators rather than a transformer over the observation-action history.
- Method A causal transformer over observation-action tokens is trained in simulation with RL plus KL distillation from a teacher state policy, then deployed zero-shot on the Digit robot.
- Results Higher success rate than the company controller on steps across 10 runs per terrain in the high-fidelity simulator, and no falls over one week of full-day outdoor testing.

Figure 7 : Overview of the method. (A) Our training consists of two steps. First, we assume that the environment is fully observable and train a teacher state policy πs(at|st). Second, we train a student observation policy using a combination of teacher imitation and reinforcement learning. ( B) We leverage fast GPU simulation powered by Isaac Gym and parallelize training across four A100 GPUs and thousands of randomized environments. Once a policy is trained in Isaac Gym, we validate it in the high-fidelity simulator provided by the robot manufacturer. Finally, we transfer it to the real robot. (C) Our neural network controller is a causal transformer model trained by autoregressive prediction of the next action from the history of observations and actions. We hypothesize that the observation-action history contains useful information about the world that a powerful transformer model can leverage to adjust its actions in-context.
Original paper · CC BY 4.0 · Ilija Radosavovic, Tete Xiao, Bike Zhang, Trevor Darrell, Jitendra Malik, Koushil Sreenath · Real-World Humanoid Locomotion with Reinforcement Learning · Original paper figure · Extracted the figure area from page 17 of the original PDF.Why a learned, history-based controller for a humanoid
The robot studied here is Digit, a full-sized humanoid about 1.6 meters tall weighing 45 kilograms, with 30 degrees of freedom. Classical controllers and optimization-based methods both achieve stable or constrained walking, but the control problem remains a considerable challenge. Learned controllers for legged robots have typically used memory networks such as LSTM, or explicit estimators fed with TCN features.
The robot carries no cameras or other extra sensing, so the controller sees only the history of its own observations and actions. The authors hypothesize that this history encodes enough information about the world for a powerful transformer to adapt its behaviour at test time, which they frame as a form of in-context learning. Adaptation is therefore expected to come from the context the policy receives, not from fine-tuning on task-specific samples.
Teacher-to-student training with a joint objective
The control problem is cast as a partially observable Markov decision process, because the agent receives an observation generated from the true state through an observation function. Training has two steps: a teacher state policy is first trained in simulation under the assumption that the environment is fully observable, and then a student observation policy is trained from it.
Optimizing the policy directly with RL in observation space was found to be slow and resource-intensive, mainly because of limited sample efficiency, so the teacher is used to speed up iteration.
The student is trained on a combined objective, where the RL loss is paired with a KL divergence term that pulls the observation policy toward the state policy. The objective is written as follows, with the weighting factor λ controlling the state-policy supervision. \[ L(\pi_o) = L_{RL}(\pi_o) + \lambda D_{KL}(\pi_o \,\|\, \pi_s) \] Here L_RL is the RL loss and D_KL is the KL divergence between the observation policy and the state policy.
The weighting factor is annealed to zero, typically reaching zero at the midpoint of training, so the student learns from the teacher early and can later surpass it. Both supervision signals are computed on-policy, so no pre-computed trajectories or offline datasets are needed. The RL policies are trained with proximal policy optimization (PPO).
The action is the PD setpoints for 16 actuated joints plus predicted PD gains for the 8 actuated leg joints. The four toe motors are not controlled by the policy and keep default positions with fixed PD gains. The reward draws on biomechanics studies of human walking and was tuned by trial and error, without a pre-computed gait library.
How the causal transformer turns history into an action
The policy takes a history of observation-action pairs over a context window of length l and outputs the next action. Each observation-action pair is one token, and an MLP embeds each pair into a feature space before attention is applied. Sinusoidal positional encodings are added to the features so the model knows where each token sits in the sequence.
Self-attention weighs each input element by comparing queries and keys, and returns a weighted sum of values. \[ \mathrm{Attention}(Q,K,V)=\mathrm{softmax}\left(\frac{QK^{T}}{\sqrt{d_k}}\right)V \] Attention is restricted to tokens that come before the current one, which makes the model causal.
The model has four transformer blocks with an embedding dimension of 192 and 4 attention heads, and its MLP ratio is 2.0. The MLP that projects input observations has hidden sizes [512, 512], and the action head uses hidden sizes [256, 128]. The full model has 1.4M parameters and uses a context window of 16. The teacher state model is a separate MLP with hidden sizes [512, 512, 256, 128].
Simulating the closed chains and randomizing the world
Isaac Gym models rigid-body and contact dynamics, but it cannot model the closed kinematic chains and underactuated joints of Digit accurately. The workaround is a virtual spring with high stiffness standing in for the rods, driven by forces from its deviation from nominal length, with an alternating sub-step method that corrects the spring length.
The authors note that approximations of this kind remain a source of difficulty for sim-to-real transfer.
Commands for forward, sideward and turning motion are resampled at a fixed interval, and commands below a small cut-off are set to zero. Training runs on four A100 GPUs across thousands of randomized environments.
Before hardware, a policy is evaluated in the Agility simulator, which models the closed chains and the sensor noise of the real robot. This evaluation does not change the network parameters and only filters out unsafe policies. On hardware the policy runs at 50 Hz while the joint PD controller runs at 1 kHz, with joint encoder and IMU data obtained through the manufacturer API.
Outdoor walking and robustness to disturbances and terrain
The terrain properties were not encountered during training, and the controller walked all tested terrains without a safety gantry. Over one week of full-day outdoor testing, no falls were observed.
Sudden external forces were applied by throwing a large yoga ball, pushing with a wooden stick, and pulling from behind while the robot walked forward. The controller stabilized the robot in each of these scenarios, where the robot has only fractions of a second to correct its stance.
In the laboratory, the robot walked forward at 0.15 m/s over rubbers, cloths, cables and bubble wraps, which altered the roughness and could cause entanglement or slipping. Two slopes were tested, with training slopes up to 10% grade and testing slopes up to 8.7% grade. The robot traversed both slopes, with more robustness at 0.2 m/s on the steeper slope.
The robot completed its walking route with each load, including a loaded trash bag attached to an arm, even though the policy relies on arm swing for balance.
Comparison with the company controller on three terrains
The company controller from Agility Robotics is the reference for Digit, and it was compared in the high-fidelity Agility simulator. Three terrains were used, slopes, steps and unstable ground, and a trial counted as a success only if the robot crossed the terrain without falling, with partial credit for partial crossings. The mean success rate with 95% CI was reported per terrain over 10 runs.
Both controllers work well on slopes. On steps the company controller struggles to correct foot trapping and shuts off, while the controller recovers, and the authors replicated this scenario on hardware with consistent behaviour. The controller was not trained on steps in simulation, so the recovery behaviour is emergent.
On unstable planks, where the terrain can dislodge under the feet, the controller considerably outperforms the company controller. This terrain was not tested on hardware because of concerns about hardware damage.
Architecture, context length and training objective
Figure 8 panels cover the architecture comparison, the context length study and the training objective ablation. Four architectures were compared: an MLP, a TCN, an LSTM and the transformer, all trained in the same framework with only the student architecture varied and hyperparameters tuned for each. Across 30 trials from three scenarios of Figure 2D, the transformer outperformed the other architectures by a considerable margin in mean success rate with 95% CI.
Context length was varied for a commanded 1 m/s over two slopes, with randomized initial positions and heading and 20 trials per setting.
The training objective was compared as imitation alone, RL alone and the joint objective, with everything else held fixed. The joint imitation and reinforcement learning objective outperforms training with either term alone.
Terrain-dependent gait and foot-trapping recovery
The robot walked over flat ground, a downward slope and flat ground again, and its gait changed from normal walking to small steps without much leg lifting on the slope, then back. The authors describe this change as emergent and not pre-specified during training.
Some neurons in the last layer have high amplitude during flat walking and low amplitude on the slope, which tracks gait, and other neurons respond high on flat terrain and low on the slope, which tracks terrain. The 192-dimensional hidden state at each timestep, projected to two dimensions with PCA and t-SNE, forms clusters by terrain type, with terrain labels used only for visualization.
The authors describe this recovery as emergent and not pre-programmed or encouraged during training.
In one analysed episode, the last-layer activity shows a visible change in pattern during the foot-trapping event. The mean neuron response deviates from normal activity during the same event, and the authors read this as the transformer implicitly detecting such events.
Command following, fast walking and arm swing
The policy follows linear velocity commands along x and y and angular velocity around z, with commands sampled randomly every 10 seconds in training. Joystick commands changing in real time were followed even though they differ from the training commands.
At a commanded step velocity of 1 m/s on hardware, the robot reaches the velocity from rest within 1 s and tracks it for the course.
No explicit arm constraint or reference trajectory is used in the reward, yet an arm swing emerges that is coordinated with the legs. When the left leg lifts, the right arm swings forward, which the authors describe as a contralateral relationship. The reward contains energy minimization terms, which the authors note might relate to the swing, but no energy measurement is reported for this behaviour.
Limitations
The policy is not perfectly symmetric, because the motors on the two sides do not produce identical trajectories, and it is better at lateral movement to the left than to the right. Velocity tracking is imperfect, and very strong pulls on a cable attached to the robot can cause a fall.
Without cameras the controller can bump into obstacles such as steps and become trapped, though it adapts to avoid falling. Steps and other discrete obstacles were not seen during training.
The outdoor evidence is a qualitative report of no falls over one week, with no success metric reported for the outdoor terrains. The planks terrain was not tested on hardware, and the slope tests on hardware go up to 8.7% grade. The authors also state that Isaac Gym approximations of the closed chains remain in use.
Paper info
- Authors
- Ilija Radosavovic, Tete Xiao, Bike Zhang, Trevor Darrell, Jitendra Malik, Koushil Sreenath
- Venue
- arXiv · Preprint
- First published
- 2023-3-6
- Added
- 2026-11-6
- Updated
- 2023-12-14
- Version
- v2
- arXiv
- 2303.03381
- Category
- cs.RO · cs.LG
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Humanoid robots that can autonomously operate in diverse environments have the potential to help address labour shortages in factories, assist elderly at homes, and colonize new planets. While classical controllers for humanoid robots have shown impressive results in a number of settings, they are challenging to generalize and adapt to new environments. Here, we present a fully learning-based approach for real-world humanoid locomotion. Our controller is a causal transformer that takes the history of proprioceptive observations and actions as input and predicts the next action. We hypothesize that the observation-action history contains useful information about the world that a powerful transformer model can use to adapt its behavior in-context, without updating its weights. We train our model with large-scale model-free reinforcement learning on an ensemble of randomized environments in simulation and deploy it to the real world zero-shot. Our controller can walk over various outdoor terrains, is robust to external disturbances, and can adapt in context.
Quote from the paper
Ilija Radosavovic, Tete Xiao, Bike Zhang, Trevor Darrell, Jitendra Malik, Koushil Sreenath (2023). Real-World Humanoid Locomotion with Reinforcement Learning. arXiv:2303.03381v2. https://arxiv.org/abs/2303.03381v2
BibTeX
@misc{radosavovic2023real,
title = {{Real-World Humanoid Locomotion with Reinforcement Learning}},
author = {Ilija Radosavovic and Tete Xiao and Bike Zhang and Trevor Darrell and Jitendra Malik and Koushil Sreenath},
year = {2023},
eprint = {2303.03381},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2303.03381v2}
}