π MENTOR: Efficient Multimodal-Conditioned Tuning for Autoregressive Vision Generation
July 16, 2025 Β· View on GitHub
π Efficient Autoregressive Multimodal Image Generation with 10Γ Less Data
π Paper | π» Code | π€ Models | π€ Stage1 Data| | π€ Stage2 Data|
π― Why MENTOR?
| π₯ 10Γ Less Training Data | β‘ Faster Training | πͺ Better Performance |
|---|---|---|
| 3M vs 16-200M samples | 1.5 days in 8*A100 GPU | 0.47 CPΒ·PF score |
MENTOR demonstrates competitive multimodal image generation capabilities, achieving superior results with dramatically reduced resources thanks to an efficient tuning paradigm. While competitors like Emu2 require 37 billion parameters and vast datasets, MENTOR surpasses their performance with only 2.3 billion parameters and significantly less training data in an autoregressive vision generation framework.
π Table of Contents
β¨ Key Features
| Feature | MENTOR | Diffusion-Based Models |
|---|---|---|
| Training Efficiency | β 1.5 days on 8 GPUs | β 3+ days on 256 GPUs |
| Deterministic Control | β Precise AR generation | β Stochastic sampling |
| Modality Balance | β Lowest CP/PF ratio (0.65) | β High imbalance (>1.0) |
| Architecture | β Simple unified transformer | β Complex auxiliary modules |
π Quick Start
π» Installation
Requirements
- Python β₯ 3.11
- PyTorch β₯ 2.5.1
- CUDA β₯ 12.1
- 8Γ NVIDIA A100 GPUs (80GB) for training
# Clone repository
git clone https://github.com/HaozheZhao/MENTOR.git
cd MENTOR
# Install dependencies
conda env create --file environment.yml
π₯ Download Dataset and Model
# Download model checkpoints
huggingface-cli download BleachNick/Mentor --local-dir Mentor
# Download Stage-1 dataset
huggingface-cli download BleachNick/Mentor_Stage1 --repo-type dataset --local-dir Mentor_Stage1
cd Mentor_Stage1
cat stage1_data.tar.gz.part-* | pv | tar -xzf -
cd ..
# Download Stage-2 dataset
huggingface-cli download BleachNick/Mentor_Stage2 --repo-type dataset --local-dir Mentor_Stage2
cd Mentor_Stage2
cat stage2_data.tar.gz.part-* | pv | tar -xzf -
cd ..
ποΈββοΈ Training
# Stage 1 training
bash scripts/autoregressive/train_stage1.sh
# Stage 2 training
bash scripts/autoregressive/train_stage2.sh
# Run ablation experiments
bash scripts/autoregressive/ablation.sh
π Main Results
π DreamBench++ Benchmark Leadership
| Method | Model Size | Training Data | CPβ | PFβ | CPΒ·PFβ | CP/PFβ |
|---|---|---|---|---|---|---|
| DreamEngine | 10.5B | 21M | 0.68 | 0.37 | 0.26 | 1.84 |
| Kosmos-G | 3B | 200M | 0.54 | 0.51 | 0.28 | 1.06 |
| Emu2 | 37B | 16M | 0.53 | 0.69 | 0.36 | 0.77 |
| IP-Adapter ViT-G | 2.5B | 10M | 0.59 | 0.64 | 0.38 | 0.92 |
| MENTOR | 2.3B | 3M | 0.55 | 0.84 | 0.47 | 0.65 |
CP: Concept Preservation | PF: Prompt Following | Lower CP/PF = Better Balance
π¨ Superior Image Reconstruction
| Method | COCO L2β | JourneyDB L2β | Improvement |
|---|---|---|---|
| SeedTokenizer | 0.5102 | 0.5291 | \ |
| SEED-X | 0.4317 | 0.4352 | \ |
| EMU2-Gen | 0.3828 | 0.2869 | \ |
| DreamEngine | 0.2065 | 0.2052 | Baseline |
| MENTOR | 0.1008 | 0.0867 | ~50% Better |
ποΈ Method Overview
Two-Stage Training Paradigm
| Stage | Purpose | Tasks | Training Time |
|---|---|---|---|
| Stage 1 | Multimodal Alignment | β’ Image Reconstruction β’ Object Segmentation β’ T2I Generation | 14 hours |
| Stage 2 | Instruction Tuning | β’ Image Recovery β’ Subject-driven Gen β’ Balanced Integration | 20 hours |
Architecture Components
π§ Click to expand technical architecture
Multimodal Encoder
- Vision: CLIP-Large-Patch14 (frozen)
- Language: FlanT5-XL
- Connector Options:
- MLP-based: Full visual detail preservation (256 tokens/image)
- Query-based: Efficient token compression (32 tokens/image)
Autoregressive Decoder
- Base Model: LlamaGen-XL (775M parameters)
- Vocabulary: Shared with VQGAN tokenizer
- Generation: Deterministic next-token prediction
π― Usage Examples
Basic Generation
python demo.py \
--image_path cat.jpg \
--prompt "A cat in <image>.\n A cat in a 16-bit fantasy pixel-art scene" \
--gpt_ckpt Mentor/stage2.pt \
--vq_ckpt Mentor/vq_ds16_t2i.pt \
--output out/cat_pixel.jpg \
--mm_vision_tower "openai/clip-vit-large-patch14" \
--multimodal_encoder llava \
π¬ Technical Details
π Mathematical Formulation
Training Objective
Given multimodal inputs c = {I, T}, the encoder Ο produces:
H = MLP(Ο(c)) = (hβ, ..., hβ) β βα΄ΉΛ£α΅
The AR decoder ΞΈ generates image sequence y:
ΞΈ(y | H) = βα΅’ββα΄Έ ΞΈ(yα΅’ | y<α΅’, H)
Classifier-Free Guidance
- Training: Replace H with Hα΅€ with probability p = 0.1
- Inference: β_g = β_u + (β_c - β_u) Γ Ξ»
π§ Training Configuration
Hyperparameters
- Optimizer: AdamW
- Learning Rate: Stage 1: 5e-4, Stage 2: 1e-4
- Batch Size: 96 for stage1 and 64 for stage 2(global)
- Warmup: 5% of total steps
- Schedule: Cosine decay
Hardware Requirements
- Training: 8Γ A100 80GB (~34 hours total)
- Inference: 1Γ GPU 24GB+
π Extended Results
Ablation Studies
| Configuration | CP | PF | CPΒ·PF |
|---|---|---|---|
| Full Model | 0.555 | 0.839 | 0.466 |
| w/o Stage 1 | 0.179 | 0.673 | 0.120 |
| w/o Image Recovery | 0.661 | 0.284 | 0.188 |
| w/o Segmentation | 0.412 | 0.918 | 0.378 |
π οΈ ROPE Fix for LlamaGen #54
We identified and resolved a critical bug in LlamaGen's 2D ROPE implementation that was causing significant information loss. Our fix required retraining the model prior to fine-tuning.
π Gallery
π Citation
If you find MENTOR useful, please cite our paper:
@misc{zhao2025mentorefficientmultimodalconditionedtuning,
title={MENTOR: Efficient Multimodal-Conditioned Tuning for Autoregressive Vision Generation Models},
author={Haozhe Zhao and Zefan Cai and Shuzheng Si and Liang Chen and Jiuxiang Gu and Wen Xiao and Junjie Hu},
year={2025},
eprint={2507.09574},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2507.09574},
}
π Acknowledgments
We thank the teams behind [LlamaGen]{https://github.com/FoundationVision/LlamaGen}, and [DreamBench++]{https://github.com/yuangpeng/dreambench_plus} for their foundational contributions.