Masked Generative Pretraining Improves Cross-Dataset Transfer in Pixel-Space Diffusion

Shu Wei, Jiachen Lei, Jiahong Wu, Xiangxiang ChuNeurIPS 2026

TL;DR

To train image generators faster, researchers often pretrain encoders using contrastive learning—a technique that teaches models to ignore variations like color shifts or crops. While great for recognizing objects, throwing away these fine-grained visual details hurts generating new images, especially when adapting a model to unfamiliar datasets. This paper introduces MPG, an augmentation-free pretraining method that uses masked image reconstruction across noise levels to build a versatile pixel-space diffusion encoder that transfers cleanly to new visual worlds.

What Problem Does This Paper Address?

For a while, latent-space diffusion models (like Stable Diffusion) stole the spotlight because compressing images into a smaller "latent" space makes training affordable. Recently, pixel-space diffusion—generating raw RGB pixels directly—has made a comeback, avoiding the subtle visual artifacts caused by image compressors. However, training directly on pixels is computationally expensive.

A promising shortcut is a two-stage "pretrain-then-finetune" recipe called Representation Consistency Training (exemplified by a recent baseline called EPG). Instead of relying on an external vision model, you pretrain the diffusion encoder itself to understand visual concepts across different levels of static (noise), and then reuse that smart encoder for various generative tasks.

Here is the catch: existing pretraining relies on contrastive learning with hand-crafted augmentations (like color jittering, blurring, or random cropping). This forces the encoder to become invariant to those changes—teaching it that a bright pink flower and a washed-out grey flower are the exact same thing. For classification, that is a feature. For generation, it is a bug. To paint a convincing picture on a brand-new dataset, a model needs exact textures, colors, and spatial layouts, not just abstract concepts.

Methods

The authors propose Masked Pixel-space Generative Pretraining (MPG), keeping the standard two-stage pipeline (ViT-Base encoder + EDM diffusion framework) while overhauling Stage I to be completely augmentation-free.

Figure 2: Method overview. (a) During pretraining, we learn semantic representations by recon- structing masked regions of the clean image with a masked-reconstruction loss Lrec, and further align the reconstructed outputs along the same ODE sampling trajectories with a masked-consistency loss Ltraj. sg denotes the stop-gradient operation. (b) During generative fine-tuning, we discard the pretrained decoder and introduce a randomly initialized decoder that is depth-symmetric to the encoder but wider (i.e., with a larger latent dimension). We train the model end-to-end for diffusion generation.
  • Stage I: Self-Supervised Pretraining. Using an asymmetric architecture (a standard encoder paired with a lightweight, throwaway decoder), the authors hide 75% of an image's patches. They then apply two novel, complementary objectives:
  • Masked Clean Reconstruction ($\mathcal{L}_{\text{rec}}$): Given visible patches at minimal noise, the model must reconstruct the missing clean pixel regions, forcing the encoder to learn rich, fine-grained spatial and color cues.
  • Masked Trajectory Consistency ($\mathcal{L}_{\text{traj}}$): Taking the exact same image and Gaussian noise pattern at two adjacent noise levels, the model must make consistent clean-image predictions for the masked regions (using a stop-gradient on the cleaner step). This adapts the encoder to diffusion trajectories without external teachers.
  • Stage II: Generative Fine-tuning. The lightweight decoder is discarded and replaced with a wider, high-capacity generative decoder. Masking is turned off, and the full network is fine-tuned end-to-end for standard pixel-space denoising.
  • New Diagnostic Metric: The authors also introduce NC-CKNNA (Noise-Consistency Centered Kernel Nearest-Neighbor Alignment) to measure how well local feature geometry holds steady across adjacent noise levels during pretraining.

Datasets

No new benchmarks are introduced; instead, the authors use established datasets to stress-test cross-domain transfer:

  • Source Pretraining (and Source Generation): ImageNet-256 ($256 \times 256$ resolution).
  • Downstream Transfer Targets (7 diverse datasets): CelebA-HQ (faces), CIFAR-10 (low-res natural images), Flowers-102 (fine-grained categories), LSUN-Bedroom, LSUN-Church, Places (indoor/outdoor scenes), and ADE20K (complex layouts).

Key Insights and Ideas

  • Invariance is a liability for generative transfer: Using patch-level geometric analysis (CKNNA), the authors prove that MPG retains much higher sensitivity to color, texture, and spatial shifts than contrastive baselines. Because it doesn't bake in artificial blind spots during pretraining, it adapts far more gracefully when the target dataset looks nothing like ImageNet.
  • Better priors mean less "forgetting": When fine-tuning on the seven downstream datasets, MPG exhibits significantly lower representation drift than the contrastive baseline. Its pretrained local feature geometry is already well-suited for generation, so Stage II doesn't have to tear down and rebuild what Stage I learned.
  • Semantics alone don't predict diffusion readiness: Standard linear probing (measuring class separability) only moderately explains downstream generation quality ($R^2 = 0.633$). Combining it with the authors' noise-consistency metric (NC-CKNNA) jumps the descriptive fit to $R^2 = 0.906$, showing that both semantic understanding and stability across noise levels matter.

Key Results

When transferring an ImageNet-pretrained encoder to seven downstream datasets under identical fine-tuning protocols (evaluated without classifier-free guidance for a strict representation comparison), MPG outperforms the contrastive EPG baseline across the board:

Figure 1: MPG enables robust cross-dataset transfer for pixel-space diffusion. (a) Representative qualitative comparisons between EPG and MPG across diverse target domains. Note: Images are scaled down for layout purposes. (b) FID comparison on all seven target datasets.
  • 15.1% average relative FID improvement across all seven target datasets (dropping average FID from 46.41 to 39.40; lower is better).
  • Standout scene and fine-grained gains: Relative FID improves by 26.0% on Places (23.42 $\rightarrow$ 17.34), 24.9% on LSUN-Church (34.97 $\rightarrow$ 26.26), and 13.5% on Flowers-102 (103.71 $\rightarrow$ 89.70). Qualitatively, MPG produces noticeably sharper architectural geometry and truer colors.
  • Competitive source-domain generation: On ImageNet-256 (with Interval-CFG), MPG achieves a strong 2.21 FID, edging out latent-space MaskDiT (2.28) and pixel-space PixNerd (2.29).
  • Healthy scaling: Controlled experiments show downstream FID steadily improves as pretraining data scales from 10% to 100% of ImageNet and as encoder depth increases from 8 to 16 blocks.

Limitations and Future Work

  • The Source- vs. Target-Domain Trade-off: While MPG wins decisively on cross-dataset transfer, its 2.21 FID on ImageNet-256 trails heavily optimized source-domain specialists like JiT-H (1.86) and EPG-XXL (1.87).
  • Future Directions: The authors suggest pairing MPG's masked pretraining recipe with specialized, modern pixel-space architectures like JiT or PixelDiT to close that source-domain gap. They also note that scaling laws remain to be verified beyond ImageNet-scale data and model sizes.

Summary updated

Abstract

Pixel-space diffusion models have recently seen a revival in image generation, yet their training remains less efficient than that of their latent-space counterparts. Existing methods reduce this cost by equipping diffusion models with external representations from clean images. In contrast, representation consistency training, a new generative pretraining paradigm, stands out as it eliminates the need for any off-the-shelf semantic encoders. It proposes pretraining the diffusion model to simultaneously capture meaningful visual semantics from clean images while aligning them with data points across various noise levels. Nevertheless, its training depends on contrastive learning with hand-crafted augmentations. These augmentations impose predefined invariances during pretraining, potentially limiting model performance when transferred to downstream target distributions that substantially deviate from the pretraining manifold. To address this, we propose Masked Pixel-space Generative Pretraining (MPG), an augmentation-free framework based on masked image modeling. MPG trains the encoder to recover masked image regions and aligns the resulting predictions across different noise levels. Under the same architectures and fine-tuning settings, MPG produces better generation performance across seven downstream datasets, while retaining competitive generation quality on ImageNet-256. Further analyses show that MPG exhibits weaker invariance to hand-crafted augmentations and better preserves its pretrained representation geometry during downstream fine-tuning. These results suggest masked generative pretraining as a practical alternative for training pixel diffusion models.
BibTeX
@inproceedings{wei2026masked,
  author = {Shu Wei and Jiachen Lei and Jiahong Wu and Xiangxiang Chu},
  title = {{Masked Generative Pretraining Improves Cross-Dataset Transfer in Pixel-Space Diffusion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=VGs5oln6Kl},
}
Figure