Contents

Embodied AI Algorithms: From Beginner to Mastery

Embodied AI
#Embodied AI#Reinforcement Learning#Imitation Learning#Vision-Language-Action Models#World Models#Sim-to-Real

0. Primer: See the Whole Map First, Then Take the Algorithms Apart One by One

“Embodied AI” (intelligence with a physical body that can perceive, decide, and act inside a real or simulated environment) sounds like a new direction, but it is really the confluence of three old technical threads: reinforcement learning (RL, learning a policy by interacting with an environment and learning from trial and error), imitation learning (IL, acquiring skills by learning from human demonstrations), and large-scale pretrained models (learning general representations from massive data first, then transferring them to specific tasks).

The mistake beginners make most often is to read the literature in order of paper popularity: diffusion policy today, vision-language-action (VLA) models tomorrow, and after a pile of reading they still do not know what problem each of them solves or why each of them has to exist. The right approach is to first build a map organized by “capability level”, hang every algorithm at a fixed position on that map, and then take each one apart.

The organization of this article is exactly that map, four layers from top to bottom:

LayerProblem it solvesRepresentative algorithmsData sourceOutput frequency (policy inference)
Foundation layer · semantics (subgoals)Given one natural-language instruction, which subtask should be done now, where to go, what to grasp?RT-2, OpenVLA, FAST, GR-2, HPTInternet-scale multi-robot data + vision-language pretrainingLow frequency 3–10 Hz (chunk level or event level)
Foundation layer · action (continuous)Given a subgoal, how to stably generate high-frequency continuous action chunks?π₀ (flow-matching action expert), RDT-1B (diffusion action head), Octo (lightweight general baseline)Multi-embodiment trajectories + unified action spaceMedium frequency 10–50 Hz (action-chunk inference)
Skill layerGiven a specific task, how to reliably execute the action?Behavior cloning, ACT, Diffusion PolicyHuman teleoperation demonstrations (tens to thousands of episodes)Medium frequency 10–50 Hz (action-chunk inference)
Foundation layer (basic)Without demonstrations, how to optimize long-term return through trial and error?PPO, SAC (model-free); DreamerV3, TD-MPC2 (model-based, see Chapter 5)Autonomous interaction in a simulatorHigh frequency (simulation step level or control step level)
Robustness layerOnce a policy is learned in simulation, how to keep it from collapsing on the real robot?Domain randomization, system identification, real-world fine-tuningSimulation + a small amount of real dataUnchanged, runs through the whole pipeline

Two things must be remembered about this table: the higher up you go, the more the layer depends on prior knowledge and big data; the lower down you go, the more it depends on interaction and reward design. And the higher up, the lower the decision frequency, but the “action generation frequency” is not necessarily low — the high level decides “what to do” (a few times per second is enough), the action layer decides “how to move” (ten to tens of times per second), and the low-level servo still runs at 100–1000 Hz (see the three-level frequency split in 7.3). These are three different notions of frequency.

The table splits the foundation-model layer into two rows because it has never been a homogeneous category. Three criteria are worth remembering separately:

  • π₀ is a composite and cannot be labeled with a single frequency. Its vision-language backbone handles low-frequency semantics (on the order of 3–10 Hz), while the added flow-matching action expert handles high-frequency continuous action chunks (inference can reach 20–50 Hz, see Section 4.3). Both frequencies exist in one model at the same time. Labeling π₀ only as “3–10 Hz” throws away half of its action-layer capability.
  • Octo is a lightweight general baseline, not a representative of “internet-scale pretraining”. It is trained on Open X-Embodiment, a large-scale multi-robot collection; it has few parameters, and its main use is “take the open-source weights and fine-tune on your own data”. It therefore sits in the “baseline / fine-tuning starting point” slot of the action layer, rather than being listed alongside heavy models such as RT-2 and OpenVLA.
  • RDT-1B is a domain foundation model focused on dual arms. Its data scale is large (on the order of a million trajectories), but its task domain is concentrated on dual-arm manipulation, so its generalization boundary differs from that of a “general internet-level VLA”.

Two further points are easy to misread: JEPA is not in the basic layer — it outputs representations / world models and does not produce actions itself, so it must be paired with a planner or policy optimizer to close the loop (see Section 5.4 and the comparison table with DreamerV3 for details); and every Hz value in the frequency column means “how often the policy emits a decision or an action chunk”, not the servo loop frequency. What the policy outputs is usually a target point or an action chunk; the genuinely high-frequency closed loop is handled by the low-level controller.

Going from beginner to mastery means crossing five thresholds in order. Chapter 8 of this article gives an executable training path; they are listed here so that you can locate yourself at any time:

  1. Prerequisites: Markov decision processes (Markov Decision Process, MDP, a mathematical framework that formalizes the “state–action–reward” interaction), policy gradients, and the basic notation of probability theory and variational inference.
  2. Get one RL loop working: train a continuous-control task with PPO in MuJoCo (a commonly used physics simulation engine) and be able to explain every hyperparameter yourself.
  3. Get one imitation-learning loop working: train a grasping task with ACT or Diffusion Policy on demonstration data, and understand why “action chunking” rescues behavior cloning.
  4. Read and be able to fine-tune a VLA: understand the trade-off between the two routes of action tokenization (discretization) and continuous action generation (flow matching), and be able to use LoRA (Low-Rank Adaptation, a fine-tuning method that trains only a small number of additional parameters) to fine-tune an open-source VLA on your own data.
  5. Cross the reality gap: migrate a simulation policy to a real robot and master the full pipeline of domain randomization, system identification, and safety evaluation.

After reading Chapters 2 to 6, which correspond to these five thresholds, Chapter 11 is a horizontal summary: it steps out of the “by layer” order, uses one mechanism overview table, six key divergences, and one “capability gap” reverse-lookup chain to compare all methods side by side, and specifically answers “which one should I pick, and when should I not pick it”. Chapter 12 is the lookup-table version of the summary: it compresses the same conclusions into a “difference–scenario” matrix, reverse lookups by resource constraint, and default combinations per task family, for direct use when choosing a model. If you come only for model selection, you can go straight to the constraint decision in Chapter 7, then the mechanism comparison in Chapter 11, and finally settle the plan with Chapter 12.

Reading conventions: in the formulas of this article, ss denotes state, aa denotes action, rr denotes reward, π\pi denotes policy (the distribution of actions given a state), and γ\gamma denotes the discount factor; value-network parameters are written ϕ\phi and policy-network parameters θ\theta. Every pseudocode block annotates “Input / Output” and the shapes of key variables on its first line inside the block, and symbols follow the definition of their first appearance in that section — when the same symbol is reused across sections its meaning stays consistent, and if a section temporarily changes the convention it is noted inside the block. All derivations are kept in click-to-expand collapsible blocks — read the conclusion and the intuition first, and expand the derivation only when you need it. This is the most time-efficient way to read from beginner to mastery.

1. Problem Formalization: What Embodied AI Is Actually Optimizing

1.1 Starting from the MDP: A Widely Reused Abstraction

Any embodied task, whether “pick up a cup” or “fold clothes”, can be written as an MDP: a five-tuple (S,A,P,R,γ)(\mathcal{S}, \mathcal{A}, P, R, \gamma), where S\mathcal{S} is the state space, A\mathcal{A} is the action space, P(s′∣s,a)P(s' \mid s, a) is the state transition probability, R(s,a)R(s,a) is the reward function, and γ∈[0,1)\gamma \in [0,1) is the discount factor (the closer to 1, the more long-term return matters).

The agent’s goal is to find a policy π(a∣s)\pi(a \mid s) that maximizes the expected discounted return:

J(π)=Eτ∼π[∑t=0∞γtrt]J(\pi) = \mathbb{E}_{\tau \sim \pi}\left[\sum_{t=0}^{\infty} \gamma^t r_t\right]

Here τ=(s0,a0,r0,s1,a1,r1,… )\tau = (s_0, a_0, r_0, s_1, a_1, r_1, \dots) is a trajectory. This expression is the objective shared by all later algorithms — RL, imitation learning, and world models differ only in “how this expectation is estimated” and “what data is used to estimate it”.

Derivation: Why a discount factor is used, and where the Bellman optimality equation comes from

Step 1: what the discount does. Without discounting (γ=1\gamma = 1), the sum of returns may diverge as long as the task continues; moreover “one point of reward today” and “one point of reward a year from now” would be treated equally, which does not match the practical needs of control problems. With γ\gamma, the return is upper bounded by rmax⁡/(1−γ)r_{\max}/(1-\gamma), and distant rewards get lower weight, which guarantees convergence mathematically.

Step 2: define the state value. The expected return starting from state ss and acting according to policy π\pi:

Vπ(s)=Eπ[∑k=0∞γkrt+k | st=s]V^\pi(s) = \mathbb{E}_{\pi}\left[\sum_{k=0}^{\infty}\gamma^k r_{t+k} \,\middle|\, s_t = s\right]

Step 3: peel off the first step. Take the first term of the sum out on its own; the remaining terms are exactly the value starting from st+1s_{t+1}:

Vπ(s)=Ea∼π(⋅∣s)[R(s,a)+γ Es′∼P(⋅∣s,a)[Vπ(s′)]]V^\pi(s) = \mathbb{E}_{a \sim \pi(\cdot|s)}\left[R(s,a) + \gamma\, \mathbb{E}_{s' \sim P(\cdot|s,a)}\left[V^\pi(s')\right]\right]

This is the Bellman expectation equation. It turns an “infinite sum” into a recursion of “one-step reward + value of the next state”, and it is the root of all value iteration and temporal difference (Temporal Difference, TD, updating the current estimate with an estimate of the next step) methods.

Step 4: take the optimum. Replace the policy with “pick the optimal action in every state” to obtain the optimal value function V∗V^*:

V∗(s)=max⁡a[R(s,a)+γEs′[V∗(s′)]]V^*(s) = \max_{a}\left[R(s,a) + \gamma \mathbb{E}_{s'}\left[V^*(s')\right]\right]

The corresponding action value (execute action aa in state ss first, then act according to the optimal policy) satisfies:

Q∗(s,a)=R(s,a)+γ∑s′P(s′∣s,a)max⁡a′Q∗(s′,a′)Q^*(s,a) = R(s,a) + \gamma \sum_{s'} P(s' \mid s,a) \max_{a'} Q^*(s',a')

This is the Bellman optimality equation. It shows that the optimal action value can be defined self-consistently — no knowledge of the full environment model is needed; as long as there is a sufficiently large table (or a function approximator) updated iteratively, it converges to it. This “self-consistency” property is the theoretical basis of every TD learning algorithm that follows (including the deep versions in the DQN family).

Step 5: policy and value imply each other. Given Q∗Q^*, the optimal policy is the greedy policy π∗(a∣s)=arg⁡max⁡aQ∗(s,a)\pi^*(a|s) = \arg\max_a Q^*(s,a); conversely, given a policy, its value can be evaluated with the Bellman expectation equation. This alternating “evaluate — improve” process is called policy iteration, and convergence is guaranteed by the contraction property of the Bellman operator (with contraction coefficient γ\gamma).

1.2 The Real Difficulty of Embodied AI: Partial Observability

The MDP above assumes the agent can see the full state. Real robots cannot: a camera only sees part of the scene inside a conical field of view in front of it, and occluded objects, the precise torque of its own joints, and the ground friction coefficient are all unavailable. The problem then becomes a partially observable Markov decision process (Partially Observable MDP, POMDP): the agent receives an observation oto_t that depends on the true state ss through O(o∣s)O(o \mid s) but is not identical to ss.

The standard solution to a POMDP is to maintain a belief bt(s)=P(st=s∣o0:t,a0:t−1)b_t(s) = P(s_t = s \mid o_{0:t}, a_{0:t-1}), that is, “given everything seen and done so far, the probability distribution over what the current state is”. The policy changes from “state to action” into “belief to action” π(a∣b)\pi(a \mid b).

Derivation: The Bayesian recursion of the belief (the core update of a POMDP)

Suppose the belief at the previous instant bt−1(s′)b_{t-1}(s') is known; after executing action at−1a_{t-1} we observe oto_t. The new belief is then:

bt(s)=O(ot∣s)∑s′P(s∣s′,at−1) bt−1(s′)P(ot∣bt−1,at−1)b_t(s) = \frac{O(o_t \mid s)\displaystyle\sum_{s'} P(s \mid s', a_{t-1})\, b_{t-1}(s')}{P(o_t \mid b_{t-1}, a_{t-1})}

Where it comes from: apply Bayes’ rule to P(st=s∣o0:t,a0:t−1)P(s_t = s \mid o_{0:t}, a_{0:t-1}); the numerator expands into “observation likelihood × state prior”, and the state prior is obtained by summing “previous belief × transition probability”:

P(st=s,ot∣bt−1,at−1)=O(ot∣s)∑s′P(s∣s′,at−1)bt−1(s′)P(s_t = s, o_t \mid b_{t-1}, a_{t-1}) = O(o_t \mid s)\sum_{s'}P(s \mid s', a_{t-1})b_{t-1}(s')

The denominator is a normalization constant (a sum over ss) that keeps the belief a probability distribution.

Why this expression matters: it shows that “memory” can be compressed into a probability distribution instead of storing the whole history. In engineering nobody actually computes this integral (states are continuous and extremely high-dimensional); instead a recurrent neural network (Recurrent Neural Network, RNN) or the hidden state of a Transformer approximately “remembers” the history — this is exactly why ACT, DreamerV3, and VLA all come with a history encoder. Understand this and you understand “why almost every embodied policy consumes a history of frames rather than a single frame”.

1.3 Three Learning Paradigms: One Objective, Three Data Sources

Facing the same J(π)J(\pi), the field has evolved three complementary routes; their fundamental difference is where the data comes from and whether a reward signal is needed:

ParadigmDataRewardAdvantagesFatal weakness
Reinforcement learningThe agent interacts with the environment itselfRequiredCan surpass demonstrations and find better policiesLow sample efficiency, hard reward design, dangerous trial and error on real robots
Imitation learningHuman teleoperation demonstrationsNot requiredHigh data utilization, simple to implement, natural behaviorDistribution shift (covariate shift, see 3.1) causes compounding error
Model-basedInteraction data + a learned environment modelOptionalHighest sample efficiency, supports “imagination” planningModel error accumulates, long-horizon predictions distort

A mature embodied system usually uses all three: a VLA is pretrained on massive demonstrations (imitation learning), the lower layer uses RL for fine control and robustness, and a world model is used for low-cost trial and error and planning. Do not treat them as mutually exclusive options — this is the first cognitive upgrade on the way from beginner to mastery.

The rest of the article takes the four-layer map apart layer by layer. Every section follows the same structure: intuition → principle → expandable derivation → pseudocode → pseudocode walkthrough → common pitfalls.

2. Basic Layer: Reinforcement Learning — How to Learn Without Demonstrations

2.1 Policy Gradient: Directly Optimizing “the Probability of an Action”

Value-function methods (the Q-learning family) first learn “how many points each action is worth” and then pick actions by score; policy gradient (Policy Gradient, PG) does the opposite: it parameterizes the policy πθ(a∣s)\pi_\theta(a|s) directly and uses gradient ascent to increase the probability of “actions that obtain high return”.

The central formula is the policy gradient theorem:

∇θJ(πθ)=Eτ∼πθ[∑t=0T∇θlog⁡πθ(at∣st) A^t]\nabla_\theta J(\pi_\theta) = \mathbb{E}_{\tau \sim \pi_\theta}\left[\sum_{t=0}^{T}\nabla_\theta \log \pi_\theta(a_t \mid s_t)\, \hat{A}_t\right]

where A^t\hat{A}_t is an estimate of the advantage function (advantage, measuring “how much better this action is than average”). Intuition: when A^t>0\hat{A}_t > 0, increase the probability of that action; when A^t<0\hat{A}_t < 0, decrease it.

Derivation: The policy gradient theorem (log-likelihood trick + a baseline introduces no bias)

Step 1: push the gradient inside the expectation. The trajectory probability is

pθ(τ)=ρ(s0)∏t=0Tπθ(at∣st) P(st+1∣st,at)p_\theta(\tau) = \rho(s_0)\prod_{t=0}^{T} \pi_\theta(a_t|s_t)\, P(s_{t+1}|s_t,a_t)

The objective is J(θ)=∫pθ(τ)R(τ) dτJ(\theta)=\int p_\theta(\tau)R(\tau)\,d\tau, hence

∇θJ=∫∇θpθ(τ)R(τ) dτ=Eτ∼pθ[∇θlog⁡pθ(τ) R(τ)]\nabla_\theta J = \int \nabla_\theta p_\theta(\tau) R(\tau)\, d\tau = \mathbb{E}_{\tau\sim p_\theta}\left[\nabla_\theta \log p_\theta(\tau)\, R(\tau)\right]

The second equality uses the identity ∇θp=p ∇θlog⁡p\nabla_\theta p = p\,\nabla_\theta \log p. What this step achieves is turning “a gradient with respect to a distribution” into “an expectation over samples”, which can then be estimated by sampling.

Step 2: only the policy term contains θ\theta. In log⁡pθ(τ)\log p_\theta(\tau), the initial state distribution ρ(s0)\rho(s_0) and the transition probability PP do not depend on θ\theta (the environment does not change with the policy), so after differentiating only

∇θlog⁡pθ(τ)=∑t=0T∇θlog⁡πθ(at∣st)\nabla_\theta \log p_\theta(\tau) = \sum_{t=0}^{T}\nabla_\theta \log \pi_\theta(a_t|s_t)

remains.

Step 3: introduce a baseline. If the return R(τ)R(\tau) is replaced by “the return from time tt onward, RtR_t” minus a baseline that depends only on the state, b(st)b(s_t), the expectation is unchanged:

Eat∼πθ[∇θlog⁡πθ(at∣st) b(st)]=b(st)∑at∇θπθ(at∣st)=b(st) ∇θ1=0\mathbb{E}_{a_t\sim\pi_\theta}\left[\nabla_\theta\log\pi_\theta(a_t|s_t)\, b(s_t)\right] = b(s_t)\sum_{a_t}\nabla_\theta \pi_\theta(a_t|s_t) = b(s_t)\,\nabla_\theta 1 = 0

because the gradient of a probability distribution with respect to its parameters integrates to zero. This property says: subtracting a baseline does not change the expected gradient; it only reduces the variance. Taking b(st)=Vπ(st)b(s_t)=V^\pi(s_t) makes Rt−b(st)R_t - b(s_t) the advantage AtA_t; in practice one often uses the Monte Carlo return minus a value estimate, i.e. A^t=Gt−Vϕ(st)\hat{A}_t = G_t - V_\phi(s_t).

Step 4: why it converges. With a soft policy (such as a Gaussian policy) and a suitable step size, the expected direction of the above gradient agrees with the true gradient of JJ, so stochastic gradient ascent converges to a local optimum. All the engineering complexity comes from “the variance is too large”, which is precisely why PPO and GAE exist later.

Three pitfalls of the starter implementation (REINFORCE): (1) using the whole-trajectory return as a weight gives enormous variance, so a baseline is mandatory; (2) not normalizing the advantage means that different reward scales across tasks make the learning rate meaningless; (3) the sampling policy and the update policy must be identical (on-policy), otherwise the gradient is biased.

2.2 PPO: Getting “the Size of the Update” Under Control

Proximal policy optimization (Proximal Policy Optimization, PPO) was proposed in 2017 and is still the default baseline for continuous control today. It addresses a structural defect of policy gradients: a slightly too large step and the policy collapses — one update pushes the probability of some action close to 0 or 1, after which counterexamples are never sampled again, and the gradient vanishes or explodes.

PPO’s remedy is to “limit the size of each update”. It has two key components: the clipped surrogate objective and generalized advantage estimation (Generalized Advantage Estimation, GAE).

2.2.1 From Importance Sampling to the Clipped Objective

Let the old policy be πθold\pi_{\theta_{\text{old}}} and the new policy πθ\pi_\theta, and define the probability ratio

rt(θ)=πθ(at∣st)πθold(at∣st)r_t(\theta) = \frac{\pi_\theta(a_t|s_t)}{\pi_{\theta_{\text{old}}}(a_t|s_t)}

PPO maximizes:

Lclip(θ)=Et[min⁡(rt(θ)A^t, clip⁡(rt(θ),1−ϵ,1+ϵ)A^t)]L^{\text{clip}}(\theta) = \mathbb{E}_t\left[\min\left(r_t(\theta)\hat{A}_t,\ \operatorname{clip}(r_t(\theta), 1-\epsilon, 1+\epsilon)\hat{A}_t\right)\right]

where ϵ\epsilon is usually set to 0.2.

Derivation: Why importance sampling is used, why min is taken, and what the clipping actually limits

Step 1: why importance sampling (Importance Sampling, IS). Data collected by the old policy has to be used to evaluate the new policy, which requires a correction by the probability ratio:

Ea∼πθ[f(a)]=Ea∼πold[πθ(a∣s)πold(a∣s)f(a)]\mathbb{E}_{a\sim\pi_\theta}[f(a)] = \mathbb{E}_{a\sim\pi_{\text{old}}}\left[\frac{\pi_\theta(a|s)}{\pi_{\text{old}}(a|s)}f(a)\right]

Without this correction, computing the gradient of the new policy directly from old data gives a biased estimate.

Step 2: the problem with plain IS. If πθ\pi_\theta and πold\pi_{\text{old}} are too far apart, rtr_t can be enormous (variance explosion) or tiny (information loss). The distance between the two must therefore be constrained inside the objective. PPO’s choice is “clipping” rather than explicitly computing the Kullback-Leibler divergence (KL divergence, which measures the difference between two distributions).

Step 3: what min does. Look at two cases:

  • A^t>0\hat{A}_t > 0 (the action is good and we want to raise its probability): the objective is rtA^tr_t\hat{A}_t, but once rtr_t exceeds 1+ϵ1+\epsilon it is clipped to (1+ϵ)A^t(1+\epsilon)\hat{A}_t and the gradient becomes 0 — raising it further brings no extra benefit, so it stops there.
  • A^t<0\hat{A}_t < 0 (the action is bad and we want to lower its probability): the objective is rtA^tr_t\hat{A}_t, and once rtr_t drops below 1−ϵ1-\epsilon it is clipped to (1−ϵ)A^t(1-\epsilon)\hat{A}_t and the gradient is again 0 — lowering it further brings no extra benefit.

Taking the min gives a “pessimistic lower bound”: when the clipped term and the original term disagree in direction (for example A^t>0\hat{A}_t>0 while rtr_t is very small), the smaller one is taken, so that the objective is never overestimated because of clipping and out-of-range updates are never encouraged.

Step 4: what constraint it is equivalent to. In the small neighborhood where rtr_t is close to 1, log⁡rt≈rt−1\log r_t \approx r_t - 1, and the second-order approximation of the KL divergence is

DKL(πold ∥ πθ)≈12E[(log⁡rt)2]D_{\mathrm{KL}}(\pi_{\text{old}}\,\|\,\pi_\theta) \approx \frac{1}{2}\mathbb{E}\left[(\log r_t)^2\right]

so “restricting rtr_t to [1−ϵ,1+ϵ][1-\epsilon,1+\epsilon]” is approximately “restricting the policy movement to a trust region”. TRPO (Trust Region Policy Optimization) solves this constraint explicitly (with conjugate gradients plus a line search), while PPO approximates it with a clipped surrogate objective — this is the fundamental reason PPO is cheap, stable, and good enough.

2.2.2 GAE: A Continuous Dial Between Bias and Variance

Advantage estimation has two extremes: use the one-step TD error (high bias, low variance), or use the Monte Carlo return of the whole trajectory (low bias, high variance). GAE interpolates continuously between them with one parameter λ\lambda.

Define the TD error δt=rt+γVϕ(st+1)−Vϕ(st)\delta_t = r_t + \gamma V_\phi(s_{t+1}) - V_\phi(s_t); then

A^tGAE(γ,λ)=∑l=0∞(γλ)lδt+l\hat{A}_t^{\text{GAE}(\gamma,\lambda)} = \sum_{l=0}^{\infty}(\gamma\lambda)^l \delta_{t+l}
Derivation: The exponentially weighted expansion of GAE, and what the two ends λ=0 / λ=1 degenerate into

Expand the sum term by term:

A^t=δt+γλ δt+1+(γλ)2δt+2+⋯\hat{A}_t = \delta_t + \gamma\lambda\,\delta_{t+1} + (\gamma\lambda)^2\delta_{t+2} + \cdots

λ=0\lambda=0: only A^t=δt=rt+γV(st+1)−V(st)\hat{A}_t=\delta_t = r_t+\gamma V(s_{t+1})-V(s_t) remains, i.e. the one-step TD error. High bias, low variance — the bias comes from bootstrapping: the only real signal in the whole expression is rtr_t, everything else relies on guesses from the value network VϕV_\phi, and this error persists whenever VϕV_\phi estimates badly; the variance is low because only a single random reward is accumulated, so there are the fewest sources of randomness.

λ=1\lambda=1: all δ\delta have equal weight (because γλ=γ\gamma\lambda=\gamma), and the telescoping sum cancels term by term:

∑l=0∞γlδt+l=∑l≥0γlrt+l+∑l≥0γl+1V(st+l+1)−∑l≥0γlV(st+l)\sum_{l=0}^{\infty}\gamma^l\delta_{t+l} = \sum_{l\ge0}\gamma^l r_{t+l} + \sum_{l\ge0}\gamma^{l+1}V(s_{t+l+1}) - \sum_{l\ge0}\gamma^l V(s_{t+l})

The last two terms cancel after shifting the index, and the result is exactly the Monte Carlo return minus the baseline, ∑lγlrt+l−V(st)\sum_l \gamma^l r_{t+l} - V(s_t), i.e. an unbiased but high-variance estimate: unbiased because there is no bootstrapping any more and all real rewards are used; high variance because dozens to hundreds of random rewards along the whole trajectory are summed, so the randomness grows linearly.

Intermediate values: the smaller λ\lambda, the more we trust “bootstrapping” (using the value estimate in place of the actual subsequent return); the larger, the more we trust “actual sampling”. In practice λ=0.95\lambda=0.95 is a common compromise.

Engineering note: GAE is not accumulated forward along the trajectory but computed by backward recursion (from the last step backwards), because A^t\hat{A}_t depends on A^t+1\hat{A}_{t+1}:

A^t=δt+γλ A^t+1,A^T=0\hat{A}_t = \delta_t + \gamma\lambda\,\hat{A}_{t+1},\qquad \hat{A}_T = 0

The boundary condition A^T=0\hat{A}_T=0 means “there is no more information beyond the trajectory”; at the end of the recursion, the advantage of the last step degenerates into its own δT\delta_T. See 2.2.3 for the full implementation.

Derivation: Why termination and truncation must be distinguished as two separate masks

Step 1: distinguish the two kinds of “episode end”.

  • True termination (terminal, e.g. falling over or task success): the environment enters an absorbing state, no states exist afterwards, and the future return is identically 0;
  • Time truncation (truncation, e.g. being forcibly cut off at the 1000-step limit): the episode is merely “cut short”, the environment itself could continue to evolve, and the future return is not 0.

Step 2: the δt\delta_t corresponding to each case.

On true termination, the term γV(st+1)\gamma V(s_{t+1}) must be set to zero:

δtterm=rt−V(st)\delta_t^{\text{term}} = r_t - V(s_t)

On time truncation, bootstrapping must be kept (using V(st+1)V(s_{t+1}) to represent “the return that could have been obtained after the interruption”):

δttrunc=rt+γV(st+1)−V(st)\delta_t^{\text{trunc}} = r_t + \gamma V(s_{t+1}) - V(s_t)

Step 3: why one cannot simply treat everything as termination. Suppose a trajectory is truncated at t=T−1t=T-1 and the true return afterwards is not 0 (for example the robot is still moving toward the goal). If it is wrongly treated as termination, δT−1\delta_{T-1} loses γV(sT+)\gamma V(s_{T}^{+}) out of thin air; this negative bias then propagates forward attenuated by γλ\gamma\lambda:

A^t  ⟵  A^t−(γλ)T−1−t γV(sT+)\hat{A}_t \;\longleftarrow\; \hat{A}_t - (\gamma\lambda)^{T-1-t}\,\gamma V(s_{T}^{+})

As a result, states closer to the time limit have their advantages pushed lower; and since Rett=A^t+Vϕ(st)\mathrm{Ret}_t=\hat{A}_t+V_\phi(s_t), the regression target of the value network is systematically biased low as well. After long training, the value function develops an artificial downward slope near the time limit — the so-called false cliff: the policy learns to “give up when approaching step 1000”, because it believes the remaining time is worthless.

Step 4: conversely, treating termination as truncation is equally harmful. If an episode really ends and bootstrapping is still applied, γV(st+1)\gamma V(s_{t+1}) counts the value of the next episode into the end of this one, effectively “stealing” reward across episodes: the value estimate is inflated and the advantage jumps at the episode boundary.

Step 5: express both with a mask. Take dt∈{0,1}d_t\in\{0,1\} with dt=1d_t=1 meaning true termination; then

δt=rt+γ(1−dt)V(st+1)−V(st),A^t=δt+γλ(1−dt)A^t+1\delta_t = r_t + \gamma(1-d_t)V(s_{t+1}) - V(s_t),\qquad \hat{A}_t = \delta_t + \gamma\lambda(1-d_t)\hat{A}_{t+1}

Note that the mask must be applied in both places: the first masks the bootstrapping term, the second masks the advantage coming from the next episode. Changing only the first and forgetting the second is the most common mistake when reproducing GAE — At+1A_{t+1} already belongs to the new episode, and without cutting it off the two episodes get mixed together.

Step 6: how to implement it. Record two flags during sampling: done (true termination) and truncated (time limit or external interruption); use only done as the mask when computing GAE, and use truncated only for statistics and curriculum scheduling, never for masking bootstrapping. If the environment returns only a single boolean, split it into two in the wrapper layer — this is why mainstream implementations (such as Stable-Baselines3 and CleanRL) all handle it separately.

For the full consequences of mistaking truncation for termination and how to fix them, see also trap 6 in Chapter 9, 9.2.

Derivation: Why the regression target of the value network is Ret = Â + V rather than the Monte Carlo return

Step 1: the definition of the advantage. The advantage is “how much better this action is than the policy’s average level”:

Aπ(st,at)=Qπ(st,at)−Vπ(st)A^\pi(s_t,a_t) = Q^\pi(s_t,a_t) - V^\pi(s_t)

Rearranging gives Qπ(st,at)=Aπ(st,at)+Vπ(st)Q^\pi(s_t,a_t) = A^\pi(s_t,a_t) + V^\pi(s_t); replacing the QQ on the left with its estimate Rett\mathrm{Ret}_t yields

Rett≈A^t+Vϕ(st)\mathrm{Ret}_t \approx \hat{A}_t + V_\phi(s_t)

Step 2: why this target is better than the Monte Carlo return. Using Gt=∑lγlrt+lG_t=\sum_l\gamma^l r_{t+l} directly as the regression target makes the variance grow linearly with trajectory length (this is the λ=1\lambda=1 case); in A^t+Vϕ(st)\hat{A}_t+V_\phi(s_t) the advantage has already mixed bootstrapping and sampling through λ\lambda, so the variance is suppressed and the bias depends only on the quality of VϕV_\phi. In other words, the value network regresses the “QQ estimate already smoothed by GAE”, not the raw return.

Step 3: three implementation details.

  1. Compute AA first, then Ret\mathrm{Ret}, and Ret\mathrm{Ret} must use the unstandardized AA — advantage standardization serves only the policy loss; adding a standardized AA back to VV shifts and rescales the value target as a whole, and cvc_v has to be retuned before convergence is even possible.
  2. Ret\mathrm{Ret} serves only as the label of the value network and must not backpropagate gradients into the input of VϕV_\phi (detach); otherwise the value loss flows back through the label and forms a self-loop.
  3. If the reward has been normalized (reward scaling), Ret\mathrm{Ret} must be computed from the same normalized reward, otherwise the value scale disagrees with the reward the policy sees.

This is the origin of line ⑥, Ret_t = A_t + V_φ(s_t), in the pseudocode of 2.2.3.

2.2.3 GAE Pseudocode and Walkthrough

All the formulas above ultimately land in one function: “given a batch of samples, compute the advantages and the value labels”. This code deserves to be written out separately, because it is the place most easily written wrong when reproducing PPO — one wrong mask and the training curve quietly degrades, while no anomaly can be seen in the metrics.

Algorithm: generalized advantage estimation GAE (single trajectory, values given by V_φ)
Input: r[0..T-1]      reward at each step
       v[0..T]        value estimate of each step; v[T] is the bootstrap value of the final state
       done[0..T-1]   termination mask (1 = true termination; time truncation recorded as 0)
       γ discount factor, λ GAE coefficient
Output: A[0..T-1] advantages, Ret[0..T-1] regression targets of the value network

A[T] ← 0                                            # ① no information beyond the trajectory
for t = T-1 downto 0:                               # ② must go backwards
    bootstrap ← 0 if done[t] == 1 else v[t+1]       # ③ termination cuts bootstrapping
    δ  ← r[t] + γ·bootstrap - v[t]                  # ④ one-step TD error
    A[t] ← δ + γ·λ·(1-done[t])·A[t+1]               # ⑤ exponentially weighted recursion
    Ret[t] ← A[t] + v[t]                            # ⑥ regression target of the value

# batch level: after concatenating E parallel trajectories into one dimension
A ← (A - mean(A)) / (std(A) + 1e-8)                 # ⑦ standardize over the whole batch only
return A, Ret

Walkthrough (numbers correspond to the steps above):

  1. ① Why set A[T]=0A[T]=0. The recursion needs an initial value; there are no steps after the final state, so the advantage is naturally 0. The real information is in v[T]v[T]: if the final state is a true termination, v[T]v[T] should be 0; if it is a time truncation, v[T]v[T] must carry the value estimate of the truncated state — missing this is equivalent to treating truncation as termination, which is exactly the cause of the “false cliff” in the previous collapsible block.
  2. ② Why it must go backwards. AtA_t depends on At+1A_{t+1}; in a forward scan At+1A_{t+1} is still unknown. This is also why many people “write it exactly as the formula says and still get it wrong”: the formula is a sum, the code is a recursion, and the direction has to be reversed.
  3. ③ The mask acts only on the bootstrapping term. bootstrap ← 0 if done[t] == 1 else v[t+1] is equivalent to γ(1−dt)V(st+1)\gamma(1-d_t)V(s_{t+1}). Note that done (true termination) is used here, not truncation; the truncation flag does not participate in this line.
  4. ④ δ\delta contains only one step of real reward. Everything else relies on bootstrapping from VϕV_\phi, which is the source of its “low variance, high bias”; the role of λ\lambda is to add the real rewards of more subsequent steps with weight (γλ)l(\gamma\lambda)^l, gradually trading the bias back.
  5. ⑤ The second mask cannot be omitted. (1-done[t]) also cuts off the incoming At+1A_{t+1}; if it is omitted, a terminating step pulls the advantage of the next episode into this episode and the two mix. A common wrong version is A[t] = δ + γλ·A[t+1] with masking only inside δ\delta — the line looks perfectly reasonable on its own, yet the result has a systematic bias at episode boundaries.
  6. ⑥ Ret is computed from the unstandardized A. Standardization serves only the policy loss (so that the learning rate means the same thing under different reward scales); standardizing before ⑥ shifts and rescales the value target as a whole, cvc_v must be retuned before convergence is possible, and this is very hard to notice.
  7. ⑦ Where and over what range to standardize. Compute the mean and standard deviation over the whole batch (all parallel environments × all time steps); do not standardize each trajectory separately — standardizing inside a single trajectory erases the relative information “how large the advantages of different trajectories are”, which is equivalent to flattening good and bad trajectories together. ϵ=10−8\epsilon=10^{-8} only prevents division by zero.
  8. Numerics and performance. TT is the number of sampling steps per round (commonly 1024–4096), and a plain Python loop becomes the bottleneck here; mainstream implementations put the time dimension in the innermost tensor dimension and vectorize with “fixed-length loop + tensor slicing”, or use a segmented parallel prefix scan. The exponential decay of (γλ)l(\gamma\lambda)^l keeps the accumulation stable and float32 suffices; but if the reward magnitude is large, the reward should be normalized first, otherwise Ret\mathrm{Ret} becomes too large, the value loss drowns the policy loss, and cvc_v is pushed out of balance.
  9. How to self-check. Under a random policy the mean advantage over the whole batch should be close to 0, because the advantage is itself a deviation “relative to the average level”; if it deviates clearly from 0, a mask is usually in the wrong place, or the bootstrap value of the final state was set to 0 when it should have been the truncated-state estimate. Another check is to fix a set of (r,v,done)(r,v,\text{done}) and hand-compute the expected values at both ends λ=0\lambda=0 and λ=1\lambda=1, then compare term by term with the implementation.
  10. Relation to 2.2.4. This is the kernel of step 2 in the PPO pseudocode; extracting it into a separate function makes unit testing easy. Real code should also store done and truncated in two separate arrays and use only done inside GAE.

2.2.4 PPO Pseudocode and Walkthrough

Algorithm: PPO with GAE (on-policy, parallel environments, continuous action space)
Input: environments env×E, rollout length T, update epochs K, minibatches M, clip ε=0.2,
       GAE λ=0.95, discount γ=0.99, policy loss weight c_pi=1, value loss weight c_v=0.5, entropy weight c_ent=0.01
Output: policy network π_θ (Gaussian mean, state-independent log-std) and value network V_φ

# ---------- one round: collect data with the current policy ----------
for t = 1..T, for each env e:                        # ① fully parallel
    a_t = π_θ(s_t)                                  # sample a_t from N(μ_θ(s_t), σ²)
    (s_{t+1}, r_t, done_t, trunc_t) = env[e].step(a_t)
    store (s_t, a_t, log π_θ(a_t|s_t), r_t, done_t)
    s_t ← s_{t+1}; if done_t: reset env[e]           # ② do not reset on truncation? see 2.2.3 mask

# ---------- compute advantages and value targets (see 2.2.3) ----------
A_t = GAE(r, V_φ(s), done, γ, λ)
Ret_t = A_t + V_φ(s_t)                              # ③ before standardization
A_t ← (A_t - mean)/std                              # ④ standardize only the policy loss

# ---------- K epochs of minibatch updates ----------
for epoch = 1..K:
    for each minibatch:
        ratio = exp(log π_θ(a|s) - log π_old(a|s))   # ⑤ current policy / old policy
        L_pi  = -min(ratio·A, clip(ratio,1-ε,1+ε)·A).mean()
        L_v   = 0.5·((V_φ(s) - Ret)²).mean()         # ⑥ Ret detached
        L_ent = entropy(π_θ(·|s)).mean()
        L = c_pi·L_pi + c_v·L_v - c_ent·L_ent
        update θ, φ with gradient descent
    early stop if approx_kl > 1.5·target_kl           # ⑦ optional safety valve

Walkthrough:

  1. ① Parallel environments are not an optimization, they are a necessity. On-policy data can be used only once; with a single environment, one round produces only TT samples, of which the variance is terrible. Typically 8–64 environments run in parallel, filling a batch of E×T≈4096E\times T \approx 4096 transitions.
  2. ② Truncation handling. When trunc fires, the environment should be reset as well, but the bootstrap value of the final state must be taken from the value network (see the mask derivation in 2.2.3), and done=0 should be stored.
  3. ③ The order must not be reversed. AA must be computed before Ret\mathrm{Ret}, and Ret\mathrm{Ret} must use the unstandardized AA; otherwise the scale of the value target drifts.
  4. ④ Standardizing only for the policy loss. Advantage standardization makes the effective learning rate insensitive to the reward scale across tasks, which is a prerequisite for “one set of hyperparameters handling many tasks”.
  5. ⑤ The old log-probability must be cached. log π_old is computed and stored at sampling time, never recomputed with the current parameters — otherwise the ratio is identically 1 and clipping never fires.
  6. ⑥ The value target must be detached. Ret\mathrm{Ret} functions as a label; if gradients flow back through it, the value loss forms a self-loop and training collapses within a few dozen rounds (see 2.2.6).
  7. ⑦ Early stopping is optional but strongly recommended. Track the approximate KL between the new and old policies inside the epoch; once it exceeds a threshold (for example 1.5×1.5\times the target), abort the remaining updates of this epoch — the data has been “used up” and further updates are pure damage.

Two implementation details worth noting: PPO usually shares a feature extractor between the policy head and the value head (actor-critic shared trunk), which saves parameters but couple the two losses — if the value loss is clearly dominant (large reward scale), the shared trunk gets skewed toward value prediction and the policy learns slowly. The alternative, separate trunks, costs twice as much but trains more cleanly. Second, log_std should be a learnable but state-independent parameter (one scalar per action dimension), not output by the network; the former is more stable and does not let the exploration noise be dragged around by the state encoding.

2.2.5 detach: Which Quantities in PPO Must Not Have Gradients

detach is a PyTorch operation: it keeps the numerical value of a tensor but takes it out of the computation graph, so that any later operation on it stops gradients from flowing back to the network that produced it. Four quantities in PPO must be treated as constants, and all four describe “the past”:

Quantity that must be detachedWhere it comes fromConsequence if not detached
logp_old (old log-probability)log⁡πθold(at∣st)\log\pi_{\theta_{\text{old}}}(a_t\mid s_t) at sampling timeThe denominator of the probability ratio also carries gradients, which amounts to optimizing the old and the new policy at the same time; the ratio loses the meaning of “how far the new policy has deviated” and the update direction is systematically distorted
v_old (old value estimate)Vϕ(st)V_\phi(s_t) at sampling timeIt enters both GAE and the value label; with gradients, the critic is torn between “computing the advantage” and “regressing the label”
Adv (advantage)Obtained by backward recursion from v_old and the rewardsThe actor loss flows back into the critic through the advantage, so the policy gradient is no longer “differentiating only with respect to θ\theta” and the actor and critic contaminate each other
Ret (value regression label)A^t+vold\hat{A}_t + v_{\text{old}}When minimizing (Vϕ−Ret)2(V_\phi - \text{Ret})^2 both sides move, which is equivalent to chasing a moving target that you built yourself; in extreme cases the gradients cancel and you get a degenerate solution where “the loss is decreasing but the value is not learned”

There is only one test: ask “should this quantity change after this update?” If the answer is “it should not”, it must be detached. The old policy’s probability, the old value, and the advantage and label computed from the old value are all constants during this update.

The most common wrong version in embodied projects (forgetting to cut the graph after sampling in parallel environments):

# Wrong: no no_grad at sampling time, the old values enter the buffer with the whole graph
logp_old = dist.log_prob(a).sum(-1)      # carries gradients
v_old    = v_net(s)                      # carries gradients
buf.store(s, a, r, done, logp_old, v_old)

# Right: build no graph during sampling, and detach explicitly once more before storing
with torch.no_grad():
    dist     = policy(s)
    logp_old = dist.log_prob(a).sum(-1)
    v_old    = v_net(s)
buf.store(s, a, r, done, logp_old.detach(), v_old.detach())

Three details that are easily confused:

  1. torch.no_grad() and .detach() are not the same thing. The former stops graph construction for a whole block of computation (saving memory and time, suitable for sampling); the latter only cuts the history of one tensor, and later operations on it can still build a graph. At sampling time wrap the forward pass in no_grad, then detach once more on the tensors being stored — belt and braces.
  2. Never wrap logp_new and v_new in no_grad during the update phase. These two must carry gradients; otherwise the whole loss has no gradient and training silently stops working (the symptom is a constant loss and parameters that never move).
  3. Detaching v_old does not affect the numerical correctness of GAE. GAE only uses the value of voldv_{\text{old}} to compute δt\delta_t and A^t\hat{A}_t and does not need to differentiate through it; it is regressed as a label, which also needs no differentiation. What does need gradients is vnewv_{\text{new}}, obtained by a fresh forward pass during the update phase.

If the actor and the critic share a vision backbone (very common in embodied tasks, because image encoders are expensive), there is one more constraint: the shared part may receive gradients only through the v_new and logp_new paths; v_old, Adv, and Ret must not flow back through it. The practical approach is “shared backbone + two independent heads”, with the value loss scale-normalized and the gradient norms of both heads monitored; when tuning becomes painful, splitting into two separate networks is actually less trouble.

2.2.6 PPO Common-Pitfall Checklist (Embodied Edition)

Compressing the derivations above into one troubleshooting table, ordered by how often the problems appear in embodied projects:

SymptomLikely causeFix
Collapses early in training, actions become deterministicLearning rate too large, K too large, ϵ\epsilon too largeDrop the learning rate to the 3×10−43\times10^{-4} order, set K to 3–10 and ϵ\epsilon to 0.1–0.2, and monitor the k3 KL
Value loss will not go downMonte Carlo return used as the label, label not detached, standardized advantage used to build the labelUse A^+Vold\hat{A}+V_{\text{old}}; detach the label; standardize only for the actor
Advantage jumps at episode boundariesdone and truncated not separated, the mask multiplied in only one placeStore the two flags separately, use only done inside GAE, and multiply the mask in both places
Probability ratio stays far from 1logp_old recomputed during the update, or the old value never storedStore logp_old at sampling time and detach it; use exp(logp_new - logp_old) instead of dividing probabilities
Monitored KL goes negativeE[log⁡πold−log⁡πθ]\mathbb{E}[\log\pi_{\text{old}}-\log\pi_\theta] was usedSwitch to the k3 estimator E[r−1−log⁡r]\mathbb{E}[r-1-\log r], which is always non-negative
Good in simulation, shaky on the real robotObservations not normalized, actions not bounded, control rate inconsistent with trainingrunning mean/std normalization; scale actions after tanh by the real limits; unify the frequency and compensate for latency
Training unstable but nothing looks wrongReward magnitude too large, no return normalizationReward scaling / return standardization, with GAE and the value target using the same scale
Fine manipulation will not learnThe exploration noise of the Gaussian policy shows up as random jitter at the end effectorLower the initial log_std and set a floor; or switch to SAC / initialize from demonstrations
Performance varies wildly across parallel environmentsRandom seeds / initial states not randomized, environment parameters not randomizedRandomize the initial state and environment parameters each episode (see domain randomization in Chapter 6)
Better and better on the same batch, worse and worse on the real robotNo early stopping, K too large so it overfits old dataAdd KL early stopping (break out once it exceeds 1.5× the target KL), or use an adaptive ϵ\epsilon

“Action bounding” deserves a separate note: the PPO policy is usually a Gaussian, and sampled actions may exceed the joint limits. Clipping directly to the limits teaches the policy a degenerate “pressed against the boundary” solution (the gradient is zero at the boundary, so the policy never learns that pushing further is useless); the standard approach is to push the Gaussian sample through tanh into (−1,1)(-1,1), then scale it linearly by the real upper and lower bounds, while subtracting the tanh Jacobian term from log_prob — exactly the same as in SAC (see 2.3.2).

2.2.7 PPO versus TRPO

DimensionTRPO (Trust Region Policy Optimization)PPO (Proximal Policy Optimization)
ConstraintHard KL constraint DKL≤δD_{\mathrm{KL}}\le\deltaProbability-ratio clipping (soft constraint)
SolverConjugate gradients + line search (second-order approximation)Standard gradient descent (first-order)
Implementation complexityHigh (the Fisher matrix and conjugate gradients both have to be right)Low (one forward, one clip, one backward)
Reuse of each data batchUsually onceK epochs, several times
StabilityGood, but sensitive to step size and approximation errorGood, and easier to tune
Fit for large-scale parallelismFairExcellent (EE environments scale linearly)
Practical popularityAcademic benchmarks and theoretical analysisEngineering default; the workhorse of embodied AI / games / RLHF

There are three common PPO variants: PPO-Clip (used in this article, the most common), PPO-Penalty (put the KL into the loss with an adaptively adjusted penalty coefficient), and the adaptive KL coefficient version (dynamically adjust ϵ\epsilon or the penalty coefficient according to the ratio of the actual KL to the target KL). More than nine out of ten embodied projects use PPO-Clip, because it has a single hyperparameter ϵ\epsilon and is insensitive to the reward scale.

2.2.8 Applicability: Where PPO Belongs in Embodied AI

PPO’s boundary is clear: large-scale parallel sampling is possible, a reward can be defined, actions may be continuous or discrete, and extreme sample efficiency is not required.

ScenarioSuitable for PPOWhy and recommendation
Humanoid locomotion in simulationVery suitableThousands of parallel environments make E×TE\times T sampling cheap; rewards (forward speed, posture penalties) are easy to write
Coarse policy pretraining for quadrupeds / arms in simulationVery suitableUse PPO to learn a robust initial policy at scale in simulation, then fine-tune on the real robot
Dexterous-hand fine manipulation (pegs, screws)FairExploration noise becomes jitter at the end effector and sample efficiency is low; initialize from demonstrations or switch to SAC/DP
Online learning on a real robot (every interaction is expensive)Not suitableOn-policy and data is discarded after one use; millions of interactions are unaffordable on hardware; switch to SAC or imitation learning
Plenty of offline demonstrations but no rewardNot suitablePPO needs a reward and environment interaction; use behavior cloning / ACT / Diffusion Policy
Sparse reward requiring long-horizon reasoningWeakWeak exploration, easily stuck; needs curriculum learning, reward shaping, or a world model
High-frequency force control (>100 Hz)Not suitablePolicy forward pass plus communication latency cannot keep up; use low-level controllers with a low-frequency policy layer

This yields a practical division of labor for embodied projects: use PPO in simulation to train “motion capability” (walking, running, standing up, resisting disturbance), use imitation learning on the real robot to acquire “manipulation skills” (pick, place, insert), and connect the two with domain randomization and real-world fine-tuning. This is also why the learning path in Chapter 8 puts PPO in stage 1 and ACT/DP in stage 2.

2.3 SAC: Writing “Exploration” into the Objective Function

Soft actor-critic (Soft Actor-Critic, SAC) is an off-policy (off-policy, meaning historical data can be reused) maximum-entropy RL algorithm. It changes the objective from “maximize return” to “maximize return + policy entropy”:

J(π)=Eτ∼π[∑tγt(rt+α H(π(⋅∣st)))]J(\pi) = \mathbb{E}_{\tau\sim\pi}\left[\sum_t \gamma^t\left(r_t + \alpha\,\mathcal{H}\left(\pi(\cdot|s_t)\right)\right)\right]

where H(π(⋅∣s))=−Ea∼πlog⁡π(a∣s)\mathcal{H}(\pi(\cdot|s)) = -\mathbb{E}_{a\sim\pi}\log\pi(a|s) is the policy entropy, and α\alpha is the temperature coefficient (controlling the weight of “exploration” relative to “return”).

Derivation: The soft Bellman equation, soft policy iteration, and the reparameterized gradient

Step 1: why add entropy. Under a pure return objective the optimal policy is often deterministic (pick a single action in a given state), and once noise pushes that action off target there is no fallback. With entropy, the objective prefers policies that “keep diversity among several good actions”; exploration then happens naturally, and robustness to model error improves. In the extreme α→∞\alpha\to\infty the policy approaches a uniform distribution (pure exploration), and α→0\alpha\to0 degenerates into standard RL.

Step 2: the soft value function. Define the soft Q function so that

Qsoft(s,a)=r(s,a)+γ Es′[Vsoft(s′)]Q_{\text{soft}}(s,a) = r(s,a) + \gamma\,\mathbb{E}_{s'}\left[V_{\text{soft}}(s')\right]

where the soft state value is a log-sum-exp soft maximum over all actions in state ss:

Vsoft(s)=αlog⁡∫exp⁡(1αQsoft(s,a))daV_{\text{soft}}(s) = \alpha\log\int \exp\left(\frac{1}{\alpha}Q_{\text{soft}}(s,a)\right)da

For discrete actions it is V(s)=αlog⁡∑aexp⁡(Q(s,a)/α)V(s)=\alpha\log\sum_a \exp(Q(s,a)/\alpha). As α→0\alpha\to 0 this degenerates into max⁡aQ(s,a)\max_a Q(s,a); as α\alpha grows, more actions are counted in — this is exactly what “soft” means: not a hard maximum, but a temperature-smoothed maximum.

Step 3: soft policy improvement. It can be shown that the optimal policy is a Boltzmann distribution:

π∗(a∣s)∝exp⁡(1αQsoft(s,a))\pi^*(a|s) \propto \exp\left(\frac{1}{\alpha}Q_{\text{soft}}(s,a)\right)

The idea of the proof: extremize Ea∼π[Q]+αH(π)\mathbb{E}_{a\sim\pi}[Q] + \alpha\mathcal{H}(\pi) under the constraint ∫π=1\int \pi = 1 with a Lagrange multiplier; differentiating with respect to π\pi gives log⁡π(a∣s)=Q(s,a)/α+const\log\pi(a|s) = Q(s,a)/\alpha + \text{const}, and rearranging completes it.

Step 4: why this expression is not used directly in engineering. In a continuous action space, integrating or summing over all actions is infeasible. SAC therefore uses two tricks: (1) reparameterized sampling — a=tanh⁡(μθ(s)+σθ(s)⊙ϵ)a = \tanh(\mu_\theta(s) + \sigma_\theta(s)\odot\epsilon), ϵ∼N(0,I)\epsilon\sim\mathcal{N}(0,I), moving the randomness to ϵ\epsilon, which is independent of the parameters, so that gradients can pass through the sampling; (2) twin Q networks with a minimum to suppress overestimation (see the next paragraph).

Step 5: the reparameterized gradient. For

Jπ(θ)=Es,ϵ[αlog⁡πθ(a∣s)−Qϕ(s,a)]a=tanh⁡(μθ(s)+σθ(s)⊙ϵ)J_\pi(\theta)=\mathbb{E}_{s,\epsilon}\left[\alpha\log\pi_\theta(a|s) - Q_\phi(s,a)\right]_{a=\tanh(\mu_\theta(s)+\sigma_\theta(s)\odot\epsilon)}

differentiate directly with respect to θ\theta, because aa is a deterministic function of θ\theta (all the randomness lives in ϵ\epsilon). Note that the tanh⁡\tanh compression changes the probability density, so the Jacobian correction term −∑ilog⁡(1−tanh⁡2(ui))-\sum_i\log(1-\tanh^2(u_i)) is needed — this is why log_prob has to subtract that term in the pseudocode.

Step 6: twin Q to suppress overestimation. Take the smaller of the two Q-network outputs:

y=r+γ(min⁡i=1,2Qϕi(s′,a′)−αlog⁡π(a′∣s′)),a′∼π(⋅∣s′)y = r + \gamma\left(\min_{i=1,2}Q_{\phi_i}(s',a') - \alpha\log\pi(a'|s')\right),\quad a'\sim\pi(\cdot|s')

A single Q network feeds “lucky overestimates” back into the next round during bootstrapping, and the error keeps growing (the max operator has a systematic positive bias); taking the min significantly reduces that bias.

Step 7: automatic temperature adjustment. Treat α\alpha as a parameter too, with the objective

J(α)=Ea∼π[−α(log⁡π(a∣s)+Hˉ)]J(\alpha)=\mathbb{E}_{a\sim\pi}\left[-\alpha\left(\log\pi(a|s) + \bar{\mathcal{H}}\right)\right]

where Hˉ\bar{\mathcal{H}} is the target entropy, often taken as −dim⁡(A)-\dim(\mathcal{A}) for continuous control. Intuition: if the current policy entropy is below the target entropy (under-exploration), the gradient increases α\alpha and forces the policy to be more random; otherwise it lowers α\alpha and allows the policy to be more deterministic.

2.3.1 SAC Pseudocode and Walkthrough

Algorithm: SAC (continuous actions, automatic temperature)
Networks: policy π_θ (mean + standard deviation, tanh squashing), two Q networks Q_φ1/Q_φ2, target Q networks Q_φ1'/Q_φ2'
Hyperparameters: discount γ, soft-update coefficient τ, batch size B, learning rate, target entropy H_bar = -dim(A), initial α
Buffer: replay buffer D (large enough capacity, reusable across episodes)

for step = 1 .. max_steps:
    # ---------- 1. interact and store ----------
    a = tanh(μ_θ(s) + σ_θ(s)·ε)          # ε ~ N(0, I)
    s', r, done = env.step(a)
    D.push(s, a, r, s', done); s ← s'
    if s is the start of an episode: sample B transitions from D and go to the update

    # ---------- 2. compute the target value (no gradients) ----------
    a'   = tanh(μ_θ(s') + σ_θ(s')·ε')                        # sample from the current policy
    logp'= log π_θ(a'|s') - Σ log(1 - tanh²(u'))             # with the tanh Jacobian correction
    y    = r + γ·(1-done)·( min(Q_φ1'(s',a'), Q_φ2'(s',a')) - α·logp' )

    # ---------- 3. update the two Q networks ----------
    for i in {1, 2}:
        L_Q_i = 0.5·( Q_φi(s,a) - stop_grad(y) )²
        gradient descent update φ_i

    # ---------- 4. update the policy ----------
    a_π   = tanh(μ_θ(s) + σ_θ(s)·ε)                           # reparameterized
    logp  = log π_θ(a_π|s) - Σ log(1 - tanh²(u_π))
    L_π   = ( α·logp - min(Q_φ1(s,a_π), Q_φ2(s,a_π)) ).mean()
    gradient descent update θ

    # ---------- 5. update the temperature ----------
    L_α = -( α·( logp.detach() + H_bar ) ).mean()
    gradient descent update α (often parameterized as log α to keep it positive)

    # ---------- 6. soft-update the target networks ----------
    φ_i' ← τ·φ_i + (1-τ)·φ_i'      # τ ≈ 0.005

Walkthrough:

  1. The value of being off-policy. Because of the replay buffer (experience replay pool), one piece of data can be reused repeatedly, so sample efficiency is an order of magnitude higher than PPO; the price is that “off-policy correction” is needed (SAC achieves it naturally through Q learning and does not need importance sampling).
  2. Twin Q + taking the min. min(...) is the core of SAC’s stability; do not keep only one to save memory.
  3. The tanh Jacobian term. Omitting -Σ log(1 - tanh²(u)) miscalculates the policy density, which shows up as alpha drifting on its own and the policy becoming more and more deterministic. This is the most common hidden bug in SAC implementations.
  4. Soft update of the target networks. Too large a τ\tau makes the target unstable; too small and learning lags. 0.005 is a common starting point.
  5. Why it can be used on real hardware. Reusable offline data + automatic exploration make SAC suitable for “expensive interaction but offline-training-friendly” scenarios (such as servo-level control of a real robotic arm).
  6. SAC’s shortcomings: sensitive to the reward scale (normalization required), exploration is still a bottleneck on long-horizon sparse-reward tasks, and the expressiveness of multi-modal action distributions is limited (a Gaussian policy can only be unimodal).

2.3.2 detach and the tanh Jacobian: The Two Easiest Things to Get Wrong in SAC

SAC’s gradient flow is more complex than PPO’s, because it has both “online network” and “target network” parameters at the same time, plus a path that goes through policy sampling. Listing the checklist by “who should receive gradients”:

QuantityShould it have gradientsExplanation
y (TD target: r+γ(min⁡Q′−αlog⁡π)r+\gamma(\min Q'-\alpha\log\pi))Must stop_gradIt is a label. With gradients the Q network chases itself
a′a' inside log⁡π(a′∣s′)\log\pi(a'\mid s')Must stop_grad (with respect to the action)The action in the target only needs its value. If gradients were allowed to flow back, the Q loss would optimize the policy at the same time and the two objectives would fight each other
logp.detach() entering the temperature lossMust detachThe temperature only needs “the gap between the current entropy and the target entropy” and should not backpropagate to the policy through it
Qϕ(s,aπ)Q_\phi(s,a_\pi) entering the policy lossMust carry gradients, but only up to the policyOften written as min(Q1,Q2) and then detach-ed once for temperature monitoring; it must be kept in the policy loss
Target network parameters ϕ′\phi'Do not participate in backpropagationUpdate only by soft update ϕ′←τϕ+(1−τ)ϕ′\phi'\leftarrow\tau\phi+(1-\tau)\phi'; do not put them in the optimizer

A typical mistake is “forgetting stop_grad on the target value”; it is well concealed in code, because the loss still decreases — it just converges to the wrong point:

# Wrong: gradients on the target side, the Q networks chase themselves
a2, logp2 = policy.sample(s2)
y = r + gamma * (1 - done) * (q_target_min(s2, a2) - alpha * logp2)
loss_q = ((q1(s, a) - y) ** 2).mean() + ((q2(s, a) - y) ** 2).mean()

# Right: detach the whole target side
with torch.no_grad():
    a2, logp2 = policy.sample(s2)
    y = r + gamma * (1 - done) * (q_target_min(s2, a2) - alpha * logp2)
loss_q = ((q1(s, a) - y) ** 2).mean() + ((q2(s, a) - y) ** 2).mean()

The tanh Jacobian correction is the second guaranteed mistake. The policy squashes the action as a=tanh⁡(u)a=\tanh(u) with u∼N(μ,σ2)u\sim\mathcal{N}(\mu,\sigma^2). The probability density has to be converted with the change-of-variables formula:

log⁡π(a∣s)=log⁡N(u;μ,σ2)−∑ilog⁡(1−tanh⁡2(ui))\log\pi(a\mid s)=\log\mathcal{N}(u;\mu,\sigma^2)-\sum_{i}\log\left(1-\tanh^2(u_i)\right)

The second term is exactly the logarithm of the Jacobian determinant. The consequence of omitting it is not an immediate error but a mismatch between the numerical value of the policy density and the actual sampling distribution: the entropy term in the policy loss is computed wrongly and the temperature α\alpha drifts in the wrong direction, showing up as “after a few hundred rounds of training the policy inexplicably becomes more and more deterministic and then gets stuck”. On the curves this bug looks very much like “exploration decaying too fast”, which makes it extremely hard to diagnose.

There is one more numerical detail: when uu is large, 1−tanh⁡2(u)1-\tanh^2(u) underflows to 0 and log(0) gives -inf. In engineering, either clip uu to (−10,10)(-10,10) beforehand, or use the equivalent stable form

log⁡(1−tanh⁡2(u))=2(log⁡2−log⁡(1+e−2∣u∣)−∣u∣)\log\left(1-\tanh^2(u)\right)=2\left(\log 2-\log\left(1+e^{-2|u|}\right)-|u|\right)

Most frameworks (such as Stable-Baselines3) already handle this internally; when writing it by hand you must take care of it yourself.

2.3.3 SAC Implementation-Pitfall Checklist

SymptomLikely causeFix
Q values explode or divergeTarget value not detached, only one of the twin Q used, target network τ\tau too largeWrap the target computation in no_grad; keep twin Q with min; start τ\tau at 0.005
The policy becomes more and more deterministic and finally gets stucktanh Jacobian term missing, log_std has no lower boundAdd −∑ilog⁡(1−tanh⁡2ui)-\sum_i\log(1-\tanh^2 u_i); clip log_std into something like [−5,−1][-5,-1]
α\alpha increases monotonically to a huge valueTarget entropy set wrong (sign or scale), reward scale too largeUse Hˉ=−dim⁡(A)\bar{\mathcal{H}}=-\dim(\mathcal{A}) for continuous control; normalize the reward first
α\alpha drops close to 0 and exploration is lostThe policy entropy estimate is too high (wrong sign of the Jacobian term)Check the sign: the squashed density should be smaller, so the Jacobian term is “subtracted”
Performance drops sharply after switching tasksToo high a proportion of old-task data in the replay buffer, not clearedClear the buffer when switching tasks, or sample stratified by task
Action jitter on a real robotThe policy mean output is not bounded, control frequency too lowScale the action by the real limits after tanh; raise the control frequency or add action low-pass filtering
Almost no learning in the early phaseReplay buffer not warmed up, too little initial random dataExplore randomly for a few thousand steps before starting updates
Multi-modal tasks learned as an “average action”A Gaussian policy can only be unimodalSwitch to a mixture-density policy, a diffusion policy, or initialize from demonstrations
The value function learns slowly while the policy keeps changingQ not detached from the policy inside the policy loss, or the critic learning rate is too lowDifferentiate the policy loss only with respect to θ\theta; raise the critic learning rate or adjust the loss weights

2.3.4 Applicability: Where SAC Belongs in Embodied AI

ScenarioSuitable for SACWhy and recommendation
Servo-level control of a real robotic armSuitableHistorical data can be reused, an obvious advantage when interaction is expensive; warm up the replay buffer with demonstration data
Tasks sensitive to sample efficiency in simulationSuitableConverges within 10510^5 steps, far fewer than PPO’s 10610^6
High-frequency continuous actions (joint velocity/torque)SuitableUnimodal Gaussian + tanh squashing; inference needs only one forward pass
Needing large-scale parallelism (thousands of environments)FairUpdates are a serial bottleneck and throughput is worse than PPO; consider parallel sampling + asynchronous updates
Sparse reward, long-horizon tasksWeakMaximum-entropy exploration still gets stuck under sparse rewards; HER (Hindsight Experience Replay, hindsight experience replay) or curriculum learning is needed
Multi-modal action distributions (going left or right are both reasonable)WeakThe Gaussian policy collapses into an average action; switch to Diffusion Policy or a mixture-density head
Purely offline data, no online interactionUsable but needs modificationStandard SAC requires online interaction; purely offline scenarios should use offline RL such as CQL/IQL

One sentence for the division of labor between the two: PPO trades “parallelism” for samples, SAC trades “reuse” for samples. In simulation parallelism is cheap, so choose PPO; on a real robot interaction is expensive, so choose SAC. Neither is the best answer for “manipulation skills” — when demonstrations exist, ACT/DP have sample efficiency another order of magnitude higher (Chapter 3).

2.4 How to Choose Between PPO and SAC

DimensionPPOSAC
Data usageOn-policy, discarded after one useOff-policy, reusable
Sample efficiencyLow (10610^6 steps)High (10510^5 steps)
Parallel scalingExcellent (EE environments scale linearly)Fair (updates are the serial bottleneck)
Hyperparameter sensitivityMedium (clip, KL, epochs)High (temperature, reward scale, τ)
ExplorationGaussian noise (weak)Maximum entropy (strong)
Discrete actionsSupported (needs special handling)Supported but needs tricks (Gumbel-Softmax)
Typical useLarge-scale parallel simulation training, humanoid locomotionFine real-robot control, scenarios with sufficient offline data

One-line selection: in simulation, if hundreds of parallel environments can be launched → PPO; if data is expensive, must be reused, and exploration matters → SAC. The two often coexist in an embodied system: the upper layer uses PPO to train locomotion skills, the lower layer uses SAC to train fine end-effector manipulation.

2.5 Beginner Experiment Checklist for the Basic Layer

Reading without practicing is the same as not learning. It is recommended to finish these three experiments in order (all can be run on a single machine):

  1. Run PPO on MuJoCo HalfCheetah to a return of 4000+: the goal is to master the trio of parallel sampling, GAE, and observation normalization.
  2. Reach the target with fewer steps using SAC on the same task: compare sample efficiency and feel the power of the replay buffer for yourself.
  3. Multiply the reward scale by 10 and train again: observe SAC collapsing while PPO is affected less — this will make you genuinely understand why “reward normalization” matters.

3. Skill Layer: Imitation Learning — How to Learn Fast When Demonstrations Are Available

3.1 The Inherent Flaw of Behavior Cloning: Compounding Error

Behavior cloning (Behavior Cloning, BC) is the most straightforward form of imitation learning: treat the demonstrations (ot,at)(o_t, a_t) as supervised-learning sample pairs, train a network to output actions, and use mean squared error or cross entropy as the loss:

LBC(θ)=E(o,a)∼D[∥πθ(o)−a∥2]\mathcal{L}_{\text{BC}}(\theta) = \mathbb{E}_{(o,a)\sim\mathcal{D}}\left[\|\pi_\theta(o) - a\|^2\right]

It performs very well on the training set but often “starts out fine and drifts further and further off” at deployment. The cause is not overfitting but distribution shift (covariate shift): once the policy deviates from the demonstration distribution it enters states that never appeared in the demonstrations, and the network has never learned “how to correct” in those states.

Derivation: Why the error of behavior cloning grows quadratically with episode length (O(εT²))

Assume the single-step prediction error is bounded, ∥π(o)−a∥≤ϵ\|\pi(o)-a\| \le \epsilon, and assume the policy’s error accumulates by some factor.

Step 1: one-step deviation. At step tt the policy action differs from the demonstration action by ϵ\epsilon, which shifts the state distribution by roughly ϵ\epsilon (first-order approximation).

Step 2: error amplification. A state shift of ϵ\epsilon in turn increases the action error of the next step by another ϵ\epsilon, so the cumulative deviation at step tt is bounded by roughly tϵt\epsilon.

Step 3: total cost. The cumulative deviation of the whole trajectory (for example the total position error) is

∑t=1Ttϵ=ϵT(T+1)2=O(ϵT2)\sum_{t=1}^{T} t\epsilon = \epsilon\frac{T(T+1)}{2} = O(\epsilon T^2)

Conclusion: the single-step error is ϵ\epsilon, the error of the whole trajectory is ϵT2\epsilon T^2 — this is quadratic amplification, not linear. It explains why BC is usable on short episodes (grasping, pressing a button) and collapses quickly on long episodes (folding clothes, long-distance navigation).

Mitigation ideas (corresponding to each algorithm that follows):

  • Give the policy a training signal also on “its own error states” → DAgger (Dataset Aggregation, letting the expert label actions again on the states the policy itself reaches), which requires continuous human intervention.
  • Do not predict the action step by step; predict a chunk of actions → ACT’s action chunking.
  • Do not output a single-point action; output a multi-modal distribution and sample from it → Diffusion Policy.
  • Use closed-loop feedback + high-frequency replanning to shorten the time span of each prediction → the action chunk + replanning of VLA.

3.2 ACT: Action Chunking + Temporal Ensembling

The action chunking transformer (Action Chunking with Transformers, ACT) was proposed by a Stanford team in 2023 and is the de facto standard for imitation learning on low-cost robotic arms. It has two core designs:

  1. Action chunking: instead of predicting a single-step action, predict a sequence of actions for the next kk steps in one go (k=100k=100 is common). This shortens the effective episode length to 1/k1/k of the original and reduces the O(ϵT2)O(\epsilon T^2) compounding error to O(ϵ(T/k)2)O(\epsilon (T/k)^2) — the quadratic term drops by a factor of k2k^2 directly.
  2. Temporal ensembling: predicting only once every kk steps causes noticeable pauses at inference time; ACT instead predicts a chunk at every time step and takes a weighted average over the overlapping parts, which is both smooth and reduces jitter.

In addition, it uses a conditional variational autoencoder (Conditional Variational Autoencoder, CVAE) to handle the multi-modality of human demonstrations (in the same scene a human might grasp with the left hand or the right hand; direct regression would learn the average of the two — an action that resembles neither).

Derivation: The evidence lower bound (ELBO) of the CVAE, and why it can express multi-modal actions

Let the observation be oo (including history frames and joint states), the action chunk be aa, and introduce a latent variable zz representing “which style/intent this demonstration adopts”. The generative model is p(a∣o,z)p(a|o,z) and the encoder (posterior) is qϕ(z∣o,a)q_\phi(z|o,a).

Step 1: write the log-likelihood.

log⁡p(a∣o)=log⁡∫p(a∣o,z)p(z∣o) dz\log p(a|o) = \log \int p(a|o,z)p(z|o)\,dz

Direct integration is infeasible (the latent space is high-dimensional).

Step 2: introduce an arbitrary posterior and decompose. Multiply and divide by qϕ(z∣o,a)q_\phi(z|o,a):

log⁡p(a∣o)=log⁡Ez∼qϕ[p(a∣o,z)p(z∣o)qϕ(z∣o,a)]\log p(a|o) = \log \mathbb{E}_{z\sim q_\phi}\left[\frac{p(a|o,z)p(z|o)}{q_\phi(z|o,a)}\right]

By Jensen’s inequality (the concavity of the logarithm) this gives the lower bound:

log⁡p(a∣o)≥Ez∼qϕ[log⁡p(a∣o,z)]−DKL(qϕ(z∣o,a) ∥ p(z∣o))\log p(a|o) \ge \mathbb{E}_{z\sim q_\phi}\left[\log p(a|o,z)\right] - D_{\mathrm{KL}}\left(q_\phi(z|o,a)\,\|\,p(z|o)\right)

The equality holds only when qϕ(z∣o,a)=p(z∣o,a)q_\phi(z|o,a)=p(z|o,a), that is, when the encoder is exactly the true posterior — this is what “variational” means: approximating an intractable posterior with a learnable distribution.

Step 3: reparameterization. If qϕ(z∣o,a)=N(μϕ,σϕ2)q_\phi(z|o,a)=\mathcal{N}(\mu_\phi,\sigma_\phi^2) is taken and sampling is done as z=μϕ+σϕ⊙ϵz=\mu_\phi+\sigma_\phi\odot\epsilon (ϵ∼N(0,I)\epsilon\sim\mathcal{N}(0,I)), gradients can pass through the sampling process, so the encoder and decoder can be trained jointly.

Step 4: why the multi-modality problem is solved. During training, zz extracts information from “which style the current demonstration belongs to”; at inference time zz is sampled from the prior N(0,I)\mathcal{N}(0,I) — each sample amounts to “choosing a style”, and the decoder generates an action chunk in that style accordingly. The model therefore learns a multi-modal conditional distribution instead of averaging several modes into one collapsed mode. Fixing zz at its mean (equivalent to removing the CVAE) noticeably degrades performance; this is one of the core conclusions of ACT’s ablation experiments.

Step 5: the actual loss. The training objective is

L=∥a^−a∥1⏟reconstruction+β DKL(qϕ(z∣o,a) ∥ N(0,I))\mathcal{L} = \underbrace{\|\hat a - a\|_1}_{\text{reconstruction}} + \beta\,D_{\mathrm{KL}}\left(q_\phi(z|o,a)\,\|\,\mathcal{N}(0,I)\right)

Note that the prior is taken as the standard normal (rather than p(z∣o)p(z|o)), so the KL term has an analytic form, and in practice one directly computes the closed-form KL between two Gaussians. β\beta controls how much information the latent variable carries; 1–10 is common.

Derivation: Why temporal ensembling uses exponential weighting, and how it suppresses jitter

Suppose there is one prediction at every time step, giving several estimates of action ata_t (from chunks with different starting instants). The simple approach is to take the arithmetic mean of all predictions covering ata_t:

aˉt=1∣St∣∑i∈Sta^t(i)\bar a_t = \frac{1}{|S_t|}\sum_{i\in S_t}\hat a_t^{(i)}

But different predictions have different “freshness”: a chunk predicted just now and a chunk predicted long ago are not equally reliable. ACT uses exponential weighting:

aˉt=∑iwi a^t(i)∑iwi,wi=e−m i\bar a_t = \frac{\sum_{i} w_i\,\hat a_t^{(i)}}{\sum_i w_i},\qquad w_i = e^{-m\,i}

where ii is “the age of that prediction relative to the current instant” and mm is the decay coefficient.

Why it works: for each prediction source, the error can be decomposed into “systematic bias + random jitter”. The weighted average reduces random jitter by 1/n1/\sqrt{n}; the exponential weights let the newest prediction dominate, which keeps the response fast to abrupt changes (an object slipping). If mm is too large → it degenerates into single-chunk prediction and the jitter comes back; if mm is too small → over-smoothing and lagging response. Common values of mm are between 0.01 and 0.1 and need tuning according to the control frequency.

Relation to action chunking: without ensembling, replanning every kk steps makes the control command jump at chunk boundaries (because two adjacent predictions are not exactly consistent), which shows up as “stuttering”. Ensembling smooths the jumps away; this is why ACT is noticeably smoother on real hardware than “naive chunking”.

3.2.1 ACT Pseudocode and Walkthrough

Training phase:
Input: demonstration dataset D = {(o_{t}, a_{t:t+k})}, chunk length k, history length H
Networks: vision backbone (ResNet/ViT) → history encoder (Transformer) → CVAE encoder/decoder
          → action decoder (Transformer, outputs k×action_dim)

for each batch:
    o   = frames and proprioceptive states from t-H+1 .. t     # history window
    a   = the demonstrated a_{t:t+k}                           # target action chunk
    μ, σ= CVAE encoder(o, a)                                   # the future action is visible during training
    z   = μ + σ·ε                                              # ε ~ N(0,I)
    a_hat = action decoder(history encoding(o), z)
    L = L1(a_hat, a) + β·KL( N(μ,σ²) || N(0,I) )
    backpropagate and update all parameters

Inference phase (control frequency 50 Hz, k=100, i.e. one chunk every 2 seconds):
cache the chunks from the most recent predictions, recording their “age”
every k steps (or every time step, depending on compute):
    z ~ N(0, I)                                   # sample one style each time
    a_hat = action decoder(history encoding(H most recent frames), z)   # one forward pass yields k steps
    write a_hat into the cache
at each control step t:
    a_t = exponentially weighted average over all cached chunks covering t
    send a_t to the low-level controller (position/velocity servo)

Walkthrough:

  1. Training sees the future action, inference does not. The CVAE encoder takes (o,a)(o,a) as input, where aa is the future chunk — available only during training; at inference time only oo is available and zz is sampled. This is a typical example of “training–inference asymmetry” (similar to the prior of a VAE-based language model).
  2. L1 rather than L2. Action sequences often contain abrupt changes (the instant of grasping), and L2 over-smooths these critical points; L1 is more robust to outliers. Measured results show L1 is clearly better.
  3. The history encoder cannot be omitted. A single frame cannot reveal velocity or occlusion history; ACT uses a Transformer to encode the most recent frames + proprioceptive state. The history length is an important hyperparameter (too short and velocity cannot be inferred, too long and latency increases).
  4. The trade-off of chunk length kk. Large kk → more compounding-error reduction and cheaper inference, but slower response to environment changes and more open-loop error accumulation inside the chunk; small kk → fast response, but it degrades back into step-by-step BC. k=100k=100 @ 50 Hz ≈ 2 seconds is a common compromise. The faster the task (such as catching a frisbee), the smaller kk should be.
  5. The inference latency budget. One ACT forward pass has to produce 100 steps, so the model cannot be too large; in practice a ResNet-18-level backbone + a small Transformer is often used, achieving 10–30 ms on Jetson-level compute.
  6. What it cannot solve. ACT is still reliable only near the demonstration distribution and fails on entirely new objects/lighting; it also has no “error correction” capability. This is exactly where VLA pretraining or RL fine-tuning has to fill in.

3.2.2 Gradient-Flow Checklist: Which Paths in ACT Must Have Gradients and Which Must Not

ACT’s structure is simpler than the RL algorithms above (pure supervised learning, no bootstrapped target), but the introduction of the CVAE makes the gradient flow have two easy-to-err points:

PathGradient requirementReason
Reconstruction loss L1(a^,a)\mathcal{L}_{1}(\hat a, a) → decoderRequiredThis is the main learning signal
Reconstruction loss → CVAE encoderRequired (through reparameterization)The encoder must learn “extract action-relevant information” from the reconstruction gradient
KL term → encoderRequiredPulls the posterior toward the standard normal so that sampling from the prior works at inference
KL term → decoderShould not existThe KL is defined between two distributions and the decoder does not participate; if the decoder input is mistakenly included in the KL, action fitting slows down
zz at inference timeNo gradient neededSampled directly from N(0,I)\mathcal{N}(0,I), not part of any optimization
Action target aaConstantA label, which naturally needs no gradient (a tensor rather than a network output suffices)

What really deserves emphasis is the training–inference asymmetry: during training zz comes from the posterior q(z∣o,a)q(z\mid o,a), at inference zz comes from the prior N(0,I)\mathcal{N}(0,I). If the KL weight β\beta is too small, the posterior hardly degenerates toward the prior, the zz sampled at inference does not match the distribution seen during training, and the symptom is “very low training loss but strange actions on the real robot”. Conversely, if β\beta is too large, the information carried by zz is squeezed out, the CVAE degenerates into ordinary regression, and the multi-modal expressiveness disappears.

A practical check: after training, measure the utilization of each zz dimension (variance per dimension). If the variance of the vast majority of dimensions is close to 0, β\beta is too large or the encoder capacity is insufficient; if the posterior mean differs enormously from the prior (a very large KL), β\beta is too small. The original ACT paper balances this with “fixed β\beta + linear warm-up”; in practice β\beta between 1 and 10 with action-dimension scaling suffices.

One more often-ignored point: image augmentation must not change the action labels. When applying random cropping/color jitter to images, the action labels must stay unchanged; if the augmentation is a “geometric transform”, the action coordinates must be transformed correspondingly, otherwise the model is being fed wrong supervision. This kind of bug shows up on the training set as “loss decreases but real-robot accuracy is an order of magnitude worse”.

3.2.3 ACT Implementation-Pitfall Checklist

SymptomLikely causeFix
Action jumps at chunk boundariesTemporal ensembling weights set wrong, chunks not overlappingUse exponential weighting (newer chunks get higher weight); make adjacent chunks overlap by at least half
Real robot lags, response is sluggishChunk length kk too large, history window too long, inference frequency too lowShorten kk (20–30 for fast tasks); keep history to 1–2 seconds; raise the inference frequency
Very low training loss but real-robot failureCVAE posterior/prior mismatch (β\beta too small), insufficient history windowRaise β\beta or use KL warm-up; lengthen the history window
Actions become an “average action”Pure L2 loss + unimodal assumption, zz collapseUse L1; check the variance of each zz dimension; increase the KL weight if necessary
Motion at the grasping instant is smoothed awayL2 loss over-smooths abrupt changesSwitch to L1 or Huber; weight the key frames
Accuracy drops sharply after changing the camera/workstationImage normalization inconsistent with training, camera intrinsics/extrinsics changedUnify preprocessing; add color jitter and random cropping as augmentation if necessary
Worse after mixing multi-robot dataAction spaces not unified (joint angles vs. end-effector pose)Unify to the same action space (see the unified action space practice in 4.5)
Inference time exceeds budgetBackbone too large, re-inference at every stepFreeze the backbone and cache features; infer the whole chunk at a fixed interval
Effective only within the demonstration distributionThe boundary of the method itselfAdd VLA pretraining, DAgger-style corrective data, or RL fine-tuning

3.2.4 Comparison with “Pure Behavior Cloning”

DimensionStep-by-step behavior cloning (BC)ACT (chunking + temporal ensembling)
Prediction granularitySingle-step actionkk-step action chunk
Compounding errorError accumulates per step; deviation can reach O(Tϵ)O(T\epsilon) after TT stepsOpen loop within a chunk, closed loop between chunks; accumulation is truncated to the scale of the chunk length
Multi-modal actionsUnimodal regression → average actionThe CVAE latent variable zz provides multi-modal expressiveness
Inference costOne forward pass per stepOne forward pass every kk steps (lower after amortization)
Requirement on the number of demonstrationsMediumHigher (needs to cover multiple styles of the same state)
Implementation complexityLowMedium (CVAE + ensembling cache)
Typical failureLong-horizon driftCannot correct immediately when disturbed within a chunk

In one sentence: ACT uses “predicting several steps at once” to compress the compounding error from “growing linearly with the number of steps” into “growing with the number of chunks”, and then uses temporal ensembling to smooth out the chunk boundaries. This is its only — and decisive — improvement over pure BC.

3.2.5 Applicability: Where ACT Should Be Used

ScenarioSuitable for ACTWhy and recommendation
Tabletop tidying, pick-and-place, folding and other medium-to-low-speed manipulationVery suitable50 Hz with a 1–2 second chunk length matches exactly
Tasks with 50–500 demonstrationsVery suitableACT’s sample efficiency is best in this range
Tasks needing high-frequency response (catching a ball, high-speed sorting)FairOpen loop within a chunk, so the response is limited by the chunk length; shorten kk and raise the inference frequency
Multi-modal demonstrations (several ways to do the same state)SuitableThe CVAE latent variable can express multiple modes
Generalization to entirely new objects/scenesNot suitableReliable only within the demonstration distribution; VLA pretraining is needed
Tasks needing force control / compliant contactFairPosition control dominates; force control needs an additional torque channel and a high-frequency loop
Heterogeneous multi-robot dataNeeds modificationUnify the action space first, or use per-embodiment stems (see 4.5)

3.3 Diffusion Policy: Treating Actions as a “Denoising Generation” Problem

The diffusion policy (Diffusion Policy, DP) is the other main line from 2023; its core insight is that the failure of behavior cloning is often not that the network is too small, but that the modeling assumption of “unimodal regression” is wrong. Human demonstrations may contain several reasonable actions in the same state (going around the left or around the right), and MSE regression gives the average of the two — an action that is physically infeasible. Diffusion models express multi-modal distributions naturally and train stably (unlike GANs, which need adversarial training).

It frames “generating actions from noise” as a reverse diffusion process: starting from pure Gaussian noise a(K)a^{(K)}, iteratively denoise for KK steps and finally obtain the action chunk a(0)a^{(0)}. The condition is the observation oo (image + proprioceptive state).

Derivation: The closed form of forward noising, the reverse mean, and the ε-prediction objective

Step 1: the forward process. Define a Markov chain that adds a small amount of Gaussian noise at each step:

q(a(k)∣a(k−1))=N(1−βk a(k−1), βkI)q(a^{(k)} \mid a^{(k-1)}) = \mathcal{N}\left(\sqrt{1-\beta_k}\,a^{(k-1)},\ \beta_k \mathbf{I}\right)

where βk\beta_k is a predefined noise schedule (controlling how much noise is added at each step).

Step 2: the closed form for any step. Let αk=1−βk\alpha_k = 1-\beta_k and αˉk=∏s=1kαs\bar\alpha_k=\prod_{s=1}^{k}\alpha_s; repeated substitution of Gaussian convolutions gives

q(a(k)∣a(0))=N(αˉk a(0), (1−αˉk)I)q(a^{(k)} \mid a^{(0)}) = \mathcal{N}\left(\sqrt{\bar\alpha_k}\,a^{(0)},\ (1-\bar\alpha_k)\mathbf{I}\right)

that is, any instant can be reached in one step: a(k)=αˉk a(0)+1−αˉk ϵa^{(k)} = \sqrt{\bar\alpha_k}\,a^{(0)} + \sqrt{1-\bar\alpha_k}\,\epsilon, ϵ∼N(0,I)\epsilon\sim\mathcal{N}(0,I). This is the key to the training efficiency of diffusion models — there is no need to actually iterate the noising kk times.

Step 3: the reverse process. By Bayes’ rule, q(a(k−1)∣a(k),a(0))q(a^{(k-1)}|a^{(k)},a^{(0)}) is still Gaussian, with mean

μ~k=αˉk−1βk1−αˉka(0)+αk(1−αˉk−1)1−αˉka(k)\tilde\mu_k = \frac{\sqrt{\bar\alpha_{k-1}}\beta_k}{1-\bar\alpha_k}a^{(0)} + \frac{\sqrt{\alpha_k}(1-\bar\alpha_{k-1})}{1-\bar\alpha_k}a^{(k)}

Step 4: parameterization. The true a(0)a^{(0)} is unknown and is predicted by the network. Express a(0)a^{(0)} in terms of “a(k)a^{(k)} and the predicted noise ϵθ\epsilon_\theta”:

a(0)=a(k)−1−αˉk ϵθ(a(k),k,o)αˉka^{(0)} = \frac{a^{(k)} - \sqrt{1-\bar\alpha_k}\,\epsilon_\theta(a^{(k)},k,o)}{\sqrt{\bar\alpha_k}}

Substituting back into the mean expression and simplifying gives the commonly used reverse sampling form:

a(k−1)=1αk(a(k)−βk1−αˉkϵθ(a(k),k,o))+σkza^{(k-1)} = \frac{1}{\sqrt{\alpha_k}}\left(a^{(k)} - \frac{\beta_k}{\sqrt{1-\bar\alpha_k}}\epsilon_\theta(a^{(k)},k,o)\right) + \sigma_k \mathbf{z}

Step 5: the training objective. A simple regression on the noise prediction:

L(θ)=Ek, a(0), ϵ[∥ϵ−ϵθ(αˉka(0)+1−αˉkϵ, k, o)∥2]\mathcal{L}(\theta) = \mathbb{E}_{k,\,a^{(0)},\,\epsilon}\left[\left\|\epsilon - \epsilon_\theta\left(\sqrt{\bar\alpha_k}a^{(0)}+\sqrt{1-\bar\alpha_k}\epsilon,\ k,\ o\right)\right\|^2\right]

Why this objective works: it is equivalent to optimizing the denoising-matching term in the evidence lower bound (ELBO); intuitively, the network learns “given a noisy action and the noise level kk, tell what this noise looks like”, and subtracting it yields the clean action. Note that kk must be fed in as a condition, otherwise the network cannot know how much noise to remove.

Step 6: inference acceleration. Standard DDPM needs KK (often 100–1000) steps; DDIM (Denoising Diffusion Implicit Models) turns sampling into a deterministic, step-skipping form that works with 10 steps. Robot control is latency-sensitive, so practical deployments almost always use DDIM or even faster distilled versions.

3.3.1 Diffusion Policy Pseudocode and Walkthrough

Training:
Input: demonstrations D = {(o_t, a_{t:t+k})}, diffusion steps K, noise schedule β_1..β_K
Networks: vision encoder + 1D convolutional U-Net (or Transformer), conditioned on o and noise level k

for each batch:
    o, a0 = sample an observation and the ground-truth action chunk
    k     = sample randomly from 1..K
    ε     = N(0, I)
    a_k   = sqrt(ᾱ_k)·a0 + sqrt(1-ᾱ_k)·ε        # jump to noise level k in one step
    ε_hat = ε_θ(a_k, k, o)                        # predict the noise
    L     = || ε - ε_hat ||²
    update θ

Inference (DDIM, 10 steps):
    a_K ~ N(0, I)                                 # start from pure noise
    for k = K .. 1:
        ε_hat = ε_θ(a_k, k, o)
        a_{k-1} = DDIM update(a_k, ε_hat, k)      # deterministic step skipping
    output a_0 (a k-step action chunk); execute the first few steps, then replan

Walkthrough:

  1. Why generate an “action chunk” at once rather than a single step. For the same reason as ACT: it reduces compounding error; and diffusion’s multi-step sampling is expensive, so generating the whole chunk in one go is what makes it worthwhile.
  2. The noise level kk must be fed to the network. Common implementations use sinusoidal positional encoding (the same origin as the timestep encoding in Transformers). Omit it and the network cannot tell “should this be heavily denoised or lightly denoised”, and the generation comes out blurry.
  3. How the observation condition is injected. Two mainstream approaches: ① concatenate the observation features at every denoising step (simpler); ② use cross-attention (observation features as key/value, action tokens as query). The latter is more expressive but more expensive.
  4. Inference latency is the biggest engineering constraint. 10 DDIM steps × one network forward pass per step, at 50 Hz control, requires less than 2 ms per step, which usually needs distillation or a smaller network; this is also the direct reason why flow-matching methods such as π₀ emerged (they produce an action in 1 step).
  5. Why it is more robust to multi-modality than ACT. ACT expresses multiple modes through the CVAE latent variable, and training is unstable (posterior collapse); diffusion’s forward process is fixed and training is just noise regression, so stability is markedly better, which is why DP is more commonly used on complex tasks.
  6. Shortcomings. Sampling is slow, it is sensitive to the noise schedule, the chunk still runs open loop, and it does not fit scenarios needing very high-frequency (>100 Hz) force control.

3.3.2 Gradient Flow and Condition Injection: The Paths Easily Confused in DP

DP is pure supervised learning, so the gradient flow itself is simpler than in SAC/Dreamer, but “which quantities should be noised and which should not” is often written wrong:

PathGradient or processing requirementReason
ϵθ(a(k),k,o)\epsilon_\theta(a^{(k)},k,o) → network parametersRequiredThe only learning signal
Regression target ϵ\epsilonConstant (obtained by sampling)A label, no gradient needed
The encoding of condition ooHas gradients, but is not noisedThe condition is “clean”; noising oo would destroy task information as well
Action target a(0)a^{(0)}ConstantA label
Noise level kkConstant (discrete or continuous embedding)Only a condition, not a quantity to be optimized
a(K)a^{(K)} at inference timeNo gradient neededThe pure-noise starting point
Using EMA weights for inferenceDo not participate in backpropagationForward only; unlike the EMA target encoder in JEPA, here it only smooths

Two frequent mistakes:

  1. Adding noise to the observation. Some people add noise to images to make the model “robust”, but this amounts to injecting uncertainty into the condition, so the model learns “guess the action under a blurred image” and real-robot accuracy actually drops. The right way to gain robustness is data augmentation (cropping, color jitter), not diffusion noising.
  2. The noise schedule does not match the number of inference steps. Training uses the αˉk\bar\alpha_k of K=100K=100, while inference uses DDIM with 10 steps; applying the training schedule coefficients directly makes the denoising trajectory deviate. Either use DDIM’s compatible coefficients, or recalibrate after distilling to a few-step model. The symptom is “the generated actions are shifted by an overall constant” or “end-effector jitter”.

One more training trick worth remembering: weight the loss by noise level (min-SNR weighting), so that the model spends more capacity on “medium noise”. Without weighting, the many easy high-noise samples dominate the gradient and the generated details get worse.

3.3.3 DP Implementation-Pitfall Checklist

SymptomLikely causeFix
Generated actions are blurry, like averagesToo few denoising steps, noise schedule too narrow, insufficient network capacityIncrease the number of DDIM steps (10–20); check whether αˉK\bar\alpha_K is close to 0; widen the U-Net
Inference latency over budgetA large network at every step, no distillationUse DDIM/DDPM with few steps; distill to 1–4 steps; shrink the network or cache visual features
Actions shifted as a wholeInconsistent decoding coefficients between training and inference, actions not normalizedUnify the αˉ\bar\alpha convention; normalize actions to [−1,1][-1,1] using dataset statistics
End-effector jitterOpen loop within the chunk + residual noise, executing for too longExecute only the first few steps and replan; use fewer noise steps at the end
Slower with multiple camera inputsEach camera goes through an independent encoder and nothing is cachedShare the backbone; cache the condition features (the condition does not change within a control step)
Training does not convergeLearning rate too large, noise-level embedding missingDrop the learning rate to 10−410^{-4}; confirm that kk is injected into the network
Effective only within the demonstration distributionThe boundary of the methodAdd VLA pretraining or RL fine-tuning
Fails entirely after changing robotsAction space and normalization statistics inconsistentUnify the action space and recompute the normalization statistics

3.3.4 Comparison with Flow Matching (π₀), and Applicability

DimensionDiffusion PolicyFlow-matching action head (π₀, see 4.3)
Generation pathCurved (progressive denoising according to the noise schedule)Nearly straight (OT pairing)
Number of sampling steps10–1001–10
Training objectivePredict the noise ϵ\epsilonRegress the velocity field x1−x0x_1-x_0
Need a large backboneNo (can start from a small network)Yes (usually hung on a VLM backbone)
Single-machine deployment costLow–mediumHigh
Multi-modal expressivenessStrongStrong

DP’s applicability boundary:

ScenarioSuitable for DPWhy and recommendation
Fine manipulation, multi-modal demonstrations (left or right)Very suitableGenerative modeling is naturally multi-modal and trains more stably than CVAE
200–2000 demonstrationsVery suitableThe more data, the better the generative model’s expressiveness
Edge deployment under compute constraintsFairMulti-step denoising is a hard cost; distillation or few-step sampling is needed
High-frequency force control (>100 Hz)Not suitableSampling + communication latency cannot meet the requirement
Needing very strong generalization to new objectsNot suitable (used alone)Needs a VLA backbone
Simple unimodal tasks, very little dataOverkillACT is cheaper and equally effective

3.4 ACT versus Diffusion Policy

DimensionACTDiffusion Policy
Multi-modal modelingCVAE latent variable (training is more brittle)Diffusion generation (training is stable)
Inference costOne forward pass produces the whole chunk (low)K-step denoising (high, needs distillation)
Action smoothnessGuaranteed by temporal ensemblingNaturally smooth in the generation process
Data requirementTens to hundreds of demonstrationsHundreds to thousands (more)
Typical scenarioLow-cost robotic arms, fast deploymentFine manipulation, multi-modal demonstrations
Main riskPosterior collapse, chunk-boundary jumpsLatency, noise schedule mismatch

Selection advice: tight budget and want to get it working fast → ACT; the demonstrations clearly contain several ways of doing things, or high-precision multi-modal actions are needed → Diffusion Policy.

4. Foundation-Model Layer: Vision-Language-Action Models

The models of the two layers above all follow the pattern “one robot, one task, retrain once”. That works in a lab but not in a product: change an object or a sentence and the data has to be collected again. What the foundation layer solves is generalization — letting one model understand natural-language instructions, recognize objects it has never seen, and need only very few demonstrations or even none at all on a new task.

4.1 Why the “Vision-Language-Action Model” Route Works

Large language models (Large Language Model, LLM) and vision-language models (Vision-Language Model, VLM) have already learned two things from internet-scale data that are extremely valuable for robots:

  1. Semantic priors: instructions such as “put the soda can in the trash bin” or “open the drawer halfway” involve concepts and objects that the VLM has already seen during pretraining, so the robot does not need to collect tens of thousands of episodes itself to build the concept of “what a soda can looks like”.
  2. A vision-language alignment structure: the intermediate representations of the VLM already align “image regions” with “words”, which provides a good initialization for “seeing the target → generating the action”.

The idea of the vision-language-action model (Vision-Language-Action model, VLA) is therefore to turn actions into another kind of “language token”, reuse the VLM architecture and pretrained weights directly, and do post-training (post-training, further training after pretraining) only on robot data. Robot learning thereby changes from “training a dedicated policy from scratch” to “fine-tuning a model that can already look at pictures and talk”.

The unified structure is roughly:

image I_t + instruction ℓ + proprioceptive state q_t
        ↓  vision encoder (ViT)
        ↓  concatenated with text tokens into one sequence
        ↓  autoregressive Transformer (or a diffusion / flow-matching decoding head)
action chunk a_{t:t+k}

The only difference lies in “how actions are represented and decoded”, from which three routes branch out.

4.2 Route 1: Discretize Actions into Tokens (RT-2 / OpenVLA)

This is the most direct idea: since the VLM can only output tokens from its vocabulary, give actions a vocabulary too.

RT-2 (Robotic Transformer 2, 2023) splits the value range of each action dimension into 256 bins, each bin corresponding to a special token. The action is usually 7-dimensional (end-effector position x/y/z, orientation roll/pitch/yaw, gripper open/close), so the vocabulary grows by 7×256=17927\times256=1792 tokens. The training objective is the standard autoregressive cross entropy, exactly the same as training a VLM.

OpenVLA (2024) reproduced this open-source and optimized the engineering: using Llama-2 7B or Prismatic VLM as the backbone, trained on Open X-Embodiment (about 970k real robot trajectories), producing an open-source VLA with about 7B parameters that can be fine-tuned directly.

The key detail is quantile discretization: bins are not cut at equal width but at the quantiles of the data distribution.

Derivation: Quantile discretization of actions, boundary handling, and decoding error

The problem. With equal-width bins, if the distribution of an action dimension is extremely uneven (for example the gripper is at 0 or 1 for 90% of the time and rarely in between), the vast majority of samples fall into a few bins and learning becomes extremely imbalanced; joint limits also differ, so a range must be set for each dimension separately.

The approach. For all training values of the jj-th action dimension, {aj(1),…,aj(N)}\{a^{(1)}_j,\dots,a^{(N)}_j\}, compute B+1B+1 quantiles

qj(c)=Quantile({aj(n)}, cB),c=0,1,…,Bq^{(c)}_j = \mathrm{Quantile}\left(\{a^{(n)}_j\},\ \frac{c}{B}\right),\qquad c=0,1,\dots,B

with B=256B=256. By convention qj(0)=min⁡naj(n)q^{(0)}_j=\min_n a^{(n)}_j and qj(B)=max⁡naj(n)q^{(B)}_j=\max_n a^{(n)}_j, guaranteeing the full range is covered.

Encoding (action → token). The center of bin cc is the midpoint between adjacent quantiles:

aˉj(c)=qj(c−1)+qj(c)2\bar a^{(c)}_j = \frac{q^{(c-1)}_j + q^{(c)}_j}{2}

Given a true action aja_j, find the bin it falls into:

c∗=arg⁡min⁡c∈{1,…,B}∣aj−aˉj(c)∣c^{\ast} = \arg\min_{c\in\{1,\dots,B\}} \left| a_j - \bar a^{(c)}_j \right|

The index c∗c^{\ast} is the token id for that dimension and is mapped to the corresponding special symbol in the vocabulary.

Decoding (token → action). After the network emits the token, the bin center is looked up directly:

a^j=aˉj(c∗)\hat a_j = \bar a^{(c^{\ast})}_{j}

Upper bound on decoding error. Let the width of bin cc be wj(c)=qj(c)−qj(c−1)w^{(c)}_j=q^{(c)}_j-q^{(c-1)}_j. Since a^j\hat a_j is the center and the true value must lie in the same bin, the error does not exceed half the width:

∣aj−a^j∣≤wj(c)2\left| a_j - \hat a_j \right| \le \frac{w^{(c)}_j}{2}

What this formula says. Precision is not uniform: where data is dense (quantiles packed together) ww is small and precision is high; where data is sparse ww is large and precision is low. In other words, the model is fine on common actions and coarse on rare ones — exactly the inductive bias we want, and it explains why quantile binning is far better than equal-width binning at the same token budget.

Relation to cross entropy. If each dimension is treated as an independent BB-class classification, the training loss is

L=−∑t∑j=17log⁡pθ(cj(t) ∣ It, ℓ, qt, c<j(t))\mathcal{L} = -\sum_{t}\sum_{j=1}^{7}\log p_\theta\left(c^{(t)}_j \,\mid\, I_{t},\ \ell,\ q_t,\ c^{(t)}_{<j}\right)

Note that the condition includes the dimensions already generated at the same instant (c<j(t)c^{(t)}_{<j}), a direct consequence of autoregressive decoding: the 7 dimensions are generated serially, so one action prediction needs 7 forward passes. This is the biggest inference bottleneck of this route.

Why it is still usable. Because action chunking predicts several steps at once: predicting kk steps × 7 dimensions = 7k7k tokens makes the token count larger, but the number of forward passes amortized per control step drops sharply. Both RT-2 and OpenVLA use the “emit a short action chunk at once” approach.

4.2.1 RT-2 / OpenVLA Pseudocode and Walkthrough

Preparation phase (offline, one time):
for each action dimension j = 1..7:
    compute the quantiles q_j^(0..256) over the training set for that dimension
    compute the center ā_j^(c) of each bin
Vocabulary extension: assign one special token id to each (j, c) combination

Training (post-training on robot data):
Input: image I_t, instruction text ℓ, proprioceptive state q_t, demonstrated action chunk a_{t:t+k}
Tokenization:
    I_t  → ViT splits into several visual tokens
    ℓ    → text tokens
    q_t  → each dimension discretized into a few tokens (or projected linearly)
    a_{t:t+k} → quantile-quantized per (dimension j, step t'), giving 7k action tokens
Concatenate into one sequence and train with "next token prediction":
    L = -Σ log p_θ(action tokens | all preceding tokens)
Update only (or low-rank adapt) the Transformer; the vision encoder can be frozen

Inference (control frequency 5–20 Hz):
    encode image + instruction + proprioceptive state into a prefix
    autoregressively generate 7k action tokens
    look up the table to decode them into a numeric action chunk, send the first few steps
    cache the chunk and do temporal ensembling (same as ACT)

Walkthrough:

  1. The biggest advantage is full compatibility with the VLM ecosystem. Actions are tokens, so the VLM’s pretrained weights, training code, and inference framework (KV cache, batching, quantization) can all be inherited directly. Almost no engineering rework is needed, which is the core reason RT-2 drew attention at the time.
  2. The biggest disadvantage is being slow. Autoregressively decoding 7k tokens, even with a KV cache, a 7B model on an edge device can only manage a few Hz. It therefore suits “slow but accurate” tasks (tidying a desk, folding clothes) and not high-frequency force control.
  3. Quantile discretization is a necessary engineering detail. Equal-width binning loses a noticeable amount of performance; quantile binning makes every bin carry roughly the same number of samples, balances training, and automatically adapts to the joint ranges of different robots (no manual normalization needed).
  4. Proprioceptive state must be handled carefully. Position/velocity are continuous; hard discretization loses precision. The common approach is to normalize each dimension and project it linearly into a few tokens, or simply concatenate it as one vector into the sequence (OpenVLA uses the latter: better results and far fewer tokens).
  5. Visual tokens are a hidden cost. A 224×224 image split into 14×14 patches is 256 tokens; with multiple cameras (wrist + head + side view) that easily becomes over a thousand tokens, and the prefix length directly determines latency. In practice the vision encoder is often frozen and its outputs cached.
  6. It still needs robot data for post-training. The VLM provides semantic priors, not control ability; without robot data the model can only “describe what should be done” and cannot “produce the correct action sequence”. Pretraining solves generalization, post-training solves usability; neither can replace the other.
  7. Generalization boundary. The generalization reported in the RT-2 paper is mainly at the “semantic level” (new objects, new instruction combinations), and on “precise manipulation” (plugging a hole, pouring water) it is still worse than a dedicated policy. This is directly related to its action precision being limited by discretization.

4.2.2 Gradient-Flow Checklist and Implementation Pitfalls

Supervised learning’s gradient flow is not complicated in itself, but “vocabulary extension” brings a few unique pitfalls:

QuantityGradient requirementExplanation
Cross-entropy loss of action tokens → TransformerRequiredThe only learning signal
Action token id (label)ConstantA discrete label, naturally without gradients
Vision encoderCan be frozen or use a low learning rateFreezing saves memory and preserves pretrained representations; full fine-tuning easily overfits small robot datasets
Linear projection of proprioceptive stateRequiredNewly initialized, it must learn
The 1,792 newly added token embeddingsRequiredRandomly initialized; if the vocabulary is frozen, training simply does not move

Pitfall checklist:

SymptomLikely causeFix
Action precision clearly insufficient256 bins too coarse, quantile statistics computed over the whole dataset (including outliers)Increase to 512 bins; exclude out-of-range samples before computing quantiles
Training loss normal but real-robot actions jumpBin centers at decoding differ from training, or equal-width inverse decoding usedShare the same quantile table between training and inference and freeze it
Inference only 1–2 HzPer-dimension autoregression with 7k forward passes, prefix too longIncrease the chunk length to amortize; cache KV; fewer cameras; smaller backbone
Cannot learn new actionsNew actions fall outside the training distribution and the quantile tableRecompute quantiles periodically; or keep several equal-width fallback bins
Poor language instruction followingInstruction data mix too low, visual tokens eat the contextIncrease instruction diversity; shorten the visual token count
Poor joint-dimension precisionProprioceptive state hard-discretizedSwitch proprioceptive state to a linear projection instead of the vocabulary
Forgets prior abilities after fine-tuningFull-parameter fine-tuning, learning rate too largeFreeze the vision tower, low-rank adaptation, mix in pretraining data

4.2.3 Comparison with π₀ and FAST

DimensionRT-2 / OpenVLA (discrete tokens)π₀ (continuous flow matching)FAST (frequency-domain tokens)
Action representation256 bins per dimensionContinuous vectorDCT coefficients + run-length encoding
Decoding methodAutoregressive token by tokenODE integration over a few stepsAutoregressive tokens → inverse DCT
Precision ceilingLimited by bin width (half width)Continuous, high precisionLimited by the quantization step Δ\Delta
Inference latencyHigh (many tokens)Medium (the backbone dominates)Medium (tokens already compressed)
Compatibility with the LLM ecosystemCompletePartial (the decoding head must change)Complete
Best suited forSlow but accurate, semantic generalizationHigh frequency, high precision, multi-modalLong sequences, few degrees of freedom

An easily overlooked difference is the nature of the error: the error of discrete tokens is “staircase-shaped” (identical inside a bin), the error of flow matching is a “small continuous deviation”, and the error of FAST is “overall smoothing caused by frequency-domain truncation”. The first makes contact tasks jitter at bin boundaries, the last flattens fast actions. Selection should be based on how sensitive the task is to the shape of the error, not only on the average error.

4.2.4 Applicability

ScenarioSuitable for discrete-token VLAWhy and recommendation
Semantic generalization (new objects, new instructions)Very suitableInherits the VLM semantic prior directly
Medium-to-low-speed tasks such as desk tidying and folding clothesSuitableInsensitive to latency
Sub-centimeter precision such as plugging holes or screwingFair/weak256 bins are not precise enough; switch to a continuous head
High-frequency control (>30 Hz)Not suitableAutoregressive decoding is too slow
Edge-device deploymentFairThe 7B model needs quantization + caching; or distill to a small model
Lacking robot data, only a VLMNot suitable for direct usePost-training is mandatory, otherwise it only “describes actions”

4.3 Route 2: Flow-Matching Action Head (π₀)

π₀ (pi-zero, 2024, Physical Intelligence) addresses the two pain points above with a different approach: do not turn actions into tokens; instead attach a dedicated “action expert” that generates continuous actions, using flow matching so that the whole action chunk comes out in one or a few forward passes.

The overall skeleton is still a VLM: vision and language go through the pretrained VLM pathway, but actions do not go through the vocabulary — they take a continuous “noise to action” generation pathway. The two pathways are coupled through attention, so that action tokens can attend to vision/language tokens and thereby obtain the instruction and scene information.

Derivation: The conditional flow-matching loss, the straight-line path, and optimal transport

The goal. We want to learn a velocity field that “turns the noise distribution into the action distribution”. Let x1x_1 be the true action chunk (data) and x0∼N(0,I)x_0\sim\mathcal{N}(0,I) be noise. Define a path xtx_t from x0x_0 to x1x_1, t∈[0,1]t\in[0,1].

Step 1: choose the path. The simplest is a straight line (linear interpolation, also called rectified flow):

xt=(1−t) x0+t x1x_t = (1-t)\,x_0 + t\,x_1

Step 2: compute the velocity field. Differentiate with respect to tt:

ut=dxtdt=x1−x0u_t = \frac{\mathrm{d}x_t}{\mathrm{d}t} = x_1 - x_0

Note that along a straight-line path the velocity is a constant vector, independent of tt. This is exactly why it is easier to learn than diffusion (whose curved path varies with the schedule).

Step 3: the conditional flow-matching loss. Train a network vθ(xt,t,c)v_\theta(x_t, t, c) (cc is the observation/instruction condition) to regress that velocity:

LCFM(θ)=Et∼U[0,1], x0∼N(0,I), x1∼pdata∥vθ((1−t)x0+tx1, t, c)−(x1−x0)∥2\mathcal{L}_{\mathrm{CFM}}(\theta) = \mathbb{E}_{t\sim U[0,1],\ x_0\sim\mathcal{N}(0,I),\ x_1\sim p_{\mathrm{data}}}\left\| v_\theta\left((1-t)x_0+t x_1,\ t,\ c\right) - (x_1 - x_0) \right\|^2

Step 4: why this loss is correct. Let ptp_t be the marginal distribution of xtx_t. It can be shown that minimizing the above expression is equivalent to fitting vθv_\theta to the “probability-flow” velocity field of the marginal ptp_t, and that velocity field satisfies the continuity equation

∂pt∂t+∇⋅(pt vt)=0\frac{\partial p_t}{\partial t} + \nabla\cdot(p_t\, v_t) = 0

With vtv_t available, one can integrate the ordinary differential equation (Ordinary Differential Equation, ODE)

dxtdt=vθ(xt,t,c)\frac{\mathrm{d}x_t}{\mathrm{d}t} = v_\theta(x_t,t,c)

from any x0∼p0x_0\sim p_0, from t=0t=0 to t=1t=1, to obtain x1∼pdatax_1\sim p_{\mathrm{data}}. This is the complete procedure of “generating an action”.

Step 5: why the straight-line path is better. If the pairing of x0x_0 and x1x_1 is random (independent sampling), straight-line paths cross each other, the marginal velocity field exhibits “averaging out”, and integration needs many steps. If the pairing is optimal (i.e. x0x_0 and x1x_1 form an optimal transport (OT) coupling), the straight lines do not intersect, the paths are nearly straight, and a few steps (even 1) suffice to complete the integration.

In practice OT pairing is used: within each batch, a simple greedy/Hungarian matching pairs noise with actions by distance. The cost is small but it shortens the integration steps markedly. This is why π₀ can manage “10 steps or even fewer”.

Step 6: comparison with diffusion (in one sentence). Diffusion learns “how much noise to remove at each step” and must accumulate according to the schedule; flow matching learns “how far and in which direction to move in one step”, the path is straight, and therefore large step sizes are allowed. Mathematically both come from probability flows, but in engineering the sampling efficiency of flow matching is markedly higher.

Step 7: details of the loss and time sampling. The sampling distribution of tt affects difficulty: near t=0t=0 noise dominates, near t=1t=1 signal dominates, and the middle is hardest. In practice sampling biased toward the middle is common (such as a β\beta distribution or logit-normal), converging better than uniform sampling — a trick widely used by π₀ and later work.

4.3.1 The Network Structure and Pseudocode of π₀

The structure of π₀ can be summarized as “one VLM backbone + one action expert + bidirectional attention”:

  • Backbone: a pretrained VLM (PaliGemma class), taking images and language as input and outputting a vision-language token sequence.
  • Action expert: a set of additional Transformer layers whose input is “action tokens” (initially noise) plus the timestep embedding tt; every layer can attend to the backbone’s vision-language tokens.
  • Training: the backbone can use a low learning rate (or be partly frozen), and the action expert is trained from scratch; the loss is the conditional flow-matching loss above.
  • Inference: start from noise, do NN-step Euler integration (NN about 5–10) to obtain the action chunk; execute the first few steps and then replan.
Training:
Input: demonstrations (I_t, ℓ, q_t, a_{t:t+k})
Backbone = pretrained VLM (vision encoder + LLM)
Action expert = newly added Transformer layers (far fewer parameters than the backbone)

for each batch:
    # 1. condition pathway (run once, can be cached)
    h_vl = backbone encoding(I_t, ℓ, q_t)       # vision-language token sequence

    # 2. sample noise, time, target
    x0 ~ N(0, I)                               # same shape as the action chunk (k × 7)
    t  ~ a distribution biased toward the middle (e.g. logit-normal)
    x1 = the true action chunk a_{t:t+k}
    xt = (1-t)·x0 + t·x1                       # a point on the straight-line path

    # 3. action expert forward: action tokens cross-attend to h_vl
    v_hat = action expert(xt, t | h_vl)

    # 4. regress the velocity (note the target is x1 - x0, independent of t)
    L = || v_hat - (x1 - x0) ||²
    update the action expert (optionally update the backbone with a low learning rate)

Inference (control frequency 20–50 Hz, chunk length k):
    h_vl = backbone encoding(I_t, ℓ, q_t)       # must run every step, cache for speed
    xt = x0 ~ N(0, I)
    for n = 1..N:                              # N = 5–10 Euler steps
        xt = xt + (1/N)·action expert(xt, n/N | h_vl)
    output x1 as the action chunk, execute the first few steps and replan

Walkthrough:

  1. Why a dedicated “action expert” instead of reusing LLM layers. Actions are continuous high-dimensional vectors extremely sensitive to precision, while language tokens are discrete; sharing parameters lets action precision be “dragged around” by the language modeling objective. Separate parameters with information shared only through attention is the key design that reconciles “inheriting semantic priors” with “guaranteeing action precision”.
  2. The number of integration steps NN directly determines latency. With N=10N=10 the action expert’s forward cost is about 10×; since the action expert is much smaller than the backbone, the total cost is still acceptable. The real bulk is the backbone — which is why π₀-class methods cache vision encoding results or reuse backbone outputs within a chunk during deployment.
  3. OT pairing is the precondition for “few steps”. Without OT pairing, straight-line paths cross and NN has to be tens of steps; with it, NN can drop below 10. This is a typical trade of “a bit more compute at training time for much less at inference time”.
  4. Open loop within the chunk remains. The generated action chunk is an open-loop trajectory that physical disturbances will push off course; hence “execute part, then replan”, and temporal ensembling must smooth the chunk boundaries (same as ACT).
  5. Its strengths are “high frequency + high precision + multi-modal”. Continuous output is not limited by discretization precision; emitting a whole chunk at once supports high-frequency control; generative modeling is naturally multi-modal. Together these three make π₀-class methods the mainstream choice for real-robot manipulation tasks in 2024–2026.
  6. Its weakness is the threshold of data and compute. Training a VLM backbone + action expert is far more expensive than ACT/DP, and heterogeneous multi-robot, multi-task data is required to show the generalization advantage. Small teams usually fine-tune open-source weights directly rather than training from scratch.

4.3.2 Gradient-Flow Checklist: “Who Should Learn, Who Should Be Frozen, Who Should Not Propagate” in π₀

π₀ trains three kinds of networks together, so the delineation of gradient flow is far more complex than in the discrete-token route:

PathGradient requirementReason
Flow-matching loss → action expertRequired (main signal)This is the only learning source for action generation
Flow-matching loss → backboneOptional, low learning rateAllows the action objective to adjust the vision-language representation slightly; a full-speed update would destroy the semantic priors
Vision encoderUsually frozenPreserves pretrained representations and saves memory
Embedding of timestep ttConstant input, the parameters inside the network are learnablett is a condition, not a quantity to be optimized
Target velocity x1−x0x_1-x_0ConstantA label
Noise x0x_0ConstantObtained by sampling
Intermediate states in the ODE integration at inference timeNo gradient neededPure forward pass

One key judgment: the action expert must not share all of its parameters with the language model. Forced sharing makes the language-modeling objective pull the representation toward “discrete semantics”, whereas actions require millimeter-level continuous precision; the gradient directions of the two conflict, which shows up as “language ability has not degraded, but action precision will not improve”. π₀’s “independent action expert + attention coupling” is designed precisely to avoid this conflict.

4.3.3 π₀ Implementation-Pitfall Checklist

SymptomLikely causeFix
Actions are overall too “soft” and cannot keep up with fast changesOT pairing not done, too few integration stepsEnable in-batch OT pairing; raise NN to 10
Training loss is low but real-robot trajectories drifttt sampled uniformly at training time, fixed step size at inferenceSwitch to tt sampling biased toward the low-noise region (such as a Beta distribution); align the inference step size with the training distribution
Action magnitude accumulates and grows chunk by chunkNo temporal ensembling between chunks, replanning interval too longSame as ACT: execute the first several steps + exponential weighted ensembling
The backbone is “trained broken” and instruction following degradesBackbone learning rate too highFreeze the backbone or lower it to 1/10 of the action expert’s
Latency exceeds the budget with multiple camerasThe backbone is rerun at every stepCache the vision-language features and reuse them within a chunk
Actions are discontinuous at chunk boundariesIndependent noise sampling each time, no correlation between chunksCondition on the tail of the previous chunk, or do overlapping averaging
Overfitting after fine-tuning on small dataAction expert capacity too large, insufficient data diversityReduce the width of the action expert; add multi-embodiment data
Some joints are never accurateAction normalization uses global statistics rather than per-jointNormalize per dimension and denormalize at the output

4.3.4 Comparison with Discrete Tokens and Diffusion Policy, and Applicability

Dimensionπ₀ (flow matching)RT-2 (discrete)DP (diffusion)
PrecisionHigh (continuous)Limited by bin widthHigh (continuous)
Sampling steps1–107k autoregressive passes10–100
Training stabilityGood (regress the velocity field)Good (classification)Good (regress the noise)
Multi-modal expressivenessStrongMedium (affected by the bins)Strong
Requirement on the backboneVLM-levelVLM-levelCan be small
Deployment costHighMedium–highMedium

Applicability:

ScenarioSuitable for π₀Why and recommendation
High-frequency + high-precision real-robot manipulationVery suitableFew-step generation, continuous actions, multi-modal expressiveness
Pretraining on heterogeneous multi-embodiment dataVery suitableRelies on a unified action space (see 4.5)
Single machine, small data, fast deploymentNot suitableTraining and deployment costs are too high; start with ACT/DP
Edge devices with extremely limited computeFairNeeds distillation of the action expert or quantization of the backbone
Purely semantic generalization, low precision requirementOverkillA discrete-token VLA is cheaper

4.4 Route 3: Frequency-Domain Tokenization (FAST)

FAST (Frequency-space Action Sequence Tokenization, 2025, Physical Intelligence) solves a very practical problem: an autoregressive VLA wants to keep the benefits of “tokenization” (reusing the LLM ecosystem), but discretizing per dimension and per frame produces far too many tokens.

Its approach is to treat the whole action sequence as a signal and compress it:

  1. For each action dimension, take an action sequence a1:Ta_{1:T} of length TT;
  2. Apply the discrete cosine transform (Discrete Cosine Transform, DCT) to move the time-domain signal into the frequency domain;
  3. Quantize in the frequency domain and order coefficients “low frequency first”;
  4. Use run-length encoding to collapse the many repeated / near-zero coefficients;
  5. Obtain a token string far shorter than the raw dimensionality and hand it to the autoregressive model.
Derivation: The DCT, energy concentration in the frequency domain, and the compression ratio of run-length encoding

Step 1: the DCT-II definition. For a real sequence a1:Ta_{1:T} of length TT, the type-II discrete cosine transform is

Ak=∑n=1Tancos⁡[πT(n−12)k],k=0,…,T−1A_k = \sum_{n=1}^{T} a_n \cos\left[\frac{\pi}{T}\left(n-\tfrac{1}{2}\right)k\right],\qquad k=0,\dots,T-1

and the inverse transform is

an=2T∑k=0T−1Akcos⁡[πT(n−12)k]a_n = \frac{2}{T}\sum_{k=0}^{T-1} A_k \cos\left[\frac{\pi}{T}\left(n-\tfrac{1}{2}\right)k\right]

Step 2: why the frequency domain can compress. Robot action sequences consist of “smooth trajectories + a few abrupt changes”. The energy of a smooth trajectory is concentrated at low frequencies (small kk), and the high-frequency components are close to 0. Hence, once the coefficients are ordered from small kk to large kk, a large number of tail coefficients can be coarsely quantized or even discarded with very small error. This is exactly the same reason JPEG uses the DCT.

Step 3: quantization and error. Let the quantization step be Δ\Delta and the quantized coefficient be A^k=Δ⋅round(Ak/Δ)\hat A_k = \Delta\cdot\mathrm{round}(A_k/\Delta); then the per-coefficient error satisfies ∣Ak−A^k∣≤Δ/2|A_k-\hat A_k|\le \Delta/2. By the linearity of the inverse transform, the reconstruction error of the signal satisfies

∣an−a^n∣≤2T∑k=0T−1∣Ak−A^k∣∣cos⁡(⋅)∣≤2T⋅T⋅Δ2=Δ\left| a_n - \hat a_n \right| \le \frac{2}{T}\sum_{k=0}^{T-1}\left|A_k-\hat A_k\right| \left|\cos(\cdot)\right| \le \frac{2}{T}\cdot T\cdot\frac{\Delta}{2} = \Delta

that is, the reconstruction error at every action point does not exceed one quantization step. This gives a direct conversion between “quantization granularity ↔ action precision”, which is easier to control than point-wise discretization.

Step 4: the compression ratio of run-length encoding. Suppose there are mm non-zero coefficients after quantization and the remaining T−mT-m are 0. Encoding them as (value, run length) pairs, the token count is approximately

Ntoken≈2m+(a few marker bits)N_{\mathrm{token}} \approx 2m + \text{(a few marker bits)}

When m≪Tm\ll T, the compression ratio is approximately T/(2m)T/(2m). Measurements on typical manipulation tasks show that FAST reduces the token count per trajectory to 1/3 to 1/5 of the original, and because the frequency-domain representation is “smoother”, the autoregressive model also converges faster.

Step 5: the interface with an “autoregressive VLA”. The encoded tokens are mixed into the same sequence as ordinary vocabulary tokens, and the model is trained with next-token prediction as usual. At decoding time the inverse DCT is applied first and then the actions are restored according to the quantization step. FAST therefore keeps the LLM ecosystem (pretrained weights, KV cache) while sharply shortening the sequence length — this is its core advantage over per-dimension discretization (Section 4.2).

Step 6: the cost. Frequency-domain encoding is “lossy and delayed”: TT steps must be accumulated before one transform can be done, block boundaries need overlapping or padding, and the inverse transform adds computation. In practice a shorter window is used (for example TT corresponding to 0.5–1 second) to balance this.

Training (data preprocessing stage, one time):
for each trajectory's action sequence:
    split by action dimension, take a window of length T for each dimension
    apply the DCT to obtain A_k
    order by k from small to large and quantize with Δ
    run-length encode: collapse runs of identical/zero coefficients into (value, length)
    output: the action token sequence (far shorter than T × dimensions)
concatenate this sequence with vision/language tokens and train the VLM with next-token prediction

Inference:
    encode image + instruction to obtain the prefix
    autoregressively generate the action token sequence
    run-length decode → inverse DCT → obtain the action chunk
    execute the first several steps, then replan

Walkthrough:

  1. It does not change the paradigm of “actions are tokens”, only “how tokens are cut”. All of RT-2’s ecosystem advantages (reusing VLMs, KV cache, quantization toolchains) are therefore preserved.
  2. The compression ratio comes from the properties of the signal, not from the model. Unlike learning a compressor, DCT + run-length encoding is a fixed transform that needs no training, is stable, and is interpretable; the price is that it cannot adapt to the action statistics of different tasks.
  3. Precision is controlled by the quantization step Δ\Delta. This is a more intuitive parameter than “256 bins”: Δ\Delta directly corresponds to the maximum reconstruction error at an action point. When tuning, first decide the position error the task allows (such as ±2 mm), then derive Δ\Delta from it.
  4. The block length TT is a trade-off. Large TT → higher compression ratio, but more latency and discontinuous block boundaries; small TT → faster response, but less compression benefit.
  5. It suits “long action sequences + few degrees of freedom” best. If the action dimensionality is high (such as a multi-fingered dexterous hand with 20+ dimensions), every dimension needs its own DCT and the token total still inflates; a continuous action head (π₀ class) is then more advantageous.

4.4.1 FAST Implementation-Pitfall Checklist

SymptomLikely causeFix
Actions show “ringing”, end effector jittersHigh-frequency coefficients coarsely quantized or discardedReduce Δ\Delta; keep more high-frequency coefficients; use finer quantization for the end effector separately
Actions are smoothed out overall, response slowsWindow TT too long, low-frequency truncation too aggressiveShorten TT (0.3–0.8 s); keep the first several orders of coefficients
Token count goes up instead of downActions are jittery, too many non-zero coefficientsLow-pass smooth the demonstrations first; increase Δ\Delta; change the window length
Discontinuities at block boundariesAdjacent windows transformed independently, no overlapOverlap windows by 25%–50% and cross-fade at the boundaries
Wrong action magnitude after decodingThe normalization coefficient of the inverse transform is wrong (the 2/T2/T is missing)Implement strictly according to the DCT-II inverse formula and unit-test the round-trip error
Training loss normal but real-robot accuracy insufficientQuantization error accumulates over joints, error shape mismatched to the taskDerive Δ\Delta from the error the task allows (e.g. ±2 mm corresponds to Δ=2\Delta=2 mm)
Semantics confused after run-length encodingEncoding order (low frequency first) not aligned with decodingFix the encoding order and mark boundaries explicitly in the vocabulary

4.4.2 Comparison with Other Tokenization Schemes, and Applicability

DimensionPer-dimension per-frame discretization (RT-2)FAST (frequency domain + run-length encoding)Continuous head (π₀/DP)
Sequence lengthLong (7k7k)Short (about 1/3–1/5)No tokens
Precision controlBin widthQuantization step Δ\DeltaContinuous
LLM ecosystem compatibilityCompleteCompletePartial
Error shapeStaircaseOverall smoothing / ringingSmall continuous deviation
Best suited forSemantic generalizationLong sequences, few degrees of freedomHigh frequency, high precision, multi-modal

Applicability:

ScenarioSuitable for FASTWhy and recommendation
Long action chunks + low-dimensional actions (within 7 dims)Very suitableLargest compression benefit
Already using an autoregressive VLA and wanting a shorter sequenceVery suitableChange only the tokenizer, not the model
High-dimensional dexterous hand (20+ dims)FairTokens remain numerous after per-dimension transforms; consider a continuous head
Extremely high-frequency abrupt actions (tapping, tossing and catching)Relatively weakHigh-frequency coefficients get compressed away; keep more coefficients
Needing point-wise millimeter precisionFairReducing Δ\Delta costs compression ratio

4.5 Other Open-Source / Representative Models Worth Knowing

Beyond the three main lines above, several other classes of models make up the complete picture of VLAs from 2023 to 2026; it is enough to understand their positioning.

Octo (2023–2024, an open-source generalist policy). Its positioning is “the general-purpose Transformer of the robotics world”: a Transformer trunk takes multi-camera images + language + proprioceptive state and outputs an action chunk; it is pretrained on Open X-Embodiment and supports many robot embodiments (single arm, dual arm, quadruped). Its value lies mainly in providing a reproducible open-source baseline and a flexible multi-embodiment interface, which makes it suitable as a starting point for teaching and for further development. Technically it does not introduce a new paradigm; it is an engineering integration of “Transformer policy + large-scale multi-embodiment data”.

GR-2 (2024, generative video pretraining). It first pretrains a model on a video generation task (learning to predict “how the picture will change as a result of the action”) and then converts that model into a policy. The core motivation is that video data (internet scale) far exceeds robot action data, and video pretraining can learn physical intuition (how objects move, how contact happens), which is closer to control than the purely semantic priors of a VLM. It is a cross-product of “world-model thinking” and “VLA thinking”.

HPT (Heterogeneous Pre-trained Transformer, 2024). It solves the problem that “different robot embodiments differ enormously”. It introduces embodiment-specific stems (input/output adaptation modules): each robot has its own vision stem and action stem, and they share the Transformer trunk in the middle. Different embodiments thereby share “task understanding” while each keeps its own “embodiment interface”. This has become the standard practice for multi-embodiment VLAs.

RDT-1B (2024, a large model for dual-arm robots). With about 1B parameters and aimed at dual-arm robots, it is pretrained on about 46 datasets and 1M+ trajectories and uses a diffusion-style action head (rather than discretization). Its significance is that it validated the unified action space route: projecting the actions of different robots into a shared physical-quantity space (end-effector pose + gripper), so that heterogeneous data can be trained together. This is the key precondition for data scale to grow.

One comparison table puts the above models in the same coordinate system:

ModelAction representationDecoding headPretraining data focusMain contribution
RT-2Per-dimension quantile discrete tokensAutoregressiveInternet VLM + robot dataProved “actions as tokens” works
OpenVLASame as aboveAutoregressive (Llama backbone)Open X-Embodiment (970k trajectories)The first usable open-source 7B VLA
π₀Continuous action chunkFlow matching (OT pairing)Heterogeneous multi-embodiment real robot dataHigh frequency + high precision + few-step sampling
FASTFrequency-domain compressed tokensAutoregressiveSame as aboveSolved the token-length explosion
OctoContinuous action chunkDiffusion/regression headOpen X-EmbodimentOpen-source generalist baseline, multi-embodiment interface
GR-2Continuous action chunkDiffusion headVideo generation pretrainingLearning physical intuition from video
HPTContinuous action chunkPer-embodiment independent stemsMulti-embodiment heterogeneousCross-embodiment parameter sharing
RDT-1BContinuous action chunkDiffusion head46 datasets / 1M+ trajectoriesUnified action space, dual-arm large model

4.5.1 Mechanism Essentials, Common Pitfalls, and Applicability of the Four Models

These four models need not be expanded into nine sections, but each is worth remembering for “what problem it solves, where it is easiest to get wrong, and when to choose it”.

ModelMechanism essentialsKey designCommon pitfallsApplicability
OctoTransformer trunk + action-chunk regression/diffusion head, multi-embodiment input/output adaptationUnified multi-camera tokenization, pluggable observation/action tokenizerRunning a new embodiment without changing the tokenizer so the action dimensions do not match; the pretrained weights overfit on small dataTeaching, further development, multi-embodiment experiments needing a reproducible baseline
GR-2Pretrain with video generation (predicting future frames), then convert into a policyVideo pretraining provides physical intuition; a generative head outputs actionsVideo data is not aligned with the robot action space (no action labels); texture details of generated video waste capacityContact-rich tasks needing physical intuition; when video data is plentiful
HPTShared Transformer trunk + an independent stem per embodimentEmbodiment-specific input/output stems, shared trunkA stem that is too narrow under-represents the embodiment features; unbalanced data ratios across embodimentsMulti-embodiment heterogeneous data, cross-embodiment transfer
RDT-1B1B parameters, diffusion action head, unified action spaceProject heterogeneous actions into a shared physical-quantity space (end-effector pose + gripper)The unified space loses embodiment-specific degrees of freedom (such as dexterous finger joints); projection error accumulatesDual-arm robots, large-scale heterogeneous-data pretraining

One shared engineering conclusion: among these four models the “model structure” differs far less than the “data processing pipeline”. In practice, nine out of ten reproduction failures come from action space unification, normalization statistics, temporal alignment, and camera calibration, not from network design. This is also why Chapter 6 puts “calibration and time synchronization” before domain randomization.

5. World Models and Model-Based Reinforcement Learning

All the methods above assume “the policy maps observations directly to actions”. Biology does not work that way: before doing something, a person “rehearses” it in their head — imagining what will happen if the cup is pushed over. A world model makes that rehearsal capability explicit by learning a model of “given the current state and action, predict the next state and reward”, and then planning or training a policy inside that model.

Why does it matter? Because real interaction is the most expensive resource. Collecting one trajectory on a real robot takes tens of seconds and may damage the hardware; simulation also costs compute. If thousands of trajectories can be “imagined” inside a model, sample efficiency improves by one to two orders of magnitude. This is especially critical for embodied AI — collecting robot data costs far more than text and images.

5.1 Three Routes for World Models

RouteWhat it predictsRepresentative methodsMain advantageMain cost
Pixel reconstructionThe next image frameThe Dreamer familyIntuitive, visualizableCompute is wasted on texture details
Latent-space prediction (no decoder)Latent state + reward + valueTD-MPC2Fast, supports long-horizon planningLatent space is hard to interpret and drifts easily
Representation prediction (no reconstruction)Future representation (embedding)The JEPA familyIgnores unpredictable detailsNeeds protection against representation collapse; downstream adaptation is complex

The point of divergence among the three is a fundamental question: to what granularity should “predicting the future” predict? Pixel level is the most complete but the most wasteful; latent space is a compromise; representation level is the cheapest but needs extra regularization to avoid the degenerate solution “all inputs map to the same vector”.

5.2 DreamerV3: Training a Policy by “Dreaming” in Latent Space

Dreamer’s core component is the recurrent state space model (Recurrent State Space Model, RSSM). It splits the state into two parts:

  • Deterministic latent state hth_t: produced by a recurrent network (GRU) from the action history and the previous latent variable; it is responsible for memory;
  • Stochastic latent state ztz_t: sampled from a prior/posterior distribution; it is responsible for expressing uncertainty.
ht=fϕ(ht−1, zt−1, at−1),zt∼qϕ(zt∣ht, ot)  (posterior, sees the observation),z^t∼pϕ(zt∣ht)  (prior, does not see the observation)h_t = f_\phi(h_{t-1},\, z_{t-1},\, a_{t-1}),\qquad z_t \sim q_\phi(z_t \mid h_t,\, o_t)\ \ (\text{posterior, sees the observation}),\qquad \hat z_t \sim p_\phi(z_t \mid h_t)\ \ (\text{prior, does not see the observation})

The benefit of this design is that training uses the posterior (it has observations and is more accurate), while imagination uses the prior (there are no observations and it must predict) — and the two are pulled together by a KL term, which guarantees that “imagination” and “reality” do not diverge.

Derivation: The evidence lower bound (ELBO) of the RSSM, KL balancing, and the symlog transform

Step 1: write the lower bound of the log-likelihood. Let the observation sequence be o1:To_{1:T}, the actions a1:Ta_{1:T}, and the latent variables z1:Tz_{1:T}. Maximizing ln⁡p(o1:T∣a1:T)\ln p(o_{1:T}\mid a_{1:T}) directly is infeasible (it requires integrating over the latent variables), so variational inference introduces the posterior qϕ(zt∣ht,ot)q_\phi(z_t\mid h_t,o_t):

ln⁡p(o1:T∣a1:T)≥∑t=1TEqϕ[ln⁡pϕ(ot∣ht,zt)⏟reconstruction]−∑t=1TKL(qϕ(zt∣ht,ot) ∥ pϕ(zt∣ht))⏟distance between posterior and prior\ln p(o_{1:T}\mid a_{1:T}) \ge \sum_{t=1}^{T}\mathbb{E}_{q_\phi}\left[\underbrace{\ln p_\phi(o_t\mid h_t,z_t)}_{\text{reconstruction}}\right] - \sum_{t=1}^{T}\underbrace{\mathrm{KL}\left(q_\phi(z_t\mid h_t,o_t)\,\|\,p_\phi(z_t\mid h_t)\right)}_{\text{distance between posterior and prior}}

Key derivation: write ln⁡p(o∣a)=ln⁡∫p(o,z∣a) dz\ln p(o\mid a) = \ln \int p(o,z\mid a)\,\mathrm{d}z as ln⁡Eq[p(o,z)q(z)]\ln \mathbb{E}_{q}[\frac{p(o,z)}{q(z)}] and apply Jensen’s inequality (under the concave function ln⁡\ln, ln⁡E[X]≥E[ln⁡X]\ln\mathbb{E}[X]\ge\mathbb{E}[\ln X]). The reward and termination signals each have their own reconstruction terms, ln⁡pϕ(rt∣ht,zt)\ln p_\phi(r_t\mid h_t,z_t) and ln⁡pϕ(ct∣ht,zt)\ln p_\phi(c_t\mid h_t,z_t) (ctc_t being the “whether to continue” flag); together they form the complete objective.

Step 2: why the KL term needs “balancing”. The expression above optimizes two things at once: making the posterior close to the observation (improving reconstruction), and making the posterior close to the prior (improving predictability). The two conflict: the posterior wants to “remember every detail”, the prior wants to “keep only the predictable part”. Without weighting, the posterior usually fills the latent variables with details, so that the prior cannot learn and imagination deviates badly.

DreamerV3’s fix is to split the KL into two terms and stop the gradient on one of them (stop-gradient, written sg(⋅)\mathrm{sg}(\cdot)):

LKL=α KL(sg(qϕ) ∥ pϕ)+(1−α) KL(qϕ ∥ sg(pϕ)),α=0.8\mathcal{L}_{\mathrm{KL}} = \alpha\,\mathrm{KL}\left(\mathrm{sg}(q_\phi)\ \|\ p_\phi\right) + (1-\alpha)\,\mathrm{KL}\left(q_\phi\ \|\ \mathrm{sg}(p_\phi)\right),\qquad \alpha=0.8
  • The first term pulls the prior pϕp_\phi toward the posterior, but does not let the gradient flow through qϕq_\phi (qq is the “teacher” and must not degrade because of pp‘s shortcomings) — this term trains the prior, with weight 0.80.8;
  • The second term pulls the posterior qϕq_\phi toward the prior, likewise without letting the gradient flow through pϕp_\phi — it trains the encoder/posterior, with weight 0.20.2.

A larger α\alpha means “make the prior learn first”. This is the key to DreamerV3 running on dozens of wildly different tasks with one set of hyperparameters: the balancing coefficients decouple “learning the representation” from “learning to predict”, removing the need to retune the KL weight per task.

Step 3: why symlog is needed. Reward magnitudes differ hugely across tasks (+0.01 for one step, +100 for winning a game). Direct MSE regression lets large rewards dominate the gradient. DreamerV3 applies symmetric logarithmic compression to rewards, values, and observations alike:

symlog(x)=sign(x) ln⁡(1+∣x∣),symexp(y)=sign(y)(e∣y∣−1)\mathrm{symlog}(x) = \mathrm{sign}(x)\,\ln\left(1+|x|\right),\qquad \mathrm{symexp}(y)=\mathrm{sign}(y)\left(e^{|y|}-1\right)

Properties: when ∣x∣≪1|x|\ll1, symlog(x)≈x\mathrm{symlog}(x)\approx x (small values are not distorted); when ∣x∣≫1|x|\gg1, the growth is compressed logarithmically (large values do not explode); the sign is preserved, the function is monotonic and invertible (its inverse is symexp).

Step 4: why it handles negative rewards as well. Because symlog is an odd function, negative rewards are compressed the same way without losing their sign. With ln⁡(1+x)\ln(1+x) instead, negative rewards would be undefined — this is exactly why “symmetric” is necessary.

Step 5: policy learning happens “in imagination”. Starting from a real posterior state in latent space, the prior “imagines” an HH-step trajectory (no interaction with the environment), and the actor and critic are trained on the imagined trajectory with the λ\lambda-return (λ\lambda-return, i.e. the weighted multi-step return of TD(λ)):

Gtλ=rt+γ[(1−λ) Vψ(st+1)+λ Gt+1λ]G_t^{\lambda} = r_t + \gamma\left[(1-\lambda)\,V_\psi(s_{t+1}) + \lambda\,G_{t+1}^{\lambda}\right]

λ=1\lambda=1 degenerates into the Monte Carlo return (unbiased but high variance), λ=0\lambda=0 into one-step TD (biased but low variance); intermediate values balance the two. Note that no gradient flows back into the world model (the imagined trajectory is treated as “the environment”); otherwise the world model would be distorted by the policy objective.

5.2.1 DreamerV3 Pseudocode and Walkthrough

Initialization: RSSM (encoder q, prior p, decoder), actor, critic, replay buffer

for each round of interaction with the environment:
    # ---------- data collection (using the current actor, with exploration noise) ----------
    h, z = latent state at the previous instant
    observation o_t
    h = GRU(h, z, a_{t-1})
    z ~ q(h, o_t)                                 # an observation is available, so use the posterior
    a_t = actor(h, z) + exploration noise
    execute a_t, obtain o_{t+1}, r_t, c_t, and store them in the replay buffer

    # ---------- world model training ----------
    for each batch (sample sequences of length T from the replay buffer):
        for t = 1..T:
            h_t = GRU(h_{t-1}, z_{t-1}, a_{t-1})
            z_t ~ q(h_t, o_t)                     # posterior (for training)
            z_hat_t ~ p(h_t)                      # prior (computed at the same time, for the KL)
        L_recon = -ln p(o_t|h_t,z_t) - ln p(r_t|h_t,z_t) - ln p(c_t|h_t,z_t)
        L_KL    = 0.8·KL(sg(q) || p) + 0.2·KL(q || sg(p))
        L_wm    = L_recon + β_KL·L_KL + β_pred·(extra prediction terms for reward/termination)
        update the encoder/decoder/prior (without touching the actor or critic)

    # ---------- train the actor / critic in imagination ----------
    h, z = take real posterior states from the replay buffer as starting points
    for τ = 1..H (imagined steps, e.g. 15):
        z_hat ~ p(h)                              # prior only, no real observation
        r_hat, c_hat = decoder/prediction head(h, z_hat)
        h = GRU(h, z_hat, actor(h, z_hat))        # the action comes from the actor
        accumulate the λ-return G_τ
    L_actor  = -Σ G_τ                             # or a variant with entropy regularization
    L_critic = Σ (V(h,z) - sg(G_τ))²
    update the actor and critic (gradients do not flow back into the world model)

Walkthrough:

  1. “Training in imagination” is the source of its sample efficiency. One real interaction can be paired with several imagined rollouts (15–50 imagined steps per batch), as if one real trajectory were amplified into dozens of training signals. This is why Dreamer-class methods clearly outperform model-free RL in low-data regimes.
  2. The dual-track posterior/prior design cannot be omitted. With only the posterior, inference (the imagination phase) has no observation and collapses; with only the prior, training lacks enough information to fit the observations. The dual track plus a KL pulling them together is the only solution.
  3. The KL balancing coefficient α=0.8\alpha=0.8 is the key to “being general across tasks”. Traditional Dreamer has to tune the KL weight per task; after splitting the terms with stop-gradient, DreamerV3 can use a fixed value. Do not change this number casually when reproducing, because it encodes the explicit intent “make the prior predictable first”.
  4. symlog is not just a numerical trick. It makes the same loss function stable on tasks with reward magnitudes from 10−210^{-2} to 10210^{2}, and is a necessary condition for “one set of hyperparameters running dozens of tasks”.
  5. The number of imagined steps HH has an optimal value. Too short and long-term consequences are not learned; too long and errors accumulate (prior drift). In practice about 15 is common, together with “termination prediction” for early truncation (the model predicts “the episode ends” itself so as not to keep imagining in wrong states).
  6. Its weak point is “compounding model error”. After 50 imagined steps the predicted state may have completely diverged from reality, and the policy exploits the model’s flaws (model exploitation). It is therefore better suited to short-to-medium-horizon tasks; long-horizon tasks need hierarchy or model ensembles.
  7. It is “world model + RL”, not “model predictive control”. Dreamer trains a policy network on imagined trajectories and at deployment runs only the policy (fast); TD-MPC2 below does online planning (it runs optimization at deployment). These are two different engineering routes.

5.2.2 Gradient-Flow Checklist: The Three Non-Interfering Gradient Paths in DreamerV3

Dreamer trains the same representation with three losses at the same time, and the most failure-prone spot is “gradients contaminating each other”. Listing them one by one:

PathGradient requirementReason
World model loss (reconstruction + reward + termination prediction) → RSSM and decoderRequiredThis is the representation learning signal
KL term → posterior and priorRequired, but with an sg target on the prior sideGuarantees “the prior is predictable” rather than dragging the posterior down
Policy loss → policy networkRequiredMain signal
Policy loss → world modelMust be sg (stop gradient)Otherwise the policy “rewrites the world model into a fake model that yields high returns”, i.e. model exploitation
Value loss → value networkRequiredTD regression
Value loss → world model/policyShould be sgThe value is only an evaluator and should not rewrite the model
States zt+1,…z_{t+1},\dots on the imagined trajectoryKeep gradients to the policy, but cut them to the model with sgThis is Dreamer’s most critical graph structure

In PyTorch, this boundary of “the policy gradient goes through the policy but not the model” usually looks like this:

# Imagination rollout: states are rolled out by the model, but treated as constants for the policy loss
z = z_t.detach()
for t in range(H):
    a, logp = actor(z)                 # the policy output carries gradients
    z_next, r, cont = world_model.imagine(z.detach(), a.detach())
    z = z_next.detach()                # key point: the imagination chain does not backpropagate into the policy loss
    # the policy parameters only get gradients through the logp term; a's value enters the model and the gradient is cut here

The most common beginner mistake is “not detaching the whole imagination rollout”, so the policy loss backpropagates all the way into the RSSM; the return rises quickly for a short while, but after two or three hundred rounds the model has been rewritten to be more and more “optimistic” and real-robot performance falls off a cliff. The curve signature of this bug is very characteristic: training return rises monotonically, real evaluation return rises then collapses; when the two clearly diverge, check this gradient boundary.

5.2.3 DreamerV3 Implementation-Pitfall Checklist

SymptomLikely causeFix
Training return rises, real return collapsesThe policy loss backpropagates into the world model (model exploitation)detach the state in the imagination rollout
The picture becomes completely blurry after a few imagined stepsPrior drift, inappropriate KL balancing coefficientFix α=0.8\alpha=0.8; shorten the imagination horizon; use termination prediction for early truncation
It collapses whenever the reward magnitude changessymlog not used, return normalization not doneApply symlog to both reward and return uniformly; use percentile normalization
Posterior collapse, latent variables unusedKL weight too large, decoder too strongReduce the KL weight; check whether the reconstruction gradient reaches the posterior
Value scale driftValue target not normalized, symlog not usedApply symlog and percentile scaling to the value target
Long-horizon tasks learn nothingImagination error compounds, horizon exceeds the model’s reliable rangeHierarchical policy, shorten HH, add model ensembles
Discrete-action tasks do not convergeThe policy still uses a Gaussian instead of a categorical distributionSwitch the distribution according to the action type
Out of GPU memoryImagined sequences and real sequences are backpropagated togetherBackpropagate in segments; keep only the policy gradient in the imagination segment
Hyperparameters must be retuned for a new taskThe “cross-task fixed hyperparameter” configuration is not usedAdopt the fixed hyperparameter set from the original paper (including α\alpha, symlog, percentiles)

5.2.4 Route Differences from TD-MPC2, and Applicability

DimensionDreamerV3TD-MPC2
DecoderYes (reconstructs observations)No (constrained by a consistency loss)
Policy networkYes (deployment runs only the policy)No (online planning at deployment)
Deployment computeOne forward pass, extremely fastCEM iterations at every step, slower
Training signalReconstruction + reward + terminationConsistency + reward + TD
Suitable tasksShort-to-medium horizon, needs dense representationsShort horizon, needs precise local control
Main riskThe model is exploited by the policyPlanning falls into the model-error region

DreamerV3’s applicability boundary:

ScenarioSuitable for DreamerV3?Reason and recommendation
Simulation training with a low data budgetVery suitableOne real interaction can be amplified into dozens of imagined ones
Visual input that requires representation learningVery suitableThe reconstruction objective provides dense supervision
Multi-task settings with very different reward magnitudesVery suitablesymlog + fixed hyperparameters are designed exactly for this
High-precision contact tasks (peg insertion)So-soReconstructed pixels do not match the precision required for decisions; planning-based methods are more suitable
Long-horizon tasks (> hundreds of steps)WeakerError compounds; hierarchy is needed
Online learning on real robotsSo-soTraining is expensive, and model errors are costly on real hardware

5.3 TD-MPC2: Latent-Space MPC That Skips Decoding and Only Plans

The philosophy of TD-MPC2 (Temporal Difference Model Predictive Control, 2023–2024) is the opposite of Dreamer’s: do not reconstruct observations, and do not train a policy network; do model predictive control (Model Predictive Control, MPC) directly in latent space.

It needs only four components:

zt=encϕ(ot)⏟encoder,zt+1=dϕ(zt,at)⏟latent dynamics,r^t=Rϕ(zt,at)⏟reward head,Vψ(zt)⏟value head\underbrace{z_t = \mathrm{enc}_\phi(o_t)}_{\text{encoder}},\quad \underbrace{z_{t+1} = d_\phi(z_t, a_t)}_{\text{latent dynamics}},\quad \underbrace{\hat r_t = R_\phi(z_t,a_t)}_{\text{reward head}},\quad \underbrace{V_\psi(z_t)}_{\text{value head}}

There is no decoder — this is its most important design choice. The benefit is saved compute and avoidance of “reconstructing pixels”, an objective unrelated to decisions; the price is that the latent space has no pixel-level supervision and must be “pinned down” by other losses.

Derivation: the decoder-free representation-consistency loss, TD learning, and CEM planning

Question one: without a decoder, how do we prevent latent-space collapse? If we optimize only reward prediction, the encoder can map all observations to the same vector (because the reward depends only on task-relevant parts). TD-MPC2 constrains this with a multi-step temporal consistency loss: the result of “rolling kk steps in latent space” is aligned with “directly encoding the real observation kk steps later”:

Lcons=∑k=1H∥dϕ(k)(zt, at:t+k−1)−sg(encϕ(ot+k))∥22\mathcal{L}_{\mathrm{cons}} = \sum_{k=1}^{H}\left\| d_\phi^{(k)}(z_t,\, a_{t:t+k-1}) - \mathrm{sg}\left(\mathrm{enc}_\phi(o_{t+k})\right) \right\|_2^2

Here d(k)d^{(k)} means rolling the dynamics kk times, and sg\mathrm{sg} means no gradient is backpropagated on the target side (otherwise the encoder can “cheat” by driving both sides to zero).

Why this expression prevents collapse. It requires the latent state to retain enough information to predict the next HH steps. If all observations were mapped to the same vector, the target kk steps later would be identical to the current one, which implicitly requires that observations “making the future distinguishable from the present” must be encoded — so the collapsed solution does not satisfy consistency.

Question two: how is the value learned? With TD learning (Temporal Difference), the target is nn-step bootstrapping (using one’s own estimate as the target for later timesteps):

LV=E[(Vψ(zt)−sg(∑i=0n−1γir^t+i+γnVψ(zt+n)))2]\mathcal{L}_{V} = \mathbb{E}\left[\left(V_\psi(z_t) - \mathrm{sg}\left(\sum_{i=0}^{n-1}\gamma^i \hat r_{t+i} + \gamma^{n} V_\psi(z_{t+n})\right)\right)^2\right]

sg\mathrm{sg} guarantees that gradients flow only out of “the current value”, while the target side is treated as a constant — this is the common formulation of all TD methods, otherwise a fixed-point drift of “chasing one’s own tail” appears.

Question three: how are actions selected at deployment? With the cross-entropy method (Cross-Entropy Method, CEM). It performs iterative sampling-based optimization in the space of action sequences:

  1. Initialize the action-sequence distribution N(μ1:H, σ1:H2)\mathcal{N}(\mu_{1:H},\ \sigma^2_{1:H}) (diagonal Gaussian);
  2. Sample NN candidate sequences, roll each HH steps with the model, and accumulate the return
G^(i)=∑t=1Hγt−1r^t(i)+γHVψ(zH(i))\hat G^{(i)} = \sum_{t=1}^{H}\gamma^{t-1}\hat r_t^{(i)} + \gamma^{H}V_\psi(z_H^{(i)})
  1. Take the KK “elites” with the highest returns (K<NK<N) and re-estimate the mean and variance from their actions:
μ←mean(elites),σ←std(elites)\mu \leftarrow \mathrm{mean}(\text{elites}),\qquad \sigma \leftarrow \mathrm{std}(\text{elites})
  1. Repeat steps 2–3 a few rounds and output the first several steps of μ\mu as the actions to execute.

Why CEM rather than gradient optimization. The MPC objective is “the cumulative return over the next HH steps”; taking its gradient with respect to actions requires backpropagating through the entire dynamics model (an extremely deep computation graph, with bounded actions). CEM is gradient-free: it only needs forward rollouts and naturally supports action bounds (clipping after sampling), so it is robust. The price is many samples — this is the main compute cost of MPC-style methods at deployment.

Question four: the relationship between CEM and “temperature”. If elite selection is viewed as softmax weighting, the shrinkage speed of σ\sigma is equivalent to a “temperature” parameter: shrinking too fast converges prematurely to a local optimum, too slow gives insufficient precision. In practice, a fixed number of iterations (say 6) with moderate shrinkage per round is the stable choice.

5.3.1 TD-MPC2 Pseudocode and Walkthrough

Components: encoder enc, latent dynamics d, reward head R, value head V (no decoder)
Hyperparameters: planning horizon H (e.g. 5), CEM sample count N (e.g. 512), elite count K (e.g. 64), iteration count M (e.g. 6)

# ---------- Training (interact with the environment + sample from the replay buffer) ----------
for each interaction:
    z = enc(o_t)
    obtain a_t by CEM planning (see below), add exploration noise and execute, store (o_t, a_t, r_t, o_{t+1}, c_t)

for each training batch:
    z_t = enc(o_t)
    for k = 1..H:
        z_hat_{t+k} = d(z_hat_{t+k-1}, a_{t+k-1})
        r_hat_{t+k-1} = R(z_hat_{t+k-1}, a_{t+k-1})
    L_cons = Σ_k || z_hat_{t+k} - sg(enc(o_{t+k})) ||²
    L_rew  = Σ_k (r_hat_{t+k-1} - sg(r_{t+k-1}))²
    L_val  = (V(z_t) - sg(Σ_{i<n} γ^i r_{t+i} + γ^n V(z_{t+n})))²
    L = L_cons + L_rew + L_val
    update enc, d, R, V

# ---------- CEM planning at deployment (run at every control step) ----------
μ = 0, σ = 1                       # initialize the action-sequence distribution (H × action dimension)
for m = 1..M:
    # sample N candidate action sequences, all clipped to the action bounds
    for i = 1..N:
        A^(i) = clip(μ + σ·ε^(i)),  ε^(i) ~ N(0, I)
        z = enc(o_t)
        G^(i) = 0
        for t = 1..H:
            r = R(z, A^(i)_t);  z = d(z, A^(i)_t)
            G^(i) += γ^{t-1}·r
        G^(i) += γ^H·V(z)                         # bootstrap with the value function at the end
    select the K sequences with the largest G → update μ, σ with their A
output the first several steps of μ, execute them, then replan (receding horizon)

Walkthrough:

  1. The decoder-free design is a deliberate trade-off. It saves the compute of “reconstructing the whole image” and removes that objective conflict, letting the model focus on “information relevant to decisions”. The price is that the representation must be pinned down by a consistency loss, and the latent space cannot be visualized and is hard to debug.
  2. The consistency loss acts like a “self-supervised world model”. It gives the encoder a representation with a “predict-the-future” structure, which is the same idea as JEPA (see 5.4); the only difference is that TD-MPC2 predicts “the latent state” while JEPA predicts “the output of a target encoder”.
  3. Deployment compute is spent entirely on planning. Each control step requires M×NM\times N forward rollouts (e.g. 6×512=30726\times512=3072), which is tight at 50 Hz even with a small model. This is the inherent bottleneck of the MPC route for high-frequency control, and it is exactly where Dreamer’s “train a policy, run one forward pass at deployment” wins.
  4. CEM parallelizes very well. The NN candidates can be fully parallelized (batched forward passes), so it is not slow on a GPU; the real latency comes from “having to replan when control steps are short”.
  5. It is easier than Dreamer to use in scenarios with “frequent task switching”. Planning targets the reward directly, so changing tasks only means changing the reward function, without retraining a policy; Dreamer usually needs to retrain the actor when the task changes.
  6. Weak points. Latent-model error accumulates after HH rollout steps, leading to “model exploitation”; and CEM is only a local optimizer, so sampling efficiency drops when the action space is high-dimensional (e.g. 30+ dimensions for a humanoid). In practice it is often paired with “prior-policy sampling” (learning an action proposal distribution) to mitigate this.

5.3.2 Gradient-Flow Checklist: TD-MPC2’s Four “sg”s

All TD-MPC2 losses are written in the same line of code, and where sg\mathrm{sg} sits determines whether it learns correctly:

PathGradient requirementWhat happens otherwise
Consistency loss → dynamics ddRequiredThe dynamics is not learned and planning immediately fails
Consistency-loss target enc(ot+k)\mathrm{enc}(o_{t+k})Must be sgBoth sides move, and the encoder compresses all observations into the same vector (collapse)
Reward-loss target rt+kr_{t+k}Must be sg (the label itself has no gradient)Usually not a mistake, but taking the label from the model output is self-deception
Value-loss target (nn-step return + V(zt+n)V(z_{t+n}))Must be sgThe target chases itself and the value scale drifts
CEM forward passes during planningNo gradient neededWrap in torch.no_grad(), otherwise GPU memory explodes
Encoder parameters ϕ\phiUpdated jointly by the consistency, reward, and value pathsImbalanced weights across the three paths bias the representation toward one objective

One easily overlooked detail: in the consistency loss, sg\mathrm{sg} should only be applied to the target side; the prediction side dd must not be wrapped in no_grad as well. Some people wrap the whole block to save memory, so the dynamics only receives gradients from the reward loss, diverges after a few rollouts, and shows up as “H=1H=1 is fine, H=5H=5 is a mess”.

5.3.3 TD-MPC2 Implementation-Pitfall Checklist

SymptomLikely causeFix
Latent-space collapse, planned actions constantConsistency target not sg, encoder too strongstop_grad on the target side; add VICReg-style variance regularization
Predictions completely distorted after HH rollout stepsConsistency trained only for k=1k=1, γ\gamma too close to 1Cover consistency up to HH steps; use HH of 3–5; lower γ\gamma appropriately
Planned actions jitter, execution not smoothμ,σ\mu,\sigma re-initialized from scratch at every stepWarm-start from the previous solution; or low-pass filter the output
Deployment cannot reach the control frequencyM×NM\times N too large, model not smallReduce MM (4–6) and NN (128–256); batch the forward passes; lower the control frequency
Planning fails for high-dimensional actions (30+ dims)CEM sampling is inefficient in high-dimensional spacesLearn an action proposal network, reduce dimensionality, or use MPPI (Model Predictive Path Integral) instead
Collapses after the reward scale changesReward not normalizedStandardize the reward; symlog the value target
Retraining needed when the task changesNormal (it is reward-driven)Just change the reward function; fine-tune the model if necessary
Training loss drops but real-robot performance is badThe latent space is misaligned with pixels (cannot be debugged visually)Add an auxiliary reconstruction head for diagnosis (training only)

5.3.4 Comparison with DreamerV3 and JEPA, and Applicability

DimensionTD-MPC2DreamerV3JEPA
Representation learningConsistency loss (no decoder)Reconstruction + KL (with decoder)Prediction in representation space + EMA
Decision makingOnline CEM planningTrains a policy networkUsually representation pretraining, followed by a downstream policy
Deployment latencyHigh (planning at every step)Extremely low (one forward pass)Depends on the downstream component
Cost of switching tasksLow (change the reward)High (retrain the actor)Medium
Main riskLocal optima, hard sampling in high dimensionsModel exploitation, imagination driftRepresentation collapse

TD-MPC2’s applicability boundary:

ScenarioSuitable for TD-MPC2?Reason and recommendation
Short horizon, precise local control (pushing, insertion, turning)Very suitablePlanning can optimize the reward directly, with high precision
Needs frequent task switchingVery suitableOnly the reward function changes
Low-dimensional actions (≤ 12 dims)Very suitableCEM sampling efficiency is acceptable
Whole-body control of a high-dimensional humanoidSo-soCurse of dimensionality in sampling; needs a proposal network or hierarchy
High-frequency control (> 50 Hz)WeakerPer-step planning is expensive
Long-horizon tasksWeakerModel error compounds
Just want a fast deployable policyNot suitableUse Dreamer or plain model-free RL

5.4 JEPA: Predicting “Representations”, Not “Details”

The core claim of JEPA (Joint-Embedding Predictive Architecture, proposed from 2022 onward by Yann LeCun’s group) is: when predicting the future you should not predict every pixel, because most pixels are unpredictable (texture, lighting, noise), and forcing a prediction only makes the model waste compute on irrelevant details.

Its approach: encode both the observation xx and the target yy into representations, then predict in representation space.

LJEPA=∥predϕ(encθ(x), a)−sg(encθˉ(y))∥2\mathcal{L}_{\mathrm{JEPA}} = \left\| \mathrm{pred}_\phi\left(\mathrm{enc}_\theta(x),\, a\right) - \mathrm{sg}\left(\mathrm{enc}_{\bar\theta}(y)\right) \right\|^2

Here encθˉ\mathrm{enc}_{\bar\theta} is the target encoder, whose parameters θˉ\bar\theta are not updated by gradients but by an exponential moving average (Exponential Moving Average, EMA) of the online encoder parameters:

θˉ←m θˉ+(1−m) θ,m≈0.99\bar\theta \leftarrow m\,\bar\theta + (1-m)\,\theta,\qquad m\approx 0.99
Derivation: why a target encoder and EMA are needed, the three forms of representation collapse, and VICReg regularization

Question one: what happens without a target encoder? If the loss is written directly as ∥pred(enc(x),a)−enc(y)∥2\|\mathrm{pred}(\mathrm{enc}(x),a)-\mathrm{enc}(y)\|^2, gradients optimize the predictor and both encoders at the same time. The laziest solution is to let the encoder output a constant (identical for all inputs), making the loss identically zero. This is representation collapse.

Question two: why does an EMA target encoder mitigate it? Once the target side has its gradient cut by sg\mathrm{sg}, the encoder can no longer be lazy by “pulling the representation of yy toward the prediction”; and θˉ\bar\theta follows θ\theta slowly, providing a lagging but identically distributed target. This is the same idea as the momentum encoder in “Momentum Contrast” (MoCo): use a slowly moving anchor to prevent both sides from collapsing together.

Question three: the effective time constant of EMA. Expanding θˉ\bar\theta recursively gives

θˉk=(1−m)∑i=0∞mi θk−i\bar\theta_k = (1-m)\sum_{i=0}^{\infty} m^{i}\,\theta_{k-i}

that is, the target parameters are a geometrically weighted average of past online parameters, with an effective window of about 1/(1−m)1/(1-m) steps (about 100 steps when m=0.99m=0.99). Too large mm → the target lags too much and learning stalls; too small mm → the target is synchronized with the online encoder and collapse prevention fails. 0.99 is a good empirical compromise.

Question four: even with EMA, collapse can still happen — how do we prevent it completely? Add explicit variance–covariance regularization, i.e. VICReg (Variance-Invariance-Covariance Regularization):

LVICReg=λinv∥pred−sg(zˉ)∥2⏟invariance+λvar∑jmax⁡(0, γ−std(z⋅,j))⏟prevents single-dimension collapse+λcov∑i≠j[Cij]2⏟prevents dimension redundancy\mathcal{L}_{\mathrm{VICReg}} = \lambda_{\mathrm{inv}}\underbrace{\left\|\mathrm{pred}-\mathrm{sg}(\bar z)\right\|^2}_{\text{invariance}} + \lambda_{\mathrm{var}}\underbrace{\sum_{j}\max\left(0,\ \gamma-\mathrm{std}(z_{\cdot,j})\right)}_{\text{prevents single-dimension collapse}} + \lambda_{\mathrm{cov}}\underbrace{\sum_{i\neq j}\left[C_{ij}\right]^2}_{\text{prevents dimension redundancy}}
  • Variance term: requires the standard deviation of every representation dimension to be at least γ\gamma (a hinge loss) and penalizes otherwise — directly forbidding “all outputs are the same”;
  • Covariance term: requires covariances between different dimensions to be close to 0, avoiding dimension redundancy (two dimensions carrying the same information is a waste);
  • Invariance term: this is the actual prediction objective.

Together the three terms remove the degenerate “collapsed” solution from the feasible set.

Question five: why is “representation prediction” useful for robots? Because the effect of an action is usually reflected in a few key quantities (whether an object moved, whether it was grasped), while pixel-level details (reflections, shadows) are useless for decisions and hard to predict. Predicting representations amounts to automatic “information filtering”, concentrating modeling capacity on the controllable, predictable part. This also explains why JEPA-style methods have outstanding sample efficiency on video and robotics.

Question six: the price. Predictions in representation space cannot be directly “visualized”, so debugging is hard; and if a downstream task needs exactly the details that the representation discarded (e.g. “which way the screw groove faces”), performance drops. JEPA is therefore better suited to high-level planning and representation learning; fine-grained manipulation still usually needs pixel-level or geometric supervision.

Pretraining (self-supervised, runs even without action labels):
online encoder enc_θ, predictor pred_φ, target encoder enc_θ̄ (θ̄ initialized from θ)

for each batch (sampling (x, y, a) from unlabeled video/trajectories):
    z_x = enc_θ(x)
    z_y = enc_θ̄(y)                     # target side, gradient cut
    z_hat = pred_φ(z_x, a)              # prediction in representation space
    L = || z_hat - sg(z_y) ||²
        + λ_var·variance regularizer(z_x)
        + λ_cov·covariance regularizer(z_x)
    update θ, φ
    θ̄ = m·θ̄ + (1-m)·θ                  # EMA update of the target encoder

Downstream use (two ways):
  (a) use enc_θ as a visual encoder and attach it to the action head of ACT / DP / VLA for fine-tuning;
  (b) add a planner in representation space (similar to TD-MPC2's CEM), but roll out in z space

Walkthrough:

  1. It is essentially a “self-supervised world model”. It can learn “what changes together with what” from video without action labels, which lets it use internet-scale video pretraining — this is its biggest data advantage over Dreamer/TD-MPC2.
  2. Target encoder + EMA + variance regularization: all three are indispensable. Removing any one of them makes training collapse or diverge. Reproductions must implement all three together.
  3. Where does aa (the action) in the loss come from. If the data has action labels (robot trajectories), feed the action directly; if there is only video, “latent actions” or “inter-frame differences” can serve as a coarse action proxy. The latter is what many video world models actually do.
  4. It is complementary to VLA, not a replacement. JEPA provides visual representations and physical intuition, VLA provides semantics and action generation; recent work has attached JEPA-style pretraining to VLA backbones, which is a fusion of the two paradigms.
  5. A common misuse in practice. Treating JEPA as “universal pretraining” and directly attaching a linear action head is often worse than a dedicated action head (diffusion/flow matching); the correct usage is to use its encoder as initialization, while the action head still follows the methods in Chapter 3/Chapter 4.

5.4.1 Gradient-Flow Checklist: JEPA Has Only One Gradient Path but Three “Do-Not-Touch” Rules

PathGradient requirementExplanation
Prediction loss → online encoder θ\thetaRequired (can carry a small weight)Adapts the representation to the “predictable” objective
Prediction loss → predictor ϕ\phiRequired (main signal)The predictor carries most of the fitting work
Prediction loss → target encoder θˉ\bar\thetaMust be sgThe target side does not move, otherwise both sides collapse
Variance regularizer / covariance regularizer → online encoderRequiredPrevents all outputs from collapsing to one point
EMA update of θˉ\bar\thetaNot a gradient, but a parameter writeMust not be updated by the optimizer, and must not appear in .parameters()
Downstream fine-tuning stageUsually freeze the encoder or use a low learning rateAvoid destroying the learned representation

An extremely hidden implementation bug: registering the target encoder in the optimizer as well (e.g. optimizer = Adam(list(online.parameters()) + list(target.parameters()))). Then sg looks applied, but the optimizer still moves θˉ\bar\theta one step per iteration, destroying the “slow anchor” property of EMA; nothing shows up early in training, but the representation gradually collapses later. The correct approach is to set requires_grad=False on the target encoder parameters, not pass them to the optimizer, and write them in place with the EMA formula only.

5.4.2 JEPA Implementation-Pitfall Checklist

SymptomLikely causeFix
Representation collapse (all inputs map to the same vector)Target side not sg, no variance regularization, EMA coefficient too smallstop_grad on the target side; add VICReg variance/covariance terms; raise mm above 0.99
The loss suddenly becomes NaNRepresentations not normalized, variance-regularizer weight too largeL2-normalize the representations; tune the regularizer weight to the loss magnitude
Pretraining is good, downstream is badThe representation lost task-relevant detailsDo not fully freeze downstream; add an adaptation layer; or change the prediction target
Training on video works, on robots it does notAction proxy too coarse (frame differences), wrong temporal spanUse real actions or a finer action proxy; adjust the prediction time span
Training is extremely slowTwo encoders are computed at every step and the target side is not cachedUse no_grad on the target side; video-frame features can be pre-extracted and cached
Representations are inconsistent across viewsEach view encoded independently, no cross-view predictionAdd a cross-view prediction objective (the same downstream state under different views should align)
The predictor is too strong, the encoder “gets lazy”Predictor capacity far exceeds encoder capacityBalance the two capacities; give the encoder loss a higher weight

5.4.3 Positioning Difference from Dreamer and TD-MPC2, and Applicability

The fundamental difference between JEPA and the other two is not in “network structure” but in the fact that it is usually not a complete policy, but a representation-pretraining stage. Dreamer and TD-MPC2 both come with a decision mechanism (policy or planning); JEPA only provides a “predictable representation”, and decisions must be attached downstream.

ScenarioSuitable for JEPA?Reason and recommendation
Plenty of video without action labelsVery suitableThis is exactly its data advantage over Dreamer/TD-MPC2
As visual-backbone initialization for VLA / ACT / DPVery suitableImproves sample efficiency and physical intuition
Needs fine-grained geometric precision (screw-groove orientation)WeakerRepresentations drop details; pixel-level or geometric supervision is needed
Used alone as a complete policyNot suitableLacks a decision mechanism; must attach an action head or planner
Extremely limited compute, very little dataSo-soPretraining is expensive, and the gains are unclear with small data
Needs fast interpretable debuggingWeakerThe latent space cannot be visualized

5.5 How to Choose Among the Three

DimensionDreamerV3TD-MPC2JEPA
Decoder neededYes (reconstructs observations)NoNo
What deployment computesOne forward pass of the policy networkOnline CEM planning (expensive)Depends on the downstream attachment
Sample efficiencyVery highHighVery high (can work without action labels)
Fit for high-frequency controlGood (policy forward pass is fast)Poor (planning at every step)Good (if attached to a policy head)
Cost of switching tasksRequires retraining the actorOnly change the reward functionRequires fine-tuning the downstream head
Main riskCompounding model error, exploiting loopholesLatent-space drift, planning computeRepresentation collapse, loss of details
Typical useLow-data control, gamesMedium-horizon control, fast adaptationVisual pretraining, high-level planning

One-sentence selection guide: to train a policy that can execute at high frequency under a low data budget → DreamerV3; to adapt quickly to a new reward at test time with compute available for planning → TD-MPC2; to learn representations from massive unlabeled video → JEPA.


6. Robustness Layer: From Simulation to Reality (Sim-to-Real)

Up to here, every method above can produce beautiful curves in simulation. But a 95% success rate in simulation often drops to 30% on real hardware. This layer introduces no new paradigm; it only asks “how do we make what was learned in simulation still hold in the real world” — the unavoidable gate of every robotics project, and the one that consumes the most engineering time.

6.1 The Six Sources of the Reality Gap

Classifying the differences is the first step to solving them. Ordered by “difficulty of fixing”, from easy to hard:

SourceManifestationCommon countermeasure
① Visual domain gapLighting, color temperature, material reflections, background texture, camera exposureImage randomization, fine-tuning on real images, domain adaptation
② Sensor noise and latencyCamera 20–60 ms latency, IMU noise, encoder quantizationLatency modeling, noise injection, state-estimation filtering
③ Dynamic parametersMass, center of mass, joint damping, link flexibilityDomain randomization, system identification
④ Actuator nonlinearityDead zone, saturation, backlash, PD gains drifting with temperatureActuator models, torque limiting, identification from real data
⑤ Contact and frictionCollision stiffness, friction cone, static/dynamic friction switching, deformationDomain randomization + soft contact models; the hardest
⑥ Control loopFrequency mismatch, filter phase lag, communication jitterUnify the control frequency, latency compensation, time alignment

Why ⑤ is the hardest: contact is a discontinuous, non-differentiable, strongly nonlinear physical process. “Rigid body + Coulomb friction” in a simulator differs enormously from “elastic deformation + stick-slip switching” in reality, and manipulation tasks rely entirely on contact (grasping, pushing, inserting, screwing). This is also why real-robot success rates on contact-rich tasks have long been low — it is not a matter of tuning parameters but of model accuracy.

Before discussing any policy, get the three calibration quantities of the perception pipeline right — get any one wrong and all the later domain randomization and fine-tuning is wasted, because they fix model errors while what is wrong here is “the input itself”:

  1. Camera intrinsics and extrinsics: intrinsic errors bend the pixel-to-ray mapping as a whole, while extrinsic errors show up directly as a systematic offset between “the object position you see” and “the real object position”. Use a checkerboard or dot calibration board for standard calibration, and recalibrate after every collision, lens change, or mounting change; recalibration is far cheaper than misdiagnosing “the policy does not converge”.
  2. Hand-eye calibration: aligning the camera frame with the robot end-effector (or base) frame. With eye-in-hand (the camera is mounted on the end-effector) the error changes with joint configuration; with eye-to-hand (the camera is fixed to the frame) the error changes with frame vibration and workspace position — the two error types look completely different, so fault diagnosis must first decide which one it is.
  3. Time synchronization: image timestamps and joint-angle timestamps must be aligned at the millisecond level. Misalignment puts “observation” and “action” out of step, which for the policy is equivalent to injecting random latency, so it learns the wrong causal relationship — on training curves this shows up as “great in simulation, mysteriously jittery on the real robot”.

If there are also tactile, force/torque, or IMU sensors, calibrate their zero points and ranges first in the same way, and unify the coordinate frames of all cameras and sensors into the same base frame.

6.2 Domain Randomization: Making the Policy “Well-Traveled”

Domain randomization (Domain Randomization, DR) is the most mainstream and most effective move: do not train with a single set of parameters; every episode samples a set of environment parameters from a distribution (mass, friction, lighting, camera position, latency, …), so the policy learns to “succeed even when the parameters are uncertain”.

It essentially replaces the “training distribution” from a single point δ(ξreal)\delta(\xi_{\mathrm{real}}) with a distribution ptrain(ξ)p_{\mathrm{train}}(\xi) covering the real parameters.

Derivation: the risk upper bound of domain randomization, the coverage condition, and the cost of “randomizing too widely”

Step one: formalization. Let the environment parameters be ξ∈Ξ\xi\in\Xi (mass, friction coefficient, light intensity, etc.); the expected return of policy π\pi under parameters ξ\xi is

J(π;ξ)=Eτ∼p(τ∣π,ξ)[G(τ)]J(\pi;\xi) = \mathbb{E}_{\tau\sim p(\tau\mid \pi,\xi)}\left[G(\tau)\right]

The training objective is “the average over the randomization distribution”:

Jtrain(π)=Eξ∼ptrain[J(π;ξ)]J_{\mathrm{train}}(\pi) = \mathbb{E}_{\xi\sim p_{\mathrm{train}}}\left[J(\pi;\xi)\right]

while what we really care about is J(π;ξreal)J(\pi;\xi_{\mathrm{real}}) — a single point.

Step two: write the difference between the single point and the average as an integral. If ξreal\xi_{\mathrm{real}} lies in the support of ptrainp_{\mathrm{train}},

J(π;ξreal)−Jtrain(π)=∫Ξ[J(π;ξreal)−J(π;ξ)] ptrain(ξ) dξJ(\pi;\xi_{\mathrm{real}}) - J_{\mathrm{train}}(\pi) = \int_{\Xi}\left[J(\pi;\xi_{\mathrm{real}}) - J(\pi;\xi)\right]\,p_{\mathrm{train}}(\xi)\,\mathrm{d}\xi

Step three: use total variation distance to give an upper bound. If the return is bounded ∣G(τ)∣≤Gmax⁡|G(\tau)|\le G_{\max}, then for any two environment parameters the difference in their trajectory distributions can be controlled by the total variation (Total Variation, TV) distance:

∣J(π;ξreal)−J(π;ξ)∣≤2Gmax⁡ TV(p(τ∣ξreal), p(τ∣ξ))\left|J(\pi;\xi_{\mathrm{real}}) - J(\pi;\xi)\right| \le 2G_{\max}\,\mathrm{TV}\left(p(\tau\mid\xi_{\mathrm{real}}),\ p(\tau\mid\xi)\right)

(This step comes from the standard result “the difference of the expectations of a bounded function under two distributions does not exceed a constant × TV distance”.)

Substituting into the previous expression gives

J(π;ξreal)≤Jtrain(π)+2Gmax⁡Eξ∼ptrain[TV(p(τ∣ξreal),p(τ∣ξ))]⏟denoted ΔgapJ(\pi;\xi_{\mathrm{real}}) \le J_{\mathrm{train}}(\pi) + 2G_{\max}\underbrace{\mathbb{E}_{\xi\sim p_{\mathrm{train}}}\left[\mathrm{TV}\left(p(\tau\mid\xi_{\mathrm{real}}),p(\tau\mid\xi)\right)\right]}_{\text{denoted }\Delta_{\mathrm{gap}}}

Step four: what this upper bound tells us. It is “training performance + a penalty term Δgap\Delta_{\mathrm{gap}}”, and Δgap\Delta_{\mathrm{gap}} depends on two things:

  1. Whether ptrainp_{\mathrm{train}} has mass near ξreal\xi_{\mathrm{real}} (coverage). If the randomization range simply does not contain the real value, Δgap\Delta_{\mathrm{gap}} is large and the upper bound is useless — this is the most common failure cause: friction is only randomized up to 0.5 while the real robot is at 1.2.
  2. The spread of ptrainp_{\mathrm{train}}. The narrower ptrainp_{\mathrm{train}}, the higher the probability of landing near ξreal\xi_{\mathrm{real}} and the smaller Δgap\Delta_{\mathrm{gap}}; but the easier it is to “miss” the real value.

Step five: why “wider is better” is wrong. Widen the randomization range and the training objective JtrainJ_{\mathrm{train}} becomes “the average over a large number of extreme environments”. To cover all cases the policy takes more conservative actions (e.g. always slow down, increase grip force), causing lower absolute performance in the real environment. This is another manifestation of the bias–variance trade-off:

J(π;ξreal)⏟real performance≈Jtrain(π)⏟decreases as the range widens(the policy becomes conservative)+Δgap⏟decreases as the range widens\underbrace{J(\pi;\xi_{\mathrm{real}})}_{\text{real performance}} \approx \underbrace{J_{\mathrm{train}}(\pi)}_{\substack{\text{decreases as the range widens}\\\text{(the policy becomes conservative)}}} + \underbrace{\Delta_{\mathrm{gap}}}_{\text{decreases as the range widens}}

The two terms move in opposite directions, so there is an optimum: a width that exactly covers the real parameter distribution.

Step six: practical conclusions. Three operational guidelines:

  • Measure the real parameters first (even roughly, with a scale, force gauge, caliper) to determine the lower and upper bounds of the randomization interval, and never let the real value fall outside it;
  • Make the interval slightly wider than the measured range (e.g. measured friction 0.8–1.1, randomized 0.6–1.3), leaving margin for calibration error;
  • Widen the “most critical parameters” and narrow the “irrelevant ones” — for example, in grasping tasks friction matters far more than background texture, so do not waste randomization budget on texture.

6.2.1 Automatic Domain Randomization (ADR)

Setting randomization ranges by hand is time-consuming, and the optimal range differs across tasks. ADR (Automatic Domain Randomization) lets the range grow automatically: start from a very narrow interval and expand outward once the policy performs well enough at the “boundary”.

Initialization: set the interval [lo, hi] of every parameter very narrow (even close to the real value)
Hyperparameters: expansion threshold θ_pass (e.g. success rate 0.7), expansion step δ

for each training round:
    # ---------- Data collection: sample according to the current interval ----------
    sample one episode of environment parameters ξ ~ U(lo, hi)
    run the policy under ξ, record whether it succeeded (or the return)
    store into the replay buffer

    # ---------- Decide whether expansion is needed ----------
    compute the success rate p_boundary "near the interval boundary"
    if p_boundary > θ_pass:
        for every expandable parameter:
            with some probability decrease lo by δ and increase hi by δ      # or expand by quantiles
        if the interval has reached the physical upper/lower limit: freeze that parameter

    # ---------- Policy update ----------
    train PPO/SAC with all data in the replay buffer (including data from historically narrower intervals)

Walkthrough:

  1. The core of ADR is “curriculum learning”. It replaces “handing over a very wide range all at once” with “widening gradually”, avoiding the problem that an early policy cannot learn at all under extreme environments. This matches the idea of curriculum learning.
  2. The boundary success rate is the “passing grade”. The range may only be pushed harder when the policy can also succeed at the hardest end. The threshold θpass\theta_{\mathrm{pass}} therefore decides “how robust a policy must be before expanding”, usually 0.7–0.9.
  3. Historical data must be kept. After expansion, data from the old interval must not be discarded, otherwise the policy “forgets” it (catastrophic forgetting). This is a common bug in ADR implementations.
  4. Must expansion act on all related parameters simultaneously? No. Each parameter can be judged independently (maintaining its own boundary success rate), so “easy parameters” expand first and “hard parameters” later, which is more efficient.
  5. Its ceiling is the simulator’s physical limit. If the simulator itself cannot express real friction behavior, no amount of range expansion reaches real-robot performance — ADR can only cover parameters; it cannot fix structural errors in the model.

6.2.2 Complete Pseudocode for Domain Randomization + PPO

# Goal: train a grasping policy in simulation that can go straight onto the real robot

# ---------- 0. Build the parameter table (measure first) ----------
parameter_table = {
  mass:            [0.8× measured, 1.2× measured],
  friction_coef:   [0.6× measured, 1.3× measured],
  joint_damping:   [0.7× nominal, 1.5× nominal],
  PD_gain:         [0.8× nominal, 1.2× nominal],
  camera_position: uniform perturbation of ±2 cm,
  camera_latency:  [0, 60] ms,
  light_intensity: [0.5× baseline, 2× baseline],
  background_texture: sampled from 200 random images,
  action_latency:  [0, 2] control steps
}

for each training iteration:
    # ---------- Sample many environments in parallel ----------
    for each parallel worker (e.g. 4096):
        sample ξ ~ parameter_table (independently per worker)
        rebuild/reset the simulation scene with ξ
        run T steps, record (o, a, r, o', done)
        implement "action latency" as: execute a_{t-d} (d sampled from the parameter table)
        implement "camera latency" as: return the image from time t-d

    # ---------- Training ----------
    for each epoch:
        sample a batch from the replay buffer
        update the policy and value network with the PPO clipped objective
        (if visual input: randomly apply brightness/contrast/color shift/blur to images)

    # ---------- Periodic evaluation (for early stopping and model selection) ----------
    evaluate in a simulation with "real parameters only" (no randomization)
    record the success rate; if it does not improve for N consecutive rounds, lower the learning rate or stop early

Walkthrough:

  1. The number of parallel environments determines the “variance of the randomization”. 4096 parallel environments let each iteration cover a sufficiently wide combination of parameters; with only a few dozen, the effect of randomization is greatly reduced (insufficient sampling).
  2. Latency must be modeled explicitly. Camera latency and communication latency on real robots are typical problems that “the policy cannot learn in simulation”. Implementing latency as “the policy sees the observation from dd steps ago” is the simplest and most effective approach.
  3. The “degree” of visual randomization must be controlled. Excessive brightness/color randomization makes the policy insensitive to color (e.g. unable to tell red objects from blue ones); in practice, “task-relevant attributes” (object color) should be excluded from randomization.
  4. Evaluate with “real parameters only”, not with the randomized average. The training objective is “the average over a wide distribution”, but the model-selection criterion should be “best under real parameters” — when the two disagree, the latter wins.
  5. Randomization cannot replace system identification. If the simulator’s contact model is badly off overall (e.g. the real gripper deforms and the simulation does not model it at all), randomization only shakes a wrong model and cannot converge to real-robot performance.

6.2.3 Why Domain Randomization Works, and When It Does Not

This subsection introduces no new algorithm; it answers one engineering question: when should we keep adding randomization, and when should we stop and fix something else? The criteria can be organized into a diagnostic table:

Real-robot symptomMore likely causePriority action
Simulation success rate 95%, real robot 30%, failures concentrated at the contact instantContact model error (friction, deformation, compliance)Add friction/stiffness randomization; introduce system identification; fine-tune with real contact data if necessary
Good in simulation, real-robot motion uniformly too slow/fastAction latency and time synchronization not modeledAdd action latency and camera latency; unify the control frequency
Fails when lighting/background changesVisual distribution shiftAdd lighting and texture randomization; but exclude task-relevant attributes (object color)
Fails when the workstation or camera changesCamera intrinsics/extrinsics changeAdd camera pose perturbation; do hand-eye calibration
Simulation metrics drop after adding randomization, real robot unchangedRandomization range too wide, the policy becomes overly conservativeNarrow the range; expand gradually with ADR; select models by “evaluation under real parameters”
Works early on the real robot, drifts after a few hoursThermal drift, battery voltage, mechanical wearInclude these quantities in randomization; add periodic real-robot fine-tuning
Badly off no matter how much you randomizeThe observation/action space definition is already wrong (calibration, frames, units)Check calibration and coordinate frames first, then talk about randomization

One rule of thumb: randomization should only cover quantities that “really do vary in the real system and that the policy cannot infer from observations”. If the policy can estimate a quantity directly from observations (e.g. lighting is visible in the image), randomizing it brings limited benefit; conversely, if a quantity is completely unobservable to the policy (e.g. motor internal resistance, battery voltage) and it affects the dynamics, then it must be randomized.

6.3 The Other Three Routes: System Identification, Domain Adaptation, Real-World Fine-Tuning

System identification (System Identification, SysID). Instead of randomizing, fit the simulation parameters accurately with real data. The approach treats the simulator’s key parameters ξ\xi as quantities to be estimated and minimizes the trajectory difference between simulation and reality:

ξ∗=arg⁡min⁡ξ ∑i∥yreal(i)−ysim(i)(ξ)∥2\xi^{\ast} = \arg\min_{\xi}\ \sum_{i}\left\| y_{\mathrm{real}}^{(i)} - y_{\mathrm{sim}}^{(i)}(\xi) \right\|^2

Here yy can be a joint-angle trajectory, an end-effector pose, or a torque reading. For solving, Bayesian optimization (Bayesian Optimization, sample-efficient and suited to expensive simulator calls) or CMA-ES (covariance matrix adaptation evolution strategy, suited to moderate dimensions and non-smooth objectives) is commonly used.

Derivation: why system identification has “multiple solutions”, and how identifiability is quantified

Step one: locally linearize the “parameter fit”. Let the parameters to identify be ξ∈Rd\xi\in\mathbb{R}^{d} and the real-robot observation be yreal∈Rmy_{\mathrm{real}}\in\mathbb{R}^{m} (mm is “number of sample points × number of channels”, usually far larger than dd). Do a first-order expansion around the current initial value ξ0\xi_0:

ysim(ξ)≈ysim(ξ0)+J(ξ−ξ0),J=∂ysim∂ξ∣ξ0∈Rm×dy_{\mathrm{sim}}(\xi)\approx y_{\mathrm{sim}}(\xi_0)+J\left(\xi-\xi_0\right),\qquad J=\frac{\partial y_{\mathrm{sim}}}{\partial\xi}\bigg|_{\xi_0}\in\mathbb{R}^{m\times d}

Write e=yreal−ysim(ξ0)e=y_{\mathrm{real}}-y_{\mathrm{sim}}(\xi_0) and Δξ=ξ−ξ0\Delta\xi=\xi-\xi_0; the least-squares objective becomes

L(Δξ)=∥e−J Δξ∥2L(\Delta\xi)=\left\|e-J\,\Delta\xi\right\|^2

Step two: the normal equations give the condition for a “unique solution”. Take the gradient with respect to Δξ\Delta\xi and set it to zero:

∇ΔξL=−2J⊤(e−J Δξ)=0⟹J⊤J Δξ=J⊤e\nabla_{\Delta\xi}L=-2J^{\top}\left(e-J\,\Delta\xi\right)=0\quad\Longrightarrow\quad J^{\top}J\,\Delta\xi=J^{\top}e

When J⊤JJ^{\top}J has full rank (the dd columns of JJ are linearly independent),

Δξ∗=(J⊤J)−1J⊤e\Delta\xi^{\ast}=\left(J^{\top}J\right)^{-1}J^{\top}e

and the solution is unique. So “can the parameter be identified” is equivalent to “are the columns of JJ linearly independent” — a pure linear-algebra condition, independent of whether Bayesian optimization or CMA-ES is used.

Step three: unidentifiable = JJ has a null-space direction. If there is a nonzero direction vv with Jv=0Jv=0, then moving any distance along that direction does not change the prediction (to first order), the loss surface is flat along it, J⊤JJ^{\top}J is singular, and there are infinitely many optima. The physical meaning is “this dataset does not excite that parameter”. Two typical examples:

  • Friction coefficient affects the trajectory only when slipping occurs. If the collected trajectory is pure rolling throughout (static friction never saturates), then ∂y/∂μ≈0\partial y/\partial\mu\approx0, that column is approximately all zeros, and no fitting can pin down the friction value;
  • Contact stiffness and contact damping can substitute for each other in the torque curve (high stiffness with low damping and low stiffness with high damping give similar peaks and decay), so the two columns are approximately collinear and the smallest eigenvalue of J⊤JJ^{\top}J is near zero.

Step four: identifiability is quantified by eigenvalues and the condition number, not as “can/cannot”. Under observation noise ϵ∼N(0,σ2I)\epsilon\sim\mathcal{N}(0,\sigma^2 I), the covariance of the estimation error is

Cov(Δξ^)=σ2(J⊤J)−1\mathrm{Cov}\left(\Delta\hat\xi\right)=\sigma^2\left(J^{\top}J\right)^{-1}

The standard deviation of the ii-th parameter is σ[(J⊤J)−1]ii\sigma\sqrt{\left[\left(J^{\top}J\right)^{-1}\right]_{ii}}. Writing it in eigenvalue form is more intuitive: let the eigenvalues of J⊤JJ^{\top}J be λ1≥⋯≥λd\lambda_1\ge\cdots\ge\lambda_d; then the standard deviation in the worst direction (the parameter combination corresponding to λmin⁡\lambda_{\min}) is σ/λmin⁡\sigma/\sqrt{\lambda_{\min}}. As λmin⁡→0\lambda_{\min}\to0 the standard deviation diverges — this is the quantitative version of “multiple solutions”: it is not that there is no information at all, but that the information is so small that it is drowned by noise. The condition number κ=λmax⁡/λmin⁡\kappa=\lambda_{\max}/\lambda_{\min} is a normalized statement of the same thing.

Step five: all three handling routes can be read off this expression.

① Add regularization (ridge regression/Tikhonov, equivalent to giving ξ\xi a Gaussian prior):

Δξ∗=(J⊤J+λI)−1J⊤e\Delta\xi^{\ast}=\left(J^{\top}J+\lambda I\right)^{-1}J^{\top}e

Adding II makes the matrix positive definite and the solution unique, but the price is that in the direction of λmin⁡\lambda_{\min} the optimum is “pressed toward zero”, i.e. pulled back to the prior — so regularization buys a “stable but biased” estimate.

② Design excitation trajectories: make the smallest eigenvalue of J⊤JJ^{\top}J as large as possible. The D-optimality criterion in experimental design maximizes log⁡det⁡(J⊤J)\log\det\left(J^{\top}J\right); concretely, make every joint exercise enough range of amplitude, velocity, and acceleration, and deliberately include several contact events.

③ Give up identification and randomize instead: when λmin⁡\lambda_{\min} is too small and the regularized estimate is no longer trustworthy, treating it as a randomization target is safer than freezing in a wrong value.

Step six: this explains the recommendation in the 6.3 table that “contact-type parameters should mainly be randomized over a narrow range”. Contact events appear sparsely in the data (the contact columns of JJ are nonzero in only a few rows), so the effective rank is low; friction and stiffness are also highly collinear, making the condition number enormous. Together these make the estimate interval for contact parameters so wide that it has no practical value, so the more reliable engineering approach is “identify kinematics and geometry (large λmin⁡\lambda_{\min}, good condition number) + randomize contact parameters + fine-tune with real contact data”.

“Identify first” and “randomize first” are not alternatives; they should be handled separately according to each parameter’s identifiability. The criterion is: is this parameter “excited” sufficiently in the collected data — if the trajectory contains almost no motion segment that reflects it in isolation, the fitted value is non-unique, and fixing it to an “approximate value” then amounts to welding the error into the simulator; conversely, if it can be uniquely determined by the trajectory, randomizing it over a wide range only widens the training distribution unnecessarily and lowers the policy’s performance under real parameters.

Parameter classTypical parametersRecommended treatmentReason
Kinematics and geometryLink lengths, camera intrinsics/extrinsics, joint zero offsets, tool frameIdentify first, then fixUniquely determined by trajectory fitting; errors translate directly into end-effector positioning error, so they must be accurate
DynamicsLink masses, center-of-mass positions, moments of inertia, motor torque constantsIdentify first, or randomize only over a narrow range around the identified valueDepends on whether the excitation trajectory covers enough poses; identified values are trustworthy but still have residual error
Contact and frictionFriction coefficients, contact stiffness, contact damping, gripper deformationMainly narrow-range randomizationContact events are sparse in the data and the parameters are non-unique; fitting with torque trajectories often “matches however you tune it”
Time-varying and unidentifiableWear, cable compliance, torque bias caused by battery voltage, unmodeled transmission backlashWide-range randomization + online adaptationCannot be measured accurately in advance, and drifts over time and operating conditions

The standard engineering order is: first collect a dedicated excitation trajectory (make every joint exercise enough range of amplitude, velocity, and acceleration, and include several contact events) → fit the identifiable parameters → inspect the residual: if the residual is concentrated in the contact phase, the problem is the contact model rather than kinematics, so switch the contact parameters to randomization targets → finally, accept the result in an environment with “real parameters, no randomization” (see walkthrough item 4 of 6.2).

  • Advantages: once the parameters are accurate, simulation and reality match closely and the transfer loss of the policy is small;
  • Disadvantages: contact parameters (friction, stiffness) can almost never be uniquely determined by trajectory fitting (unidentifiable), and the parameters drift with wear;
  • Practical combination: first tune the “identifiable parameters” with system identification, then randomize the “unidentifiable parameters” over a narrow range — this is the most commonly used combination in industry.

Which layers to actually touch during real-world fine-tuning. This question is easier to get wrong than “whether to fine-tune at all” — full-parameter fine-tuning on a small dataset erases the generalization learned during pretraining:

  • VLA-type models (OpenVLA, π₀, etc.): freeze the visual encoder and most of the language backbone, train only the action head (or action expert) + the last one or two layers, with low-rank adaptation (LoRA) or adapters; consider unfreezing the backbone only after hundreds of hours of data.
  • ACT / Diffusion Policy: small models with few parameters, so full-parameter training is usually fine; but if there are only a few dozen real-robot demonstrations, freezing the visual backbone and training only the action decoder is still recommended.
  • Residual RL: train only the small network that produces the “correction”, with the base policy completely frozen. This is needed both for sample efficiency and for safety — the base action is unchanged, so the worst case is that the correction fails, not that the whole system goes out of control.

Domain adaptation. Do not touch the dynamics; align only the representation. A typical approach is to add a “domain discriminator” at the feature level so that the encoder’s output cannot distinguish “simulated image” from “real image” (adversarial alignment, similar to the DANN idea); or to pretrain self-supervised on real images and then freeze the encoder.

  • Applicable: scenarios with large visual differences and small dynamic differences (e.g. poor rendering quality in simulation but an accurate physical model);
  • Risk: adversarial training is unstable, and alignment may also erase “task-relevant information” (for example, aligning away object color).

Real-world fine-tuning. The simplest and most direct approach: take the policy pretrained in simulation onto the real robot and continue training with a small amount of real data.

  • If the task is imitation learning: collect 20–50 real-robot demonstrations and fine-tune with ACT/DP (lowest cost, most commonly used);
  • If the task is reinforcement learning: real-robot RL is risky and sample-hungry, so practice usually uses “residual RL” — the simulated policy outputs the base action and RL learns only a small correction, greatly reducing exploration risk;
  • Key experience: use a small learning rate when fine-tuning and mix in some simulated data, otherwise the generalization learned in simulation is catastrophically forgotten.

6.4 Safety and Evaluation: Real-Robot Deployment Is Not Just About Success Rate

Safety bottom lines (none of them can be skipped):

  1. Action clipping and torque limits: apply hard limits at the lowest level of the controller (not at the policy level) to prevent abnormal policy outputs from damaging the equipment;
  2. Watchdog: if inference times out or observations are interrupted, enter a safe stop immediately;
  3. Speed ramp-up: first validate at 10% speed and gradually raise it to 100%, with manual confirmation at every level;
  4. Manual emergency stop: the physical emergency-stop button must be at hand and independent of the software emergency stop;
  5. Workspace limits: use software fences to restrict the end-effector’s range of motion so it cannot hit people;
  6. First run with no load: run a new policy first in an environment with no objects and no people, and confirm the motions are reasonable.

Evaluation methods (more important than the success-rate number):

  • Layered reporting rather than a single total: stratify by “object category / lighting condition / initial position offset / presence of occlusion”, otherwise an average success rate of 80% may hide the disaster of “0% on new objects”;
  • Multiple independent trials: at least 20 trials per condition, reporting the success rate and the Wilson confidence interval (Wilson score interval, the interval obtained by inverting the score test; it is more stable than the common normal approximation for small samples)
p^=kn,CI95%:p^+z22n±zp^(1−p^)n+z24n21+z2n,z=1.96\hat p = \frac{k}{n},\qquad \mathrm{CI}_{95\%}:\quad \frac{\hat p+\frac{z^2}{2n}\pm z\sqrt{\frac{\hat p(1-\hat p)}{n}+\frac{z^2}{4n^2}}}{1+\frac{z^2}{n}},\qquad z=1.96

(kk is the number of successes and nn the number of trials. As a contrast, the textbook normal-approximation interval is p^±zp^(1−p^)/n\hat p\pm z\sqrt{\hat p(1-\hat p)/n}, but it degenerates to a zero-width point when p^=0\hat p=0 or p^=1\hat p=1 — “20 out of 20 successes” does not mean “100% success rate”.)

Derivation: how the Wilson interval is solved, and why $n=20$ cannot separate 70% from 90%

Step one: interval estimation is equivalent to “inverting a hypothesis test”. Let the true success rate be pp, with kk successes observed and estimate p^=k/n\hat p=k/n. Perform a score test for a candidate value pp (using the variance under the candidate value rather than under the estimate):

z=p^−pp(1−p)/nz=\frac{\hat p-p}{\sqrt{p(1-p)/n}}

If ∣z∣≤1.96|z|\le1.96, then pp is considered consistent with the observation and is kept inside the interval. Hence

(p^−p)2≤z2 p(1−p)n\left(\hat p-p\right)^2\le z^2\,\frac{p(1-p)}{n}

Step two: rearrange the inequality into a quadratic inequality in pp. Expand and move terms:

n(p^−p)2≤z2 p(1−p)n\left(\hat p-p\right)^2\le z^2\,p(1-p) (1+z2n)p2−(2p^+z2n)p+p^2≤0\left(1+\frac{z^2}{n}\right)p^2-\left(2\hat p+\frac{z^2}{n}\right)p+\hat p^2\le0

Step three: solve this quadratic inequality; the two roots are the interval endpoints. By the quadratic formula, the roots are

p±=(2p^+z2n)±(2p^+z2n)2−4(1+z2n)p^22(1+z2n)p_{\pm}=\frac{\left(2\hat p+\frac{z^2}{n}\right)\pm\sqrt{\left(2\hat p+\frac{z^2}{n}\right)^2-4\left(1+\frac{z^2}{n}\right)\hat p^2}}{2\left(1+\frac{z^2}{n}\right)}

Simplify the discriminant:

(2p^+z2n)2−4(1+z2n)p^2=4z2p^(1−p^)n+z4n2\left(2\hat p+\frac{z^2}{n}\right)^2-4\left(1+\frac{z^2}{n}\right)\hat p^2=\frac{4z^2\hat p(1-\hat p)}{n}+\frac{z^4}{n^2}

After taking the square root, factor out 22, and divide numerator and denominator by 22, obtaining

p±=p^+z22n±zp^(1−p^)n+z24n21+z2np_{\pm}=\frac{\hat p+\frac{z^2}{2n}\pm z\sqrt{\frac{\hat p(1-\hat p)}{n}+\frac{z^2}{4n^2}}}{1+\frac{z^2}{n}}

This is the closed-form solution of the Wilson interval. Its structure can be read directly: the z22n\frac{z^2}{2n} in the numerator pulls the center from p^\hat p toward 0.50.5 (shrinking toward the middle for small samples), the denominator 1+z2n1+\frac{z^2}{n} compresses the whole interval, and the z24n2\frac{z^2}{4n^2} inside the square root guarantees that the width stays positive when p^=0\hat p=0 or 11.

Step four: why the normal approximation fails for small samples. The normal approximation p^±zp^(1−p^)/n\hat p\pm z\sqrt{\hat p(1-\hat p)/n} uses the estimate p^\hat p instead of the true pp to compute the variance. When p^=0\hat p=0 the estimated variance is 00, the interval collapses to [0,0][0,0], which amounts to claiming “the true success rate must be 0” — whereas 20 out of 20 successes precisely suggests the true rate may be very high. Wilson uses the variance under the candidate value pp and applies center and width corrections, so it still gives a nonzero width at the boundary. The root of the difference is “should the variance be computed from the estimate or from the candidate value”.

Step five: compute the actual width for n=20n=20, p^=0.8\hat p=0.8. Substituting z=1.96z=1.96:

p^(1−p^)n=0.1620=0.008,z24n2=3.84161600≈0.0024\frac{\hat p(1-\hat p)}{n}=\frac{0.16}{20}=0.008,\qquad \frac{z^2}{4n^2}=\frac{3.8416}{1600}\approx0.0024

The sum inside the square root is 0.01040.0104, the square root is about 0.1020.102, multiplied by zz gives 0.200.20; the denominator is 1+3.841620≈1.1921+\frac{3.8416}{20}\approx1.192. So the half-width is about 0.1680.168 and the interval is about [0.63, 0.97][0.63,\ 0.97] — 0.90.9 falls inside this interval, so “a true success rate of 90%” and “an observed success rate of 80%” simply cannot be distinguished with 20 trials.

Step six: how many trials are needed to distinguish 70% from 90%.? Estimate the order of magnitude with the half-width of the normal approximation, requiring the half-width not to exceed half of the gap between the two levels (0.10.1):

1.96p(1−p)n≤0.1⟹n≥1.962⋅0.210.12≈811.96\sqrt{\frac{p(1-p)}{n}}\le0.1\quad\Longrightarrow\quad n\ge\frac{1.96^2\cdot0.21}{0.1^2}\approx81

That is, each condition needs at least more than 80 trials to separate 70% from 90%. This also explains why paper conclusions of “20 trials, 80% average success rate” often cannot be reproduced: it is not that the policy is unstable, but that the sample size is simply insufficient to support a comparison at that precision.

  • Distinguish “failure types”: how much is grasping empty, dropping the object, colliding, timing out, or getting stuck? This directly indicates which layer to fix;
  • Do not use MSE instead of success rate: a policy with a small action MSE may be completely unable to complete the task (e.g. it always outputs “stay still”).

7. Panoramic Comparison Table and Selection Decisions

The previous six chapters unfolded in the order “from basic to foundation-model to robustness”, but in real projects selection does not follow that order; it follows constraints: how much data do you have? Do you have a real robot? Do you need it to understand natural language? What control frequency?

7.1 One Master Table

Algorithm / modelLayerMain inputMain outputData scaleTraining computeInference latency
PPOBasic layerState/imagesSingle-step actionMedium (millions of interaction steps)One GPU to multiple GPUsExtremely low (one forward pass)
SACBasic layerContinuous stateSingle-step continuous actionMedium–high (better sample efficiency than PPO)One GPUExtremely low
BC (behavior cloning)Skill layerObservationSingle-step actionLow (tens to hundreds of demonstrations)Extremely lowLow
ACTSkill layerMulti-camera images + jointsAction chunk (k steps)Low–medium (50–500 demonstrations)One GPULow (~10–30 ms)
Diffusion PolicySkill layerObservation historyAction chunkLow–mediumOne GPUMedium (multi-step denoising)
RT-2Foundation-model layer · semanticsImage + instructionDiscrete action tokensHigh (millions of trajectories)Large-scaleHigh (autoregressive)
OpenVLAFoundation-model layer · semanticsImage + instructionDiscrete action tokensHighLarge-scale (multiple GPUs)Medium–high (7B autoregressive)
π₀Foundation-model layer · actionImage + instruction + jointsContinuous action chunkExtremely high (multi-embodiment)Large-scaleMedium (backbone + few integration steps)
FASTFoundation-model layer · semanticsImage + instructionFrequency-domain compressed tokensHighLarge-scaleMedium
OctoFoundation-model layer · actionMulti-camera + instruction + jointsAction chunkHigh (multi-embodiment)Multiple GPUsLow–medium
GR-2Foundation-model layer · semanticsVideo + instructionAction chunkExtremely high (video pretraining)Large-scaleMedium
HPTFoundation-model layer · semanticsMulti-embodiment inputActions per embodimentExtremely highLarge-scaleMedium
RDT-1BFoundation-model layer · actionImage + instruction + jointsAction chunk (diffusion)Extremely high (1M+ trajectories)Large-scaleMedium
DreamerV3World modelObservationPolicy (trained via imagination)Low (high sample efficiency)One GPUExtremely low
TD-MPC2World modelObservationAction (online planning)MediumOne GPUHigh (CEM planning)
JEPAWorld modelVideo/observationRepresentation (not actions)Extremely high (can be unlabeled)Large-scaleDepends on the downstream component

Key points for reading the table:

  • “Data scale” is the hardest gate. BC/ACT are the only ones that work on “a few dozen demonstrations”; VLA-type models need millions of trajectories, so small teams can almost never train them from scratch and can only fine-tune.
  • “Inference latency” determines whether it can go on a real robot. Autoregressive VLA and online MPC can both exceed 50 ms and must be amortized with chunked prediction, action experts, caching, and so on.
  • “Training compute” and “data scale” are often both constrained. If neither is sufficient, the pragmatic choice is ACT/DP + a little real-robot fine-tuning; do not start with a VLA.

7.2 Selection Decisions: Ask Yourself in Order of the Problem

Question one: do I have a real robot?

  • No, only simulation → go with “simulation RL + domain randomization”, using PPO or SAC as the base; if online planning cost is acceptable, TD-MPC2 converges faster.
  • I have a real robot but dare not let it explore on its own → go with imitation learning (ACT / Diffusion Policy).
  • I have a real robot and can collect data safely → imitation learning as the main route, plus a little real-world fine-tuning if necessary.

Question two: does the task need to understand natural language?

  • No (fixed task, fixed workstation) → do not use a VLA. ACT/DP usually achieve higher success rates, lower latency, and simpler debugging on fixed tasks.
  • Yes (switch tasks with one sentence, open vocabulary) → use “fine-tuning an open-source VLA” (OpenVLA / π₀ / Octo) and post-train on your own data.

Question three: how much action precision is required?

  • Sub-millimeter, contact-rich (peg insertion, screw driving, pouring water) → continuous action heads (π₀ flow matching / diffusion), not discrete tokens.
  • Centimeter-level is enough (transport, coarse placement) → discrete tokens or ACT both suffice.

Question four: how high is the required control frequency?

  • > 50 Hz (force control, dynamic balancing) → must be the “one forward pass per policy” route (ACT / π₀ few-step integration / Dreamer policy), ruling out autoregressive models and online MPC.
  • < 20 Hz (desktop manipulation, slow grasping) → both autoregressive VLA and MPC are acceptable.

Question five: can the data be scaled up?

  • Yes (hundreds of hours or more, multi-embodiment) → take the foundation-model route; pretraining is worth the investment.
  • No → take “a specialized policy + strong inductive bias” and spend data on “task diversity” rather than “quantity”.

A common wrong path is: having only 100 demonstrations but fine-tuning a 7B VLA directly, ending up overfitting to the backgrounds and object positions of those 100 trajectories, with worse generalization than a 60M-parameter ACT. Model scale should match data scale.

7.3 Combined Use: Real Projects Rarely Use Only One Method

A real engineering solution is usually a “multi-layer assembly”:

High level (slow, 1–5 Hz): VLA or LLM planner → outputs subtask / target pose
Middle level (medium, 10–20 Hz): ACT / diffusion policy → outputs action chunks
Low level (fast, 100–1000 Hz): joint servo / impedance control → outputs torques
  • Benefit of layering: each layer only solves the problem at its own frequency; if the high level is wrong, the low level can still guarantee safety.
  • Cost of layering: complex interface design, and errors propagate between levels.
  • Practical advice: first validate feasibility with a “single-layer end-to-end” setup, then split the layers. Splitting layers is usually for interpretability and safety, not for performance.

8. Five-Stage Learning Path

Below is an executable path; each stage gives “goal / minimal experiment / acceptance criteria / common pitfalls”. Do not skip stages: the parts you skip come back later in the form of “it does not work and I do not know why”.

Stage 0: Prerequisites

  • Goal: be able to run a Gymnasium environment independently, read formulas in papers, and write a two-layer network by hand.
  • Minimal experiment: write a CartPole REINFORCE implementation in PyTorch by hand, without any RL library.
  • Acceptance criteria: can explain “why REINFORCE needs a baseline”; can implement it from scratch and plot the learning curve.
  • Common pitfalls: diving straight into the PPO source code without understanding “where the variance of the policy-gradient estimate comes from”.

Stage 1: Reinforcement Learning Basics (PPO / SAC)

  • Goal: understand MDP, Bellman equations, policy gradient, GAE, entropy regularization; be able to tune stable curves on continuous control tasks.
  • Minimal experiment: MuJoCo’s HalfCheetah-v4 and Ant-v4, trained with PPO and SAC respectively, with 3 random seeds each.
  • Acceptance criteria:
    • PPO reaches more than 80% of the reference implementation’s return on HalfCheetah;
    • can plot “mean ± standard deviation over 3 seeds” curves rather than a single line;
    • can explain “why SAC has higher sample efficiency than PPO, but PPO is faster in wall-clock time under parallel sampling”.
  • Common pitfalls:
    • forgetting observation normalization (RunningMeanStd), causing unstable training;
    • mixing up GAE’s λ\lambda and γ\gamma;
    • judging algorithms by “single-seed” conclusions (the variance is huge and easily leads to wrong conclusions).

Stage 2: Imitation Learning (ACT / Diffusion Policy)

  • Goal: understand the compounding error of behavior cloning, action chunking, temporal ensembling, and action generation by diffusion/flow matching.
  • Minimal experiment: train ACT on public datasets (e.g. ALOHA’s insertion tasks, RoboMimic’s Lift/Can), then train Diffusion Policy, and compare.
  • Acceptance criteria:
    • ACT’s success rate on fixed tasks > 60% (depending on task difficulty);
    • can explain “why action chunking is needed” and “how to choose the exponential weights of temporal ensembling”;
    • can reproduce the phenomenon that “when the demonstrations are multimodal, the regression head fails and the diffusion head succeeds” (multimodal data can be constructed artificially).
  • Common pitfalls:
    • splitting different time segments of the same trajectory into the training/validation sets during data splitting (data leakage, giving an inflated validation success rate);
    • image preprocessing inconsistent between training and inference (RGB in training, BGR at deployment);
    • evaluating the policy with MSE instead of closed-loop success rate.

Stage 3: VLA (Fine-Tuning Open-Source Models)

  • Goal: understand the two routes of “actions as tokens” and “continuous action heads”, and be able to fine-tune an open-source VLA.
  • Minimal experiment: use the open weights of OpenVLA or π₀ and do LoRA fine-tuning on 50–200 self-collected real-robot (or simulated) demonstrations, evaluating instruction following and generalization.
  • Acceptance criteria:
    • after fine-tuning, the success rate “within the training distribution” is not lower than an ACT trained on the same amount of data;
    • clearly better than ACT on “new objects / new instruction combinations” (this is what a VLA is for);
    • can clearly explain the physical reasons for “why it generalizes better” and “why it is slower”.
  • Common pitfalls:
    • fine-tuning only the action head and freezing all of the vision, so the model cannot adapt to a new camera viewpoint;
    • too large a learning rate causing catastrophic forgetting (the model forgets how to follow instructions);
    • instruction texts in the data are too monotonous, so the model learns a “fixed action” and the generalization evaluation is distorted.

Stage 4: World Models (DreamerV3 / TD-MPC2)

  • Goal: understand latent-space models, imagination training, and online planning; be able to connect a world model with policy learning.
  • Minimal experiment: run DreamerV3 on 3–5 tasks (including sparse-reward tasks) in the DeepMind Control suite, then run TD-MPC2 on the same tasks and compare sample efficiency.
  • Acceptance criteria:
    • reach more than 70% of the reference performance within 100k environment steps;
    • can explain “why KL balancing lets one set of hyperparameters work across tasks”;
    • can plot the trade-off curve of “imagination horizon HH versus final performance”.
  • Common pitfalls:
    • gradients from imagined trajectories backpropagating into the world model (contaminating model training);
    • too few CEM samples, so planning degenerates into randomness;
    • using pixel reconstruction error as the only metric while ignoring “whether decision-relevant information is retained”.

Stage 5: Real Robots and Sim-to-Real

  • Goal: deploy any of the above methods on a real robot and handle latency, calibration, safety, and evaluation.
  • Minimal experiment: a “pick-and-place” task: simulated pretraining (domain randomization) → zero-shot real-robot test → fine-tuning on 20 real-robot demonstrations → test again.
  • Acceptance criteria:
    • the gap between simulation success rate and real-robot success rate is quantifiable (e.g. 90% in simulation, 40% zero-shot on the real robot, 75% after fine-tuning);
    • ≥ 20 trials per condition, reporting confidence intervals and the distribution of failure types;
    • the whole pipeline has an emergency stop and clipping, and has passed low-speed validation.
  • Common pitfalls:
    • inconsistent control frequency between simulation and the real robot (50 Hz in simulation, 10 Hz on the real robot), so the policy immediately collapses;
    • camera calibration error causing a 2 cm difference between “the position you see” and “the actual position”, so it grasps empty;
    • forgetting to model actuator latency, causing oscillation on the real robot.

Trade-Off Advice for the Learning Path

  • Only want to do research and publish papers: stages 1 → 2 → 4 are the main line (RL + imitation + world models), with VLA as a comparison baseline.
  • Want to build a product prototype: stages 2 → 3 → 5 are the main line (imitation + VLA fine-tuning + real robot), with RL used only locally (e.g. low-level control).
  • Want to do algorithm research (new methods): stage 1 must be solid (otherwise you cannot judge “what is good about a new method”); the rest can be chosen according to your direction.

Hardware and Budget: Zero-Yuan Simulation, Thousand-Yuan Robot Arms, and the Truth About the “50-Yuan Robot Dog”

The five-stage path only covered “what to learn”; it did not cover “how much it costs”. This section adds the budget dimension, because most people get stuck at their first purchase: either they are misled by the marketing claim “you can build a robot for a few dozen yuan” and find that what arrives cannot run any learning algorithm, or they buy a complete machine from the start, spend the money, and do not know how to use it.

1. Split Into Tiers First: Different Things to Validate Require Different Hardware

TierTypical spend (RMB, as of the 2026-11 search)What it can validateWhat it cannot validate
A. Pure simulation0 yuan marginal cost (assuming a discrete GPU is already available)Control policies, imitation learning, world models, the Sim-to-Real pipelineReal dynamics, sensor noise, actuator latency, calibration error
B. Desktop-level real robot1,000–1,500 yuan (single arm + camera + own computer)Data collection, ACT/diffusion policy training, real-robot closed-loop success rateDual-arm coordination, mobile manipulation, on-device inference of large models
C. Onboard compute2,500–4,500 yuan (adding a development kit to B)Offline inference without a computer, latency and power measurementLarge-scale parallel training, multi-camera high frame rates
D. Dual-arm mobile4,000–6,500 yuanDual-arm coordination, mobile grasping, long-horizon tasksIndustrial-grade precision, high payloads
E. Research/general-purpose base30,000 yuan to 100,000 yuan and aboveHigh-precision force control, humanoid whole-body control, large-scale VLA fine-tuningLow-cost reproduction (this step does not fit a personal budget)

The key to this table is that every tier has an explicit “cannot validate”. Many discussions either carry conclusions from tier A straight over to tier E, or use tier E prices to deny the feasibility of tier A — both mismatch “validation goal” and “hardware tier”.

2. Hardware Price Table (Search Snapshot of 2026-11-10)

Prices are listed separately as “parts delivered price” and “kit price”. The price of the same model often differs by 30%–50% across channels; the numbers below are only for judging order of magnitude and budget allocation and must be re-verified before purchase.

CategoryModelReference priceBasis and notes
Bus servo (with position feedback)Feetech STS3215 (magnetic encoder, TTL serial bus, 30 kg·cm class)53–99 yuan/unitTaobao parts from 53 yuan; another seller at 64 yuan and 99 yuan; 1688 bulk is lower
Analog servo (no position feedback)SG90 / MG90S4–6 yuan / 8–15 yuanSG90 has plastic gears; MG90S has metal gears and costs about 1 USD more
Desktop robot-arm kitSO-ARM100 / SO-101 (one leader and one follower, including 6–7 STS3215, driver board, power supply)950–2,168 yuan/kit1688 one-piece starting price; US retail 199–299 USD (excluding shipping and tax)
Dual-arm mobile platform (parts)XLeRobot Basic (using your own laptop + a single RGB head camera)About 3,999 yuanOfficial bill of materials with regional quotes: about 660 USD in the US, about 680 EUR in Europe, about 3,999 yuan in China
Dual-arm mobile platform (with onboard compute)XLeRobot + edge computerWithin 1,300 USDUpper bound of the complete-machine cost reported in the academic paper
Robot development kit (high compute)RDK S100 (80 TOPS)2,799 yuan (launch price 2,499 yuan)Official pricing; third-party retail 3,499 yuan; S100P (128 TOPS) 5,999 yuan
Edge AI development kitNVIDIA Jetson Orin Nano Super (8 GB)249 USD / suggested retail 2,070 yuanOfficial page price; domestic channels are often above the suggested price
Desktop six-axis armmyCobot 280 (Arduino / M5 / Raspberry Pi versions)599–799 USD (commonly just over 3,000 yuan in China)Official store price; domestic channel prices differ from the official price
Open-source quadruped (with Raspberry Pi)Hiwonder PuppyPi (Raspberry Pi 5, 4 GB)589.99 USD; 2,999–4,100 yuan in ChinaOfficial price; Taobao kit price
Open-source quadruped (low-price tier)MechDog and other fully open-source quadrupedsAbout 1,699 yuanTaobao price, usually excluding extra compute and a depth camera
Depth cameraIntel RealSense D435i2,380–2,899 yuanTaobao/1688 parts; D435 (no IMU) 2,122–2,320 yuan
Complete humanoidUnitree G1From 99,000 yuan (cut to about 85,000 yuan in 2026); 13,500 USD in the USOfficial and media reports; deployment and service bring the landed cost to about 100,000–200,000 yuan

Three “hidden costs” to catch when reading this table:

  1. Cameras and compute are usually not included in the “robot-arm kit”. The 950–1,100 yuan SO-101 kit is just the arm body; the computer for training and the camera for deployment are extra.
  2. Batteries, power supplies, shipping, tax, and tools (screwdrivers, hex keys, zip ties, spare servos) are usually omitted from the advertised price and actually add 10%–25%.
  3. Structural parts come in “with 3D-printed parts” and “print it yourself”. Printing it yourself requires a printer (thousand-yuan class) and filament, priced by gram; hiring someone to print is priced by part and is often 3–5 times more expensive than the filament.

3. Is the “50-Yuan Material Cost” Credible?

An entry-level plan circulated in Chinese-language communities in November 2026 (original share link) has a reliable path section (simulation first, then a robot arm, then Sim2Real), but one sentence — “the material cost of a desktop-level quadruped robot dog is only about 50 yuan” — lost its qualifications when it was widely forwarded. Breaking it down item by item at real parts prices:

ComponentQuantityUnit price (lowest parts price, 2026-11)Subtotal
ESP8266 main controller (NodeMCU-type development board)110–15 yuan10–15 yuan
16-channel servo driver board (PCA9685)18–15 yuan8–15 yuan
SG90 analog servo (quadruped × 2 joints)84–6 yuan32–48 yuan
18650 lithium battery × 2 + battery holder1 set20–35 yuan20–35 yuan
3D-printed structural parts (about 80–120 g of PLA)1 set5–12 yuan (filament)5–12 yuan
Dupont wires, screws, brass standoffssome5–10 yuan5–10 yuan
Offline voice module (optional)110–20 yuan10–20 yuan
Total (excluding battery and shipping, with own printer)65–110 yuan
Total (including battery, with own printer)85–145 yuan
Total (including battery, paid printing of structural parts, including shipping)120–230 yuan

The conclusion has three layers:

  • As a “extreme material-cost basis of accounting”, 50 yuan barely holds. Similar open-source projects also claim “about 30 yuan excluding the battery” (plug-in versions of robot dogs with 12-yuan servos, a 4.5-yuan screen, and a 4-yuan main controller); the basis is the same: lowest channel prices, excluding the battery, excluding shipping, excluding printing amortization, excluding tools and spare parts. Add the battery and shipping back and it is already 85–145 yuan.
  • As “the practical cost of embodied AI”, 50 yuan does not hold. This machine can only run fixed action sequences, fixed expressions, and fixed voice phrases. The reasons are hard constraints: the SG90 is an open-loop PWM servo with no position feedback, poor repeatability, and easy burnout when stalled; the ESP8266 has no neural-network accelerator and only a few MB of memory, so it cannot run any vision network; the platform has no camera, so it cannot collect paired “vision–action” data. Without data and without repeatable actuators, none of the four algorithm layers (reinforcement learning, imitation learning, VLA, world models) can be validated.
  • To cross from 50 yuan to “capable of learning”, the minimum threshold is about 1,000–1,500 yuan. The difference is not “inflated marketing” but four indispensable items: bus servos with position feedback (STS3215 × 6, about 318–594 yuan), a camera (100–300 yuan), structural parts and power (100–300 yuan), and compute (0 marginal cost with your own computer, or about 2,070 yuan for a Jetson Orin Nano Super). This matches the realistic transaction price of the SO-101 kit (950–1,100 yuan).

4. Item-by-Item Verdicts: What in That Plan Is Credible and What Needs Correction

Original claimVerdictBasis and correction
No hardware needed to start; simulation runs the core algorithms at zero costCredible“Zero cost” means marginal cost; the premise is an existing discrete GPU with 6 GB or more of VRAM. If a new one must be bought, it is actually a 2,000–3,000 yuan GPU expense
6 GB of VRAM or more is enoughNeeds correction (too low)6–8 GB works for small-batch ACT and diffusion-policy training; VLA LoRA fine-tuning is recommended at 12–16 GB, full-parameter fine-tuning at 24 GB or more; also consider how image resolution and action-chunk length amplify VRAM use
MuJoCo/PyBullet for getting started → Isaac Sim/Isaac Gym for scale → Habitat for visual navigationCredibleThe division of labor among the three tools matches the community situation; the Isaac family has hard requirements on NVIDIA GPUs and driver versions
Prefer robot arms for manipulation tasks; robot dogs only supplement legged controlCrediblePublic datasets, pretrained models, and evaluation protocols for grasping tasks are all concentrated on the robot-arm side; public manipulation data for quadrupeds is extremely scarce
Sim2Real follows “simulated pretraining → parameter identification → domain randomization → real-robot fine-tuning”CredibleConsistent with the four-step flow in Chapter 6; parameter identification requires extra calibration fixtures and measurements, which are hidden costs
A complete XLeRobot build costs less than 1,000 USD (about 4,000 yuan)CredibleOfficial bill of materials: about 660 USD in the US, about 3,999 yuan in China; but that price excludes the laptop for training and excludes camera and compute upgrades
The RDK S100 + LeRobot dual-arm solution costs within 5,000 yuanBasically credible, but very tightS100 kit 2,799 yuan + dual-arm kit 950–1,100 yuan + camera 100–300 yuan + power and structure 200–400 yuan, totaling about 4,000–4,600 yuan; adding shipping, tools, and spare servos pushes it close to the limit
myCobot 280 costs about 3,000 yuanBasically credibleThe common domestic channel price is indeed just over 3,000 yuan; the official store price is 599–799 USD
A full-stack open-source quadruped costs about 1,500 yuan in hardwareBasically credibleComparable open-source quadrupeds (e.g. MechDog) cost about 1,699 yuan; but usually excluding a depth camera and extra compute
A desktop quadruped costs about 50 yuan in materialsA matter of accounting basis (see the previous section)It holds under the extreme material-cost basis; it does not hold as “the entry cost of embodied AI”, and the battery, shipping, and printing amortization must be added

In one sentence: the “path” in this plan is right, but the “prices” must be read with their basis of accounting. The path is highly credible (simulation first, robot arms first, four-step Sim2Real), while the credibility of the prices depends on whether it states clearly “with or without battery, camera, compute, shipping, and printing”.

5. Four Configurations That Can Be Implemented Directly According to Budget

BudgetConfigurationFirst acceptance goal
0–300 yuanMuJoCo + Gymnasium + LeRobot simulation environment, loading the SO-101 modelTrain ACT with scripted demonstrations; simulation success rate > 60%; able to plot three-seed curves
1,000–1,500 yuanSO-101 leader-follower kit (950–1,100 yuan) + USB camera (100–300 yuan) + your own computerCollect 50–100 real-robot demonstrations; ACT success rate within the training distribution > 60%
2,500–4,500 yuanThe previous tier + Jetson Orin Nano Super (about 2,070 yuan) or RDK S100 (2,799 yuan)Run inference without a computer; measure end-to-end latency and power; align the success rate with the computer-side result
4,000–6,500 yuanXLeRobot parts (about 3,999 yuan) + camera/computeDual-arm coordinated grasping; long-horizon tasks combining a mobile base and an arm

The research tier (myCobot 280 / RealSense D435i / workstation) and the general-purpose base (Unitree G1, from 85,000 yuan) should only be considered when high-precision force control, humanoid whole-body control, or large-scale VLA fine-tuning is needed; for individuals in the learning stage, spending money on these two tiers has far lower marginal benefit than getting the first four tiers working.

6. Six Must-Ask Questions Before Buying

  1. Does the actuator have position feedback? Bus servos (such as the STS3215) have magnetic encoders and readback, so action trajectories can be recorded and stalls detected; PWM servos (SG90) do not, so there is no ground truth for “whether the action was executed”.
  2. What are the control frequency and the communication method? Bus servos commonly use 1 Mbps with a control frequency on the order of 1 kHz; PWM servos are on the order of 50 Hz. A difference of one order of magnitude in frequency means a completely different time scale for the policy.
  3. Is the listed price a material price or a landed price? Does it include the battery, power supply, shipping, tax, spare servos, and tools?
  4. Do the structural parts include printing? “With printed parts” means usable on arrival; “print it yourself” means adding a printer and leveling time.
  5. Are the camera and compute included? Can the camera’s resolution, frame rate, and exposure be locked (automatic exposure jumping will make the policy treat “brightness changes” as “object motion”)?
  6. Is there a complete bill of materials and assembly documentation, and is there any third-party reproduction record? Projects with only rendered images and no bill of materials usually have severely underestimated real costs.

7. The Real Big Cost Is Often Data, Not Hardware

A 30–60 second teleoperation demonstration takes about 2–4 minutes to collect and organize; 100 demonstrations mean 4–7 hours of pure human labor, not counting re-collection of failures, annotation, and cleaning. At this scale, the labor time cost often exceeds the 1,000–1,500 yuan hardware investment. This also explains why the correct order is “get the pipeline working in simulation first, then collect the minimum necessary data on the real robot” — buying hardware first and then fumbling with the pipeline wastes the most expensive part of the budget.

Price note: all numbers above are public-channel search snapshots as of 2026-11-10 (1688, Taobao, official stores, and official documentation), excluding shipping and tax, and ignoring bulk discounts. Prices of electronic components and kits fluctuate greatly; before ordering, rely on the page price at that time. The prices cited in this article are only for judging order of magnitude and allocating budget, not as a quotation basis.

Main sources (search date 2026-11-10):


9. Engineering Pitfalls and Common Misconceptions

This section is the “list of pitfalls we have stepped into”. They do not appear in papers, but they can waste two weeks of your experiments.

9.1 Data Handling

  1. Data leakage. Cutting the same trajectory into multiple windows and then randomly splitting them into training/validation sets. The correct approach is to split by trajectory (all windows of the same trajectory must be in the same set).
  2. Loss of normalization statistics. Normalizing observations with the training set’s mean and variance during training, then forgetting to save those two numbers at deployment, or re-computing them on the validation set. Normalization parameters must be saved together with the model.
  3. Inconsistent action spaces. Training with “joint position increments” and deploying with “end-effector pose increments”; or training with “absolute positions” and deploying with “increments”. This class of error shows up as “the policy is great in simulation and flails on the real robot”.
  4. Inconsistent image preprocessing. Bilinear resize in training and nearest-neighbor at deployment; BGR in training and RGB at deployment; normalization to [0,1] in training and to [-1,1] at deployment. Preprocessing code must share a single implementation.
  5. Time-alignment errors. The timestamps of images, joint states, and actions are not aligned, so that “the picture you see is 30 ms later than the action”. This is fatal in high-speed tasks.

9.2 Training

  1. Confusing termination with truncation (a classic RL pitfall). See the derivation block below — this is the most common bug in PPO implementations and causes a systematic bias in the value function.
  2. BatchNorm fails in RL. The distribution of data in the replay buffer changes with the policy, so BatchNorm’s running statistics become distorted; and inconsistency between training and inference modes makes deployment behavior drift. Prefer LayerNorm or no normalization layer in RL.
  3. Learning rate not scaled with batch size. Changing the batch from 256 to 2048 without adjusting the learning rate makes convergence slower or divergent.
  4. Replay buffer too large, causing the “policy to lag behind”. If the buffer is too large, most samples come from old policies, the off-policy correction is insufficient, and the learning signal weakens.
  5. Single-seed conclusions. RL has enormous seed variance (for the same algorithm and task, returns can differ by a factor of 2). Use at least 3 seeds and report the mean and standard deviation.
  6. Using training-mode randomization during evaluation. Evaluation should be done under “fixed real parameters”, otherwise the numbers are meaningless.
Derivation: why “time-limit truncation” must bootstrap, while “true termination” must not

Background. An episode may end for two reasons: the environment reaches a terminal state (e.g. falling over, success), or the time limit is reached (e.g. 500 steps). Both appear as done = True in the data, but their semantics are completely different.

General form of the TD target.

yt=rt+γ (1−dt) V(st+1)y_t = r_t + \gamma\,(1-d_t)\,V(s_{t+1})

where dtd_t is the indicator of “whether it truly terminated” (1 means terminated).

Case one: true termination. After termination there is no future return, V(st+1)V(s_{t+1}) is meaningless, so dt=1d_t=1 and the target is simply yt=rty_t=r_t. If truncation is mistakenly treated as termination, the true return is underestimated (the future reward of “it could actually continue” is discarded).

Case two: time-limit truncation. The episode is forcibly interrupted, but the environment itself has not terminated; st+1s_{t+1} is still valid and future returns still exist. Here we should bootstrap (dt=0d_t=0):

yt=rt+γV(st+1)y_t = r_t + \gamma V(s_{t+1})

If truncation is mistakenly treated as termination (dt=1d_t=1), the value function learns “value drops sharply near the time limit”, producing a spurious value cliff. The policy then learns to “slack off when time is nearly up”, a behavior that is meaningless in real deployment.

Why many people make this mistake. Because early versions of Gymnasium returned only a single done boolean and did not distinguish terminated from truncated; many open-source implementations directly treat done as termination. Newer versions split it into two fields, and implementations must handle them separately:

# Correct form
y = r + gamma * (1.0 - terminated) * V_next     # Note: use only terminated, not truncated

The cost of this bug. On tasks with a time limit (the default upper limit of 1000 steps in most Gym environments), the value function develops a systematic bias, showing up as “a sawtooth return curve in late training and abnormal policy behavior in the last few hundred steps”. It is hidden, because the curve looks like “just instability”.

A one-sentence criterion. Ask yourself: “after this step, can the environment continue?” If it can → bootstrap; if it cannot → do not bootstrap.

9.3 Deployment

  1. Control frequency mismatch. Training at 20 Hz and deploying at 10 Hz means the “action magnitude per step” the policy learned becomes doubled on the real robot, causing overshoot directly.
  2. Latency not compensated. A 40 ms visual latency is equivalent to “driving blind for 40 ms” in highly dynamic tasks. Countermeasure: model latency explicitly, or extrapolate with state estimation.
  3. Missing action smoothing. Jumps at the boundary of adjacent action chunks cause mechanical jitter and wear. Countermeasure: temporal ensembling (ACT’s exponential weighting) or low-pass filtering (note that filtering introduces phase lag).
  4. Safety clipping placed at the policy level. When the policy output is abnormal, if the clipping is inside the policy (e.g. using tanh), a faulty model can still output dangerous actions. Clipping must be at the lowest level of the controller.
  5. No failure-recovery mechanism. After the real robot gets stuck it needs manual intervention, but there is no “detect stuck → automatically return to the safe pose” logic, so someone has to run over every time it fails.

9.4 Cognitive Misconceptions

  1. “Success in simulation = success on the real robot.” They are separated by the six gaps in Chapter 6 and must be measured empirically.
  2. “More parameters are always better.” Training a 7B model on 100 demonstrations usually generalizes worse than a 60M ACT. Capacity must match data.
  3. “An 80% success rate is enough.” For industrial scenarios, a 20% failure rate means manual intervention every 5 attempts; you also need to check whether the failure types are recoverable.
  4. “Adding randomization is enough for sim2real.” If the simulator’s contact model is itself wrong, randomization is only shaking a wrong model.
  5. “Imitation learning does not need a reward, so it is simple.” It moves the difficulty from “designing a reward” to “collecting high-quality demonstrations + handling distribution shift”; it does not disappear.

This section is not “predicting the future”; it lists problems that remain unsolved and that directly affect engineering decisions.

① Long horizon and memory. Most existing methods work on tasks lasting “seconds to tens of seconds”. Tasks lasting minutes to hours require hierarchy (high-level planning + low-level execution) and long-term memory, while current VLA context windows are limited and world-model errors compound. This is the gap between “a household robot” and “a single-workstation operator”.

② Unified action space. Different robots (single arm, dual arm, humanoid, dexterous hand) have completely different action dimensions and semantics. Work such as RDT-1B uses “end-effector pose + gripper” as a unified projection, but this loses joint-level information; how to design an action representation that is “both general and lossless in precision” remains undecided.

③ Touch and force control. Vision-language-action models are almost all “seeing” models, lacking tactile and torque feedback. Yet the core information for tasks like insertion, tightening, and unscrewing caps lives in the force/tactile channel. A VLA with touch is an obvious research gap.

④ The cost of data scaling. Text and images can be crawled, but robot data must be physically collected. Teleoperation, simulation synthesis, and video-to-action are the three main paths, but none has resolved the contradiction between “data diversity and cost”.

⑤ Lack of evaluation standards. At present each lab uses its own robot, its own tasks, and its own success criteria, so results cannot be compared across labs. Simulation benchmarks (such as RoboMimic, LIBERO, CALVIN) alleviate part of this, but “evaluation of simulation-to-real transfer” still has no standard. This directly leads to “great numbers in papers, hard to reproduce”.

⑥ The credibility of world models. “Model exploitation” caused by compounding model error (the policy exploits model errors) is an inherent difficulty. How to quantify “in which states the model is trustworthy” and make the policy avoid untrustworthy regions is the core difficulty of current world-model research.

⑦ Inference latency and edge deployment. A 7B model cannot easily reach 50 Hz on edge devices. Quantization, distillation, separating the action expert, and chunked prediction all mitigate this, but the fundamental contradiction of “large model + high-frequency control” remains unsolved.

⑧ Safety and verifiability. Neural-network policies have no formal guarantees. Industrial deployment requires engineering measures such as “bounded error” and “detectable failure”, to which academia pays insufficient attention.

⑨ From “action cloning” to “task understanding”. Current VLAs mostly imitate “the action sequences that appear in the demonstrations” and lack explicit modeling of task goals and causal relations. Whether a model can “understand why this should be done” instead of “remember how it was done” is the key to generalizing to entirely new tasks.

⑩ Architectural unification of multimodal fusion. Vision, language, action, touch, and audio currently each have their own encoder, and fusion is mostly “concatenation + attention”. Whether a more fundamental unified representation exists remains an open question.

Advice for readers. If your goal is to build a product, focus on ①②③⑤⑧ (they determine whether it can ship); if your goal is to do research, ④⑥⑨⑩ are currently the most promising directions.


11. Summary: The Fundamental Differences Between Methods and Their Applicability Boundaries

The previous seven chapters unfolded in the order “basic layer → skill layer → foundation-model layer → world models → robustness layer”, and Chapter 7 gave selection questions from engineering constraints (data volume, whether a real robot exists, frequency, whether language is needed). This chapter takes a different angle: ignore which layer a method belongs to, and look at what trade-off it makes at the mechanism level. After reading it you should be able to answer one question — when someone recommends a new model, you can tell which class it belongs to, where its cost lies, and under what conditions you should not use it.

11.1 One Table to See the Mechanism Differences

The master table in Chapter 7 answers “how much data, compute, and latency”; this table answers “what it learns from, what it relies on for generalization, and when there is no substitute for it”.

MethodLearning signalWhere the data comes fromHow the policy is representedWhat generalization relies onFatal weaknessScenarios with no substitute
Behavior cloning (BC)Supervised loss (action regression or negative log-likelihood)Human demonstrationsSingle-step actionThe state distribution covered by the demonstrationsCompounding error (covariate shift); error accumulates with stepsVery few demonstrations, fixed task, extremely latency-sensitive
ACTAction-chunk regression (L1/MSE, optionally CVAE)Human demonstrations (50–500)kk-step chunk per forward pass + temporal ensemblingIntra-chunk consistency and demonstration diversityChunk-boundary jitter, long-horizon error accumulationDozens of demonstrations + desktop manipulation at 10–50 Hz
Diffusion Policy (DP)Denoising loss (predicting noise or the velocity field)Human demonstrationsMulti-step denoising to generate action chunksMultimodal expression of the generative distributionMultiple forward passes at inference, high latencyThe same observation corresponds to several reasonable actions (multimodal tasks)
RT-2Next-token cross-entropyInternet vision-language data + robot trajectoriesDiscrete action tokens, autoregressiveSemantic grounding from vision-language pretrainingActions are discretized, precision is limited; autoregressive latency is highTask switching that needs open vocabulary and semantic generalization
OpenVLASame as RT-2 (7B scale)Same as above, at larger scaleDiscrete tokens, autoregressiveLarge-scale vision-language pretrainingMany parameters, hard to deploy on edge devicesAn open-source, fine-tunable general semantic base
FASTToken cross-entropy after frequency-domain compressionHigh-frequency action sequencesFrequency-domain tokens, autoregressive decodingSequence efficiency after compressionStill autoregressive; latency not fundamentally solvedTokenization of high-frequency, long-sequence actions
π₀Flow-matching velocity-field regressionLarge-scale multi-embodiment trajectoriesContinuous action chunks, few-step integrationVision-language backbone semantics + multi-embodiment dataExtremely high data and compute thresholdsNeeds semantic generalization + continuous high-precision actions
OctoDiffusion or regression action headMulti-embodiment dataset (Open X-Embodiment)Action chunksBreadth of multi-embodiment data, realized through fine-tuningSmall capacity, limited zero-shot abilityWants a lightweight open-source baseline for fast fine-tuning
GR-2Video prediction + action generationVideo pretraining + robot dataAction chunksPhysical and motion priors in videoThe gap between the video domain and the robot domainWants to transfer motion skills from human video
HPTMulti-embodiment action predictionHeterogeneous multi-embodiment dataPer-embodiment actions (shared trunk + embodiment head)Shared representation + embodiment-specific outputComplex embodiment-head design, sensitive data mixingOne trunk serving multiple robot morphologies
RDT-1BDiffusion action headMillion-level dual-arm trajectoriesContinuous action chunksLarge-scale dual-arm data + unified action spaceThe task domain is concentrated on dual arms, narrow generalization boundaryDual-arm manipulation that needs a large-scale pretraining starting point
PPOClipped surrogate objective + GAEAutonomous interaction with a simulatorSingle-step action (stochastic policy)Reward-driven trial and error, not limited by demonstrationsLarge sample demand, hard reward design, risky real-robot explorationSimulation with massive parallelism, rewards that can be computed automatically
SACMaximum-entropy objective + double QSimulation, or real interaction under safe conditionsSingle-step continuous actionEntropy-driven exploration + off-policy data reuseThe entropy coefficient needs tuning, risk of Critic overestimationExpensive interaction samples, need for robust exploration
DreamerV3Latent imagination + λ-returnSimulation interactionA policy trained in latent spaceCheap “imagined” samples provided by the world modelCompounding model error, long-horizon prediction distortionSample efficiency first, interaction extremely expensive
TD-MPC2Latent-space planning (CEM) + temporal differenceSimulation interactionAction sequences produced by online planningThe learned latent dynamicsPlanning at every decision, high latencyShort horizon, tasks that need online replanning
JEPAPrediction in representation space (no action output)Video or observations, possibly unlabeledProduces no actions, only representationsLarge-scale unlabeled videoCannot close the loop directly; must attach a planner or policyPretrained representations for downstream use
Domain randomization / system identificationNo extra learning signal (change environment parameters or identify them)Simulation + a small amount of real dataDoes not change the policy structureThe training distribution covering the real distributionThe randomization range is hard to set; real friction and latency may not be coverableThe mandatory step before a simulated policy goes onto a real robot

Key points for reading the table:

  1. The “learning signal” column distinguishes the three paradigms. Supervised losses (BC, ACT, DP, all VLAs) only need demonstrations; reward signals (PPO, SAC, DreamerV3, TD-MPC2) need a reward that can be computed automatically; representation prediction (JEPA) does not even need actions. When you meet a new method, first look at what signal it consumes — this decides whether you can use it.
  2. “How the policy is represented” determines latency and precision. A single forward pass is fastest; action chunks amortize kk steps over one forward pass; generative approaches (diffusion, flow matching) can express multimodality but need multiple forward passes; autoregressive tokens have the highest latency. The stronger the precision and multimodal capability, the higher the latency usually is — this is the root of the triangle in 11.6.
  3. “What generalization relies on” determines how much data you need. Relying on pretrained semantics (RT-2, OpenVLA, π₀) requires massive data; relying on inductive bias (ACT’s chunk structure, DP’s generative prior) works with dozens of demonstrations; relying on reward-driven trial and error (PPO) requires a parallelizable high-fidelity simulator. Model capacity must match data scale — the number-one mismatch already emphasized in 7.2 and emphasized again here.

11.1.1 Cross-Method Quick Reference: The Quantities That “Must Stay Outside the Gradient” in Every Algorithm

Each algorithm above has its own detach (gradient truncation) or sg (stop-gradient) checklist. Putting them side by side shows that all cases fall into only three classes, and this table can be used directly as a troubleshooting manual:

MethodQuantities that must be detached / sgCategoryTypical symptom if not done
PPOlogp_old, v_old, Adv, RetOld valuesThe probability ratio is distorted, the value chases a moving target
SACThe TD target yy (including a′a' and log⁡π′\log\pi'), the logp in the temperature lossLabelsQ values diverge, α\alpha drifts
DreamerV3The latent states on the imagination chain, the prior side of the KL, the path from the policy loss to the world modelLabels + slow anchorThe model is exploited by the policy, evaluation return collapses later
TD-MPC2The encoded output of the consistency target, the TD targetLabelsLatent-space collapse, value scale drift
JEPAThe output of the target encoder; the target encoder parameters never enter the optimizer, only EMASlow anchorRepresentation collapse
ACTThe action labels; the zz at inference needs no gradientLabels(Usually not wrong; mistakes are in β\beta and posterior/prior matching)
Diffusion PolicyThe noise target ϵ\epsilon; the observation condition is not noisedLabelsGenerated actions shift, the conditioning information is destroyed
π₀The target velocity x1−x0x_1-x_0, the starting noise x0x_0LabelsVelocity-field regression becomes meaningless
RT-2 / OpenVLAThe action token idLabelsThe cross-entropy target is wrong
FASTThe quantized coefficient labelsLabelsAbnormal decoded amplitude

Three criteria can be memorized:

  1. Labels do not move. Any “target we want the network to fit” must carry no gradient, including returns, TD targets, noise, velocity fields, and token ids.
  2. Old values do not move. Any quantity “describing the previous policy or the previous model” must carry no gradient, including old log-probabilities, old values, and old latent states.
  3. Slow anchors do not move. Any “copy designed to follow slowly” must not enter the optimizer and can only be written in place by the EMA formula, including target Q networks and target encoders.

Conversely, only two classes of quantities must carry gradients: the network parameters being optimized, and the intermediate quantities “kept in the computation graph so that gradients can pass through” (such as reparameterized sampling, the actions output by the policy, and the predicted velocity field of flow matching). Detach everything outside these two classes and most “training runs but learns the wrong thing” problems disappear.

11.2 Six Key Divergences: Where Do Methods Actually Differ?

(1) Learning actions or learning representations

This is the most easily confused line. DreamerV3 and TD-MPC2 learn “how the environment evolves” and derive actions from it; JEPA learns only “what the future representation looks like” and does not output actions itself.

DimensionLearns actions (BC, ACT, DP, VLA, PPO, SAC)Learns a world model (DreamerV3, TD-MPC2)Learns only representations (JEPA)
OutputActions or action distributionsLatent dynamics + policy/planningRepresentation vectors
Can it close the loop directlyYesYes (via imagination training or online planning)No, it must attach a planner
Data efficiencyMedium (demonstrations or interaction)High (one interaction is repeatedly imagined)Extremely high (can be unlabeled)
Main riskDistribution shift, sample demandCompounding model errorZero gain if the downstream task is poorly designed

The criterion: do you want “a policy that can move right away”, or “reusable environment understanding”? For the former, choose an action-learning method directly; for the latter, choose a world model or JEPA, but be prepared to attach a downstream planner or policy head.

(2) Single step, action chunk, or generative multi-step

RepresentationExamplesLatencyMultimodal capabilitySuitable action characteristics
Single-step regression/classificationBC, PPO, SACLowest (one forward pass)Weak (regression averages multiple peaks)Smooth, unimodal, high frequency
Action chunksACT, Octo, π₀Low (one forward pass amortizes kk steps)MediumManipulation that needs temporal consistency
Generative (diffusion/flow matching)Diffusion Policy, π₀ action expert, RDT-1BMedium to high (multiple denoising or integration steps)Strong (can preserve multiple peaks)Contact-rich, several reasonable actions exist
Autoregressive tokensRT-2, OpenVLA, FASTHigh (token-by-token decoding)MediumMany semantic switches, low frequency requirements

The criterion: write down the frequency requirement first, then choose the representation. For force control and balancing tasks above 50 Hz, only “one forward pass” representations are possible (single step, action chunks, or very few integration steps); both autoregressive and multi-step denoising are ruled out.

(3) Discrete tokens or continuous generation

DimensionDiscrete tokens (RT-2, OpenVLA, FAST)Continuous regression/generation (ACT, DP, π₀, RDT-1B)
PrecisionLimited by discretization granularity, usually centimeter levelCan reach below millimeter level
Interface with language modelsNaturally unified: an action is just a wordNeeds an extra action head
MultimodalityDepends on sampling temperature, limited expressionGenerative models can express the full distribution
Main costTokenization scheme design, decoding latencyAction-head training, number of generation steps

The criterion: for contact-rich, millimeter-precision tasks such as peg insertion, screw driving, and pouring water, do not use discrete tokens; for centimeter-level tasks such as transport and coarse placement, discrete tokens are simpler and easier to unify with language models.

(4) Semantic grounding or a pure motion policy

DimensionVLAs with language (RT-2, OpenVLA, π₀, GR-2, HPT)Pure vision-motion policies (BC, ACT, DP)
Task switchingJust change one instructionMust change the model or the weights
Generalization to new objects/scenesRelies on vision-language pretrainingRelies on demonstration diversity
LatencyRelatively high (large model + autoregressive or generative head)Low
Debugging costHigh (data mixing, instruction templates, action space)Low

The criterion: in production-line scenarios with a fixed workstation and a fixed task, a pure motion policy usually has a higher success rate and lower latency; the semantic cost of a VLA is only worth paying when “switching tasks with one sentence” is a product requirement.

(5) Simulation trial and error or real demonstrations

DimensionReinforcement learning (PPO, SAC, DreamerV3, TD-MPC2)Imitation learning (BC, ACT, DP, VLA)
RewardMust be computable automaticallyNot needed
Data costSimulation compute (cheap) or real-robot trial and error (expensive and dangerous)Human teleoperation time (expensive but safe)
Upper boundMay exceed the demonstrations and discover better policiesDoes not exceed demonstration quality
Main riskReward hacking, the simulation-to-reality gapCompounding error, insufficient demonstration coverage

The criterion: if the reward can be computed automatically, the simulation is realistic enough, and it can be parallelized → reinforcement learning; if the reward is hard to design and you dare not let a real robot explore → imitation learning. The two are not mutually exclusive: pre-training with demonstrations first and then fine-tuning with a small amount of RL is currently a relatively stable combination.

(6) Scale matching: how large should model capacity be

This is not a “divergence between methods” but a constraint shared by all methods; yet in embodied AI it is more fatal than in pure vision, because robot data cannot be crawled.

Data scaleReasonable method scaleWhat not to do
Tens to hundreds of demonstrationsBC, ACT, DP (10M–100M parameters)Fine-tuning a 7B VLA, training a base model from scratch
Thousands to tens of thousandsACT/DP with more capacity, or lightweight VLA fine-tuning (Octo class)Pretraining a large model from scratch
Million-level multi-embodiment trajectoriesVLA pretraining (RT-2, OpenVLA, π₀, RDT-1B class)Only doing single-task fine-tuning, wasting the pretraining value

The criterion: count your trajectories first, then decide the model scale. The typical result of fine-tuning a 7B model on 100 trajectories is: it memorizes the background and object positions, fails as soon as the workstation changes, and generalizes worse than a 60M-parameter ACT.

11.3 Reverse Lookup by “Capability Gap”: Fill In Whatever You Lack

Section 7.2 is a decision chain starting from constraints; here we add a reverse-lookup table starting from the “capability gap”. The two are used together: first use 7.2 to rule out impossible options, then use this table to confirm which method corresponds to the gap.

Which capability am I missing right now?
├── Missing "can perform this action"
│   ├── Have demonstrations → BC / ACT / DP (choose by precision and multimodality needs)
│   └── No demonstrations, but there is a reward computable automatically
│       ├── Simulation can be parallelized → PPO (stable) or SAC (higher sample efficiency)
│       └── Interaction is extremely expensive → DreamerV3 (imagination) or TD-MPC2 (online planning)
├── Missing "understand human language, switch tasks"
│   └── Fine-tune an open-source VLA (OpenVLA / π₀ / Octo); data volume decides scale
├── Missing "millimeter-level contact precision"
│   └── Continuous action head (π₀ flow matching / DP diffusion / RDT-1B); give up discrete tokens
├── Missing "high-frequency closed loop"
│   └── One-forward-pass route (ACT / π₀ few-step integration / Dreamer policy); rule out autoregressive and online MPC
├── Missing "does not collapse on the real robot"
│   └── Robustness layer: domain randomization → system identification → domain adaptation → real-world fine-tuning (in the order of 6.3)
└── Missing "reusable environment understanding"
    └── World model or JEPA (note that JEPA produces no actions and needs an attached planner)

The matching “gap → minimal-cost plan” table:

GapMinimal-cost planHigher-cost upgradeCommon waste
A single fixed task with sufficient demonstrationsACT (50–500 demonstrations, single GPU)Diffusion Policy (when multimodality is needed)Going straight to a VLA
Many tasks, needs language switchingOcto / small VLA fine-tuningπ₀ / RDT-1B (stronger precision and embodiment coverage)Building your own base model
Cannot learn in simulationPPO + reward shapingSAC / DreamerV3 (sample efficiency)Trial and error on the real robot
Works in simulation, collapses on the real robotDomain randomization + system identificationReal-world fine-tuning (small amount of data)Only widening the randomization range
Latency over budgetAction chunks + model quantizationSeparating the action expert, distillationSwitching to a larger model

11.4 The Six Most Easily Mismatched Combinations

Each corresponds to a mechanism in an earlier section. These are not “theoretically forbidden” but repeatedly occurring wastes in practice:

  1. Fine-tuning a 7B VLA on 100 demonstrations. Parameter count and data volume are severely mismatched, so the model fits the background and object positions in the demonstrations and fails as soon as the workstation changes. In this case ACT/DP usually generalize better.
  2. Using an autoregressive VLA for force control above 50 Hz. Token-by-token decoding latency cannot meet the closed-loop frequency of force control and dynamic balancing; no amount of semantic capability helps. Such tasks must take the “one forward pass” route.
  3. Using discrete action tokens for millimeter-level tasks such as peg insertion. Tokenization granularity determines the precision ceiling; discretization error cannot be eliminated by training. Contact-rich tasks should use continuous generative action heads.
  4. Deploying a VLA on a fixed workstation. On fixed tasks ACT/DP usually have a higher success rate, lower latency, and simpler debugging; the semantic capability of a VLA brings no benefit on a fixed workstation and only adds cost.
  5. Doing only domain randomization without system identification. Randomization covers parameter uncertainty, but the real system’s latency, friction nonlinearity, and actuator dead zone are often outside its range; the order in 6.3 is “identify first, then decide what to randomize”.
  6. Deploying JEPA directly as a policy. JEPA outputs representations, not actions; without an attached planner or policy head it cannot close the loop. Its benefits during pretraining must be realized on a downstream task.

11.5 One-Page Quick Notes: One Sentence per Method

  • BC: the plainest supervised learning, mapping observations to actions; cheap, but compounding error grows with the number of steps.
  • ACT: predicts a kk-step action chunk at once and smooths it with temporal ensembling; the chunk structure buys high-frequency control under little data.
  • Diffusion Policy: treats action generation as a denoising process, trading multiple forward passes for multimodal expression and high precision.
  • RT-2: discretizes actions into tokens and borrows vision-language pretraining for semantic generalization, at the cost of precision and latency.
  • OpenVLA: the open-source 7B version of the RT-2 idea; its main use is fine-tuning on your own data.
  • FAST: compresses long action sequences into short token strings in the frequency domain, easing the action-sequence burden of autoregression.
  • π₀: the vision-language backbone handles semantics and the flow-matching action expert handles high-frequency continuous chunks; a composite of “semantics + actions”.
  • Octo: a lightweight multi-embodiment baseline with few parameters, mainly used by fine-tuning; not a zero-shot general model.
  • GR-2: obtains physical and motion priors from video pretraining, then transfers from video to robot actions.
  • HPT: a shared trunk plus per-embodiment output heads, serving multiple robot morphologies with one model.
  • RDT-1B: a large-scale diffusion action model for dual arms; strong in data scale, bounded in task domain.
  • PPO: clipped objective + GAE, relying on large-scale parallel simulation trial and error; the default baseline for continuous control.
  • SAC: maximum-entropy objective + double Q + off-policy replay; saves interaction compared with PPO when samples are expensive.
  • DreamerV3: trains the policy by “imagining” in latent space, with the highest sample efficiency, at the cost of compounding model error.
  • TD-MPC2: no decoding, model predictive control only in latent space; strong on short horizons, high latency.
  • JEPA: predicts only representations, not pixel details; a pretraining tool rather than a controller.
  • Domain randomization / system identification: makes the simulation distribution cover the real distribution; the mandatory step before a simulated policy goes onto a real robot.

11.6 Three General Principles Worth Taking Away

First, all methods solve the same objective; the difference is in “data” and “priors”. The objective is always to maximize the expected discounted return; the paths diverge in only two places: whether the expectation is estimated with demonstrations, interaction, or unlabeled data; and what structure is written into the model (chunk structure, generative priors, vision-language pretraining, latent dynamics). When you see a new method, answer these two questions first, then look at its implementation details.

Second, capability can only come from three places; there is no fourth. Inductive bias (chunk structure, generative models, hierarchy), data scale (multi-embodiment, internet video), and pretraining transfer (VLM semantics). Every method is limited on these three: ACT relies on inductive bias, RT-2 on pretraining, and π₀ needs both. When someone claims a model is “zero-shot general”, what you should look for is which of these three it has invested in.

Third, precision, frequency, and generalization form a triangle; any method can occupy only two corners. This is also the biggest difference between embodied AI and pure vision tasks — pure vision can talk about precision alone, while embodied AI is simultaneously constrained by the physical closed loop.

Two corners you wantThe corner to give upRepresentative methodsEngineering implication
Precision + frequencyGeneralizationACT, DP (on task-specific data)Optimal for a fixed workstation; retraining is needed when the task changes
Precision + generalizationFrequencyπ₀, RDT-1B (generative action experts)Needs few-step integration and more compute; trading latency for capability
Frequency + generalizationPrecisionRT-2, OpenVLA (discrete tokens)Flexible semantic switching, but only centimeter-level tasks

The most common engineering mistake is imposing requirements on all three corners at once: 50 Hz, millimeter level, and task switching with one sentence. No current method satisfies all three; the correct approach is to decide which corner can be compromised first, and then choose the method.

Finally, back to the sentence from Chapter 7: selection follows constraints, not paper popularity. Chapter 7 gives you the constraint checklist; this chapter gives you the mechanism comparison and the capability reverse lookup. Cross-referencing the two basically rules out most wrong options.


12. Quick-Reference Summary: Core Differences and Applicable Scenarios of Each Algorithm

Chapter 11 answered “where the mechanisms differ”; this chapter answers only two questions that come up when you start working: how is it actually different from the nearest method, and should I use it under my conditions? The whole chapter is organized as “one matrix → constraint reverse lookup → default combinations by task family → four-step decision”, and can be flipped through directly as a comparison table during selection.

12.1 One Matrix: Positioning, Key Differences, Applicability and Forbidden Zones

The “key difference from the nearest neighbor” column is the focus of this table: each algorithm looks like “yet another end-to-end model” when viewed in isolation; the difference only shows when it is placed next to the one most easily confused with it.

AlgorithmOne-sentence positioningKey difference from the nearest neighborData thresholdTypical inference frequencyBest forExplicitly do not use
Behavior cloning (BC)The plainest supervised mapping from observations to actionsVersus ACT: single-step prediction, no chunk structure, no latent variables50–500 demonstrationsSame order as a network forward passFixed tasks, extremely latency-sensitive, very few demonstrationsLong horizons, multimodal demonstrations, state distribution shift
ACTPredicts a kk-step action chunk at once + temporal ensemblingVersus BC: the chunk structure truncates compounding error to the chunk length50–500 demonstrations10–50 Hz (amortized by chunks)Desktop low-to-medium-speed manipulation, single GPU, limited demonstrationsHigh-speed abrupt tasks, entirely new objects, force control
Diffusion Policy (DP)Treats action generation as multi-step denoisingVersus ACT: generative modeling, naturally expresses multiple peaks200–2000 demonstrations10–20 Hz (multi-step sampling)Multimodal demonstrations, fine manipulation, deformable objectsEdge devices with low compute, >50 Hz, very little data
RT-2Discretizes actions into tokens and uses a vision-language model for decisionsVersus DP: discrete bins buy semantic generalization at the cost of precisionInternet vision-language data + robot trajectories3–10 Hz (autoregressive)Open vocabulary, semantic switching, low-to-medium-speed tasksMillimeter-level assembly, >30 Hz, fine-tuning on small data
OpenVLAThe open-source 7B version of the RT-2 ideaVersus RT-2: larger scale, open weights, easier to fine-tuneSame as above, 7B scale3–5 HzOpen-source starting point, fine-tuning on own data, semantic generalizationSingle-GPU small data, edge deployment, high-frequency closed loops
FASTCompresses long action sequences into short tokens in the frequency domainVersus RT-2: still autoregressive, but the token count drops to about 1/3–1/5An existing autoregressive VLA + high-frequency action data5–15 HzLong action chunks, low-dimensional actions, wanting shorter sequencesHigh-dimensional dexterous hands, extremely high-frequency abrupt tasks, millimeter level
π₀Vision-language backbone + flow-matching action expertVersus DP: the backbone brings semantics, few-step integration brings high frequencyLarge-scale multi-embodiment trajectories (million level)20–50 Hz (few-step integration)High frequency + high precision + semantic generalizationSmall teams with little data, edge compute, rapid validation
OctoLightweight multi-embodiment general baselineVersus π₀: fewer parameters, mainly used by fine-tuningOpen X-Embodiment-scale multi-embodiment data10–20 HzQuickly obtaining a reproducible baseline, secondary developmentZero-shot generality, sub-centimeter precision
GR-2Video prediction first, then converted into a policyVersus JEPA: outputs actions, using a generative action headVideo + robot action data10–20 HzContact-rich, needs physical and motion priorsNo video data, purely semantic tasks, strict real-time requirements
HPTShared trunk + independent input/output heads per embodimentVersus Octo: models “embodiment differences” explicitly in the structureHeterogeneous multi-embodiment data10–20 HzOne model serving multiple robot morphologiesA single embodiment, extreme precision, hard-to-control data mixing
RDT-1BA large-scale diffusion action base for dual armsVersus π₀: diffusion head, unified action space, focused on dual armsMillion-level dual-arm trajectories10–20 HzDual-arm manipulation, a large-scale pretraining starting pointSmall single-arm tasks, edge devices, non-dual-arm domains
PPOOn-policy RL with a clipped objective + generalized advantage estimationVersus SAC: on-policy, trading parallel sampling for sample efficiencyMillion-level simulation interactionsSimulation step levelWalking/locomotion, large-scale parallel simulation, writable rewardsReal-robot online learning, sparse rewards, only demonstrations and no reward
SACMaximum-entropy objective + double Q + off-policy replayVersus PPO: reuses historical data, an order of magnitude higher sample efficiencyHundred-thousand-level interactionsControl step levelReal-robot servoing, expensive interaction, continuous actionsThousands of parallel environments, multimodal actions, purely offline settings
DreamerV3“Imagines” in latent space and trains a policyVersus TD-MPC2: trains a policy network, deployment needs only one forward passHundred-thousand-level interactionsOne forward pass (extremely fast at deployment)Low data budget, visual input, reward magnitudes that vary widelySub-centimeter contact, long horizons, real-robot online training
TD-MPC2No decoding; model predictive control only in latent spaceVersus Dreamer: online planning at deployment, no observation decodingHundred-thousand-level interactionsPlanning at every step (slower)Short-horizon precise local control, frequent task switchingHigh-dimensional actions, >50 Hz, long horizons
JEPAA pretraining architecture that predicts only in representation spaceVersus Dreamer: outputs no actions, just a representation toolUnlabeled video or observationsDepends on the downstream componentVisual-backbone initialization, data without action labelsDirect closed-loop deployment, millimeter-level geometric tasks
Domain randomization / system identificationMakes the training distribution cover the real distributionNot a policy algorithm but a step before real-robot deploymentSimulation + a small amount of real dataDoes not change the policy frequencyTransferring simulated policies, large parameter uncertaintyReplacing contact modeling, replacing calibration and time synchronization

12.2 Reverse Lookup by Constraint: Which One Should I Choose Under My Conditions

This section treats “resources and constraints” as the search key. Usage: find the row closest to your situation, then look at the “first choice / second choice / do not choose” columns. If several rows hit at the same time, the stricter one wins (for example, when “only 50 demonstrations” and “need 30 Hz” both hold, only ACT satisfies both).

Your constraintFirst choiceSecond choiceDo not choose
Only 50–200 demonstrations, single GPUACTBehavior cloning (when the task is extremely simple)Fine-tuning a 7B VLA, training π₀ from scratch
500–2000 demonstrations, several reasonable ways existDiffusion PolicyACT + data augmentationPlain BC with unimodal regression
No demonstrations, but simulation and a writable rewardPPO (large-scale parallel)SAC (few environments, expensive samples)Imitation learning (no demonstrations)
No demonstrations, interaction extremely expensiveDreamerV3SAC + a demonstration-warmed replay bufferPPO (million-level interaction is unaffordable)
Learned in simulation, collapses on the real robotDomain randomization + system identificationFine-tuning with a small amount of real dataOnly widening the randomization range
Needs language instructions and open vocabularyOpenVLA / Octo fine-tuningπ₀ (stronger precision and embodiment coverage)Building your own base model, plain ACT
Needs a closed loop above 30 HzACT / π₀ few-step integration / Dreamer policyA distilled small modelAutoregressive VLA, online MPC
Needs millimeter level (peg insertion, screw driving)DP / π₀ continuous action headACT + a force-control low levelDiscrete-token VLA, FAST
Long action sequences, low-dimensional actions, limited computeFASTACTFrame-by-frame per-dimension discrete tokens
One model serving multiple robotsHPTRDT-1B / OctoTraining a separate set for each embodiment
Plenty of unlabeled videoJEPA pretraining → attach a action headGR-2 (video-pretrained policy)Using JEPA directly as a controller
Dual arms, large-scale dataRDT-1Bπ₀Forcing a small single-arm model to scale up
Deployed on edge devices with limited computeACT / a quantized small VLADistilled DPDeploying a 7B-class VLA as is

12.3 Default Combinations by Task Family

Real projects rarely use only one method; the following are “default combinations when there are no special constraints”, usable directly as a starting point and then adjusted according to 12.2.

Task familyDefault combinationKey reasonCommon alternative
Desktop grasping and organizingACT or DP + fixed cameraDozens to hundreds of demonstrations suffice, and 10–30 Hz is enoughAdd a lightweight VLA for subtask selection when multi-task
Folding clothes, deformable objectsDP + relatively high control frequencySeveral reasonable actions exist for the same state; multimodal expression is neededACT + demonstrations of multiple styles
Peg insertion, assembly, contact-richDP / π₀ continuous head + low-level force controlMillimeter precision and contact stability come firstTD-MPC2 (short-horizon precise control)
Humanoid walkingPPO + domain randomizationThousands of parallel environments; rewards (speed, posture) are easy to writeSAC (when there are few environments)
Quadruped locomotionPPO + automatic domain randomizationParallel sampling is cheap and disturbance rejection is neededDreamerV3 (when the sample budget is tight)
Dexterous multi-finger manipulationSimulation PPO/SAC + demonstration fine-tuningHigh-dimensional actions rely on simulation trial and error as a base, with demonstrations fixing precisionDP (mind the cost of sampling in high dimensions)
Dual-arm coordinated manipulationRDT-1B pretraining + DP/ACT fine-tuningDual-arm data and a unified action space are keyπ₀ multi-embodiment pretraining
Open-vocabulary sortingVLA high level selects targets + ACT/DP low level executesSemantics and precision divide the work, avoiding forcing one model to do everythingFAST to shorten the high-level sequence

12.4 Four-Step Decision: From Constraints to a Plan

Compressing the tables above into a sequence you can follow, where each step answers only one question:

  1. Are there demonstrations? Yes → go to the skill layer (BC / ACT / DP); no → go to the basic layer (PPO / SAC / world models); only unlabeled video → do representation pretraining first (JEPA), then attach an action head.
  2. How high a closed-loop frequency is needed? Above 30 Hz → only the “one forward pass producing action chunks” route (ACT, π₀ few-step, Dreamer policy); around 10 Hz → DP and VLA are both fine; 3–10 Hz → autoregressive VLA is acceptable too.
  3. How strong a generalization is needed? Fixed workstation → no need for a VLA; ACT/DP are faster and more accurate; multi-task, open vocabulary → pretrained semantics are required (OpenVLA, π₀, RDT-1B).
  4. How much deployment compute is available? Edge device → ACT or a quantized small model; a server available → generative action heads and 7B-class VLAs are possible.

After the four steps, if several candidates remain, use the “do not choose” column of 12.2 to exclude them, then check the data volume, real-robot conditions, and safety requirements against the constraint checklist in Chapter 7. If two candidates are both feasible on paper, choose the one that is simpler to implement, faster at inference, and more interpretable to debug — in embodied projects, a plan that can run and iterate quickly usually ends up performing better than one with higher paper metrics.

12.5 Five Cross-Cutting Conclusions

  1. If there are demonstrations, use the skill layer; only without demonstrations use reinforcement learning. The sample efficiency of imitation learning is usually an order of magnitude higher, and the value of reinforcement learning lies in “the places demonstrations do not cover” and “rewards that can be computed automatically”.
  2. Precision, frequency, and generalization form a triangle; any method can occupy only two corners. A fixed workstation chooses “precision + frequency”; open vocabulary chooses “frequency + generalization”; high-precision generalization chooses “precision + generalization” and accepts the latency.
  3. Layering is inevitable, not optional. The high level runs slowly for semantics and subtasks, the middle level produces action chunks, and the low level runs the servo loop; trying to make one model handle all three layers almost always fails on frequency or precision.
  4. Each of the three kinds of pretraining buys a different capability. Vision-language pretraining buys “semantics”, video/world-model pretraining buys “physical intuition”, and action-data pretraining buys “embodiment and skill coverage”. The three cannot substitute for each other.
  5. The last mile before the real robot is data and calibration, not algorithms. If the four things — unified action space, time synchronization, camera calibration, and latency compensation — are not done well, no algorithm can save it.

Appendix A: Abbreviations Quick Reference

AbbreviationFull English nameExplanation
ACTAction Chunking with TransformersTransformer-based action-chunking imitation learning
ADRAutomatic Domain RandomizationAutomatic domain randomization
BCBehavior CloningBehavior cloning (the most basic imitation learning)
CEMCross-Entropy MethodCross-entropy method (gradient-free sampling optimization)
CMA-ESCovariance Matrix Adaptation Evolution StrategyCovariance matrix adaptation evolution strategy
CNNConvolutional Neural NetworkConvolutional neural network
CVAEConditional Variational AutoencoderConditional variational autoencoder
DANNDomain-Adversarial Neural NetworkDomain-adversarial neural network
DCTDiscrete Cosine TransformDiscrete cosine transform
DPDiffusion PolicyDiffusion policy (also Dynamic Programming; distinguished by context)
DRDomain RandomizationDomain randomization
ELBOEvidence Lower BoundEvidence lower bound (the objective of variational inference)
EMAExponential Moving AverageExponential moving average
FASTFrequency-space Action Sequence TokenizationFrequency-space action-sequence tokenization
GAEGeneralized Advantage EstimationGeneralized advantage estimation
GRUGated Recurrent UnitGated recurrent unit
HPTHeterogeneous Pre-trained TransformerHeterogeneous pretrained Transformer (shared trunk across embodiments)
ILImitation LearningImitation learning
JEPAJoint-Embedding Predictive ArchitectureJoint-embedding predictive architecture
KLKullback-Leibler divergenceKL divergence (a measure of the difference between two distributions)
LLMLarge Language ModelLarge language model
MDPMarkov Decision ProcessMarkov decision process
MPCModel Predictive ControlModel predictive control
MSEMean Squared ErrorMean squared error
ODEOrdinary Differential EquationOrdinary differential equation
OTOptimal TransportOptimal transport
POMDPPartially Observable Markov Decision ProcessPartially observable Markov decision process
PPOProximal Policy OptimizationProximal policy optimization
RSSMRecurrent State Space ModelRecurrent state space model
RT-2Robotic Transformer 2Second-generation robotic Transformer (the representative of “actions as tokens”)
SACSoft Actor-CriticSoft actor-critic (maximum-entropy reinforcement learning)
Sim-to-RealSimulation to RealitySimulation-to-reality transfer
SysIDSystem IdentificationSystem identification
TDTemporal DifferenceTemporal difference
TD-MPC2Temporal Difference Model Predictive Control v2Temporal-difference model predictive control (second generation)
TVTotal VariationTotal variation (a kind of distribution distance)
VAEVariational AutoencoderVariational autoencoder
VICRegVariance-Invariance-Covariance RegularizationVariance-invariance-covariance regularization
ViTVision TransformerVision Transformer
VLAVision-Language-Action modelVision-language-action model
VLMVision-Language ModelVision-language model

Supplementary terminology notes (not abbreviations, but easily misunderstood):

  • Action chunking: predicting the next kk actions at once instead of only one step.
  • Temporal ensembling: exponentially weighted averaging of several overlapping action chunks to smooth chunk boundaries.
  • Imagination: rolling out multiple trajectories in the latent space of a world model without interacting with the environment.
  • Model exploitation: the policy learns to use the world model’s prediction errors to obtain high returns instead of actually completing the task.
  • Representation collapse: the encoder maps all inputs to the same (or extremely low-rank) representation, making the prediction loss degenerate to zero.
  • Bootstrapping: using one’s own value estimate as part of the update target.
  • Stop-gradient: truncating the gradient of a certain path during backpropagation, commonly used for target networks.

Conclusion: How to Use This Document

The structure of this document is a “four-layer map”, but the real way to use it is to look things up backward:

  1. First clarify your constraints (data volume, whether a real robot exists, frequency, whether language is needed) and go through the decision questions in Chapter 7; if you are still unsure, do the reverse lookup by “capability gap” in Chapter 11 (11.3);
  2. Locate the corresponding layer and go back to that chapter for the “principle + pseudocode”;
  3. Before starting, copy the “acceptance criteria” of the corresponding stage in Chapter 8 as a checklist;
  4. When it does not work, check the pitfall list in Chapter 9 first — eighty percent of the problems are on that list;
  5. When you need mathematical details, expand the collapsible derivation in the corresponding section, where there is a complete chain of reasoning rather than only the conclusion.

One last reminder: the bottleneck of embodied AI is usually not the algorithm but data, latency, and contact physics. Algorithms determine the ceiling; engineering determines how far you can go.

Comments

Loading comments…

    ← Back to home