---
title: MechVL-4B-RL
canonical_url: "https://www.modelscope.cn/models/xiaofengalg/MechVL-4B-RL"
md_url: "https://www.modelscope.cn/models/xiaofengalg/MechVL-4B-RL.md"
repository: xiaofengalg/MechVL-4B-RL
last_updated: 2026-06-26
license: apache-2.0
pipeline_tag: image-text-to-text
tasks:
  - image-text-to-text
model_type:
  - qwen3_vl
architectures:
  - Qwen3VLForConditionalGeneration
base_model:
  - xiaofengalg/MechVL-4B-SFT
base_model_relation: finetune
parameters: 4.8B
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - PyTorch
language:
  - zh
  - en
downloads: 338
stars: 3
tags:
  - multimodal
  - vision-language
  - mechanical-drawing
  - vqa
  - mechvqa
  - reinforcement-learning
  - reasoning
---

# MechVL-4B-RL

> MechVL-4B-RL - xiaofengalg 在 ModelScope 开源的模型。The RL checkpoint of MechVL — the domain-specialized multimodal model for mechanical engineering drawing understanding, introduced in:

xiaofengalg/MechVL-4B-RL 是 ModelScope 魔搭社区上的 4.8B 参数image-text-to-text模型，采用 apache-2.0 许可，基于 xiaofengalg/MechVL-4B-SFT 构建。

- **Repository**: xiaofengalg/MechVL-4B-RL
- **License**: apache-2.0
- **Tasks**: image-text-to-text
- **Parameters**: 4.8B
- **Base model**: xiaofengalg/MechVL-4B-SFT
- **Tags**: multimodal, vision-language, mechanical-drawing, vqa, mechvqa, reinforcement-learning, reasoning
- **Downloads**: 338
- **Stars**: 3
- **Last updated**: 2026-06-26

Source: https://www.modelscope.cn/models/xiaofengalg/MechVL-4B-RL

---

# MechVL-4B-RL

The **RL checkpoint** of **MechVL** — the domain-specialized multimodal model for mechanical engineering drawing understanding, introduced in:

> **MechVQA: Benchmarking and Enhancing Multimodal LLMs on Comprehensive Mechanical Drawing Understanding** (ICML 2026)

[![arXiv](https://img.shields.io/badge/arXiv-2605.30794-b31b1b.svg)](https://arxiv.org/abs/2605.30794)
[![GitHub](https://img.shields.io/badge/Code-GitHub-181717.svg)](https://github.com/xiaofengShi/MechVQA)

## Model description

MechVL-4B-RL is obtained by further optimizing [MechVL-4B-SFT](https://modelscope.cn/models/xiaofengalg/MechVL-4B-SFT) with **DAPO** (Decoupled Clip and Dynamic Sampling Policy Optimization) in a **two-stage self-play** regime:

- **Stage 1 (full)**: DAPO over the full MechVQA training split.
- **Stage 2 (targeted)**: DAPO over a re-sampled subset with an increased proportion of underperforming subtasks.

Reward = **Accuracy** (LLM-as-a-Judge, semantic equivalence in [0,1]) + **Format** (binary, well-formed `<think>/<answer>`) + **Quality** (Logic / Professionalism / Conciseness).

| | |
|---|---|
| Base model | Qwen3-VL-4B-Instruct |
| Architecture | Qwen3VLForConditionalGeneration |
| Stage | 2 / 2 — RL (DAPO self-play, on top of SFT) |
| MechVQA Total | **84.85** (best across open- & closed-source MLLMs) |
| SFT checkpoint | [xiaofengalg/MechVL-4B-SFT](https://modelscope.cn/models/xiaofengalg/MechVL-4B-SFT) |

## Output format

The model reasons then answers, enclosed as:

```
<think> ...reasoning... </think><answer> ...final answer... </answer>
```

Parse the `<answer>...</answer>` span for the final answer (a regex like `<answer>(.*?)</answer>` works).

## Usage (ModelScope)

```python
import re, torch
from modelscope import AutoModelForCausalLM, AutoProcessor

model = AutoModelForCausalLM.from_pretrained(
    "xiaofengalg/MechVL-4B-RL", torch_dtype=torch.bfloat16, device_map="auto"
)
processor = AutoProcessor.from_pretrained("xiaofengalg/MechVL-4B-RL")

question = "图纸中标注的零件总长度是多少？"
messages = [{"role": "user", "content": [
    {"type": "image", "image": "path/to/drawing.png"},
    {"type": "text", "text": question},
]}]
inputs = processor.apply_chat_template(
    messages, add_generation_prompt=True, tokenize=True,
    return_dict=True, return_tensors="pt",
).to(model.device)
out = model.generate(**inputs, max_new_tokens=4096, do_sample=True,
                     temperature=0.6, top_p=0.95, top_k=20)
text = processor.decode(out[0], skip_special_tokens=True)
m = re.search(r"<answer>(.*?)</answer>", text, re.DOTALL)
print("answer:", m.group(1).strip() if m else text)
```

Also available on [HuggingFace](https://huggingface.co/MonteXiaofeng/MechVL-4B-RL). For batch vLLM inference with the exact training-time format prompt, see [`scripts/batch_infer.py`](https://github.com/xiaofengShi/MechVQA/blob/main/scripts/batch_infer.py) (MODE=rl) and [`prompts/mech_r1.jinja`](https://github.com/xiaofengShi/MechVQA/blob/main/prompts/mech_r1.jinja).

## Results

On the MechVQA benchmark (Total score):

| Model | Total |
|---|:---:|
| GPT-5 | 75.44 |
| Gemini-3-Pro-Preview | 77.28 |
| GLM-4.6V (best closed-source) | 78.91 |
| MechVL-4B-SFT | 76.36 |
| **MechVL-4B-RL (this model)** | **84.85** |

See [§6 of the paper](https://arxiv.org/abs/2605.30794) for the full table and ablations.

## Citation

```bibtex
@misc{kou2026mechvqabenchmarkingenhancingmultimodal,
      title={MechVQA: Benchmarking and Enhancing Multimodal LLMs on Comprehensive Mechanical Drawing Understanding},
      author={Qian Kou and Xiaofeng Shi and Yulin Li and Xiaosong Qiu and Xinyang Wang and Hua Zhou and Cao Dongxing},
      year={2026},
      eprint={2605.30794},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2605.30794}
}
```

## License

Apache-2.0.
