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:
|
| 6 |
+
- inclusionAI/ZwZ-RL-VQA
|
| 7 |
+
- inclusionAI/ZoomBench
|
| 8 |
+
language:
|
| 9 |
+
- en
|
| 10 |
+
pipeline_tag: image-text-to-text
|
| 11 |
+
library_name: transformers
|
| 12 |
+
tags:
|
| 13 |
+
- text-generation-inference
|
| 14 |
+
- F8_E4M3
|
| 15 |
+
- fp8
|
| 16 |
+
- vllm
|
| 17 |
+
- llm-compressor
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
# **ZwZ-8B-FP8**
|
| 23 |
+
|
| 24 |
+
> **ZwZ-8B-FP8** is an FP8-compressed evolution built on top of **inclusionAI/ZwZ-8B**. This variant leverages **BF16 · FP8 (F8_E4M3)** precision formats to significantly reduce memory footprint and improve inference efficiency while preserving the fine-grained multimodal perception strengths of the original architecture.
|
| 25 |
+
> The result is a highly efficient 8B vision-language model optimized for real-time, single-pass visual reasoning with enhanced hardware efficiency.
|
| 26 |
+
|
| 27 |
+
> [!important]
|
| 28 |
+
> FP8 (8-bit floating point) weight and activation quantization using hardware acceleration on GPUs – [FP8 W8A8](https://docs.vllm.ai/en/stable/features/quantization/fp8/). Quantization W8A8 FP8-dynamic recipe – [examples](https://github.com/vllm-project/llm-compressor/tree/main/examples/quantization_w8a8_fp8).
|
| 29 |
+
|
| 30 |
+
## About the Base Model
|
| 31 |
+
|
| 32 |
+
**ZwZ-8B** from inclusionAI is an 8B-parameter fine-grained multimodal perception vision-language model built upon Qwen3-VL-8B. It is trained using innovative **Region-to-Image Distillation (R2I)** combined with reinforcement learning to achieve state-of-the-art visual understanding in a single forward pass.
|
| 33 |
+
|
| 34 |
+
Unlike traditional VLMs that require inference-time zooming, cropping, or tool calling, ZwZ internalizes region-level perception directly into full-image reasoning.
|
| 35 |
+
|
| 36 |
+
### Key Innovations of ZwZ-8B
|
| 37 |
+
|
| 38 |
+
* **Region-to-Image Distillation (R2I)**:
|
| 39 |
+
Teacher models such as Qwen3-VL-235B and GLM-4.5V generate high-fidelity VQA supervision on micro-cropped image regions with precise bounding boxes. This region-grounded supervision is distilled back into full-image context, allowing the student model to internalize fine-grained perception.
|
| 40 |
+
|
| 41 |
+
* **Single-Pass Fine-Grained Understanding**:
|
| 42 |
+
Eliminates multi-step inference pipelines involving zooming, cropping, or external tool calls.
|
| 43 |
+
|
| 44 |
+
* **Strong Micro-Perception Capabilities**:
|
| 45 |
+
|
| 46 |
+
* OCR and small-text detection
|
| 47 |
+
* Object counting
|
| 48 |
+
* Color and material attribute recognition
|
| 49 |
+
* Structural analysis
|
| 50 |
+
* Symbol and icon detection in dense scenes
|
| 51 |
+
|
| 52 |
+
* **Out-of-Distribution Generalization**:
|
| 53 |
+
Demonstrates strong performance on:
|
| 54 |
+
|
| 55 |
+
* Visual reasoning benchmarks
|
| 56 |
+
* GUI agent tasks
|
| 57 |
+
* AIGC detection
|
| 58 |
+
* Complex real-world scenes
|
| 59 |
+
|
| 60 |
+
* **Edge-Optimized Deployment**:
|
| 61 |
+
Enables real-time robotics and mobile vision applications without multi-stage inference overhead.
|
| 62 |
+
|
| 63 |
+
ZwZ is part of a broader model family spanning 4B, 7B, and 8B scales.
|
| 64 |
+
|
| 65 |
+
## What FP8 Adds
|
| 66 |
+
|
| 67 |
+
The **ZwZ-8B-FP8** variant introduces:
|
| 68 |
+
|
| 69 |
+
* **BF16 · FP8 (F8_E4M3) Compression**: Transformer Engine–based quantization reduces VRAM usage while maintaining strong perception fidelity.
|
| 70 |
+
* **Higher Throughput**: Improved tokens per second and image processing speed.
|
| 71 |
+
* **Lower Memory Footprint**: Better deployment feasibility on Hopper-class and compatible GPUs.
|
| 72 |
+
* **Production-Friendly Efficiency**: Ideal for real-time multimodal systems requiring compact yet powerful perception models.
|
| 73 |
+
|
| 74 |
+
## Quick Start with Transformers
|
| 75 |
+
|
| 76 |
+
```python
|
| 77 |
+
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
|
| 78 |
+
from qwen_vl_utils import process_vision_info
|
| 79 |
+
import torch
|
| 80 |
+
|
| 81 |
+
# Load the FP8-compressed ZwZ-8B model
|
| 82 |
+
model = Qwen3VLForConditionalGeneration.from_pretrained(
|
| 83 |
+
"prithivMLmods/ZwZ-8B-FP8",
|
| 84 |
+
torch_dtype="auto",
|
| 85 |
+
device_map="auto"
|
| 86 |
+
)
|
| 87 |
+
|
| 88 |
+
processor = AutoProcessor.from_pretrained(
|
| 89 |
+
"prithivMLmods/ZwZ-8B-FP8"
|
| 90 |
+
)
|
| 91 |
+
|
| 92 |
+
messages = [
|
| 93 |
+
{
|
| 94 |
+
"role": "user",
|
| 95 |
+
"content": [
|
| 96 |
+
{
|
| 97 |
+
"type": "image",
|
| 98 |
+
"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
|
| 99 |
+
},
|
| 100 |
+
{"type": "text", "text": "Analyze the fine-grained details in this image."},
|
| 101 |
+
],
|
| 102 |
+
}
|
| 103 |
+
]
|
| 104 |
+
|
| 105 |
+
text = processor.apply_chat_template(
|
| 106 |
+
messages, tokenize=False, add_generation_prompt=True
|
| 107 |
+
)
|
| 108 |
+
|
| 109 |
+
image_inputs, video_inputs = process_vision_info(messages)
|
| 110 |
+
|
| 111 |
+
inputs = processor(
|
| 112 |
+
text=[text],
|
| 113 |
+
images=image_inputs,
|
| 114 |
+
videos=video_inputs,
|
| 115 |
+
padding=True,
|
| 116 |
+
return_tensors="pt",
|
| 117 |
+
).to("cuda")
|
| 118 |
+
|
| 119 |
+
generated_ids = model.generate(**inputs, max_new_tokens=256)
|
| 120 |
+
|
| 121 |
+
generated_ids_trimmed = [
|
| 122 |
+
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
|
| 123 |
+
]
|
| 124 |
+
|
| 125 |
+
output_text = processor.batch_decode(
|
| 126 |
+
generated_ids_trimmed,
|
| 127 |
+
skip_special_tokens=True,
|
| 128 |
+
clean_up_tokenization_spaces=False
|
| 129 |
+
)
|
| 130 |
+
|
| 131 |
+
print(output_text)
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
## Intended Use
|
| 135 |
+
|
| 136 |
+
* Real-time multimodal perception systems
|
| 137 |
+
* Robotics and embodied AI
|
| 138 |
+
* GUI agents
|
| 139 |
+
* OCR-heavy and structured visual environments
|
| 140 |
+
* Edge deployment scenarios requiring single-pass inference
|
| 141 |
+
|
| 142 |
+
## Limitations & Risks
|
| 143 |
+
|
| 144 |
+
* FP8 requires compatible GPU architectures for optimal acceleration.
|
| 145 |
+
* While compression maintains strong fidelity, extremely fine-grained edge cases may show minor precision differences compared to full BF16.
|
| 146 |
+
* Users are responsible for ethical and lawful deployment.
|