A Streaming Action Tokenizer
Tokenize robot actions one control step at a time, with no neural network and a guaranteed error bound at every step. One pretrained instance serves 24 embodiments.
import numpy as np
from transformers import AutoProcessor
codec = AutoProcessor.from_pretrained(
"anonymous/ActionCodec2-1st-order",
trust_remote_code=True,
)
# Synthetic episode for a copy-paste check. Replace with your own (T, 7) data.
actions = np.zeros((12, 7), dtype=np.float32)
actions[:, 6] = 1.0 # open gripper
tokens = codec.encode(actions, fps=15)
decoded_actions = codec.decode(tokens, fps=15)
01Why streaming
Almost every action tokenizer encodes a whole chunk of motion, one to two seconds, as a unit: nothing runs until the chunk is complete, and then it runs open-loop. A streaming tokenizer gives each control step its own tokens, so the robot acts as each token lands.
CHUNK VS STREAMING
What a chunk tokenizer gives up
chunk tokenizerstreaming tokenizer
02Covering
Each step's tokens must be accurate on their own, even on motion never seen in training. The rule: the reconstruction stays within ε of the true action at every step.
A fixed grid, not a learned codebook, so unseen actions stay accurate.
WHERE THE ERROR GOES
A learned codebook vs a fixed grid
training datatokens per action: fewer → morean action never seen in training
One step, one axis. Only the range reachable in one step needs cells.
TRANSLATION
One step of streaming, along one axis
true actiontokenized actionallowed error ±ε
The same step in rotation, with cells covering the ball of reachable turns.
ORIENTATION · SO(3)
The same step, in rotation space
true orientationtokenized orientationallowed error ±ε
How few tokens that takes: for a real arm, 800 bins per axis become 17.
IN NUMBERS · 3-D TRANSLATION
How many bins does a robot arm need?
per axis · arm range 4 m · 5 mm resolution · 15 actions per second · top speed 1.2 m/s
03Set-BPE
Set-BPE makes common motions cheap by merging tokens as sets: across axes within a step, then across nearby steps. It is lossless, so the ε bound is untouched.
REAL DATA · PRETRAINED ACTIONCODEC2
One second of a real robot arm, into tokens and back
8.0–11.9%fewer tokens than order-dependent BPE, on held-out data
04Benchmarks
One VLA (G0.5), one training recipe; only the action tokenizer changes.
Four benchmarks: ActionCodec2 variants take the top places on all four. Axes are zoomed to where the methods differ.
On the real robot: zero-shot DROID-Franka rollouts, side by side.
05Reinforcement learning
Each policy is then fine-tuned with PPO on a harder LIBERO-Object, where objects and basket are re-placed every episode. From about 5% success, the ActionCodec2 variants climb fastest to 83–93%; the others level off at 71–77%.
Rolling mean over PPO steps, band ± one rolling std. Click the plot to jump to step 0, 100 or 200.
06Agents
Each token names a physical motion (x−1o: 1 cm left, gripper open), so a VLM agent can write tokens directly
and save sequences it trusts as macros.
THE LOOP
Look up, act, reflect, grow the library
Tokens beat poses; macros beat both. As the macro library grows, decisions per submission fall from 17 to 8.3.
What the agent learned: 13 macros, each named and described in its own words.
THE MACRO LIBRARY
Pick any of the 13 macros
The macros carry over. On a new task: 63 decisions and a failure from scratch, 16 and a success with the macros.
REUSE ON A NEW TASK
The same new task, run twice
Move the cube between the mats onto the empty mat, press the button once, then move the other cube into the gap.
One segment per decision; gold segments call a macro.
Thinking
Output
A long-horizon case study: 20 episodes of Multi-Drawer Search on a bimanual robot. Pick a milestone to replay it.
MULTI-DRAWER SEARCH · 20 EPISODES
Nine first-time milestones, replayed
Search two cabinets for a measuring cup and tongs; place each in the red bin, cup first.
Thinking
Macros
07Try it
20khours
Fitted on 24 embodiments
Fitted once on 105M end-effector and 204M joint frames.
4,096tokens
Universal
Out of distribution it may lose compression, never accuracy.
0trained weights
NN-free
Closed-form covering primitives and exact greedy Set-BPE. No network, no training.
8.8tokens/s
Compact
For 15 Hz end-effector motion (10.8 for joints). Set-BPE packs them losslessly, with 11.9% fewer tokens than order-dependent BPE.
≤5mm
Bounded tracking error
And 0.02 rad, at every step of a rollout of any length.
1step at a time
Streaming
Tokens come out one control step at a time, so the policy reacts to every new observation instead of waiting for a chunk to finish.
x−1o
Physical meaning
Every token names a motion: x−1o moves 1 cm left with the gripper open, so an agent can write tokens directly.
drop-in
Plug and play
Use it as the action vocabulary of any autoregressive VLA. The decoder is stateless and has no weights to load.
Try it
On Hugging Face
Hugging Face · coming soon