FocusDiff: Advancing Fine-Grained Text-Image Alignment for Autoregressive Visual Generation through RL

Kaihang Pan, Wendong Bu, Yuruo Wu, Yang Wu, Kai Shen, Yunfei Li, Hang Zhao, Juncheng Li, Siliang Tang, Yueting Zhuang · DOI

Abstract

Autoregressive (AR) text-to-image models have demonstrated impressive generation capabilities but often struggle with fine-grained text-image alignment, particularly when prompts involve specific attributes, counts, or spatial relations. We present FocusDiff, a novel reinforcement learning approach that utilizes differential learning on paired datasets to enhance precise visual control. By training on sets of similar text-image pairs and employing a specialized RL framework (Pair-GRPO), FocusDiff significantly improves generation stability and outperforms existing state-of-the-art models on fine-grained benchmarks.

Introduction

Recent advancements in autoregressive visual generation have brought image quality on par with diffusion-based methods. However, a persistent challenge remains: poor fine-grained alignment. AR models often rely on semantic coherence and training data biases rather than precise token-level control. For instance, a model might consistently generate a "red apple" even when prompted for a "purple apple" due to the prevalence of red apples in the training set.

Examples of fine-grained alignment challenges: spatial relations (cow/laptop) and attribute binding (red/purple apple).

FocusDiff addresses this by forcing the model to learn the specific visual tokens associated with fine-grained textual changes, breaking free from confounder biases through contrastive learning.

Methodology

FocusDiff innovates on the training paradigm and data structure rather than the core architecture.

FocusDiff-Data and Differential Learning

The framework utilizes FocusDiff-Data, a dataset of approximately 200,000 high-quality text-image pairs. Unlike traditional datasets that use isolated pairs, FocusDiff-Data consists of sets of pairs where images share a common base but differ in local semantics (e.g., changing an object's color or position). This enables differential learning, where the model learns exactly which visual tokens correspond to specific textual modifications.

Pair-GRPO and RL Training

We adapt Group Relative Policy Optimization (GRPO) into Pair-GRPO. While standard GRPO calculates rewards based on a group of responses for a single prompt, Pair-GRPO expands this to include responses from pairs of similar prompts. This contrastive setup helps the model distinguish between subtle prompt variations.

To stabilize training, we implement an Exploitation-to-Exploration Shift, where ground-truth images are initially used as guides and gradually phased out. In this setup, ground-truth images serve a dual role: as positive guides for their matching prompts and as negative counterexamples for paired prompts, explicitly teaching the model what to avoid. A Vision-Language Model (InternVL2.5-26B) provides rewards based on fine-grained criteria.

Evaluation and Results

We evaluate FocusDiff using a new benchmark, PairComp, designed to test fine-grained control across six categories: appearance, color, counting, position, style, and text. PairComp utilizes both arithmetic mean (overall accuracy) and geometric mean (stability across pairs). A high geometric mean indicates that the model is not merely "getting lucky" on common prompts but is consistently accurate across variations.

The FocusDiff framework and results: (a) Comparative performance on the PairComp benchmark, (b) examples of fine-grained control, and (c) the Pair-GRPO token alignment mechanism.

FocusDiff, applied to the Janus-Pro-7B model (Janus-FocusDiff-7B), achieved an arithmetic mean of 85.0 and a geometric mean of 83.5 on PairComp. The narrow 1.5-point gap between these metrics—compared to a 5.1-point gap in the base model—demonstrates significantly enhanced stability. Furthermore, Janus-FocusDiff-7B achieved state-of-the-art results on standard benchmarks, including GenEval (0.85), T2I-CompBench, and DPG-Bench (85.23). Qualitatively, the model excels at counterfactual generation, successfully creating out-of-distribution concepts like square watermelons.

Conclusion

FocusDiff represents a significant step forward in fine-grained text-to-image alignment for autoregressive models. By leveraging differential learning and a pair-based RL framework, it effectively breaks training data biases and achieves precise compositional control. Future work will focus on expanding the diversity of FocusDiff-Data to address remaining weaknesses in counting and text rendering.

Summary updated

BibTeX
@misc{pan2025focusdiff,
  author = {Kaihang Pan and Wendong Bu and Yuruo Wu and Yang Wu and Kai Shen and Yunfei Li and Hang Zhao and Juncheng Li and Siliang Tang and Yueting Zhuang},
  title = {{FocusDiff: Advancing Fine-Grained Text-Image Alignment for Autoregressive Visual Generation through RL}},
  year = {2025},
  eprint = {2506.05501},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.05501},
}
Figure