DL0148 Action Chunking Transformer (ACT)

Explain the Action Chunking Transformer (ACT). How does predicting sequences of future action vectors (k-step horizons) solve temporal inconsistency and compounding error drift?

Answer

ACT is the imitation-learning policy introduced with the ALOHA bimanual setup: a transformer encoder-decoder that takes the current multi-view images plus the 14-dimensional joint state and emits, in a single forward pass, a whole chunk of k=100 future joint-position targets rather than one action. It is trained as a conditional VAE (CVAE) with an L_1 reconstruction loss on the chunk plus a KL term on a small style latent z, which lets one deterministic-at-test-time policy absorb the multimodality of human teleoperation instead of averaging it away. Chunking attacks drift arithmetically: at 50 Hz a 20-second task is 1,000 control steps but only 1000/100 = 10 chunk decisions, so the number of places where the policy can leave the training distribution shrinks by a factor of k and the classic O(\epsilon T^2) behaviour-cloning bound falls to roughly O(\epsilon T^2 / k). Chunking also removes per-step temporal inconsistency, because the actions inside a chunk are generated jointly from one latent and one observation, so the policy cannot flip between two valid modes on consecutive 20 ms steps. To avoid a visible discontinuity when a new chunk starts, ACT still queries the network every step and blends the overlapping predictions with temporal ensembling.

(1) The Chunk Is The Output Unit: the policy models \pi(a_{t:t+k-1} \mid o_t) instead of \pi(a_t \mid o_t), so k correlated actions are predicted together as one object.
(2) Effective Horizon Divided By k: the agent makes H = \lceil T/k \rceil sequential decisions, and compounding error grows with the number of decisions, not with the number of motor commands.
(3) CVAE For Multimodality: a BERT-style encoder compresses the demonstrated chunk into a 32-dimensional latent z during training and is discarded at test time, where z = 0 gives one clean decisive mode.
(4) Non-Markovian Demos Stop Being Fatal: a single-step policy standing at a human pause sees a bimodal target (hold still or move) and can freeze forever; a chunk that contains the pause and the following motion resolves the ambiguity.
(5) Temporal Ensembling For Smoothness: re-query every step and average the overlapping chunk predictions with weights w_i = \exp(-m i), which keeps reaction latency at one control step while removing chunk-boundary jumps.
(6) L_1 Over L_2: the L_1 loss on absolute joint targets produces sharper, less smeared trajectories, which matters for millimetre-scale contact tasks.

Architecturally there is nothing exotic. Each of the four RGB streams (two wrist cameras, two static cameras at 480×640) goes through a ResNet-18 whose final feature map is flattened into roughly 300 tokens, the joint vector becomes one more token, and the style latent becomes one more; a 4-layer transformer encoder with width 512 mixes them, and a 7-layer decoder attends to that memory from k fixed learned position embeddings, one per future step, so the k \times 14 output is produced non-autoregressively in about 0.01 s. The whole policy is roughly 80M parameters trained from scratch per task on about 50 demonstrations, which is the interesting part: the gain does not come from scale or pretraining, it comes from changing what a single prediction means.

Architecture diagram of ACT: four RGB cameras feed per-camera ResNet-18 backbones producing about 300 tokens each, a joint-position token joins them, a 4-layer transformer encoder mixes the tokens, a 7-layer decoder with k learned queries emits a k by 14 action chunk, and above the main lane a training-only CVAE encoder maps the demonstrated action sequence and joint state to a 32-dimensional style latent z that is injected into the encoder and set to zero at test time

Figure 1: ACT is a CVAE whose decoder is a chunk predictor. The dashed lane exists only during training: it sees the ground-truth action sequence and squeezes the demonstrator’s stylistic choice into z \in \mathbb{R}^{32}. At test time z is fixed to the prior mean, so the same network becomes a deterministic policy that outputs k \times 14 absolute joint targets in one pass.

Mathematical Formulation:
\pi_\theta(\hat a_{t:t+k-1} \mid o_t, q_t, z)
\mathcal{L}_1 = \sum_{j=0}^{k-1} \| \hat a_{t+j} - a_{t+j} \|_1
\mathcal{L} = \mathcal{L}_1 + \beta \, D_{\mathrm{KL}}(q_\phi \, \| \, \mathcal{N}(0, I))

Where:

  • \hat a_{t:t+k-1} is the predicted action chunk, here k=100 absolute target joint configurations in \mathbb{R}^{14} for a bimanual 6-DoF-plus-gripper arm pair.
  • o_t are the four camera images at time t and q_t the measured joint positions, together forming the only observation the chunk is conditioned on.
  • z \in \mathbb{R}^{32} is the style latent, sampled from the encoder posterior q_\phi(z \mid a_{t:t+k-1}, q_t) in training and set to z = 0 at inference.
  • j \in \{0, \ldots, k-1\} indexes positions inside the chunk, each produced by its own learned decoder query.
  • \beta weights the KL term; a large \beta collapses z to noise while a small one lets the encoder leak the answer and hurts test-time behaviour.
  • The L_1 norm is deliberate: it penalises large joint errors less quadratically than L_2 and therefore averages competing modes less aggressively.

The drift argument is worth writing down. Standard behaviour cloning with per-step error \epsilon suffers covariate shift: a mistake moves the robot to a state the demonstrations never covered, the next prediction is worse, and the regret bound is quadratic in the horizon. Chunking does not make the policy immune, it reduces how many times the loop is closed. With H = T/k decision points, each contributing error \epsilon that persists over the remaining decisions, and each decision covering k timesteps of cost, the accumulated term scales as \epsilon H^2 k = \epsilon T^2 / k. The same factor cuts inference calls, which is why a chunked policy can afford a much heavier network per decision.

Horizon Arithmetic At 50 Hz:
T = 20 \times 50 = 1000
H = \lceil 1000 / 100 \rceil = 10
\mathcal{E}_{\mathrm{BC}} = O(\epsilon T^2)
\mathcal{E}_{\mathrm{chunk}} = O(\epsilon T^2 / k)

Semi-log chart of a compounding-error bound scale against episode length in control steps at 50 Hz, with three parabolic curves for chunk size k equal to 1, 10, and 100, showing the k equals 100 curve two orders of magnitude below the single-step curve, annotated with the point where a 20 second task of 1000 steps requires only 10 chunk decisions

Figure 2: The bound is still quadratic in task length, so chunking does not abolish drift, it buys two orders of magnitude at k=100. The practical reading is that a long-horizon task becomes as hard as a short one only if the chunk itself remains executable open-loop, which is exactly the assumption that breaks when the scene moves during the 2 seconds a chunk spans.

Naive open-loop execution of the chunk creates a new problem: every 2 seconds a fresh observation produces a fresh chunk that need not start where the previous one ended, and the robot jerks. ACT therefore runs the policy at the full control rate and aggregates. At timestep t there are up to k different chunks that predict an action for t, one from each of the previous k queries, and the executed command is their exponentially weighted mean with m = 0.01, where index i = 0 is the oldest prediction. That value of m keeps the weights nearly uniform (1.00, 0.99, 0.98, …), so new observations are folded in immediately while the average stays smooth; a larger m leans on the oldest chunk and reacts more slowly.

Temporal Ensembling:
w_i = \exp(-m i)
\bar a_t = \sum_i w_i \hat a_t^{(i)} / \sum_i w_i

Timeline diagram with four horizontal rows of six cells each, one row per chunk issued at timesteps 0, 1, 2 and 3, staggered so that all four rows cover timestep 4; the four cells covering timestep 4 are highlighted and labelled with exponential weights 1.00, 0.99, 0.98 and 0.97, and an arrow leads down to a box stating that the executed action at timestep 4 is the weighted mean of the four overlapping predictions

Figure 3: Chunks overlap because the policy is queried every step, so each control command is a vote of up to k predictions made from k different observations. This is what keeps ACT closed-loop at 50 Hz while its prediction horizon stays 2 seconds long, and it costs one extra forward pass per step rather than any extra training.

PropertySingle-step BC (k = 1)Chunk, open-loop executionACT: chunk + temporal ensembling
Policy outputOne 14-d joint target100 x 14 targets, all executed100 x 14 targets, blended with earlier chunks
Queries per 20 s task1,000101,000 (each cheap, 0.01 s)
Decision points that can drift1,000, bound scales as eps T^210, bound scales as eps T^2 / k10 committed motions, continuously re-averaged
Reaction to a disturbance20 msUp to 2 s of stale commands20 ms, damped by the weighted mean
Human pauses in demosBimodal target, policy can freezePause is inside the chunk, resolvedSame, plus no boundary discontinuity
Dominant failureJitter and mode switching between stepsJerk at chunk boundaries, blindness mid-chunkAveraging across modes can blur a decisive motion

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *