Image-Text-to-Text
Transformers
Safetensors
English
qwen3_vl
qwen3-vl
video
video-grounding
spatio-temporal-video-grounding
temporal-localization
parallel-tube-decoding
ptd
conversational
Instructions to use MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B") 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("MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B") model = AutoModelForMultimodalLM.from_pretrained("MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B", 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 MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B", "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/MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B
- SGLang
How to use MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B 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 "MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B" \ --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": "MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B", "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 "MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B" \ --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": "MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B", "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 MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B with Docker Model Runner:
docker model run hf.co/MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B
File size: 5,674 Bytes
945863a b775886 945863a | 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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | ---
license: apache-2.0
library_name: transformers
pipeline_tag: image-text-to-text
base_model: Qwen/Qwen3-VL-4B-Instruct
language:
- en
tags:
- qwen3-vl
- video
- video-grounding
- spatio-temporal-video-grounding
- temporal-localization
- parallel-tube-decoding
- ptd
---
# ParallelTubeDecoding-Qwen3-VL-4B
This repository contains the merged Qwen3-VL-4B checkpoint for **Parallel
Tube Decoding (PTD)** from *Locate Anything in Videos: Rethinking Efficient
Generative Spatio-Temporal Video Grounding*.
PTD first predicts the temporal interval of a queried event and then generates
all time-conditioned spatial blocks in parallel. Decoupled Block Attention
allows every spatial block to access the shared video-query context and the
predicted temporal block while preventing dependencies between spatial
blocks. The complete spatial tube is therefore produced in one parallel
decoding round after temporal localization.
- **Code:** [mbzuai-oryx/ParallelTubeDecoding](https://github.com/mbzuai-oryx/ParallelTubeDecoding)
- **Project page:** [Parallel Tube Decoding](https://mbzuai-oryx.github.io/ParallelTubeDecoding/)
- **Base model:** [Qwen/Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct)
## Model details
- Backbone: Qwen3-VL-4B-Instruct
- Method: Parallel Tube Decoding (PTD)
- Tasks: spatio-temporal video grounding and temporal localization
- Spatial representation: 1,001 discrete coordinate tokens over `[0, 1000]`
- Temporal representation: 100 discrete time tokens
- PTD spatial block size: 6
- Checkpoint format: merged model weights in FP16
- Transformers version: `5.12.1`
The checkpoint supports the released PTD inference path and Quantized (NTP)
inference. It does not include data or a separate LoRA adapter.
## Important loading note
Use this checkpoint with the released
[ParallelTubeDecoding](https://github.com/mbzuai-oryx/ParallelTubeDecoding)
code. Standard Transformers loading provides the Qwen3-VL architecture, but
PTD generation and Decoupled Block Attention are implemented by the released
codebase.
```bash
git clone https://github.com/mbzuai-oryx/ParallelTubeDecoding.git
cd ParallelTubeDecoding
conda create -n ptd python=3.11 -y
conda activate ptd
pip install --upgrade pip
pip install -r requirements.txt
```
The release uses:
```text
transformers==5.12.1
```
For evaluation, set the model path to this Hugging Face repository:
```bash
export MODEL="MBZUAI/ParallelTubeDecoding-Qwen3-VL-4B"
```
Then follow the repository's
[evaluation instructions](https://github.com/mbzuai-oryx/ParallelTubeDecoding/blob/main/evaluation/README.md).
The released adapter is based on `lmms-eval` v0.7.1 at commit
`88b23e2bfa16a1edbc16e9e238ed82130b3a4f56`.
## Evaluation configuration
The paper evaluation uses:
```text
fps=2
max_num_frames=64
min_pixels=131072
max_pixels=786432
temporal_patch_size=1
```
For PTD inference, use:
```text
attn_implementation=sdpa
vision_attn_implementation=flash_attention_2
ptd_attn_implementation=flash_attention_2
```
Quantized (NTP) inference uses:
```text
attn_implementation=sdpa
```
FlashAttention-2 must match the installed PyTorch and CUDA/ROCm environment.
## Training
The released model was trained in two stages:
1. Supervised fine-tuning with the joint NTP/MTP formulation on the training
splits of VidSTG and HC-STVG v1/v2.
2. Localization-aware GRPO with temporal IoU and spatial GIoU/L1 rewards.
Both stages used LoRA with rank 32 and alpha 64 while optimizing the newly
introduced localization-token embeddings. The released checkpoint contains
the merged weights. Charades-STA and ActivityNet Captions were not used for
SFT; results on both are zero-shot.
The training video configuration was:
```text
video_max_pixels=151200
fps=2
max_frames=64
temporal_patch_size=1
```
No training data, GRPO data, or GRPO data-selection code is included with the
model release.
## Results
PTD is evaluated on VidSTG, HC-STVG v1/v2, Charades-STA, and ActivityNet
Captions. On the decoding-efficiency protocol, PTD achieves a Tube Completion
Latency (TCL) of 0.4 seconds and 45.9 Boxes Per Second (BPS). Relative to
unquantized autoregressive decoding, this corresponds to 79x lower TCL and 92x
higher BPS while improving grounding accuracy.
The efficiency measurements use BF16, batch size 1, and a single 64-GB AMD
Instinct MI210 GPU with synchronized decode-only timing. Refer to the paper and
project page for complete benchmark tables and comparisons.
## Intended use
This model is intended for research on:
- spatio-temporal grounding of a referred entity in video;
- temporal localization of described events;
- efficient structured localization with PTD; and
- evaluation on VidSTG, HC-STVG, Charades-STA, and ActivityNet Captions.
Users are responsible for complying with the licenses and terms of the source
videos and evaluation datasets.
## Limitations
The released formulation predicts one continuous temporal interval and one
spatial tube per query. It is not designed for multiple disjoint event
occurrences or multiple simultaneously valid instances. Temporally subtle
state changes can produce ambiguous boundaries, while small, fast-moving, or
occluded targets remain challenging.
## Citation
```bibtex
@misc{rasheed2026locateanythingvideos,
title = {Locate Anything in Videos: Rethinking Efficient Generative Spatio-Temporal Video Grounding},
author = {Hanoona Rasheed and Haania Siddiqui and Ming-Hsuan Yang and Fahad Shahbaz Khan and Salman Khan},
year = {2026}
}
```
## Acknowledgements
This work builds on Qwen3-VL and the Qwen-VL-Series-Finetune training
framework. See the code repository for full acknowledgements.
|