ImageGen-CoT: Enhancing Text-to-Image In-context Learning with Chain-of-Thought Reasoning

Jiaqi Liao, Zhengyuan Yang, Linjie Li, Dianqi Li, Kevin Lin, Yu Cheng, Lijuan Wang

Abstract

In this work, we study the problem of Text-to-Image In-Context Learning (T2I-ICL). While Unified Multimodal LLMs (MLLMs) have advanced rapidly in recent years, they struggle with contextual reasoning in T2I-ICL scenarios. To address this limitation, we propose a novel framework that incorporates a thought process called ImageGen-CoT prior to image generation. To avoid generating unstructured ineffective reasoning steps, we develop an automatic pipeline to curate a high-quality ImageGen-CoT dataset. We then fine-tune MLLMs using this dataset to enhance their contextual reasoning capabilities. To further enhance performance, we explore test-time scale-up strategies and propose a novel hybrid scaling approach. This approach first generates multiple ImageGen-CoT chains and then produces multiple images for each chain via sampling. Extensive experiments demonstrate the effectiveness of our proposed method. Notably, fine-tuning with the ImageGen-CoT dataset leads to a substantial 80% performance gain for SEED-X on T2I-ICL tasks.

Introduction

Text-to-Image In-Context Learning (T2I-ICL) requires models to infer complex patterns from interleaved text and image examples. However, current Multimodal Large Language Models (MLLMs) often suffer from a "reasoning gap," failing to bridge the connection between multimodal context and the final generated output. For example, when presented with a "leather-bound book" and a "leather apple," standard models often ignore the implicit "leather" pattern when asked to generate a "box," resulting in a generic cardboard box. This indicates a struggle to analyze relationships within the context before synthesis.

The ImageGen-CoT Framework

To address this, we introduce the ImageGen-CoT framework, which forces the model to generate a structured textual reasoning path before synthesizing an image.

Comparison of standard SEED-X vs. SEED-X fine-tuned with ImageGen-CoT, illustrating how structured reasoning captures implicit patterns like "leather" or "made of clouds".

Our approach consists of three main pillars:

  1. Structured Reasoning Protocol: Instead of single-pass generation, the model follows a two-stage process: first generating a textual reasoning chain (analyzing the subject and planning details), then using that text as a prompt for the final image.
  2. Automated Dataset Construction: We curated a high-quality ImageGen-CoT dataset using an iterative pipeline where an MLLM acts as a Generator, Selector, Critic, and Refiner. This "self-boosting" loop provides the necessary data to fine-tune models like SEED-X.
  3. Hybrid Test-Time Scaling: We found that scaling "thinking" (multiple reasoning paths) is as effective as scaling "sampling" (multiple image seeds). Our hybrid approach combines both, significantly improving context-aware results.

Key Results and Insights

Experiments on benchmarks like CoBSAT and DreamBench++ demonstrate the power of explicit reasoning. Fine-tuning with the ImageGen-CoT dataset led to an 89% improvement on CoBSAT and a 114% improvement on DreamBench++ for the SEED-X model.

Scaling results on the CoBSAT benchmark, showing performance gains as the number of reasoning and image samples (Pass@N) increases.

Key insights from our evaluation include:

  • Reasoning as a Bridge: Explicit thoughts help align visual concepts. For instance, identifying that a "kitten's fur is transformed into fluffy clouds" ensures the final image captures that specific detail.
  • Scaling Performance: With hybrid scaling at N=16, our method achieved a score of 0.909 on CoBSAT, setting a new state-of-the-art for in-context multimodal reasoning.
  • The Rendering Bottleneck: While reasoning capabilities improved drastically, the actual image generation remains a secondary bottleneck, as models often describe the desired output better than they can render it.

Conclusion

ImageGen-CoT significantly enhances the ability of MLLMs to perform in-context learning by bridging the gap between understanding and generation through structured reasoning. While rendering fidelity remains an area for improvement, the massive performance gains highlight the importance of explicit thought processes in multimodal tasks.

Summary updated

BibTeX
@inproceedings{liao2025imagegen,
  author = {Jiaqi Liao and Zhengyuan Yang and Linjie Li and Dianqi Li and Kevin Lin and Yu Cheng and Lijuan Wang},
  title = {{ImageGen-CoT: Enhancing Text-to-Image In-context Learning with Chain-of-Thought Reasoning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure