Visual tokenization for diffusion transformers
ScaleTokHow Should Latent Token Budgets
Scale for Diffusion Transformers?
1 Google2 Virginia Tech
Half the visual tokens. Comparable generation quality.
Let token budgets grow with the square root of image area.
visual tokens
lower estimated DiT-XL FLOPs
generation FID · lower is better
Square-root vs. linear allocation at 512 × 512, with the Base tokenizer and 256 text-token positions. FLOPs are estimated per denoising step.
Watch the idea
From image geometry to token budgets.
Follow the image from CAPE coordinates to visual latents, then compare how the token budget scales.
ScaleTok studies how the visual budget should grow with image area, using a shared framework to compare three allocation rules.
Use the player to pause, scrub, or watch in full screen. A text explanation is available below.
Read the animation
The question. Doubling both image dimensions gives four times the image area. Does the visual token budget need to grow at the same rate?
CAPE: shared coordinates. Crop shared positional coordinates to the image aspect ratio, then interpolate them to the target patch grid. This supports the evaluated square, wide, and tall geometries.
Where the budget enters. Image area and an allocation rule set K learned latent tokens before encoding. The class name provides fixed conditioning to the encoder and decoder. The encoder produces K visual latents for reconstruction and for training the DiT. At generation time, DiT denoises noise into sampled visual latents, which pass through the tokenizer decoder to produce an image.
Three allocation rules. All rules start with 256 tokens at 256 × 256. At 512 × 512, fixed uses 256, square-root uses 512, and linear uses 1024. Each configuration has its own tokenizer trained jointly across the four evaluated geometries.
Same class name, extra positions. Increasing padding in the class-name sequence from 128 to 256 total positions keeps the class name and visual budget fixed. For Base at 512 × 512, reconstruction FID changes from 0.8012 to 0.7595 under fixed allocation, 0.6244 to 0.5123 under square-root allocation, and 0.4243 to 0.4963 under linear allocation. Lower is better: the benefit depends on visual capacity. These conditioning positions stay inside the tokenizer and do not enter DiT.
The trade-off. With Base and 256 text positions at 512 × 512, square-root allocation uses 512 versus 1024 visual tokens and 53.2% fewer estimated DiT-XL FLOPs per denoising step than linear allocation. Generation FID is 1.733 versus 1.843.
Overview
A smaller visual budget can go a long way.
Training generative vision models natively across multiple resolutions and aspect ratios is costly with standard patch-based tokenizers. The visual token count grows linearly with image area, while the cost of computing self-attention scores in a diffusion transformer grows quadratically with token count.
We introduce ScaleTok, a continuous visual tokenizer that decouples latent sequence length from the patch grid. Its Continuous Aspect-Aware Positional Embeddings (CAPE) crop a shared coordinate grid to each aspect ratio before interpolation, enabling us to compare fixed, square-root, and linear allocation while training a single tokenizer per configuration jointly across four ImageNet-1K geometries.
To distinguish the capacity available inside the tokenizer from the visual budget passed to the generator, we vary the number of padded text positions while holding the class name and visual budget fixed. With a ViT-B/16 backbone, these additional positions improve reconstruction FID under fixed and square-root allocation at larger image sizes but worsen it under linear allocation, suggesting a register-like role when the visual budget is constrained.
At 512 × 512 with 256 text-token positions, square-root allocation approaches linear reconstruction fidelity with half as many visual tokens and yields comparable generation FID at roughly half the estimated DiT-XL cost per denoising step.
Explore the scaling rules
More pixels. How many more tokens?
Change the image geometry to compare token budgets and measured reconstruction quality. Each dot below represents one visual token. Resolutions are height × width.
Image geometry
1× image area
Fixed
K = 256
256 tokens
Square-root
K = round(256 √a)
256 tokens
Linear
K = 256a
256 tokens
At the base resolution, all three rules use 256 visual tokens.
a is image area relative to 256 × 256. Dot placement illustrates token counts, not spatial patch locations. Selecting a resolution pauses the animation.
Reconstruction quality
All four resolutions · ImageNet-1K · 256 text-token positions
What is Micro? A smaller tokenizer backbone with a hidden width of 192, compared with 768 for Base. Both use 12-layer encoders and decoders. Switching to Micro changes model capacity while keeping the image resolutions, visual token budgets, and 256 text-token positions the same.
Measured results from the paper’s square and rectangular reconstruction tables. FID and IS here are reconstruction metrics (rFID and rIS). Each metric keeps the same zero-based scale across resolutions and backbones; bold values mark the best allocation at each resolution.
Look closer
The same image. Three token budgets.
Compare the input with fixed, square-root, and linear reconstructions at 512 × 512. The default views use the exact detail crops from Figure 1.
Sample 1 uses the bird-head crop at 5×; sample 2 uses the tail crop at 4×. Drag a panel to explore another region, or use arrow keys when focused. Home restores the figure crop. Click any panel to enlarge its current image.
Text-register capacity
More workspace. The same class name.
Increase padded text capacity from 128 to 256 positions while keeping the class name and visual token budget fixed. These extra positions stay inside the tokenizer; they do not lengthen the visual sequence passed to DiT.
Base tokenizer · reconstruction FID ↓
The results are consistent with a register-like role for padded text positions. The benefit depends on allocation and geometry; the bars show the measured values rather than assuming that more positions always help. Micro was evaluated only at T = 256, so this capacity comparison uses Base.
Method
One tokenizer. Multiple image geometries.
ScaleTok separates the image patch grid from the latent sequence. An allocation rule sets the visual budget; CAPE lets the same model handle different resolutions and aspect ratios.
Choose the allocation rule
Fixed, square-root, and linear rules vary how quickly the latent budget grows with image area.
Preserve aspect-ratio structure
CAPE crops a shared coordinate grid before interpolation, avoiding unequal stretching along the image axes.
Study text-token capacity
Extra padded text positions can help reconstruction without entering the downstream DiT sequence.
Results
Reconstruction fidelity meets generation efficiency.
Square-root allocation gives a strong trade-off between image quality and downstream compute. Each configuration uses a single tokenizer trained jointly across four geometries.
| Allocation | Visual tokens | rFID ↓ | gFID ↓ | DiT-XL GFLOPs ↓ |
|---|---|---|---|---|
| Square-root | 512 | 0.5123 | 1.733 | 490.4 |
| Linear | 1024 | 0.4963 | 1.843 | 1048.5 |
Generation uses DiT-XL. FLOPs are theoretical estimates per denoising step, not measured wall-clock speedups.
Qualitative results
Citation
BibTeX
@misc{dalva2026scaletok,
title = {ScaleTok: How Should Latent Token Budgets Scale
for Diffusion Transformers?},
author = {Yusuf Dalva and Arpit Bansal and Ashwini Pokle
and Peyman Milanfar and Mauricio Delbracio},
year = {2026},
note = {Manuscript}
}