TECHNIAHQROBOT / INDEPENDENT ROBOTICS REPORTINGENGLISH EDITION / 20 November 2026
Guides

How robots learn from actions and rewards

Learn how robots acquire skills from demonstrations and rewards, train policies in simulation, follow instructions and test two working Python examples.

What the robot learns

In robot learning, a policy is the rule used to choose an action from available observations. The observation might contain camera pixels, joint angles or a history of sensor readings. An action might request a joint position or a change in gripper pose. The training method determines how that rule is fitted. [1]

Two common routes are imitation learning from recorded behavior and reinforcement learning from reward. Simulation is a place to collect experience and test policies. It can support either route; it is not a third competing learning algorithm.

A concrete example: picking up a cube

Imagine a tabletop arm with a camera above the work area, joint encoders and a two-finger gripper. A cube starts at an unfamiliar position. The robot must identify its location, approach it, close its fingers, lift it and place it in a tray. The task is complete only when the cube rests inside the tray after the fingers open.

Schematic arm, cube and tray with camera and encoder observations entering a policy, action commands passing through a controller and new measurements feeding back.
Illustrative closed-loop control. The model proposes an action; the controller and sensors continue to update it as the object moves. Open the diagram for a larger view.
The learned policy is one component of a robot system.
LayerExample in a cube taskWhat can go wrong
ObservationCamera frame, joint angles, gripper openingThe cube is partly hidden or the camera calibration changes.
PolicyPredict a small gripper movement and closing commandThe model chose an approach that misses the cube.
ControllerConvert the desired pose or joint target into bounded motor commandsThe target is unreachable or the commanded joint exceeds its limit.
Physical resultThe fingers contact the cube; the camera receives a new imageThe cube slips, rolls or lands outside the tray.

A policy has parameters, often the weights of a neural network. During training the software changes the parameters so that its proposed actions better match demonstrations or produce higher expected rewards. During ordinary inference the weights can stay fixed while the policy receives a new observation each control cycle. Continuous feedback does not necessarily mean the model is being retrained.

For example, if the cube is 20 mm to the right of the gripper, a learned policy may request a rightward displacement. After the arm moves, the next image and joint measurements show whether that movement reduced the error. The numbers here describe an illustrative task rather than a measured robot result.

Learning from recorded behavior

ALOHA records camera images, joint positions and commands during human teleoperation. ACT learns to predict several future joint targets from these observations. Training compares predictions with the recorded commands and adjusts the model to reduce error. The trained model then predicts commands from new observations. [2] [3]

The project includes precise physical tasks such as inserting a battery and opening a small condiment container. These make the learning problem tangible. A slight alignment error can affect the next contact, and an error can accumulate over a sequence. The authors identify this drift as a difficulty for imitation learning. Their reported results concern the tasks and setup in the paper; they are not a universal success rate for household work. [2]

The ACT researchers reported 96% final success on inserting a battery and 20% on threading a Velcro cable tie, with 25 physical evaluations per task. In the harder task, the right gripper sometimes closed before it held the narrow tie or missed the insertion loop. That gap is evidence that one learned manipulation skill does not establish success on a different contact task. [3] [2]

How a demonstration becomes training data

A person moves the robot with a leader arm, joystick or another supported interface. For every control step the recorder stores a synchronized observation and the command issued at that time. A single demonstration is an episode, from the initial scene to the object placement or a documented failure. Recording the video alone usually omits the action labels needed for ordinary behavioral cloning.

A four-frame sequence of a gripper approaching a cube, closing, lifting and placing it in a tray; synchronized camera frames and commands are stored and used to train the policy.
Editorial schematic of an imitation-learning episode. Each observation is matched to the action demonstrated at that step. Open the diagram for a larger view.
Example labels expressed in words for readability. Real datasets use numeric actions and timestamps.
StepObserved stateDemonstrated action
1Cube left of gripperMove left and lower the wrist
2Fingers aligned around cubeClose the gripper
3Cube held between fingersRaise the wrist
4Cube above the trayLower and open the gripper

For training, the dataset is divided by complete episodes so almost identical neighboring frames do not appear in both training and evaluation. A forward pass predicts the recorded action or action sequence. The loss measures the difference; backpropagation computes gradients and an optimizer adjusts the weights. Repeating this across batches reduces the training loss. A low loss alone is insufficient because the robot must choose its own future actions during deployment.

Why ACT predicts a sequence rather than one motor command

Action Chunking with Transformers predicts a short sequence of future actions. Several overlapping predictions can be combined over time. A sequence helps preserve the coordination of the two arms when one holds a part and the other inserts it. New observations are still important because an unexpected contact can put the robot into a state absent from its recordings. [3]

If the new cube starts behind the usual training position, a model trained only on centered cubes may repeatedly reach the center. Add demonstrations with varied starting poses and recovery behavior, then reserve independent episodes for testing. Do not judge generalization by replaying the same recorded trajectory.

Learning from reward

Reinforcement learning uses interaction and a numerical reward. The objective concerns accumulated reward over time. The reward is part of the task design, and the agent's observations may reveal only part of the underlying state. Training therefore depends on what can be measured, what actions are available and how outcomes are scored. [1]

In an illustrative reaching task, the reward can increase as the gripper gets closer to the target. Training uses the rewards from action sequences to improve the policy. It is not given a demonstrated correct command for every observation. A reward for reaching near an object also leaves grasping and carrying it outside the task unless those outcomes are included. [1]

What the training loop actually does

Five simulated positions with start at zero and goal at four; action changes position and produces a reward returned to a learning algorithm.
Toy reinforcement-learning world used in the Python exercise below. The goal is an absorbing terminal state; rewards are illustrative. Open the diagram for a larger view.

The learning agent observes the current state, chooses an action and receives the new observation and a reward. It uses many such transitions to improve its policy. A reaching environment might give a reward for reducing distance, a larger bonus for reaching a target and a penalty for collisions. A discount factor gives future rewards less weight than immediate ones. The reward does not need to label the correct motor command. [1]

Consider an illustrative grid with positions 0 to 4. A move costs one point unless it reaches position 4, which gives ten points and ends the episode. Repeated rightward moves earn the goal reward with fewer penalties. If a reward instead paid only for moving quickly, the robot could prefer an unsafe movement or overshoot the target. That is why a reward and its success test must be designed together.

How humanoid walking can be learned

A locomotion policy can take desired travel velocity, joint positions and velocities, body orientation and motion estimates as observations. It can output desired joint positions that a lower-level motor controller tracks. Example reward terms include velocity tracking, balance, energy-related costs and penalties for falling. In simulation, episodes may begin from varied poses and reset after a fall; on real hardware those falls can damage the machine.

The ANYmal study by Rudin and colleagues uses many simulated quadrupeds in parallel and validates learned locomotion policies on a physical robot. It illustrates a practical training workflow for legged robots; it does not establish the same training time or controller settings for a humanoid. [Source ↗]

Why trial and error on a real robot needs limits

Training exploration can produce unexpected movements. Start with a simulator. For physical deployment, use the robot-specific supported controller, verified joint and speed limits, a protected workspace, the prescribed emergency stop and trained supervision. A reward penalty is not a hardware safety mechanism.

Moving from simulation to hardware

OpenAI's 2018 in-hand manipulation research trained policies in simulation and tested object reorientation on a physical Shadow Dexterous Hand. During training, the researchers varied physical properties such as friction and varied the object's appearance. That process is commonly called domain randomization. [Source ↗]

The purpose was to keep the policy from depending on one exact simulated setup. The reported transfer is evidence for that hand, task and training procedure. It does not establish that every contact interaction can be simulated accurately, or that the same policy will operate an unrelated hand. Hardware validation remains a separate step from a successful simulated episode. [Source ↗]

Build a simulation that represents the task

A useful digital environment contains a robot model with link geometry, joint types, masses, inertias and limits. It also contains collision shapes, the cube and tray, camera viewpoints and a model of actuator behavior. The physics engine advances the scene as the controller issues actions. A simulation may train imitation learning, reinforcement learning or a combination of both.

Parallel simulation environments with different friction and mass values produce a trained policy; an interface check and supervised validation gate precede a real robot.
Conceptual sim-to-real workflow. Passing simulation is a prerequisite, not a physical safety certification. Open the diagram for a larger view.
Examples of differences between a digital environment and the physical setup.
MismatchExampleTest or mitigation
Contact frictionFingers grip too well in simulationVary friction and verify with representative objects.
Actuator dynamicsSimulated joints reach targets instantlyRepresent motor response, saturation and delays.
PerceptionPerfect simulator images lack real glareVary lighting and noise; calibrate the actual camera.
TimingA slow computer misses a control deadlineMeasure latency and set a supported update rate.

Randomization exposes the policy to variations rather than one exact simulated configuration. It cannot guarantee transfer to all possible situations. First collect a simulation baseline, then change one condition at a time and log failures. Compare physical behavior at the intended operating limits only after reviewing the supported controller and completing controlled commissioning.

For model assumptions in a walking experiment, distinguish observations available during training from observations available on the real robot. A simulator may expose exact foot contact and ground geometry while a deployed policy has only estimates. If the trained policy depends on information the hardware cannot observe, its inputs must be redesigned or estimated before transfer.

How robots learn to follow language instructions

A vision-language-action model (VLA) combines an image with a human instruction and generates robot actions. In the same scene, an instruction to place the red cube in the tray should produce a different movement from an instruction to place the blue cube there. The model must connect the words to the correct visual object and produce a motion its robot can execute.

Camera image contains a red and blue cube; an instruction to place the red cube enters a multimodal policy which outputs a movement toward the red object and a gripper command.
Illustrative VLA pipeline. The instruction changes the action selected for the same scene. Open the diagram for a larger view.

OpenVLA is a research example trained on robot trajectories from the Open X-Embodiment dataset. Its visual and language representations are used to predict encoded robot actions. A platform still needs the correct action representation, normalization and supported control interface. A language model output alone cannot set valid joint torques. [Source ↗]

Diffusion Policy is another approach to imitation learning: it learns to generate plausible sequences of robot actions conditioned on observations. This is useful when several different approach paths could succeed. It still depends on data quality, observation coverage and the controller used to execute the generated actions. [Source ↗]

Software and equipment for a first robot-learning project

You can learn the basic workflow without buying a humanoid. Use a simulated reaching or pick-and-place task first. A physical tabletop arm is a later option if its software interface is documented and it can be operated in a protected setup.

Software roles rather than a mandatory installation list.
ToolPurposeWhat you actually use it for
PythonExperiment and data scriptsLoad actions, train a toy model and evaluate episodes.
MuJoCoPhysics simulationRun a modeled arm, gripper, object and contact dynamics.
PyTorchNeural network trainingDefine a policy, calculate loss and update weights.
LeRobotRecording, datasets and policiesRecord synchronized episodes, train ACT and evaluate supported robots or simulations.
Robot SDK or ROS 2 interfaceHardware integration where supportedRead sensors and send permitted commands through the correct drivers.

LeRobot documents a workflow for recording demonstrations, visualizing datasets, training an ACT policy and evaluating it in simulation or on supported hardware. Before using a command, install a compatible version in an isolated Python environment and check the robot-specific configuration. A CUDA-capable GPU can help with larger policies, but the following exercises use only standard Python. [Source ↗]

  • Choose one task and define success and failure before collection.
  • Prepare a simulated environment and confirm basic manual control.
  • Record complete demonstrations with synchronized observations and actions, or define a reward and reset conditions.
  • Train a policy, retain its configuration and save model checkpoints.
  • Evaluate held-out trials while recording failures, intervention and timing.
  • If physical deployment is required, repeat commissioning with manufacturer-approved procedures and supervision.

Try robot learning yourself with Python

Both exercises run offline on a computer using Python 3. They are deliberately small mathematical models, with no motors, GPU, camera or external package. Save each example as its own .py file and run it from a terminal. They teach how a policy is fitted and evaluated, rather than providing a full robot driver.

Exercise 1: learn from six recorded reaching actions

Open a text editor and save the following code as imitation_reach.py. The training pairs contain signed distance to the target and the corresponding demonstrated displacement in metres. The model is a single learned coefficient. Gradient descent adjusts it to reduce mean squared error.

imitation_reach.py
# Learn a one-dimensional reaching policy from demonstrations.
# No packages or physical robot are required.
examples = [(-0.30, -0.15), (-0.20, -0.10),
            (-0.10, -0.05), (0.10, 0.05),
            (0.20, 0.10), (0.30, 0.15)]
w = 0.0
for epoch in range(500):
    grad = sum(2 * (w * x - a) * x for x, a in examples)
    w -= 0.5 * grad / len(examples)

position, target = 0.0, 0.25
print(f"Learned gain: {w:.3f}")
for step in range(12):
    error = target - position
    action = max(-0.15, min(0.15, w * error))
    position += action
    print(step + 1, round(position, 4))
    if abs(target - position) < 0.002:
        break
print("Reached:", abs(target - position) < 0.002)

Run python imitation_reach.py (or python3 imitation_reach.py). The learned gain should be close to 0.5, and the position should approach 0.25 m. Reaching is defined as less than 2 mm of remaining error. Change the target to a different in-range value to see how the same coefficient predicts a new action. The program models direct displacement and does not include physical joint dynamics.

Exercise 2: learn a route using rewards

Save this code as reward_reach.py. The five positions represent a simplified robot environment. Q-learning stores the expected return for each state-action pair. The agent sometimes explores a different action, and updates the stored value from each transition.

reward_reach.py
# Tabular Q-learning in a five-position simulated world.
# State 4 is the goal. Actions are left (-1) and right (+1).
import random
random.seed(7)
Q = [[0.0, 0.0] for _ in range(5)]
for episode in range(400):
    s = 0
    for step in range(30):
        a = random.randrange(2) if random.random() < 0.2 else max(
            range(2), key=lambda i: Q[s][i])
        nxt = min(4, max(0, s + (-1, 1)[a]))
        reward = 10 if nxt == 4 else -1
        future = 0 if nxt == 4 else 0.9 * max(Q[nxt])
        Q[s][a] += 0.2 * (reward + future - Q[s][a])
        s = nxt
        if s == 4:
            break

s = 0
path = [s]
for _ in range(12):
    a = max(range(2), key=lambda i: Q[s][i])
    s = min(4, max(0, s + (-1, 1)[a]))
    path.append(s)
    if s == 4:
        break
print("Learned route:", path)

Run python reward_reach.py. With the fixed random seed and rewards, the expected route is [0, 1, 2, 3, 4]. Change the step penalty or the starting position and look at the learned values. This exercise shows reward-based learning without requiring demonstration commands. Unlike a real robot, the toy environment has no dynamics, continuous joints or damaged parts.

The next practical step is to repeat a small reaching task in a physics simulator, replace the scalar policy with multiple observations and actions, and log the difference between requested and measured motion. A physical robot requires validated safety controls and a supported interface.

Read the evaluation before the headline

For an article or technical report, record what data trained the policy, what was held back for testing and which conditions changed. Then examine the success definition. Inserting a part within a time limit, touching the target and completing a whole assembly are different outcomes.

EvidenceQuestion for the reader
Training dataWhich objects and actions were recorded?
Test setWere objects or positions held out?
InterventionsDid a person reset or rescue the attempt?
FailuresWere drops, collisions and incomplete runs counted?

A repeatable evaluation protocol

Before testing, define a completed trial: for example, the cube must rest in the tray after release before a fixed timeout, with no collision or operator intervention. Hold out object positions, backgrounds or object shapes that were not used for learning. Reset the scene after each attempt and retain all trial records, including failures.

Twenty illustrative trials shown as 16 green successes and four failed trials, with distinct failure causes recorded; 16 divided by 20 gives 80 percent.
Illustrative evaluation results, not a measured experiment. A percentage should always be accompanied by its denominator and test conditions. Open the diagram for a larger view.

Suppose a toy evaluation produces 16 successful placements out of 20 attempts. The measured result for that hypothetical test is 80%. If one gripper slips twice, one attempt times out and one is rescued by an operator, record all four as failures under the original definition. Do not delete failed trials or count a rescued attempt as autonomous.

Use logged failures to select the next test.
Failure symptomWhat to inspectNext experiment
Misses objectCamera viewpoint, calibration, dataset coverageVary starting position and compare prediction errors.
Grips then dropsFinger contact, force limits, action sequenceTest representative object surfaces with supervision.
Works in training but not testData leakage and visual overfittingSplit by complete episodes and test new scenes.
Repeated oscillationCoordinate conversion, latency and controller trackingCheck units and commanded versus measured movement in simulation.

How to install the software mentioned on this page

Choose only the tools required for your project. The commands below describe development and simulation setup, not proof of compatibility with a specific physical robot. Match the versions in the original project and test offline before connecting hardware.

Python Windows, macOS, Linux

Install the Python release required by your robot or library. On Windows use the official installer; on Ubuntu use the distribution package. Create a separate virtual environment for each project.

Installation / setup commands

python -m venv .venv
# Windows PowerShell:
.\.venv\Scripts\Activate.ps1
# Linux or macOS:
source .venv/bin/activate

Verify the installation

python --version python -m pip --version

Official instructions: https://www.python.org/downloads/

MuJoCo Windows, macOS, Linux

Create a Python virtual environment and install the official Python package. On macOS use mjpython for the interactive viewer when required.

Installation / setup commands

python -m pip install mujoco

Verify the installation

python -c "import mujoco; print(mujoco.__version__)"

Official instructions: https://mujoco.readthedocs.io/en/stable/python.html

ROS 2 (Jazzy example) Ubuntu 24.04 for Jazzy; other distributions have different instructions

On Ubuntu 24.04 first configure the official ROS apt repository using the documented ros2-apt-source procedure. Then install Jazzy desktop. Use the distribution required by your robot; for example Humble normally uses Ubuntu 22.04.

Installation / setup commands

sudo apt update
sudo apt install ros-jazzy-desktop
source /opt/ros/jazzy/setup.bash

Verify the installation

ros2 --help

Official instructions: https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html

LeRobot Supported Python environment

Check the official installation guide for the current Python version, FFmpeg and hardware extras. Create an isolated environment; install the package, then select the extra required for your particular robot or simulation.

Installation / setup commands

python -m pip install lerobot

Verify the installation

python -m pip show lerobot

Official instructions: https://huggingface.co/docs/lerobot/installation

PyTorch Windows, Linux, macOS with supported Python

Use the official installation selector for your OS, CPU or CUDA/ROCm version. Run the exact command it produces inside the project's environment. Do not assume that a CPU wheel has GPU support.

Verify the installation

python -c "import torch; print(torch.__version__, torch.cuda.is_available())"

Official instructions: https://pytorch.org/get-started/locally/

OpenVLA Supported Linux GPU/Python environment

Clone the official repository, choose the documented Python and PyTorch versions, install the required CUDA-compatible dependencies in a separate environment, and obtain the matching checkpoint from the project instructions.

Installation / setup commands

git clone https://github.com/openvla/openvla.git

Verify the installation

Run the documented offline inference example.

Official instructions: https://github.com/openvla/openvla

NVIDIA CUDA Toolkit Supported NVIDIA GPU and OS

Choose a CUDA Toolkit release matching the project, compatible driver and PyTorch build. Use NVIDIA's platform installer steps. A system-wide CUDA installation is not always needed for prebuilt PyTorch wheels.

Verify the installation

nvidia-smi nvcc --version

Official instructions: https://developer.nvidia.com/cuda-downloads

Manufacturer SDK / robot software Exact robot model and firmware version

Check whether the manufacturer provides a public SDK or a licensed developer package for this edition. Obtain the matching release and installation manual from the manufacturer. Install its documented dependencies in an isolated environment and run the offline import or simulator check. Do not flash firmware or send motor commands during installation.

Verify the installation

Confirm supported model, OS, SDK and firmware version. If no public installer is documented, request developer access from the manufacturer.

Sources and verification

  1. Spinning Up – Key Concepts in Reinforcement LearningOpenAI · Read 8 October 2026

    Educational definitions of observations, actions, policies and rewards.

  2. Learning Fine-Grained Bimanual Manipulation with Low-Cost HardwareTony Zhao, Vikash Kumar, Sergey Levine and Chelsea Finn · Read 8 October 2026

    RSS 2023 project page for ALOHA and ACT. Results apply to the tested setup.

  3. Learning Fine-Grained Bimanual Manipulation with Low-Cost HardwareTony Z. Zhao and colleagues · Read 8 October 2026

    2023 v1. Table I and section V-C supply the physical Slot Battery rate and denominator.

Article history

Explained the ACT imitation-learning target and contrasted a demonstration command with a reward signal.

Added a contextual link to the simulation series for the next engineering step.

Added the ALOHA paper’s task-specific 96% versus 20% physical result and its documented failed grasps.

Expanded the guide with concrete task examples, six original diagrams, model and software explanations, two runnable Python exercises and a repeatable evaluation protocol.