TL;DR
While modern in-context image generation models excel when given one or two reference images, their performance drops sharply when scaled to multiple references. This paper introduces MacroData, a massive 400K dataset containing up to 10 reference images per sample, and MacroBench, a comprehensive benchmark to evaluate long-context multi-reference generation. Fine-tuning open-source models on MacroData dramatically improves their ability to handle complex, multi-image reasoning tasks, significantly narrowing the gap with proprietary state-of-the-art models.
What Problem Does This Paper Address?
In-context image generation allows models to synthesize new images based on interleaved text and visual references (e.g., preserving a character's identity or applying a specific style). However, current open-source models face a severe "data bottleneck": they are trained almost exclusively on single- or few-reference pairs. Consequently, when tasked with complex real-world scenarios—such as multi-subject composition, narrative illustration, or 3D novel view synthesis—their performance degrades catastrophically beyond three to five input images.
The authors address this limitation by providing the structured, long-context training data and evaluation protocols necessary for models to learn dense inter-reference dependencies across multiple images.
Methods
To build MacroData, the authors designed a robust curation pipeline that distills knowledge from advanced closed-source models and filters real-world corpora to ensure logical consistency and visual fidelity.
Beyond data generation, the paper explores architectural and optimization techniques to handle the computational overhead of long-context image generation:
- Token Selection Strategies: Adding more images linearly expands the token sequence. The authors evaluated three filtering strategies to retain only key tokens during attention calculation: Block-wise, Image-wise, and Text-aligned selection.
- LLM-as-Judge Evaluation: Traditional metrics fail to capture complex multi-image consistency. The authors established an automated evaluation protocol using Gemini-3-Flash, employing task-specific multi-metric rubrics (scoring 1–10) to rigorously assess context sensitivity and narrative adherence.
Datasets
The paper introduces two core contributions to the community:
- MacroData: A dataset of 400K high-quality samples supporting up to 10 reference images per sample (averaging 5.44 images). It is equally divided into four distinct sub-tasks (100K samples each):
- Customization: Composing multiple subjects (humans, objects, scenes, clothes, styles) into coherent new scenes.
- Illustration: Generating context-aware images that complement complex textual narratives.
- Spatial Reasoning: Synthesizing novel viewpoints from multiple input views (including outside-in objects and inside-out panoramas).
- Temporal Dynamics: Forecasting future keyframes from historical video sequences.
- MacroBench: A standardized benchmark consisting of 4,000 held-out samples (1,000 per task) graded by input scale (1–3, 4–5, 6–7, and 8–10 images) to systematically analyze how models scale with context length.
Key Insights and Ideas
- Cross-Task Synergy: Jointly training a model on all four distinct sub-tasks yields better overall performance than training on any single subset exclusively. This demonstrates that spatial, temporal, and customization tasks share underlying multi-image reasoning representations.
- Text-Aligned Selection Excels: When pruning tokens to save compute, Text-aligned selection (which filters tokens based on text-image and image-image attention scores) significantly outperforms simple image-wise selection. Image-wise selection suffers from severe information loss because it disrupts crucial cross-reference interactions.
- Progressive Task Data Ratios: For "progressive" tasks where difficulty scales with the number of inputs (like Customization), upweighting the proportion of large-input samples during training (using a 2:2:3:3 ratio for higher image counts) substantially boosts long-context performance without harming low-context capabilities.
- Common Workarounds Fail: Popular inference-time strategies like "think-before-generation" (generating reasoning text before the image) or "collaging" (stitching multiple references into a single grid) actually underperform compared to direct multi-reference processing. Collaging suffers from severe resolution loss, while text-based reasoning struggles to synthesize multi-image information without explicit training.
Key Results
The authors fine-tuned several open-source baselines (including Bagel, OmniGen2, and Qwen-Image-Edit) on MacroData, leading to substantial improvements across the board:
- Overall Performance: The fine-tuned Bagel + Ours model achieved an average score of 5.71 on MacroBench, a massive leap from the base model's 3.03, ranking third overall behind only top-tier closed-source models.
- Closing the Gap: In Customization and Spatial tasks, the fine-tuned open-source models approached or even surpassed proprietary models like Nano Banana Pro.
- Robust Scaling: While base models showed catastrophic performance drops when moving from 1–5 images to 6–10 images, models trained on MacroData exhibited strong robustness, maintaining stable gains even at maximum context lengths.
Limitations and Future Work
Despite the advancements, the authors note that performance still experiences a slight downward trend as the number of input images scales up to 10. Additionally, MacroBench relies on predefined task structures, meaning future work is required to evaluate general multi-reference generation "in the wild."
The authors point to the design of specialized token representations and native attention mechanisms optimized specifically for multi-image in-context generation as the most promising direction to maximize computational efficiency and generation quality.
Summary updated