Skip to content
中文

MAETok: shape the space before decoding it

An interactive field guide

A tokenizer can be trained for an easier generative space, then receive a better pixel decoder.

Before this article: Semantic representations · TiTok · Diffusion and flow matching

A reconstruction-only bottleneck rewards retained pixel detail. RAE instead inherits a frozen representation. MAETok explores a middle route: learn a continuous tokenizer, but use masking and auxiliary targets to organize its latent space.

A Transformer encoder compresses visible image information into 1D latent tokens. Shallow auxiliary decoders predict targets such as HOG and pretrained DINO/CLIP features. A pixel decoder also reconstructs images. These extra prediction tasks shape the representation beyond direct pixel fitting.

Read from left to right. Select a module to connect its role, tensor shape, and calculation. Snippets are teaching pseudocode. Sources provide the paper method or audited implementation.

Mask and encode

The bottleneck is continuous; it is not a VQ codebook lookup.

visible = select_visible(patches,mask)
z = encoder(visible,latent_slots)

Auxiliary predictions

Shallow heads predict targets with different information emphasis.

loss_aux = target_losses(aux_heads(z),teacher_targets)

Pixel decoder refinement

The decoder can improve while the encoder remains fixed.

z = stop_gradient(encoder(image))
loss_pixels = reconstruction_loss(decoder(z),image)

Inspect the pinned source

L=Lpixels+∑jλjLaux,j\mathcal{L}=\mathcal{L}_{\mathrm{pixels}}+\sum_j\lambda_j\mathcal{L}_{\mathrm{aux},j}

Hide patches in the demo and inspect which target positions remain unknown to the encoder. The target still exists in the training example, so a loss can supervise hidden content. The real model must use context and its learned prior. The demo displays visibility only; it does not simulate feature prediction.

The paper uses 40–60% masking. Importing the original MAE default of 75% would change this method. A sequence of 128 continuous vectors also carries a different payload from 128 discrete code IDs; count feature width and precision before calling it the same compression.

Change a parameter, inspect the computed values, then compare this small example with the model described above.

Analytical teaching model · controls change the example, not a trained research model.

0123456789101112131415

Grey positions have no target values in the input. The model must predict them.

Computed values for the current example
QuantityValue
Observed patches8
Masked queries8
Inspected query is hiddenyes

After representation learning, freeze the encoder and fine-tune the pixel decoder to improve reconstruction. Then train a separate diffusion model on the learned latents. This order lets representation structure remain stable while pixel recovery improves. Teacher pretraining is part of the dependency cost.

The paper motivates easier diffusion with a mixture-model analysis. This is not a theorem that increasing class separability always improves generation for any real dataset. Our reading is paper-based; no fixed official code revision was audited for this article.

Why freeze the encoder before decoder fine-tuning?

It preserves the latent space learned by the earlier objectives while changing how that space is converted back to pixels.

Return to the learning map

Diagrams and snippets are teaching reconstructions. Paper reports, implementation observations, and analytical examples are distinguished. No research model runs in this page.