Skip to main content

Overview

Policies in LeRobot are neural network models that map observations to actions. They are the core component that enables robots to learn from demonstrations and make decisions. LeRobot provides several state-of-the-art policy architectures:
  • Diffusion Policy: Denoising diffusion for smooth action sequences
  • ACT (Action Chunking Transformer): Transformer-based imitation learning
  • VQ-BeT: Vector-quantized behavior transformer
  • TDMPC: Temporal difference model predictive control
  • VLA Policies: Vision-language-action models (PI0, SmolVLA, XVLA)

Policy Interface

All policies inherit from PreTrainedPolicy and share a common interface:

Key Methods

forward()

Training method that computes the loss:
Source: src/lerobot/policies/diffusion/modeling_diffusion.py:141

select_action()

Inference method that generates a single action:
Source: src/lerobot/policies/diffusion/modeling_diffusion.py:103

reset()

Clears internal state between episodes:
Must be called when starting a new episode to clear observation and action queues. Source: src/lerobot/policies/diffusion/modeling_diffusion.py:82

Configuration

Each policy has a configuration class that defines its hyperparameters:
Source: src/lerobot/policies/diffusion/configuration_diffusion.py

Example: Diffusion Policy

Diffusion Policy uses denoising diffusion to generate smooth action sequences.

Architecture

The Diffusion Policy consists of:
  1. Observation encoder: Processes images and state
  2. Noise prediction network: U-Net that predicts noise to remove
  3. Diffusion scheduler: DDPM/DDIM scheduler for sampling

Temporal Structure

Only n_action_steps actions are executed before predicting again. Source: src/lerobot/policies/diffusion/modeling_diffusion.py:112

Training

Inference

Policy-Specific Features

ACT (Action Chunking Transformer)

VQ-BeT (Vector Quantized Behavior Transformer)

Vision-Language-Action (VLA) Models

Saving and Loading

Save to Disk

Load from Disk

Push to Hub

Load from Hub

Feature Configuration

Policies need to know which features to use from the dataset:
The policy will automatically extract these features from batches during training.

Device and Dtype

Policies automatically detect device and dtype:

Processing Pipelines

Policies can integrate with processing pipelines for normalization and data transformation. See Processors for details.

Best Practices

Match training and inference: Ensure delta_timestamps in your dataset match the policy’s n_obs_steps and horizon configuration.
Reset between episodes: Always call policy.reset() when starting a new episode to clear observation and action queues.
Temporal consistency: The relationship n_action_steps <= horizon - n_obs_steps + 1 must hold for proper action execution.

Available Policies

Next Steps