Background

autoregressive Transformer

  • autoregressive Transformer: Utilizes the decoder part of the Transformer architecture. It predicts one next token at a time, sequentially, looking only at the previous inputs.
  • Uses a causal mask to prevent seeing future tokens.
  • Since generation tasks must not know the future structure, this architecture is adopted.
  • Structure
    • Input embedding: Converts tokens into vectors
    • Positional encoding: Adds token order information
    • Masked Self-Attention: Computes correlations only among previous tokens
    • Feed-forward Layer: Extracts context-based representations
    • Softmax output: Predicts the probability distribution of the next token

Inverse Dynamic Model

  • A model that predicts the action between two consecutive frames by looking at them

Method

Figure

Tokenizers

The architecture is actually simple. The visual sequence is split spatially without considering temporal consistency, fed into the Visual Tokenizer (which uses VQ-VAE) to be discretely tokenized, and likewise the action is fed into the Action Tokenizer to be tokenized. Here, the Action Tokenizer is handled by rule-based mapping without any NN.

  • Visual Tokenizer

    \[\begin{aligned} x &= (x_1, \cdots, x_n),\\ t &= (t_1, \cdots, t_c, t_{c+1}, \cdots, t_{2c}, t_{2c+1}, \cdots t_N), \end{aligned}\]
    • Uses VQ-VAE to convert each frame image into multiple tokens (= codebook indices).
    • The reason for using VQ-VAE is that, rather than just a latent embedding, it assigns discrete token IDs so that they can be processed by a language model.
  • Action Tokenizer

    • Discrete action: Contradictory actions are grouped into a single class, classified into 7 classes in total, and each class has one token.
    • Continuous action: For camera angles, they are placed into discrete bins and tokenized. One token each for the x and y axes, resulting in two tokens in total.
    • Two special tokens, [aBOS] and [aEOS], denote the start and end of the action sequence.

State and action exist concatenated consecutively, and during training each token is treated equally without distinction, so that the model jointly captures the conditional relationships between state and action.

\[\left(t_{i*c+1}, \cdots, t_{(i+1)*c}, [\texttt{aBOS}], t_1^{a_i}, \cdots, t_9^{a_i}, [\texttt{aEOS}]\right).\]

Transformer Decoder

\[f_\theta(t) = \prod_{i=1}^{N} p(t_i \vert t_{<i}).\]

The decoder just has an ordinary transformer decoder structure. The authors state in the paper that they used the LLaMa architecture w/ root mean square layer norm, Rotary Embeddings. During training, in the typical autoregressive decoder manner, each token is predicted based on all previous tokens.

Figure

Parallel Diagonal Decoding

However, to speed up the decoding process, the authors utilize a diagonal decoding approach. When the image is split into patches, it decodes \(x_{i, j+1}, x_{i+1, j}\) together in parallel. Here, the causal attention mask logic must be aligned with this diagonal decoding algorithm.

Inference

At inference time, inference proceeds by the rule: input sequence → encoder → decoder → predicted token → VQ-VAE Decoder & action decoding.

Discussions

  • p.2) Why use \(x_{< i}, a_i\) instead of \(x_{\leq i}, a_i\) to predict \(x_{i+1}\)?
    • Because the information of \(x_i\) is already implicit in \(a_i\).
  • p.3) Why only spatial compression? Why was a video level tokenizer not used? Is it because it was unnecessary, or was it needed but couldn’t be done? If it couldn’t be done, what were the difficulties, and if it wasn’t needed, why?