Image-Text-to-Text
Transformers
Safetensors
English
qwen3_vl
qwen3-vl
grpo
rlvr
verl
multimodal
math-reasoning
conversational
Instructions to use ngqtrung/omr-8b-grpo-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ngqtrung/omr-8b-grpo-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ngqtrung/omr-8b-grpo-base") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ngqtrung/omr-8b-grpo-base") model = AutoModelForMultimodalLM.from_pretrained("ngqtrung/omr-8b-grpo-base", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ngqtrung/omr-8b-grpo-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ngqtrung/omr-8b-grpo-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ngqtrung/omr-8b-grpo-base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ngqtrung/omr-8b-grpo-base
- SGLang
How to use ngqtrung/omr-8b-grpo-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ngqtrung/omr-8b-grpo-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ngqtrung/omr-8b-grpo-base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ngqtrung/omr-8b-grpo-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ngqtrung/omr-8b-grpo-base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ngqtrung/omr-8b-grpo-base with Docker Model Runner:
docker model run hf.co/ngqtrung/omr-8b-grpo-base
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: Qwen/Qwen3-VL-8B-Instruct
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- qwen3-vl
|
| 10 |
+
- grpo
|
| 11 |
+
- rlvr
|
| 12 |
+
- verl
|
| 13 |
+
- multimodal
|
| 14 |
+
- math-reasoning
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Qwen3-VL-8B · OMR · GRPO baseline (cold-start)
|
| 18 |
+
|
| 19 |
+
RLVR post-training of **Qwen/Qwen3-VL-8B-Instruct** on the **OMR** (OpenMMReasoner, math/visual-reasoning) data with fully-async **GRPO**, cold-started from the stock 8B-Instruct (no exploration, no warm-start). This is `experiment_name=grpo_omr_4node_full_v1_8b_base_perf`, **`global_step_25`** (the keeper).
|
| 20 |
+
|
| 21 |
+
**This is the OMR cold-start GRPO baseline. It peaks at OMR overall-6 val accuracy `0.668` @ step 25, then collapses to `0.499` by step 125** — cold-start RL on 8B-OMR is unstable without exploration. The keeper is `global_step_25`, the only checkpoint before degradation began. (The `omr-8b-grpo-ppexplore` sibling fixes this collapse and reaches 0.714.)
|
| 22 |
+
|
| 23 |
+
## Results
|
| 24 |
+
|
| 25 |
+
OMR 6-image inline validation (mmmu val, mathvista testmini, mathverse testmini Text-Dominant, wemath testmini, charxiv reasoning-qa, dynamath test). `overall-6` = unweighted mean. Metric = accuracy.
|
| 26 |
+
|
| 27 |
+
Keeper = **`global_step_25`** (peak):
|
| 28 |
+
|
| 29 |
+
| metric | overall-6 | mmmu | mathvista | mathverse | wemath | charxiv | dynamath |
|
| 30 |
+
|---|---|---|---|---|---|---|---|
|
| 31 |
+
| **baseline peak @25** | **0.6681** | 0.6311 | 0.8019 | 0.8404 | 0.7437 | 0.3930 | 0.5986 |
|
| 32 |
+
| stock Qwen3-VL-8B ckpt-0 | 0.659 | 0.629 | 0.811 | 0.824 | 0.723 | 0.396 | 0.570 |
|
| 33 |
+
| baseline @125 (collapse) | 0.4994 | 0.5021 | 0.6796 | 0.6995 | 0.6184 | 0.2010 | 0.2958 |
|
| 34 |
+
|
| 35 |
+
Full trajectory (overall-6): **0.668 @25** → 0.644 @50 → 0.620 @75 → 0.620 @100 → 0.499 @125 (monotone decline; the step-125 drop is catastrophic — charxiv halved, dynamath collapsed). Run died to a vLLM deepstack crash after step 125, but the model was already degrading.
|
| 36 |
+
|
| 37 |
+
## Training
|
| 38 |
+
|
| 39 |
+
- **Base model:** `Qwen/Qwen3-VL-8B-Instruct` (cold-start, `resume_mode=auto`).
|
| 40 |
+
- **Framework:** fork of [volcengine/verl](https://github.com/volcengine/verl) — [`ngquangtrung57/verl@videorl-mods`](https://github.com/ngquangtrung57/verl/tree/videorl-mods). Fully-async **GRPO**: FSDP2 trainer + vLLM rollouter.
|
| 41 |
+
- **Warm start:** none (cold-start from stock 8B-Instruct).
|
| 42 |
+
- **Reward:** dapo-style `score = 0.8·accuracy + 0.2·format` (`FORMAT_WEIGHT=0.2`, `FORMAT_MIN_THINK_CHARS=100`). No KL penalty.
|
| 43 |
+
- **Exploration:** OFF (this is the bitwise baseline against `omr-8b-grpo-ppexplore`).
|
| 44 |
+
- **Topology:** 4-node 2+2 — 2 trainer nodes (16-GPU FSDP2, dp=16) + 2 rollout nodes (16 GPU, vLLM TP=2 → 8 replicas). H100×8 per node.
|
| 45 |
+
- **Batch:** `ppo_mini_batch_size=16` × `require_batches=4` × `rollout.n=8` = **512 trajectories/step**.
|
| 46 |
+
- **Optim / seq:** lr `1e-6`, warmup 25 steps; `total_epochs=2`; clip_ratio 0.2 / 0.3 (clip_c=10.0); `max_prompt_length=2048`, `max_response_length=16384`; `enforce_eager=true`; `gpu_memory_utilization=0.75`; staleness 0.5.
|
| 47 |
+
- **Train metrics:** ~178 s/step; final reward 0.721; final response_length ~2194 tok; 125 steps trained.
|
| 48 |
+
|
| 49 |
+
## W&B
|
| 50 |
+
|
| 51 |
+
Project `verl_fully_async` (entity `quangtrung5705-nanyang-technological-university-singapore`):
|
| 52 |
+
<https://wandb.ai/quangtrung5705-nanyang-technological-university-singapore/verl_fully_async/runs/gkiiopep>
|
| 53 |
+
|
| 54 |
+
## Intended use / limitations
|
| 55 |
+
|
| 56 |
+
Research checkpoint — the **cold-start GRPO baseline** in a controlled exploration study. Useful mainly as the A/B reference for `omr-8b-grpo-ppexplore` (the winner). It only marginally beats the zero-shot base (0.668 vs 0.659) at its peak and is **unstable** (collapses to 0.499 if trained past ~step 100); for actual use prefer the ppexplore checkpoint. Math / visual-reasoning image QA, `<think>…</think>` then-answer format. No safety/RLHF alignment beyond the base.
|
| 57 |
+
|
| 58 |
+
## Usage
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
| 62 |
+
from PIL import Image
|
| 63 |
+
|
| 64 |
+
model_id = "ngqtrung/omr-8b-grpo-base"
|
| 65 |
+
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="auto", device_map="auto")
|
| 66 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 67 |
+
|
| 68 |
+
messages = [{
|
| 69 |
+
"role": "user",
|
| 70 |
+
"content": [
|
| 71 |
+
{"type": "image", "image": Image.open("problem.png")},
|
| 72 |
+
{"type": "text", "text": "Solve the problem. Think step by step inside <think>...</think>, then give the final answer."},
|
| 73 |
+
],
|
| 74 |
+
}]
|
| 75 |
+
inputs = processor.apply_chat_template(
|
| 76 |
+
messages, add_generation_prompt=True, tokenize=True,
|
| 77 |
+
return_dict=True, return_tensors="pt"
|
| 78 |
+
).to(model.device)
|
| 79 |
+
out = model.generate(**inputs, max_new_tokens=2048)
|
| 80 |
+
print(processor.batch_decode(out[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0])
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Citation / lineage
|
| 84 |
+
|
| 85 |
+
- **Base model:** Qwen3-VL-8B-Instruct (Qwen team). Inherits the **Qwen3-VL license** — review the base model's terms; the Apache-2.0 tag refers to this repo's RLVR training artifacts.
|
| 86 |
+
- **Framework:** verl (volcengine/verl), fork `ngquangtrung57/verl@videorl-mods`; fully-async GRPO (FSDP2 + vLLM).
|
| 87 |
+
- **Study:** controlled OMR/Video exploration study on Qwen3-VL-8B; this is the no-exploration OMR baseline arm (`docs/experiments_summary_8b.md`).
|