Views
No views yet
| Specification | Original (Qwen3-VL-4B) | This Model (English-Only) | Improvement |
|---|---|---|---|
| Vocabulary Size | 151,669 tokens | 105,169 tokens | -30.7% (46,500 tokens removed) |
| Context Window | 262,144 tokens | 262,144 tokens | Same max, but ~20-30% more effective for English |
| Parameters | ~4B | ~4B | Same |
| Model Size | ~9.2 GB | ~9.2 GB | Same (weights unchanged) |
| Hidden Size | 2,560 | 2,560 | Same |
| Layers | 36 | 36 | Same |
| Attention Heads | 32 | 32 | Same |
| dtype | bfloat16 | bfloat16 | Same |
| Component | Value |
|---|---|
| Model Type | Qwen3VLForConditionalGeneration |
| Hidden Size | 2,560 |
| Intermediate Size | 9,728 |
| Num Layers | 36 |
| Num Attention Heads | 32 |
| Num KV Heads | 8 (GQA) |
| Head Dim | 128 |
| RoPE Theta | 5,000,000 |
| Max Position Embeddings | 262,144 |
| Component | Value |
|---|---|
| Type | ViT (Vision Transformer) |
| Hidden Size | 1,024 |
| Depth | 24 layers |
| Num Heads | 16 |
| Patch Size | 16 |
| Spatial Merge Size | 2 |
| Category | Tokens Kept | Tokens Removed |
|---|---|---|
| ASCII (English + Code) | 94,351 | - |
| Special Tokens | 33 | - |
| Whitespace | 12 | - |
| Other (Punctuation, etc.) | 10,773 | - |
| Chinese/Japanese/Korean | - | 25,665 |
| Cyrillic (Russian, etc.) | - | 4,129 |
| Arabic | - | 3,643 |
| Korean | - | 3,544 |
| Hebrew | - | 3,164 |
| Thai | - | 2,571 |
| Japanese (additional) | - | 1,541 |
| Vietnamese | - | 1,174 |
| Other Unicode | - | 780+ |
| Token | Purpose |
|---|---|
<|im_start|> / <|im_end|> | Chat format markers |
<|vision_start|> / <|vision_end|> | Vision input markers |
<|image_pad|> / <|video_pad|> | Image/video padding |
<think> / </think> | Chain-of-thought reasoning |
<tool_call> / </tool_call> | Tool/function calling |
<|fim_prefix|> / <|fim_middle|> / <|fim_suffix|> | Fill-in-middle coding |
1from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
2
3model = Qwen2VLForConditionalGeneration.from_pretrained(
4 "DavidrPatton/Qwen3-VL-4B-English-Thinking",
5 torch_dtype="auto",
6 device_map="auto"
7)
8processor = AutoProcessor.from_pretrained(
9 "DavidrPatton/Qwen3-VL-4B-English-Thinking"
10)
11
12# Text-only example
13messages = [{"role": "user", "content": "Explain quantum computing in simple terms."}]
14
15text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
16inputs = processor(text=text, return_tensors="pt").to(model.device)
17
18output = model.generate(**inputs, max_new_tokens=512)
19print(processor.decode(output[0], skip_special_tokens=True))1from PIL import Image
2
3image = Image.open("example.jpg")
4
5messages = [
6 {
7 "role": "user",
8 "content": [
9 {"type": "image", "image": image},
10 {"type": "text", "text": "Describe what you see in this image."}
11 ]
12 }
13]
14
15text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
16inputs = processor(text=text, images=[image], return_tensors="pt").to(model.device)
17
18output = model.generate(**inputs, max_new_tokens=512)
19print(processor.decode(output[0], skip_special_tokens=True))| Configuration | VRAM Required |
|---|---|
| Full Precision (fp32) | ~18 GB |
| Half Precision (fp16/bf16) | ~10 GB |
| 8-bit Quantized | ~6 GB |
| 4-bit Quantized | ~4 GB |
| File | Size | Description |
|---|---|---|
model-00001-of-00002.safetensors | 4.95 GB | Model weights (part 1) |
model-00002-of-00002.safetensors | 4.22 GB | Model weights (part 2) |
tokenizer.json | 11.4 MB | Pruned English vocabulary |
token_remapper.json | 4.4 MB | Original to pruned token ID mapping |
token_remapper.pt | 2.1 MB | PyTorch remapper tensor |
vocab.json | 2.8 MB | Vocabulary dictionary |
merges.txt | 1.7 MB | BPE merge rules |
config.json | 1.6 KB | Model configuration |