Image-Text-to-Text
Transformers
Safetensors
English
visual-reasoning
unified-model
reinforcement-learning
emu3.5
multimodal
next-token-prediction
grpo
Instructions to use ByteDance/UniVR-34B-Planning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ByteDance/UniVR-34B-Planning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ByteDance/UniVR-34B-Planning")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ByteDance/UniVR-34B-Planning", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ByteDance/UniVR-34B-Planning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ByteDance/UniVR-34B-Planning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance/UniVR-34B-Planning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ByteDance/UniVR-34B-Planning
- SGLang
How to use ByteDance/UniVR-34B-Planning 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 "ByteDance/UniVR-34B-Planning" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance/UniVR-34B-Planning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "ByteDance/UniVR-34B-Planning" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance/UniVR-34B-Planning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ByteDance/UniVR-34B-Planning with Docker Model Runner:
docker model run hf.co/ByteDance/UniVR-34B-Planning
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,202 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-4.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-4.0
|
| 3 |
---
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
tags:
|
| 7 |
+
- visual-reasoning
|
| 8 |
+
- unified-model
|
| 9 |
+
- reinforcement-learning
|
| 10 |
+
- emu3.5
|
| 11 |
+
- multimodal
|
| 12 |
+
- next-token-prediction
|
| 13 |
+
- grpo
|
| 14 |
+
pipeline_tag: image-text-to-text
|
| 15 |
+
library_name: transformers
|
| 16 |
+
base_model:
|
| 17 |
+
- BAAI/Emu3.5
|
| 18 |
+
datasets:
|
| 19 |
+
- maverickrzw/VR-X-SFT-RL
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# UniVR: Thinking in Visual Space for Unified Visual Reasoning
|
| 23 |
+
|
| 24 |
+
<p align="center">
|
| 25 |
+
<img src="asset/Fig1_v1.png" alt="UniVR Overview" width="95%">
|
| 26 |
+
</p>
|
| 27 |
+
|
| 28 |
+
<p align="center">
|
| 29 |
+
<a href="https://maverickren.github.io/UniVR.github.io/">π Project Page</a> |
|
| 30 |
+
<a href="#">π Paper</a> |
|
| 31 |
+
<a href="https://github.com/MaverickRen/UniVR">π» Code</a> |
|
| 32 |
+
<a href="https://huggingface.co/datasets/maverickrzw/VR-X-SFT-RL">π¦ VR-X Dataset</a>
|
| 33 |
+
</p>
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## Model Summary
|
| 38 |
+
|
| 39 |
+
**UniVR** is the first framework that simultaneously learns complex reasoning, fine-grained physical dynamics, and long-term planning from pure visual demonstrations β without relying on dense image-text pairs or task-specific heuristics.
|
| 40 |
+
|
| 41 |
+
Built on [Emu3.5](https://huggingface.co/BAAI/Emu3.5) (34B), UniVR uses a unified next-token prediction objective to directly generate visual reasoning traces given an image and instruction. Training employs a two-stage pipeline: supervised cold initialization on the VR-X dataset, followed by **VR-GRPO** reinforcement learning with complementary global and step-focal rewards.
|
| 42 |
+
|
| 43 |
+
| Feature | Detail |
|
| 44 |
+
|---|---|
|
| 45 |
+
| **Architecture** | Emu3.5 34B (VQ-VAE unified generative model) |
|
| 46 |
+
| **Training** | SFT (310k samples) β VR-GRPO RL (3k samples) |
|
| 47 |
+
| **Visual Thinking** | Native visual-space reasoning, no intermediate text chain |
|
| 48 |
+
| **Benchmark** | VR-X: 16 sources, 6 task categories, 1.8k evaluation samples |
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## Available Checkpoints
|
| 53 |
+
|
| 54 |
+
| Model | Description | Link |
|
| 55 |
+
|---|---|---|
|
| 56 |
+
| **UniVR-34B-Planning** | Optimized for long-horizon planning tasks (robotic manipulation, tool use, multi-step control) | [maverickrzw/UniVR-34B-Planning](https://huggingface.co/maverickrzw/UniVR-34B-Planning) |
|
| 57 |
+
| **UniVR-34B-General** | Full UniVR recipe with interleaved image-text data; suitable for general visual reasoning | [maverickrzw/UniVR-34B-General](https://huggingface.co/maverickrzw/UniVR-34B-General) |
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## Key Results
|
| 62 |
+
|
| 63 |
+
### VR-X Benchmark
|
| 64 |
+
|
| 65 |
+
UniVR achieves up to **25% improvement** over the Emu3.5 baseline and approaches Gemini 3 Pro + Nano Banana 2 with only 34B parameters.
|
| 66 |
+
|
| 67 |
+
| Method | Visual Thinking | Guidance | Robot | Editing | Spatial | Puzzle | Search | Overallβ |
|
| 68 |
+
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
| 69 |
+
| Gemini-3-pro + Nano Banana 2 | β | 66.2 | 67.1 | 63.7 | 55.1 | 65.5 | 79.0 | **66.1** |
|
| 70 |
+
| GPT-5 + GPT-image-1.5 | β | 68.2 | 64.1 | 58.0 | 49.3 | 64.0 | 77.4 | 63.5 |
|
| 71 |
+
| Emu3.5 34B | β | 38.6 | 42.8 | 32.7 | 35.3 | 43.4 | 46.2 | 39.8 |
|
| 72 |
+
| **UniVR 34B** | **β** | **59.5** | **68.0** | **48.5** | **46.5** | **62.2** | **64.3** | **58.2** |
|
| 73 |
+
| *Ξ v.s. Emu3.5* | | *β20.9* | *β25.2* | *β15.8* | *β11.2* | *β18.8* | *β18.1* | *β18.4* |
|
| 74 |
+
|
| 75 |
+
### Multimodal Understanding
|
| 76 |
+
|
| 77 |
+
Enhanced visual reasoning also boosts standard multimodal benchmarks β no degradation of the base model's capabilities.
|
| 78 |
+
|
| 79 |
+
| Method | MMMU | MME(P) | MME(C) | MMBench | MathVista | MM-Vet |
|
| 80 |
+
|---|:---:|:---:|:---:|:---:|:---:|:---:|
|
| 81 |
+
| Emu 3.5 | 0.292 | 781.1 | 324.6 | 0.183 | 41.7 | 28.0 |
|
| 82 |
+
| **UniVR** | **0.337** | **799.3** | **338.5** | **0.198** | **44.0** | **35.6** |
|
| 83 |
+
| *Ξ v.s. Emu3.5* | *β0.045* | *β18.2* | *β13.9* | *β0.015* | *β2.3* | *β7.6* |
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## Quick Start
|
| 88 |
+
|
| 89 |
+
### Installation
|
| 90 |
+
|
| 91 |
+
```bash
|
| 92 |
+
git clone https://github.com/MaverickRen/UniVR.git
|
| 93 |
+
cd UniVR
|
| 94 |
+
bash install.sh
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
### Inference
|
| 98 |
+
|
| 99 |
+
```bash
|
| 100 |
+
cd UniVR_SFT
|
| 101 |
+
|
| 102 |
+
# Download checkpoint
|
| 103 |
+
huggingface-cli download maverickrzw/UniVR-34B-Planning --local-dir weights/UniVR-34B-Planning
|
| 104 |
+
|
| 105 |
+
# Download VisionTokenizer
|
| 106 |
+
huggingface-cli download BAAI/Emu3.5-VisionTokenizer --local-dir weights/Emu3.5-VisionTokenizer
|
| 107 |
+
|
| 108 |
+
# Run inference
|
| 109 |
+
bash scripts/inference.sh
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
Configure `configs/config.py` to set model paths and prompts:
|
| 113 |
+
|
| 114 |
+
```python
|
| 115 |
+
{
|
| 116 |
+
"prompt": "Tie the red rope around the white gift box. Finish this task in 3 steps.",
|
| 117 |
+
"reference_image": "path/to/first_frame.jpg",
|
| 118 |
+
}
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
### Training
|
| 122 |
+
|
| 123 |
+
**SFT (Cold Initialization)**:
|
| 124 |
+
```bash
|
| 125 |
+
cd UniVR_SFT
|
| 126 |
+
# LoRA (2 nodes Γ 8 GPUs)
|
| 127 |
+
bash scripts/train_sft_lora.sh
|
| 128 |
+
# Full parameter (4 nodes Γ 8 GPUs)
|
| 129 |
+
bash scripts/train_sft_full.sh
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
**RL (VR-GRPO)**:
|
| 133 |
+
```bash
|
| 134 |
+
cd UniVR_RL
|
| 135 |
+
bash examples/emu3_grpo_lora.sh
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## Method: VR-GRPO
|
| 141 |
+
|
| 142 |
+
UniVR proposes **VR-GRPO** (Visual Reasoning GRPO), a reinforcement learning paradigm that combines:
|
| 143 |
+
|
| 144 |
+
- **Global Reward (R_g)**: A VLM evaluator assesses overall task completion and visual quality via pairwise comparison.
|
| 145 |
+
- **Step-Focal Reward (R_s)**: Identifies the most error-prone sub-steps by computing inter-trajectory CLIP-feature variance across rollout samples, then applies fine-grained VLM evaluation on critical windows.
|
| 146 |
+
- **Combined Reward**: `R_reason = R_g β Ξ»|R_g β R_s|`, enforcing both terminal correctness and procedural integrity.
|
| 147 |
+
|
| 148 |
+
This design prevents reward hacking in long-horizon tasks where global-only rewards overlook intermediate physical violations and logical gaps.
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## Sample Outputs
|
| 153 |
+
|
| 154 |
+
<table>
|
| 155 |
+
<tr>
|
| 156 |
+
<td align="center"><b>Tie a Knot</b></td>
|
| 157 |
+
<td align="center"><b>Hang Clothes</b></td>
|
| 158 |
+
<td align="center"><b>Draw</b></td>
|
| 159 |
+
</tr>
|
| 160 |
+
<tr>
|
| 161 |
+
<td><img src="asset/tie_rope_02.jpg" width="250"/></td>
|
| 162 |
+
<td><img src="asset/hang_clothes_03.jpg" width="250"/></td>
|
| 163 |
+
<td><img src="asset/Draw.png" width="250"/></td>
|
| 164 |
+
</tr>
|
| 165 |
+
</table>
|
| 166 |
+
|
| 167 |
+
---
|
| 168 |
+
|
| 169 |
+
## Training Data
|
| 170 |
+
|
| 171 |
+
UniVR is trained on **VR-X**, a large-scale benchmark curated from 1.5M raw samples across 16 diverse sources:
|
| 172 |
+
|
| 173 |
+
| Category | Sources | Examples |
|
| 174 |
+
|---|---|---|
|
| 175 |
+
| Visual Guidance | EgoDex, Action100M, Epic-Kitchen, VideoCraftBench | Cooking, handcrafting, daily activities |
|
| 176 |
+
| Robot Manipulation | AgiBot, Droid, Bridge, ZebraCoT-Robot | Robotic grasping, tool use, multi-step control |
|
| 177 |
+
| Editing | ZebraCoT-Multiobject | Object manipulation, scene editing |
|
| 178 |
+
| Spatial Perception | ThinkMorph-Navigation, ZebraCoT-Embodiment | Navigation, spatial reasoning |
|
| 179 |
+
| Visual Search | VisualCoT, ThinkMorph-Search | Object localization, attention |
|
| 180 |
+
| Puzzle & Game | VRBench, Zebra-Jigsaw, ThinkMorph-VisPuzzle | Mazes, jigsaw, visual puzzles |
|
| 181 |
+
|
| 182 |
+
Download: [maverickrzw/VR-X-SFT-RL](https://huggingface.co/datasets/maverickrzw/VR-X-SFT-RL)
|
| 183 |
+
|
| 184 |
+
---
|
| 185 |
+
|
| 186 |
+
## Citation
|
| 187 |
+
|
| 188 |
+
```bibtex
|
| 189 |
+
@article{ren2026univr,
|
| 190 |
+
title={UniVR: Thinking in Visual Space for Unified Visual Reasoning},
|
| 191 |
+
author={Zhongwei Ren and Yunchao Wei and Zhao Yao and Guixun Luo and Yao Zhao and Weibo Gong and Xiao Liu and Anran Wang and Xiangtai Li and Xiaojie Jin},
|
| 192 |
+
year={2026},
|
| 193 |
+
}
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
## License
|
| 197 |
+
|
| 198 |
+
This project is released under the [Apache 2.0 License](LICENSE).
|
| 199 |
+
|
| 200 |
+
## Acknowledgements
|
| 201 |
+
|
| 202 |
+
UniVR is built upon [Emu3.5](https://github.com/baaivision/Emu3) and [verl](https://github.com/volcengine/verl). We thank the authors for their excellent open-source contributions.
|