﻿# VQ-BeT actions combine discrete latent codes with continuous offsets

Follow VQ-BeT from hierarchical action codes through the learned decoder and selected offsets, preserving the codebook and distinguishing code accuracy from command error.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-vq-bet-action-codebook-continuous-offset/
Language: en

## A token-only gateway can discard part of the policy

A deployment adapter may expose the discrete predictions of an action model and assume decoding those identifiers completes the command. VQ-BeT's released implementation also predicts continuous offsets. Dropping that branch changes the numerical policy even when the discrete code sequence remains identical.

The [VQ-BeT paper](https://arxiv.org/abs/2403.03181) describes hierarchical vector quantization for behavior generation. That representation choice should not be confused with directly classifying every physical actuator position into a universal language vocabulary.

## Code identity belongs to a learned dictionary

The [project workflow](https://raw.githubusercontent.com/jayLEE0301/vq_bet_official/main/README.md) separates residual vector-quantizer pretraining from behavior-model training. A code index obtains its meaning from the associated learned representation and decoder.

Swapping a similarly shaped dictionary changes that meaning. Preserve the quantizer checkpoint, behavior-model checkpoint, action-window configuration, and observation preparation together. An integer that stays within range can still refer to a different learned action pattern.

## Decoding and offset addition are separate operations

The [policy implementation](https://raw.githubusercontent.com/jayLEE0301/vq_bet_official/main/vq_behavior_transformer/bet.py) selects codes, obtains latent centers, decodes an action, and combines it with selected offsets. The final continuous prediction is not simply the raw code identifier or an unmodified decoded center.

A debugging export should retain intermediate identities and both numerical branches. This makes it possible to distinguish code-selection differences from offset differences instead of explaining every command change as a new behavior mode.

## Window axes do not disappear during tokenization

The policy operates with observation and action windows. A decoded result therefore needs temporal interpretation before it becomes a command at a particular control tick. Flattening the response can lose that distinction while keeping the same total element count.

The [tensor-axis guide](/journal/tensor-axes-batch-sequence-hidden/) helps preserve batch, observation-window, predicted-action-window, and component roles. Keep the environment's action scale and normalization path separate from the latent codebook identity as well.

## Validate a complete action reconstruction

Compare a recorded forward result with a reconstruction using the same selected codes, decoder, and offset values. Then verify the execution slice and postprocessing. A test that checks only code agreement does not cover the entire command path.

The [artifact validation guide](/journal/safetensors-artifact-validation/) motivates treating related learned components as a bundle. A faithful reconstruction establishes computational correspondence; it does not reproduce published task success automatically or demonstrate a new robot-domain capability without evaluation.
