Skip to main content

Robot Learning

Learning to act in the physical world: robots as embodied systems, the policy-learning formulation with observations, actions and discounted return, imitation learning by behavior cloning and its compounding errors, action chunking and diffusion policies, reinforcement learning and the policy gradient, data from teleoperation, human video and simulation, closing the sim-to-real gap, and vision-language-action models.

Everything so far has produced predictions: a label, an image, the next token. A robot must produce actions, and its actions change the world it will observe next. This chapter applies the tools of the previous chapters (supervised learning, generative models, sequence models) to that setting, and explains what makes it harder.

11.1 Robots as Embodied Learners

A robot is an embodied system: it senses the environment, decides, acts through a body, changes the physical world, and receives feedback from its own actions. In short, robot = embodiment + sensing + decision making + action. It is not only an intelligent model, but one connected to a physical body.

  • Body (morphology): arms, legs, wheels, joints, grippers. Different bodies give different action spaces, constraints, and learning problems: an arm learns manipulation, a mobile base learns navigation, a legged robot learns locomotion, a two-armed robot learns coordination.
  • Sensors: vision (RGB, depth, stereo), geometry (LiDAR, structured light), touch (tactile, force/torque), body state (joint encoders, IMUs, motor currents), audio.
  • Actuators turn commands into motion. A command may be a joint position, velocity, or torque, an end-effector pose, or a gripper open/close.
  • Computation and control answer two questions at every moment: what is happening now (state estimation from sensors), and what to do next (the policy).

Where deep learning enters.

  • End-to-end visuomotor policies (Levine et al., 2016): an RGB image and the robot’s joint configuration go into a CNN that outputs motor torques directly, with no hand-designed visual features, learning task-relevant representations from real manipulation.
  • Perception for action. Computer vision asks “what is in the image?”; robot vision asks “what can the robot do next?”. Networks predict affordances such as where to grasp or push, and fuse vision, touch, and proprioception to predict contact and object motion.
  • Prediction for planning. Visual foresight (Finn and Levine, 2017) predicts future camera frames for candidate action sequences and plans by choosing the actions whose predicted future reaches the goal. More recent work learns predictive video representations and decodes them into actions for generalist policies.
standard deep learning robot learning
output a prediction a physical action
data usually fixed changes after every action
an error affects one example affects all future observations
evaluation loss or accuracy task success in the real world

Prediction asks “what is the correct output?”; action asks “what should I do, and what will happen next?”

11.2 Problem Formulation

Definition 11.1 (Robot Policy Learning) At each time \(t\) the world is in a state \(s_t\) (object poses, robot configuration, contacts, task progress), of which the robot receives an observation \(o_t\) (images, joint readings, gripper state, forces). Given a task goal \(g\) (e.g. a language instruction), a policy chooses an action,

\[ a_t\sim\pi_\theta(a_t\mid o_t,g), \]

the environment moves to \(s_{t+1}\sim P(s_{t+1}\mid s_t,a_t)\), and the robot receives a reward \(r_t\). A rollout is a trajectory \(\tau=(o_0,a_0,r_0,o_1,a_1,r_1,\dots,o_T,a_T,r_T)\), and the objective is the expected discounted return:

\[ \theta^\star=\arg\max_\theta\;\mathbb E_{\tau\sim\pi_\theta}\Bigl[\sum_{t=0}^T\gamma^tr_t\Bigr],\qquad\gamma\in(0,1]. \]

  • The state is what is true; the observation is what is sensed. A camera does not see an occluded object or the friction of a surface, so the policy often needs the history \(o_{\le t}\), not just \(o_t\).
  • Manipulation (grasping, placing, opening drawers, pouring, tool use) needs perception and precise control together: small errors in contact position or force make the task fail. Navigation (reaching a location, finding an object, avoiding obstacles, following instructions) needs reasoning over space and long horizons.

Picking up a cup takes many steps (approach, align, close, lift, move, place), but suppose the only reward is \(+1\) when the cup is placed, at step \(T=100\). The return from the start is \(\gamma^{99}\):

  • \(\gamma=0.99\): \(0.99^{99}\approx0.37\), a clear signal;
  • \(\gamma=0.9\): \(0.9^{99}\approx3\times10^{-5}\), practically nothing.

A discount \(\gamma\) makes the agent care about roughly the next \(1/(1-\gamma)\) steps: \(100\) steps for \(0.99\), \(10\) for \(0.9\). Early actions that earn no immediate reward but enable later success are valued only if the horizon is long enough, which is why sparse, delayed rewards make long tasks hard.

A good policy can be learned from demonstrations (imitation learning), from rewards (reinforcement learning), or both. Separately from how the robot learns is where the data comes from: teleoperation, human videos, simulation, logged robot experience, and large multimodal datasets.

11.3 Imitation Learning

Learning from scratch is hard for a robot: real trial and error is slow and can be unsafe, and a good reward is often hard to write down. Many tasks are easier to show than to specify. Imitation learning asks not “what reward defines success?” but “can an expert show what success looks like?”. The pipeline: collect expert demonstrations, store the observation–action pairs, train a policy, deploy it.

Definition 11.2 (Behavior Cloning) Given demonstrations \(\mathcal D=\{(o_t,a_t^\star)\}\), behavior cloning trains the policy by supervised learning to predict the expert’s action:

\[ \min_\theta\;\mathbb E_{(o,a^\star)\sim\mathcal D}\,\ell\bigl(\pi_\theta(o),a^\star\bigr), \]

with, e.g., a squared error for continuous actions or \(-\log\pi_\theta(a^\star\mid o)\).

Behavior cloning is supervised learning, with observations as inputs and expert actions as labels. The difference appears at deployment: a wrong action changes the next state, and the robot continues from there.

Proposition 11.1 (Compounding Errors) Behavior cloning trains on states visited by the expert but is tested on states visited by the learned policy. Suppose the policy errs with probability at most \(\epsilon\) on expert-like states, and after an error it may drift to unfamiliar states where it keeps failing. Then over a horizon of \(T\) steps its expected number of failures can grow like \(\epsilon T^2\), not \(\epsilon T\).

The first mistake happens by step \(t\) with probability at most \(t\epsilon\) (a union bound over steps). In the worst case, every step after leaving the expert’s distribution is a failure, so step \(t\) fails with probability at most \(t\epsilon\). Summing,

\[ \sum_{t=1}^T\min(1,t\epsilon)\le\epsilon\frac{T(T+1)}2=O(\epsilon T^2). \]

If instead the policy is also trained on the states it visits itself, as in DAgger (Ross et al., 2011: run the learner, ask the expert to label the states it reaches, add them to the dataset, retrain), each step fails with probability about \(\epsilon\) and the total is \(O(\epsilon T)\).

This distribution shift is the central weakness of imitation learning: one small error leads to a slightly unfamiliar state, a worse action there, and growing errors.

Predicting action sequences. Many tasks (folding cloth, opening a drawer, cleaning a table) need coordinated sequences of actions. Instead of mapping an observation to one action, predict a chunk of future actions from the observation and task. RT-1 (2022) applies a transformer to images and instructions and outputs discretized actions; ACT (2023) predicts chunks of about \(100\) actions with a transformer-based conditional VAE (Ch. 6). Chunking plans several steps ahead and shortens the effective horizon over which errors compound.

Definition 11.3 (Diffusion Policy) A diffusion policy (Chi et al., 2023) models the conditional distribution of an action chunk \(A_t=(a_t,\dots,a_{t+H-1})\) given recent observations with a diffusion model (Ch. 7): a noise-prediction network \(\epsilon_\theta(A_t^{(k)},k,o_{\le t})\) is trained on demonstrations, and actions are generated by iterative denoising. The robot executes the first few actions of each chunk, then replans.

  • Why diffusion: demonstrations are often multimodal (several valid ways to do the task), motions must be smooth in time, and long-horizon tasks need coordinated sequences. A generative model represents all of this; a regression does not.

Half of the demonstrations steer around an obstacle to the left (\(a=-1\)), half to the right (\(a=+1\)). A policy trained with squared error predicts the conditional mean, \(a=0\): straight into the obstacle. Every individual prediction is “between” two correct answers, and the average is wrong. A generative policy (a diffusion policy, a mixture model, or discretized actions with a softmax) instead samples \(-1\) or \(+1\), and action chunking keeps it committed to one side for the whole maneuver instead of switching back and forth.

Strengths: a simple objective; it uses human knowledge; it is often far more data-efficient than trial and error; it works well given good demonstrations. Limits: demonstrations are expensive; it copies the demonstrator’s mistakes and biases; it struggles outside the demonstrated states; it cannot easily become better than the expert.

11.4 Reinforcement Learning

Imitation learning asks “what would the expert do?”; reinforcement learning asks “which actions lead to success?”. The robot observes, acts, receives a reward, updates its policy, and tries again.

  • The reward defines success: \(+1\) for a grasp or reaching a target, a positive reward for walking forward, penalties for falling, collisions, or excess energy. A poorly designed reward gets maximized in ways that miss the real goal (reward hacking).
  • The return (Definition 11.1) values long-term success, so actions without immediate reward still count if they enable it.
  • Exploration versus exploitation: try new actions to discover better strategies (a walking robot tries new gaits, some of which fail), or use what already works. Too little exploration never finds better behavior; too much is unsafe and inefficient.
  • Why it is harder than supervised learning: the data comes from interaction; actions change future data; rewards may be delayed; outcomes are random; and the environment is usually not differentiable, so there is no gradient through the dynamics.

Proposition 11.2 (Policy Gradient) Let \(J(\theta)=\mathbb E_{\tau\sim\pi_\theta}[R(\tau)]\) with \(R(\tau)=\sum_t\gamma^tr_t\). Then

\[ \nabla_\theta J(\theta)=\mathbb E_{\tau\sim\pi_\theta}\Bigl[\Bigl(\sum_{t=0}^T\nabla_\theta\log\pi_\theta(a_t\mid o_t)\Bigr)R(\tau)\Bigr]. \]

The dynamics \(P\) do not appear, so the gradient can be estimated from rollouts alone (REINFORCE).

For a fully observed system, \(p_\theta(\tau)=p(s_0)\prod_t\pi_\theta(a_t\mid s_t)P(s_{t+1}\mid s_t,a_t)\). By the log-derivative trick \(\nabla p=p\nabla\log p\),

\[ \nabla_\theta J=\int\nabla_\theta p_\theta(\tau)R(\tau)\,\mathrm d\tau=\mathbb E_{\tau\sim p_\theta}\bigl[\nabla_\theta\log p_\theta(\tau)\,R(\tau)\bigr], \]

and \(\log p_\theta(\tau)=\log p(s_0)+\sum_t\log\pi_\theta(a_t\mid s_t)+\sum_t\log P(s_{t+1}\mid s_t,a_t)\), where only the policy terms depend on \(\theta\).

  • The estimator raises the log-probability of actions in high-return trajectories and lowers it for low-return ones. It is unbiased but noisy; subtracting a baseline (such as a learned value estimate) from \(R\) reduces the variance without bias. PPO, used for RLHF in Ch. 10, is a stabilized version of this update.

Why RL is attractive for robots: no demonstrations needed; it optimizes task success directly; it can discover strategies that are hard to demonstrate and better than human-designed ones. It has succeeded in locomotion, dexterous manipulation, and drone racing, mostly trained in simulation.

Why RL is hard on real robots: data collection is slow and trials are expensive; exploration can be unsafe and break hardware; rewards are often sparse; resetting the scene is difficult; real environments are noisy; and a single grasping skill may need thousands of attempts.

imitation learning reinforcement learning
learns from expert demonstrations reward from interaction
objective match the expert’s actions maximize return
needs demonstrations many interactions, a reward
can exceed the expert rarely yes
main risk distribution shift unsafe exploration, reward hacking

11.5 Data for Robot Learning

Robot data is much harder to get than internet data: robots are expensive and break, collection is slow, scenes must be reset, actions must be recorded, failures are costly, and different robots have different bodies and action spaces. Three major sources:

Teleoperation. A human controls the robot (by joystick, VR controller, motion capture, wearable devices, or leader–follower arms that the operator moves by hand) while the system records observations, commands, motions, and success. The human provides the intelligence; the robot provides the body. The data is robot-compatible: observations come from the robot’s own sensors, and actions are directly executable. But it is expensive, needs skilled operators, is hard to scale across tasks, may be inconsistent, is tied to one robot body, and covers few states; a policy trained on it still suffers from distribution shift.

Human video. Videos of people cooking, cleaning, assembling, and using tools are abundant. They reveal task structure (which steps, in which order), object affordances (what can be grasped, opened, poured), goal states, and motion patterns. But there is a human-to-robot gap: different bodies (hands versus grippers), different action spaces, different viewpoints (third-person versus onboard cameras), no recorded actions, and invisible forces and contacts. Retargeting translates human motion into feasible robot motion that keeps the task’s meaning (“reach, grasp, lift the cup”) rather than copying joints.

teleoperation human video
scale small large
cost expensive cheap
robot-specific yes no
contains robot actions yes no
best for imitation learning task understanding, pretraining

Simulation. Simulators (MuJoCo, Isaac Lab, SAPIEN, Warp) model robot bodies, actuators, cameras and depth sensors, object shapes, contacts, gravity and friction, terrain, and rewards. Training there is faster, cheaper, safer, easy to reset, and massively parallel: a walking robot can fall millions of times without damage. Simulation is the main way to give RL the interactions it needs.

Definition 11.4 (Domain Randomization) Let \(\xi\) denote simulator parameters (textures, lighting, masses, friction, motor gains, sensor noise). Domain randomization trains the policy to do well across a distribution of simulators,

\[ \max_\theta\;\mathbb E_{\xi\sim p(\xi)}\bigl[J(\pi_\theta;\xi)\bigr], \]

so that the real world looks like just one more sample from \(p(\xi)\).

Other ways to close the sim-to-real gap:

  • system identification: measure the real robot and tune the simulator’s parameters to match it;
  • Real2Sim2Real: use real data to improve the simulator, then train in simulation again;
  • online adaptation: let the policy adjust its behavior during real deployment.

11.6 Robot Foundation Models

Following language and vision, robotics is moving to large pretrained models: large robot datasets plus vision–language models plus action learning, aiming at general robot behavior.

Definition 11.5 (Vision-Language-Action Model) A vision-language-action model (VLA) is a policy

\[ \pi_\theta\bigl(a_{t:t+H}\mid o_t,\ \ell,\ q_t\bigr) \]

that maps camera observations \(o_t\), a language instruction \(\ell\), and the robot’s state \(q_t\) to an action or action chunk. It is usually built on a pretrained vision–language model: vision grounds the scene, language makes the task flexible, and action data teaches the body how to move.

  • Actions are produced either as discrete tokens by the language model itself, or by a separate action expert; the \(\pi_0\) family (Physical Intelligence, 2024–2025) uses flow matching (Ch. 7) for smooth continuous action chunks.
  • VLAs are trained on mixtures of every data source above (teleoperated demonstrations across many robots, human video, web-scale image–text data, and simulation) to generalize to new scenes, objects, and instructions; newer versions also improve from their own deployment experience with RL.

11.7 Supplementary Notes

11.7.1 Key Results

  • Definition 11.1: \(a_t\sim\pi_\theta(a_t\mid o_t,g)\), maximize \(\mathbb E_{\tau}\sum_t\gamma^tr_t\); effective horizon \(\approx1/(1-\gamma)\).
  • Definition 11.2: behavior cloning is supervised learning on \((o,a^\star)\) pairs.
  • Proposition 11.1: compounding errors \(O(\epsilon T^2)\) under distribution shift; DAgger gives \(O(\epsilon T)\).
  • Definition 11.3: diffusion policy generates action chunks, handling multimodal demonstrations.
  • Proposition 11.2: \(\nabla J=\mathbb E[\sum_t\nabla\log\pi_\theta(a_t\mid o_t)R(\tau)]\), no dynamics gradient needed.
  • Definition 11.4: domain randomization maximizes \(\mathbb E_\xi J(\pi;\xi)\).
  • Definition 11.5: VLA \(\pi_\theta(a_{t:t+H}\mid o_t,\ell,q_t)\).