Improve dataset card for Vision-R1-cold
#2
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,170 +1,71 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
| Method | Bits | 1.5B | 3B | 7B | 32B |
|
| 56 |
-
| ------------------------ | ---- | ------ | ------ | ------ | ------- |
|
| 57 |
-
| GRPO Full Fine-Tuning | AMP | 2*24GB | 4*40GB | 8*40GB | 16*80GB |
|
| 58 |
-
| GRPO Full Fine-Tuning | BF16 | 1*24GB | 1*40GB | 4*40GB | 8*80GB |
|
| 59 |
-
|
| 60 |
-
> [!NOTE]
|
| 61 |
-
> Use `worker.actor.fsdp.torch_dtype=bf16` and `worker.actor.optim.strategy=adamw_bf16` to enable bf16 training.
|
| 62 |
-
>
|
| 63 |
-
> We are working hard to reduce the VRAM in RL training, LoRA support will be integrated in next updates.
|
| 64 |
-
|
| 65 |
-
## Tutorial: Run Qwen2.5-VL GRPO on [Geometry3K](https://huggingface.co/datasets/hiyouga/geometry3k) Dataset in Just 3 Steps
|
| 66 |
-
|
| 67 |
-

|
| 68 |
-
|
| 69 |
-
### Installation
|
| 70 |
-
|
| 71 |
-
```bash
|
| 72 |
-
git clone https://github.com/hiyouga/EasyR1.git
|
| 73 |
-
cd EasyR1
|
| 74 |
-
pip install -e .
|
| 75 |
-
```
|
| 76 |
-
|
| 77 |
-
### GRPO Training
|
| 78 |
-
|
| 79 |
-
```bash
|
| 80 |
-
bash examples/qwen2_5_vl_7b_geo3k_grpo.sh
|
| 81 |
-
```
|
| 82 |
-
|
| 83 |
-
### Merge Checkpoint in Hugging Face Format
|
| 84 |
-
|
| 85 |
-
```bash
|
| 86 |
-
python3 scripts/model_merger.py --local_dir checkpoints/easy_r1/exp_name/global_step_1/actor
|
| 87 |
```
|
| 88 |
|
| 89 |
-
|
| 90 |
-
> If you encounter issues with connecting to Hugging Face, consider using `export HF_ENDPOINT=https://hf-mirror.com`.
|
| 91 |
-
>
|
| 92 |
-
> If you want to use SwanLab logger, consider using `bash examples/qwen2_5_vl_7b_geo3k_swanlab.sh`.
|
| 93 |
-
|
| 94 |
-
## Custom Dataset
|
| 95 |
-
|
| 96 |
-
Please refer to the example datasets to prepare your own dataset.
|
| 97 |
-
|
| 98 |
-
- Text dataset: https://huggingface.co/datasets/hiyouga/math12k
|
| 99 |
-
- Vision-text dataset: https://huggingface.co/datasets/hiyouga/geometry3k
|
| 100 |
-
|
| 101 |
-
> [!TIP]
|
| 102 |
-
> EasyR1 already supports multi-image dataset.
|
| 103 |
-
|
| 104 |
-
## How to Understand GRPO in EasyR1
|
| 105 |
-
|
| 106 |
-

|
| 107 |
-
|
| 108 |
-
- To learn about the GRPO algorithm, you can refer to [Hugging Face's blog](https://huggingface.co/docs/trl/v0.15.2/en/grpo_trainer).
|
| 109 |
-
|
| 110 |
-
## How to Run 70B+ Model in Multi-node Environment
|
| 111 |
-
|
| 112 |
-
Please see the **[veRL's official doc](https://verl.readthedocs.io/en/latest/start/multinode.html)** for multi-node training and Ray debugger.
|
| 113 |
-
|
| 114 |
-
## Other Baselines
|
| 115 |
-
|
| 116 |
-
We also reproduced the following two baselines of the [R1-V](https://github.com/deep-agent/R1-V) project.
|
| 117 |
-
- [CLEVR-70k-Counting](examples/baselines/qwen2_5_vl_3b_clevr.sh): Train the Qwen2.5-VL-3B-Instruct model on counting problem.
|
| 118 |
-
- [GeoQA-8k](examples/baselines/qwen2_5_vl_3b_geoqa8k.sh): Train the Qwen2.5-VL-3B-Instruct model on GeoQA problem.
|
| 119 |
-
|
| 120 |
-
## Awesome Work using EasyR1
|
| 121 |
-
|
| 122 |
-
- **MMR1**: Advancing the Frontiers of Multimodal Reasoning. [![[code]](https://img.shields.io/github/stars/LengSicong/MMR1)](https://github.com/LengSicong/MMR1)
|
| 123 |
-
- **Vision-R1**: Incentivizing Reasoning Capability in Multimodal Large Language Models. [![[code]](https://img.shields.io/github/stars/Osilly/Vision-R1)](https://github.com/Osilly/Vision-R1) [![[arxiv]](https://img.shields.io/badge/arxiv-2503.06749-blue)](https://arxiv.org/abs/2503.06749)
|
| 124 |
-
- **Seg-Zero**: Reasoning-Chain Guided Segmentation via Cognitive Reinforcement. [![[code]](https://img.shields.io/github/stars/dvlab-research/Seg-Zero)](https://github.com/dvlab-research/Seg-Zero) [![[arxiv]](https://img.shields.io/badge/arxiv-2503.06520-blue)](https://arxiv.org/abs/2503.06520)
|
| 125 |
-
- **MetaSpatial**: Reinforcing 3D Spatial Reasoning in VLMs for the Metaverse. [![[code]](https://img.shields.io/github/stars/PzySeere/MetaSpatial)](https://github.com/PzySeere/MetaSpatial) [![[arxiv]](https://img.shields.io/badge/arxiv-2503.18470-blue)](https://arxiv.org/abs/2503.18470)
|
| 126 |
-
|
| 127 |
-
## TODO
|
| 128 |
-
|
| 129 |
-
- Support LoRA (high priority).
|
| 130 |
-
- Support ulysses parallelism for VLMs (middle priority).
|
| 131 |
-
- Support more VLM architectures.
|
| 132 |
-
|
| 133 |
-
> [!NOTE]
|
| 134 |
-
> We will not provide scripts for supervised fine-tuning and inference in this project. If you have such requirements, we recommend using [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory).
|
| 135 |
-
|
| 136 |
-
### Known bugs
|
| 137 |
-
|
| 138 |
-
These features are temporarily disabled for now, we plan to fix them one-by-one in the future updates.
|
| 139 |
-
|
| 140 |
-
- Vision language models are not compatible with ulysses parallelism yet.
|
| 141 |
-
|
| 142 |
-
## Discussion Group
|
| 143 |
-
|
| 144 |
-
👋 Join our [WeChat group](assets/wechat.jpg).
|
| 145 |
|
| 146 |
## Citation
|
| 147 |
|
| 148 |
-
Core contributors: [Yaowei Zheng](https://github.com/hiyouga), [Junting Lu](https://github.com/AL-377), [Shenzhi Wang](https://github.com/Shenzhi-Wang), [Zhangchi Feng](https://github.com/BUAADreamer), [Dongdong Kuang](https://github.com/Kuangdd01) and Yuwen Xiong
|
| 149 |
-
|
| 150 |
-
We also thank Guangming Sheng and Chi Zhang for helpful discussions.
|
| 151 |
-
|
| 152 |
```bibtex
|
| 153 |
-
@misc{
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
| 158 |
}
|
| 159 |
-
```
|
| 160 |
-
|
| 161 |
-
We recommend to also cite the original work.
|
| 162 |
-
|
| 163 |
-
```bibtex
|
| 164 |
-
@article{sheng2024hybridflow,
|
| 165 |
-
title = {HybridFlow: A Flexible and Efficient RLHF Framework},
|
| 166 |
-
author = {Guangming Sheng and Chi Zhang and Zilingfeng Ye and Xibin Wu and Wang Zhang and Ru Zhang and Yanghua Peng and Haibin Lin and Chuan Wu},
|
| 167 |
-
year = {2024},
|
| 168 |
-
journal = {arXiv preprint arXiv: 2409.19256}
|
| 169 |
-
}
|
| 170 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
task_categories:
|
| 3 |
+
- image-text-to-text
|
| 4 |
+
tags:
|
| 5 |
+
- multimodal
|
| 6 |
+
- reasoning
|
| 7 |
+
- chain-of-thought
|
| 8 |
+
- vision-r1
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Vision-R1-cold
|
| 12 |
+
|
| 13 |
+
Vision-R1-cold is a high-quality multimodal Chain-of-Thought (CoT) dataset consisting of 200,000 samples. It serves as the cold-start initialization data for **Vision-R1**, a multimodal large language model (MLLM) designed to enhance reasoning capabilities through Reinforcement Learning (RL).
|
| 14 |
+
|
| 15 |
+
- **Paper:** [Vision-R1: Incentivizing Reasoning Capability in Multimodal Large Language Models](https://huggingface.co/papers/2503.06749)
|
| 16 |
+
- **Repository:** [https://github.com/Osilly/Vision-R1](https://github.com/Osilly/Vision-R1)
|
| 17 |
+
|
| 18 |
+
## Dataset Description
|
| 19 |
+
|
| 20 |
+
The dataset was constructed without human annotations by leveraging an existing MLLM and DeepSeek-R1. The authors used a **Modality Bridging** approach where multimodal data is first processed by an MLLM to obtain a "Pseudo-CoT" (caption and reasoning process). This textual description is then fed to DeepSeek-R1 to facilitate the generation of high-quality, complex CoT processes. The resulting data is post-processed and filtered to create the final 200K dataset.
|
| 21 |
+
|
| 22 |
+
## Usage
|
| 23 |
+
|
| 24 |
+
To use this dataset with the [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory) framework, you can update your `dataset_info.json` with the following configuration:
|
| 25 |
+
|
| 26 |
+
```json
|
| 27 |
+
"vision_r1_llava_cot_full": {
|
| 28 |
+
"file_name": "vision_r1_llava_cot_full.json",
|
| 29 |
+
"formatting": "sharegpt",
|
| 30 |
+
"columns": {
|
| 31 |
+
"messages": "conversations",
|
| 32 |
+
"images": "image"
|
| 33 |
+
},
|
| 34 |
+
"tags": {
|
| 35 |
+
"role_tag": "from",
|
| 36 |
+
"content_tag": "value",
|
| 37 |
+
"user_tag": "human",
|
| 38 |
+
"assistant_tag": "gpt"
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"vision_r1_mulberry_sft_full": {
|
| 42 |
+
"file_name": "vision_r1_mulberry_sft_full.json",
|
| 43 |
+
"formatting": "sharegpt",
|
| 44 |
+
"columns": {
|
| 45 |
+
"messages": "conversations",
|
| 46 |
+
"images": "images"
|
| 47 |
+
},
|
| 48 |
+
"tags": {
|
| 49 |
+
"role_tag": "from",
|
| 50 |
+
"content_tag": "value",
|
| 51 |
+
"user_tag": "user",
|
| 52 |
+
"assistant_tag": "assistant"
|
| 53 |
+
}
|
| 54 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
```
|
| 56 |
|
| 57 |
+
**Note:** The images for this dataset are derived from [LLaVA-CoT-100k](https://huggingface.co/datasets/Xkev/LLaVA-CoT-100k) and [Mulberry-SFT](https://huggingface.co/datasets/HuanjinYao/Mulberry-SFT).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
## Citation
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
```bibtex
|
| 62 |
+
@misc{huang2025visionr1incentivizingreasoningcapability,
|
| 63 |
+
title={Vision-R1: Incentivizing Reasoning Capability in Multimodal Large Language Models},
|
| 64 |
+
author={Wenxuan Huang and Bohan Jia and Zijie Zhai and Shaosheng Cao and Zheyu Ye and Fei Zhao and Yao Hu and Shaohui Lin},
|
| 65 |
+
year={2025},
|
| 66 |
+
eprint={2503.06749},
|
| 67 |
+
archivePrefix={arXiv},
|
| 68 |
+
primaryClass={cs.CV},
|
| 69 |
+
url={https://arxiv.org/abs/2503.06749},
|
| 70 |
}
|
| 71 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|