File size: 3,416 Bytes
3a91e9a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
license: apache-2.0
datasets:
- ZTE-AIM/Curr-ReFT-data
base_model:
- Qwen/Qwen2.5-VL-3B-Instruct
- Qwen/Qwen2.5-VL-7B-Instruct
pipeline_tag: image-text-to-text
---

## Curr-ReFT-data
[\[๐Ÿ“‚ GitHub\]](https://github.com/ding523/Curr_REFT)
[\[๐Ÿค— HF Dataset\]](https://huggingface.co/datasets/ZTE-AIM/Curr-ReFT-data)  
## Curr-ReFT-model
[\[๐Ÿค— Curr-ReFT-3B\]](https://huggingface.co/ZTE-AIM/3B-Curr-ReFT) 
[\[๐Ÿค— Curr-ReFT-7B\]](https://huggingface.co/ZTE-AIM/7B-Curr-ReFT) 
## Model Overview

This is a multimodal large language model fine-tuned from Qwen2.5-VL using our innovative **Curr-ReFT** methodology. The model has undergone a two-stage training process: first through Curriculum Reinforcement Learning, which gradually increases task complexity, followed by Rejected Sample based Self-improvement to maintain foundational capabilities.
The model significantly enhances vision-language understanding and reasoning capabilities, making it exceptionally well-suited for complex tasks such as visual reasoning, detailed image understanding, and multimodal problem-solving. With its robust ability to perform sophisticated multimodal reasoning, Curr-ReFT emerges as a powerful AI assistant capable of addressing a wide range of challenges across diverse domains with improved accuracy and contextual awareness.

## Training Configuration
- Framework: The training process uses the open-source **R1-V** library, with **Qwen2.5-VL-Instruct** as the base model. This model comes in three variants: 3B, 7B.

The training configuration for grpo is as follows:
```python
max_pixels 401408
per_device_train_batch_size: 1
gradient_accumulation_steps: 1
learning_rate: 1.0e-5

num_train_epochs: 1.0
lr_scheduler_type: cosine
bf16: true
flash_attn: fa2
```

## Usage

You can load the model using the Hugging Face `transformers` library:

```python
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
import torch
from qwen_vl_utils import process_vision_info

MODEL_ID = "Curr-ReFT-3B"
processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    MODEL_ID,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16
).to("cuda").eval()

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": "<your image path>"},
            {"type": "text", "text": "Hint: Please answer the question and provide the final answer at the end. Question: Which number do you have to write in the last daisy?"},
        ],
    }
]

# Preparation for inference
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
)
inputs = inputs.to(model.device)

generated_ids = model.generate(**inputs, max_new_tokens=4096)
generated_ids_trimmed = [
    out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
```



# Institution
- ZTE-AIM
- University of Science and Technology of China

## Model Contact
- [email protected]
- [email protected]
- [email protected]