Advancing Multimodal Reasoning via Reinforcement Learning with Cold Start
Paper • 2505.22334 • Published • 36
# Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("WaltonFuture/Qwen2.5VL-7b-RLCS")
model = AutoModelForImageTextToText.from_pretrained("WaltonFuture/Qwen2.5VL-7b-RLCS")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
We conduct supervised fine-tuning on Qwen2.5-VL-3B and Qwen2.5-VL-7B using ms-swift. In this stage, please refer to this curated dataset distilled from Qwen2.5-VL-32B using rejection sampling.
git clone https://github.com/waltonfuture/RL-with-Cold-Start.git
cd RL-with-Cold-Start/SFT
pip install -e .
python convert_data.py
bash qwen2.5vl_sft.sh
The checkpoint can be found in SFT/output.
We further conduct GRPO using EasyR1. Please refer to this dataset for the GRPO training.
git clone https://github.com/waltonfuture/RL-with-Cold-Start.git
cd RL-with-Cold-Start/GRPO
pip install -e .
bash examples/qwen2_5_vl_7b_grpo.sh
python3 scripts/model_merger.py --local_dir checkpoints/easyr1/qwen2_5_vl_7b_grpo/global_step_80/actor
Our two stage datasets are now available on Huggingface.
| Stage | Data |
|---|---|
| Cold Start | Multimodal-Cold-Start |
| RL | Multimodal-RL-Data |
Our models are now available on Huggingface.
| Backbone | Our model |
|---|---|
| Qwen2.5-VL-7b | Qwen2.5VL-7b-RL-with-Cold-Start |
| Qwen2.5-VL-3b | Qwen2.5VL-3b-RL-with-Cold-Start |
Our models are built upon the amazing Qwen2.5-VL family. We thank EasyR1 and ms-swift for their training codes.
Please contact Lai Wei (waltonfuture@sjtu.edu.cn) if needed.
@article{wei2025advancing,
title={Advancing Multimodal Reasoning via Reinforcement Learning with Cold Start},
author={Wei, Lai and Li, Yuting and Zheng, Kaipeng and Wang, Chen and Wang, Yue and Kong, Linghe and Sun, Lichao and Huang, Weiran},
journal={arXiv preprint arXiv:2505.22334},
year={2025}
}
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="WaltonFuture/Qwen2.5VL-7b-RLCS") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)