NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Text-Conditioned Sampling Framework for Text-to-Image Generation with Masked Generative Models

Jaewoong Lee, Sangwon Jang, Jaehyeong Jo, Jaehong Yoon, Yunji Kim, Jin-Hwa Kim, Jung-Woo Ha, Sung Ju Hwang

TL;DR

This paper introduces a novel sampling framework, TCTS (Text-Conditioned Token Selection) and FAS (Frequency Adaptive Sampling), for masked generative models that significantly improves text-to-image generation quality and semantic alignment. By intelligently selecting and refining tokens during the generation process, the framework achieves state-of-the-art results with over 50% faster inference times compared to existing methods, without altering the underlying generative model.

What Problem Does This Paper Address?

Text-to-image generation has seen remarkable progress, but current methods, particularly token-based masked generative models, face a trade-off: faster inference through parallel token sampling often leads to suboptimal image quality and poor semantic alignment with the input text. This is because sampling multiple tokens simultaneously without considering their dependencies can result in inconsistencies and errors that propagate through the generation process. Existing approaches struggle to balance the speed of parallel decoding with the need for high-fidelity, text-aligned outputs, especially for complex or nuanced textual prompts.

Methods

The paper proposes two key innovations:

  • Text-Conditioned Token Selection (TCTS): This is a learnable sampling model that operates during the diffusion process. TCTS analyzes the generated tokens and uses text information to identify and mask out tokens that are not well-aligned with the given text prompt. These masked tokens are then re-sampled, allowing for localized correction and improved semantic alignment. This approach is "revocable," meaning it can undo previous sampling decisions, unlike fixed sampling strategies.
  • Frequency Adaptive Sampling (FAS): To address the over-simplification issue that can arise with revocable sampling over longer inference steps (where low-frequency image components like backgrounds can become too uniform), FAS is introduced. It leverages the self-attention maps from the generator to distinguish between high-frequency (detailed) and low-frequency (background) regions. FAS then applies revocable sampling to high-frequency areas to preserve details and persistent sampling (keeping previously sampled tokens) to low-frequency areas to prevent over-simplification.

These methods are designed to work with existing masked generative models without requiring retraining of the core generator.

Datasets

The proposed methods were trained and evaluated on two standard datasets:

  • MS-COCO: A large-scale dataset of images with complex captions, commonly used for text-to-image generation tasks.
  • CUB (Caltech-UCSD Birds-200-2011): A dataset focused on bird imagery, used to evaluate performance on a more constrained domain.

Key Insights and Ideas

  • Revocable sampling is crucial for text alignment: The paper empirically demonstrates that strategies allowing for token revision (revocable sampling) significantly improve text alignment compared to fixed sampling methods.
  • Early-stage sampling is critical: The authors found that sampling decisions made in the early stages of the diffusion process have a disproportionately large impact on the final text alignment of the generated image. This highlights the importance of TCTS's ability to correct errors early on.
  • FAS balances detail and coherence: The FAS strategy effectively tackles the over-simplification problem by intelligently applying different sampling approaches to high- and low-frequency image components, preserving visual detail while maintaining structural coherence.
  • Text-conditioning without explicit text loss: TCTS achieves improved text alignment by leveraging text information during the sampling phase, without needing to train with a specific text-related loss function on the generator.

Key Results

  • Improved Image Quality and Text Alignment: TCTS combined with FAS significantly outperforms baseline sampling methods (Uniform, Random Revoke, Purity) on metrics like MID-L (Mutual Information Divergence - text alignment) and FID (Fréchet Inception Distance - image quality). For example, on the MS-COCO dataset, TCTS+FAS achieved an FID of 14.45 with 16 steps, outperforming other methods.
  • Faster Inference: The proposed framework reduces the original inference time by more than 50% while achieving superior results. Table 6 shows that their model achieves better MID-L and FID scores in 16 steps than baselines in 50 steps, with a time multiplier of ×0.45.
  • Effective Image Refinement: The TCTS method can be used as an image refinement tool, improving samples generated by other methods.
  • Mask-free Object Editing: The framework enables efficient object editing by leveraging cross-attention maps to guide resampling, allowing for targeted changes with fewer steps and reduced background artifacts.

Limitations and Future Work

  • Over-simplification with long inference: While FAS mitigates over-simplification, the paper notes that it can still be an issue with very long inference steps.
  • Computational overhead: TCTS and FAS introduce additional computations per generation step, leading to a marginal increase in inference time compared to simpler sampling strategies, though this is offset by the significant improvement in quality and speed relative to achieving similar quality with other methods.
  • Future Work: The authors suggest that their method can be used for high-resolution image synthesis by combining it with upsampling techniques. They also hint at further analysis on the impact of FAS and persistent sampling in the supplementary materials. The framework's ability to be applied as an image refinement tool and for mask-free editing also opens up avenues for future research in image manipulation.

Summary updated

BibTeX
@inproceedings{lee2023text,
  author = {Jaewoong Lee and Sangwon Jang and Jaehyeong Jo and Jaehong Yoon and Yunji Kim and Jin-Hwa Kim and Jung-Woo Ha and Sung Ju Hwang},
  title = {{Text-Conditioned Sampling Framework for Text-to-Image Generation with Masked Generative Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=UtMqDSRfbQ},
}
Figure