|
|
--- |
|
|
license: apache-2.0 |
|
|
base_model: |
|
|
- Qwen/Qwen2.5-VL-7B-Instruct |
|
|
tags: |
|
|
- mm math reasoning |
|
|
datasets: |
|
|
- open-r1/OpenR1-Math-220k |
|
|
metrics: |
|
|
- accuracy |
|
|
--- |
|
|
|
|
|
# TBAC-VLR1-7B |
|
|
|
|
|
## Overview |
|
|
This is a multimodal language model fine-tuned by **Tencent PCG Basic Algorithm Center**. Based on Qwen2.5-VL-7B-Instruct, TBAC-VLR1-7B-SFT undergoes SFT |
|
|
training using 40k sft data filtered from OpenR1-Math-220k. TBAC-VLR1-3B then employs GRPO (Group Relative Policy Optimization) and adapts Clip-Higher from DAPO, |
|
|
achieving strong performance on several multimodal reasoning benchmarks among models of the same size. |
|
|
|
|
|
|
|
|
## Performance |
|
|
| Model | **Average** | **MathVista** | **MathVision** | **MathVerse** | **DynaMath** | **LogicVista** | |
|
|
| :--------------------------------: | :---------: | :-----------: | :------------: | :-----------: | :----------: | :------------: | |
|
|
| Qwen2.5-VL-7B | 40.5 | 68.0 | 25.7 | 45.5 | 21.8 | 41.2 | |
|
|
| VLAA-Thinker-Qwen2.5-7B | 42.7 | 68.0 | 26.4 | 48.2 | 22.4 | 48.5 | |
|
|
| VL-Rethinker-7B | 41.8 | 73.7 | 28.4 | 46.4 | 17.8 | 42.7 | |
|
|
| TBAC-VLR1-7B-RL | 41.3 | 70.1 | 25.4 | 43.4 | 19.0 | 48.4 | |
|
|
| TBAC-VLR1-7B-SFT | 41.8 | 65.1 | 28.5 | 49.1 | 20.6 | 45.5 | |
|
|
| TBAC-VLR1-7B | **43.4** | 66.7 | **31.4** | **50.1** | **22.6** | 46.4 | |
|
|
|
|
|
|
|
|
<!--  --> |
|
|
|
|
|
<!--  --> |
|
|
|
|
|
<!-- The compared results are sourced from https://opencompass.org.cn. --> |
|
|
|
|
|
The results of our model are self-reported, obtained by running evaluations offline on each benchmark. |
|
|
|
|
|
## Usage |
|
|
```python |
|
|
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor |
|
|
from qwen_vl_utils import process_vision_info |
|
|
|
|
|
model = Qwen2_5_VLForConditionalGeneration.from_pretrained( |
|
|
"TencentBAC/TBAC-VLR1-7B", torch_dtype="auto", device_map="auto" |
|
|
) |
|
|
|
|
|
processor = AutoProcessor.from_pretrained("TencentBAC/TBAC-VLR1-7B") |
|
|
|
|
|
messages = [ |
|
|
{ |
|
|
"role": "system", |
|
|
"content": "You FIRST think about the reasoning process as an internal monologue and then provide the final answer. The reasoning process MUST BE enclosed within <think> </think> tags. The final answer MUST BE put in \\boxed{}." |
|
|
}, |
|
|
{ |
|
|
"role": "user", |
|
|
"content": [ |
|
|
{ |
|
|
"type": "image", |
|
|
"image": image_path, |
|
|
}, |
|
|
{"type": "text", "text": query}, |
|
|
], |
|
|
} |
|
|
] |
|
|
|
|
|
# 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("cuda") |
|
|
|
|
|
# Inference: Generation of the output |
|
|
generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False) |
|
|
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) |
|
|
``` |
|
|
## Citation |
|
|
If you find our model useful in your research, please consider giving ❤️ and citations. Thanks! |
|
|
``` |
|
|
@misc{Ou2025TBACVLR1, |
|
|
title = {TBAC-VLR1-7B}, |
|
|
author = {Ou, Linyu and Xu, Junzhe and Yin, Yuyang}, |
|
|
year = {2025}, |
|
|
url = {https://huggingface.co/TencentBAC/TBAC-VLR1-7B}, |
|
|
} |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
**About** |
|
|
|
|
|
Created by the Tencent PCG Basic Algorithm Center. All rights reserved. |