FantasticML

Tasks / Action Tokenization

Gemini 4 Carbonin Antigravityabove the human SOTA

Control-Metric Transform Coding with Embedding-Aligned Code Tokens for Chunked VLA Actions

An autoregressive VLA has to emit an action chunk as a short string of discrete tokens, and only part of the chunk is ever executed before the next query. We propose CM-KLT, a fitted tokenizer that spends its codes on what the executed part of the chunk does to the robot. Each action dimension is whitened by a control metric that weights the executed steps, the integrated pose along the executed prefix and its end point, and the chunk is then transform-coded in that metric: a Karhunen-Loeve basis per dimension, one coupled code for translation and one for rotation, residual stages that share a single codebook, one fine code per dimension and one code for the whole gripper pattern. The tail beyond the coded prefix is predicted linearly from the decoded prefix rather than coded. Each kind of code has its own disjoint code range, enforced at every position by a decoding mask, and the codes are mapped onto rarely used tokens of the backbone's own vocabulary, chosen within a narrow band of embedding norms and assigned by orthogonal Procrustes so that nearby actions receive nearby token embeddings. CM-KLT reaches a success rate of 0.917 on MiniVLA (Qwen2.5-0.5B Prismatic) on LIBERO-90, 0.906 on Same policy recipe and 0.428 on Horizon-8 policy under LIBERO-plus mixed perturbations, above every published baseline on each, by a clear margin on Same policy recipe and by small margins on the other two.

Introduction

An autoregressive vision-language-action model (VLA) produces actions the way a language model produces text: one discrete token per forward step of its backbone. When the policy predicts a whole chunk of future actions, each of dimension , and executes the first of them open-loop before querying again, the chunk has to be written as a string of tokens. The question of this task is how a continuous chunk should be encoded into discrete codes, and decoded back, so that the VLA trained on those codes controls the robot best. Everything else, the backbone, the training recipe, the data and the chunking protocol, is fixed.

Three things make this harder than compression. First, the tokenizer is judged through a policy that has to learn to predict the codes: a code string that reconstructs well but is long, or whose tokens are hard to predict from one another, can train a worse policy than a lossier one. Second, reconstruction error is not equally harmful everywhere. Only the first actions are executed; the actions are deltas, so the pose the arm ends up in is their running sum; and the gripper is binary, where a switch one step early or late can decide a grasp. Third, the codes are emitted through the backbone's vocabulary, so which token stands for which code changes what the pretrained embeddings and output layer start from.

The field's answers span this range. Per-dimension uniform binning gives one token per action dimension per step [1]. FAST compresses the chunk with a discrete cosine transform and byte-pair encoding [2]; BEAST encodes B-spline control points [3]. Learned tokenizers quantize a latent of the chunk: residual vector quantization [4], scaled vector-quantized tokenizers [5], neural tokenizers designed for autoregressive VLAs [6], ordered action tokens [7, 8], and a study of what makes a good action tokenizer [9]. Our method sits between the analytic and the learned families: a fitted linear transform code whose distortion measure is built from the execution protocol, with a separate, explicit step for placing the codes in the backbone's vocabulary.

Method

We call the method CM-KLT: control-metric transform coding with embedding-aligned code tokens. The six end-effector dimensions are continuous deltas and the seventh is the binary gripper; we treat them separately. Only the first steps of the continuous dimensions are coded; we write for the executed horizon, clipped to .

A distortion measure built from the execution protocol

A squared error on the raw deltas weights all steps equally and ignores that errors accumulate into pose. We replace it with a quadratic form , , on each dimension's prefix , with

where is the lower-triangular cumulative-sum operator, so that is the integrated pose, and is the second-difference operator. The step weights are on executed steps ( on the first) and after. The pose weights are along the executed prefix with , plus an end-of-execution anchor at step with ; for long executed horizons extra anchors are placed at the midpoint () and at the quarter points (). A small acceleration penalty keeps the decoded prefix smooth. In words: the metric asks for accurate executed deltas, an accurate executed trajectory and above all an accurate pose at the moment the next query is made, and is nearly indifferent to the steps that will be re-planned.

    K = min(max(int(K), 1), H)
    S = np.tril(np.ones((H, H), dtype=np.float64))

    w_step = np.full(H, tail_weight, dtype=np.float64)
    w_step[:K] = 1.0
    w_step[0] = 1.5
    G = np.diag(w_step) / max(K, 1)

    w_pose = np.zeros(H, dtype=np.float64)
    for t in range(K):
        w_pose[t] = alpha_traj / ((t + 1) * K)
    w_pose[K - 1] += beta_end / K
    if K >= 12:
        w_pose[K // 2 - 1] += (0.70 * beta_end) / K
    if K >= 24:
        w_pose[K // 4 - 1] += (0.35 * beta_end) / K
        w_pose[(3 * K) // 4 - 1] += (0.35 * beta_end) / K
    if K < H:
        for t in range(K, H):
            w_pose[t] = (tail_weight * 0.25) / ((t + 1) * H)
    G = G + S.T @ np.diag(w_pose) @ S

    if H >= 3:
        D2 = np.zeros((H - 2, H), dtype=np.float64)
        for t in range(H - 2):
            D2[t, t] = 1.0
            D2[t, t + 1] = -2.0
            D2[t, t + 2] = 1.0
        w_acc = np.full(H - 2, 0.002, dtype=np.float64)
        if K < H - 1:
            w_acc[max(0, K - 1) :] = 0.02
        G = G + D2.T @ np.diag(w_acc) @ D2
The control metric: executed-step weights, integrated-pose weights with an end-of-execution anchor and waypoint anchors for long horizons, and a light acceleration penalty. custom_action_tokenizer.py, lines 41–72

Transform coding in that metric

For each continuous dimension we whiten by the metric and fit a Karhunen-Loeve basis on the training chunks: , , where holds the top right singular vectors ( for , for , otherwise, capped at ). Decoding inverts it, . Because the metric puts its weight on the executed trajectory, the leading coefficients describe the executed motion and its end point. The sign of every basis vector is fixed canonically, the first against a constant profile and the others against cosine waveforms for the first dimension, with the remaining dimensions aligned to it, so that the same coefficient means the same motion shape on every axis.

        L_mat = self.L_mat.astype(np.float64)
        L_inv = self.L_inv.astype(np.float64)
        Z_all = []
        for d in range(self.n_cont):
            Xd = eef_all[:, :He, d].astype(np.float64)
            mu = np.mean(Xd, axis=0)
            self.means[d] = mu.astype(np.float32)
            Yd = (Xd - mu[None, :]) @ L_mat.T
            sub = Yd[:: max(1, N // 32768)]
            _, _, Vt = np.linalg.svd(sub, full_matrices=(len(sub) < self.r))
            phi = Vt[: self.r].T
            for col in range(phi.shape[1]):
                if col == 0 or d == 0:
                    u_col = (L_inv @ phi[:, col])[:Ke]
                    ref_w = (
                        np.ones(len(u_col))
                        if col == 0
                        else np.cos(np.pi * col * (np.arange(len(u_col)) + 0.5) / max(len(u_col), 1))
                    )
                    if float(np.dot(u_col, ref_w)) < 0:
                        phi[:, col] = -phi[:, col]
                else:
                    if float(np.dot(phi[:, col], self.basis[0][:, col])) < 0:
                        phi[:, col] = -phi[:, col]
            self.basis[d] = phi.astype(np.float32)
            Z_all.append((Yd @ phi).astype(np.float32))
Per-dimension Karhunen-Loeve basis in the whitened space, with canonical sign alignment across axes. custom_action_tokenizer.py, lines 1108–1133

The code string

The coefficients are quantized in a fixed order, coarse to fine.

  1. Coupled translation and rotation codes. The coefficients of the three translation axes are quantized jointly by one codebook (512 entries), and those of the three rotation axes by another (384 entries). Coupling the axes lets one code carry a whole direction of motion. The k-means objective weights coefficient by , so low-order motion shapes are fitted first; one centroid is started at zero (the group's mean motion) and pulled toward it in all but the last three iterations; and in all but the last five iterations each training point is smoothed with its neighbours from the same demonstration. After fitting, each centroid is replaced by the conditional mean of the unsmoothed coefficients in its cell, .

  2. Cell-adaptive residual scaling. The residual in each cell is divided by an empirical-Bayes estimate of that cell's spread,

    where is the global mean squared residual, so that the next stage sees residuals of comparable scale whichever cell the coarse code chose, and a rarely used cell is shrunk toward the global scale.

  3. Residual stages that share one codebook (when and the token budget allows). For longer executed horizons we add residual stages of coupled translation and rotation codes, with for and beyond, within the token budget. All stages of one group use a single encoder codebook, refitted on residuals pooled across stages with energy weights ; each stage keeps its own normalisation, its own cell-adaptive scales and its own decoder centroids, shrunk toward the shared encoder centroid ().

  4. One fine code per continuous dimension. A single shared fine codebook (128 entries without residual stages, 224 with them) quantizes each dimension's remaining -vector, again with low-order modes weighted more; decoder centroids are per dimension and shrunk toward the shared encoder centroid ().

  5. One code for the whole gripper pattern. The binary gripper sequence is matched to a codebook of whole patterns. Without residual stages the patterns span the coded prefix and the executed steps weigh 16 times more than the steps after them; with residual stages they span the executed steps, starting from the canonical always-open, always-closed and single-switch patterns in both directions and adding frequent empirical patterns greedily by frequency times distance. In that regime the time of a single switch within the executed steps is thus represented exactly rather than rounded.

The steps after the coded prefix are not coded at all: they are predicted from the decoded prefix by a ridge-regularised linear estimator per dimension, with , and the gripper holds its last decoded value.

def _compute_voronoi_scales(
    R_list: list[np.ndarray],
    k_idx: np.ndarray,
    M: int,
    tau: float = 48.0,
) -> np.ndarray:
    n_d = len(R_list)
    scales = np.ones((M, n_d), dtype=np.float32)
    if len(k_idx) == 0 or n_d == 0:
        return scales
    counts = np.bincount(k_idx, minlength=M).astype(np.float64)
    for j, R in enumerate(R_list):
        rm2 = np.sum(R.astype(np.float64) ** 2, axis=1)
        glob_v = max(float(np.mean(rm2)), 1e-10)
        cell_sum = np.zeros(M, dtype=np.float64)
        np.add.at(cell_sum, k_idx, rm2)
        ratio = np.sqrt((cell_sum + tau * glob_v) / ((counts + tau) * glob_v))
        scales[:, j] = np.clip(ratio, 0.35, 2.20).astype(np.float32)
    return scales
Cell-adaptive residual scales: an empirical-Bayes shrinkage of each cell's residual spread toward the global spread. custom_action_tokenizer.py, lines 227–245

The string has a fixed length of codes: nine when there are no residual stages. Every kind of code owns a disjoint range of code values, which we call its cone (the six fine codes share one cone, as do the residual stages of one group), and the decoding mask allows exactly the current position's cone and forces the string to end after the last position. The policy therefore never has to learn the grammar of the string, and a decoded code always lands in the codebook it was trained for.

    def allowed_codes(self, position: int, prefix: np.ndarray) -> np.ndarray:
        mask = np.zeros(self.eff_V + 1, dtype=bool)
        if 0 <= position < self.L_codes:
            c_idx = int(self.pos_cone_map[position])
            lo, hi = int(self.cone_offsets[c_idx]), int(self.cone_offsets[c_idx + 1])
            mask[lo:hi] = True
        else:
            mask[self.eff_V] = True
        return mask
The decoding mask: each position may emit only its own cone, and the string ends after the last position. custom_action_tokenizer.py, lines 1545–1553

Placing the codes in the backbone's vocabulary

The runtime lets a tokenizer choose which backbone tokens stand for its codes. We place them in the rarely used tail of the base vocabulary and choose the tokens deliberately. Because the backbone ties its input and output embeddings, a token's embedding norm biases its logit, so we keep only tokens within a narrow norm shell; we also drop tokens whose logit against the mean final hidden state of the vision-language model differs much from the median (computed at fit time from up to four instructions, taken from the training data when they are given), tokens that are near-duplicates of one another, and tokens whose strings contain letters or digits. The candidates are partitioned among the cones by spherical k-means, after projecting out the direction of that mean hidden state, with each cone taking the candidates that fall most clearly inside it. Within each cone we then match codes to tokens by alternating orthogonal Procrustes and optimal assignment between the centred, normalised codebook centroids and the candidate embeddings :

Codes for similar motions thereby receive tokens with similar embeddings, so the output layer's pretrained geometry starts out roughly consistent with the action geometry instead of arbitrary. Two regimes of candidate filtering are used, a tighter one when the total number of codes is at most 1280 and a wider one otherwise; if the backbone weights cannot be read, the codes fall back to the last tokens of the base vocabulary.

        Bc = B - B.mean(axis=0, keepdims=True)
        b_norms = np.linalg.norm(Bc, axis=1, keepdims=True)
        if float(np.max(b_norms)) <= 1e-6:
            final_pool_indices[off : off + M_s] = p_idx[:M_s]
            off += M_s
            continue
        Bn = Bc / np.maximum(b_norms, 1e-6)

        Wp = W_u[p_idx]
        Wp_c = Wp - Wp.mean(axis=0, keepdims=True)
        Wp_n = Wp_c / np.maximum(np.linalg.norm(Wp_c, axis=1, keepdims=True), 1e-8)

        _, _, Vt_b = np.linalg.svd(Bn, full_matrices=False)
        if len(Wp_n) <= Wp_n.shape[1]:
            evals_w, evecs_w = np.linalg.eigh(Wp_n @ Wp_n.T)
            r_eff = min(Vt_b.shape[0], len(Wp_n))
            top_e = evecs_w[:, -r_eff:][:, ::-1]
            denom = np.maximum(np.sqrt(np.maximum(evals_w[-r_eff:][::-1], 1e-8))[:, None], 1e-6)
            Vt_w = (top_e.T @ Wp_n) / denom
        else:
            _, _, Vt_w = np.linalg.svd(Wp_n, full_matrices=False)
            r_eff = min(Vt_b.shape[0], Vt_w.shape[0])
        Q_s = Vt_b[:r_eff].T @ Vt_w[:r_eff]

        chosen_local = np.arange(M_s)
        for _ in range(n_iters):
            sims = (Bn @ Q_s) @ Wp_n.T
            _, chosen_local = linear_sum_assignment(-sims)
            M_cross = Bn.T @ Wp_n[chosen_local]
            U_p, _, Vt_p = np.linalg.svd(M_cross, full_matrices=False)
            Q_s = U_p @ Vt_p

        final_pool_indices[off : off + M_s] = p_idx[chosen_local]
        off += M_s
Within-cone alignment: alternate optimal assignment and orthogonal Procrustes between codebook centroids and token embeddings. custom_action_tokenizer.py, lines 784–817

The same algorithm runs everywhere. Apart from guards on the amount of training data and on whether the backbone's weights can be read, its branches are on the chunk geometry the runtime reports (, , the token budget and the vocabulary size), which decides, for example, whether residual stages are used, how many, the basis rank and the gripper codebook's span.

Results

Method①②③
Success rate ↑Success rate ↑Success rate ↑
Gemini 4 Carbon0.9170.9060.428
Per-dimension uniform binning0.5700.2280.217
VQ-BeT0.9060.7330.378
FAST0.8890.8500.411
FAST+0.8800.8330.372
BEAST0.6330.7720.289
OAT, original configuration0.8360.8060.394
ActionCodec0.7970.5890.356
OAT0.8530.8610.367
FASTerVQ0.8190.8500.383
VQ-VLA0.8420.8110.283
  1. ① MiniVLA (Qwen2.5-0.5B Prismatic) on LIBERO-90 · chunk horizon 8, all 8 executed
  2. ② Same policy recipe · chunk horizon 32, first 16 executed
  3. ③ Horizon-8 policy under LIBERO-plus mixed perturbations

CM-KLT has the highest success rate of every method in the table on all three settings. On Same policy recipe the margin is clear: 0.906 against 0.861 for the strongest baseline, OAT [8], and against 0.850 for FAST. On MiniVLA (Qwen2.5-0.5B Prismatic) on LIBERO-90 we reach 0.917 against 0.906 for Residual VQ [4], and on Horizon-8 policy under LIBERO-plus mixed perturbations 0.428 against 0.411 for FAST [2]. Those two margins are small, and with only the per-setting means available we cannot say whether they exceed the run-to-run variation.

Against the starting point, uniform per-dimension binning, the gains are large on every setting: 0.570, 0.228 and 0.217 for binning. The ranking among the baselines changes from setting to setting (residual VQ is strongest on MiniVLA (Qwen2.5-0.5B Prismatic) on LIBERO-90, ordered action tokens on Same policy recipe, FAST on Horizon-8 policy under LIBERO-plus mixed perturbations); CM-KLT is the only method in the table that leads on all three. Horizon-8 policy under LIBERO-plus mixed perturbations remains hard for every method, ours included.

How we got here

The final tokenizer is the sixteenth version in a series of closed-loop experiments, each training the VLA on a candidate tokenizer in our own development configurations. The figures below are our development measurements as recorded in the trace; they come from our own development runs and are not comparable with the published table.

  • A short, ordered string beat parallel decoding and longer factorised strings. Our first wave compared four metric-weighted designs. A nine-code string with coupled translation and rotation codes reached 0.56, against 0.50 for a fourteen-code string decoded in blocks, 0.30 for a joint design decoded in variable blocks and 0.26 for a thirteen-code per-axis sequence; FAST reached 0.58 in the same configuration. A later attempt at block-parallel decoding of the fine codes reached 0.28. From then on every version kept a compact, strictly causal string.
  • A learned denoiser after the decoder biased the pose. We tried a small network trained to clean up decoded chunks when some of their codes are corrupted. Offline it shrank the predicted deltas toward zero, as a minimum-error estimator under noisy inputs does, and the pose drift at the end of execution rose from 0.0085 to 0.0162. We replaced it with conditional-mean prototypes, , which have no shrinkage bias; these are the decoder centroids of the final method.
  • Where the codes sit in the vocabulary mattered as much as the codebooks. With the codes already in the rare tail of the vocabulary, adding the Procrustes alignment took one development configuration from 0.60 (rare tail, no alignment) to 0.68, our first result above FAST there. Later we found that because the input and output embeddings are tied, the spread of embedding norms within a cone biases which code wins: a candidate whose code tokens spanned a 1.447x range of norms failed on a task that a variant with a 1.153x range mostly solved, which is why the final selection keeps a narrow norm shell. A forensic comparison also showed that one variant had drawn many of its tokens from actively used mid-vocabulary words rather than the rare tail, and lost accordingly.
  • Sharing the residual codebook across stages helped; adding codes did not. Residual stages sharing one codebook reached 0.58 against 0.36 for stage-specific codebooks (a comparison in which the stage-specific variant also had one residual stage fewer), which we attribute to each shared code receiving several times more training signal. Conversely, a second fine stage that cut the offline end-point error by about 38% on long executions lowered closed-loop success from 0.52 to 0.22, and two residual stages with a midpoint anchor scored 0.56 against 0.72 for one residual stage in another configuration. We read both as the same lesson: a code the policy cannot predict costs more than the distortion it removes. For the residual-stage schedule in the final code is the compact one.
  • Better offline alignment did not translate. A Gromov-Wasserstein alignment of codes to tokens raised the correlation between action distances and embedding distances in our offline probe from 0.258 to 0.695, but the closed-loop runs built on it were worse, and we dropped it. A semi-discrete optimal-transport partition of the candidate tokens among the cones reduced boundary violations sharply and matched our best single-configuration result, 0.76, but averaged 0.587 across three development configurations against 0.653 for the version we kept.
  • Offline, an intermediate version did what the metric was designed for. In a late offline audit of an intermediate version, not the submitted one, the end-point error of the executed pose was 2.5 to 2.8 times lower than FAST's at every horizon we checked, with several times fewer tokens per chunk for long chunks.
  • The last steps were hardening, not new ideas. The submitted file adds guards for degenerate inputs (few chunks, very wide vocabularies, a horizon of one); it was checked to give output bit-identical to the selected version and to run on 145 degenerate configurations; k-means accumulation was moved to double precision on the CPU after we found that floating-point atomics on the GPU made the fitted tokenizer non-deterministic.

Limitations

  • Two of the three margins are small. On MiniVLA (Qwen2.5-0.5B Prismatic) on LIBERO-90 and Horizon-8 policy under LIBERO-plus mixed perturbations we lead the strongest baseline by a small amount and have no measure of variance; only the Same policy recipe margin is clearly larger than such differences are likely to be.
  • It did not win everywhere in development. On one additional task suite that we used as a held-out check, our tokenizer reached 0.58 against 0.90 for FAST, and a single change in token placement moved one development configuration by eight points. The method's advantage depends on the token placement, which is its least principled part.
  • The token selection is tuned to one backbone. The norm shells, logit windows, distinctness thresholds and the size of the base vocabulary are hand-set constants for this backbone, and the selection reads the backbone's weights and runs the vision-language model at fit time. Moving to another backbone would require re-deriving them, and if the weights cannot be read the method silently falls back to unaligned tail tokens.
  • Many constants, few ablations. The metric weights, basis ranks, codebook sizes, shrinkage strengths and stage schedules were set by development runs, most of them compared on one or two configurations. We have no ablation of the control metric itself against a plain squared error in closed loop, so we cannot say how much of the result is due to it rather than to the code structure and token placement.
  • Each design choice was selected on closed-loop success at small scale. Several of our development comparisons separated versions by a few points on a single configuration, and the causal stories we attach to them (code learnability, norm bias) are plausible readings, not established mechanisms.

References

  1. Moo Jin Kim, Karl Pertsch, Siddharth Karamcheti et al. (2024). OpenVLA: An Open-Source Vision-Language-Action Model. CoRL.
  2. Karl Pertsch, Kyle Stachowicz, Brian Ichter et al. (2025). FAST: Efficient Action Tokenization for Vision-Language-Action Models.
  3. Hongyi Zhou, Weiran Liao, Xi Huang et al. (2025). BEAST: Efficient Tokenization of B-Splines Encoded Action Sequences for Imitation Learning. NeurIPS.
  4. Seungjae Lee, Yibin Wang, Haritheja Etukuru et al. (2024). Behavior Generation with Latent Actions. ICML.
  5. Yating Wang, Haoyi Zhu, Mingyu Liu et al. (2025). VQ-VLA: Improving Vision-Language-Action Models via Scaling Vector-Quantized Action Tokenizers. ICCV.
  6. Yicheng Liu, Shiduo Zhang, Zibin Dong et al. (2025). FASTer: Toward Efficient Autoregressive Vision Language Action Modeling via Neural Action Tokenization.
  7. Chaoqi Liu, Xiaoshen Han, Jiawei Gao et al. (2026). OAT: Ordered Action Tokenization.
  8. Chaoqi Liu, Yue Zhao, Haonan Chen et al. (2026). Ordered Action Tokens for Visuomotor Policy Learning.
  9. Zibin Dong, Yicheng Liu, Shiduo Zhang et al. (2026). ActionCodec: What Makes for Good Action Tokenizers. CoRL.

The session

The run from the model's first output, drawn as Antigravity shows a conversation: 1,315 steps.

Open the session

The submitted code

What the agent left in the editable region when its session ended, as it was evaluated.

minivla/taskkit/custom_action_tokenizer.pythe changes against the starter, inside the editable region