Aleksandr Kovalev

Image tokenization: from convolutions to transformers

TiTok, FlexTok and FlowMO turn an image into a short sequence of tokens.

For years, people used different kinds of autoencoders to compress images. To get a discrete representation (a set of specific "symbols" instead of continuous values), they used VQ-VAE: a regular autoencoder with a vector-quantized layer in the middle.

In mid-2024 transformers reached this area too.

The main idea:

  1. Replace convolutions with transformers.
  2. Drop the 2D grid and represent an image as a plain sequence of tokens, with no explicit spatial position for each token.

TiTok: An Image is Worth 32 Tokens

Paper: arxiv.org/abs/2406.07550

The main point: 32, 64 or 128 tokens are enough to represent a whole image.

How it works:

This architecture is similar to MAE (Masked Autoencoder), but the focus is on a compact representation.

For generation they use MaskGIT, and the images are quite good. No diffusion: everything is fast and simple.

Linear probing accuracy drops as the number of tokens goes up, so there is a trade-off between compression and feature quality.

TiTok: reconstruction and generation, the tokenizer, and results for different numbers of tokens

FlexTok: flexible token length

Paper: arxiv.org/abs/2502.13967

FlexTok takes the TiTok idea, but starts from VAE latents instead of the original image:

FlexTok: images from 1 to 256 tokens, and the training scheme

FlowMO: the direct approach

Paper: arxiv.org/abs/2503.11056

FlowMO is TiTok with a diffusion decoder:

FlowMO: reconstructions and the architecture

Comparison

Model Works with Diffusion decoder Distillation Quantization
TiTok Raw images No Via MagViT VQ-VAE Standard VQ
FlexTok VAE latents Yes No FSQ, 64k vectors
FlowMO Raw images Yes No LFQ (sign) with complex losses

My thoughts on where this can go

Combine MAE with TiTok:

Combine FlexTok, TiTok and MAE into one universal feature extractor: