Abstract
Tokenizing continuous image data into discrete representations is a prerequisite for leveraging Transformer architectures in generative modeling. While Denoising Diffusion Codebook Models (DDCM) recently proposed using pre-trained diffusion models for this task, they are mathematically constrained to older discrete-time DDPM architectures. We present Generalized Denoising Diffusion Codebook Models (gDDCM), a framework that extends diffusion-based tokenization to modern continuous-time models like Flow Matching and Consistency Models. By introducing a "De-noise and Back-trace" strategy with a tunable backtracking parameter, gDDCM achieves superior reconstruction quality and universal compatibility across diffusion variants.
Introduction
The success of Large Language Models (LLMs) has spurred interest in applying Transformer architectures to image generation. This requires converting continuous pixels into discrete tokens, typically via VQ-VAEs. DDCM offered an alternative by repurposing pre-trained diffusion models, matching codebook noise to the reverse diffusion process. However, DDCM's mathematical reliance on discrete-time DDPM prevents its application to more efficient, modern continuous-time models. gDDCM addresses this by providing a unified framework compatible with Score-based Models, Consistency Models, and Rectified Flow.
The gDDCM Framework
The core of gDDCM is the "De-noise and Back-trace" sampling strategy, which operates on the marginal distributions shared by various diffusion models.
As shown in Figure 1, the process follows two main steps:
- ODE Denoising: A deterministic step removes noise from the current sample $x_t$ to reach $x_{t-\Delta t}$.
- Noise Injection (Back-trace): A specific noise token $\epsilon_k$ is selected from a codebook and injected to move the sample to $x_{t-p\Delta t}$. This token is chosen to align with the residual between the current sample and the target image.
A critical innovation is the backtracking parameter $p$. While $p=0.5$ recovers the original DDCM behavior, setting $p=0$ performs a "fixed-point iteration." This stabilizes the marginal distribution, allowing for repeated optimization of token encoding at a specific noise level without trajectory drift. Furthermore, gDDCM replaces random Gaussian initialization with a codebook-based projection, providing structural priors that reduce initial reconstruction error.
Experimental Results
gDDCM was evaluated on CIFAR10 and LSUN Bedroom datasets across multiple architectures, including EDM, Consistency Models (CM), and Rectified Flow (ReFlow).
Key findings include:
- Universal Compatibility: Unlike DDCM, which fails on CM and ReFlow, gDDCM successfully tokenizes images across all tested continuous-time architectures.
- Superior Performance: On CIFAR10 with the EDM architecture, gDDCM ($p=0$) achieved an FID of 3.2 and LPIPS of 0.060, significantly outperforming the $p=0.5$ baseline (FID 4.5, LPIPS 0.099). Even on the original DDPM architecture, gDDCM improved FID from 7.7 to 5.6.
- Scalability: The model supports 2D tokenization by splitting images into grids, allowing for higher information throughput and better reconstruction without increasing sequential inference steps.
Conclusion
gDDCM generalizes diffusion-based tokenization, making it a viable tool for modern, efficient diffusion architectures. By decoupling the noise injection from the reverse trajectory through the $p=0$ strategy and utilizing codebook-based initialization, gDDCM sets a new standard for reconstruction quality in this domain. Future work will focus on reducing inference latency through distillation and integrating these tokens into large-scale multimodal pipelines.
Summary updated