Qwen3-VL-4B-English-Thinking
An English-only, vocabulary-pruned version of Qwen3-VL-4B-Thinking with 30.7% smaller vocabulary and more efficient tokenization for English text.
Model Specifications
Key Benefits
1. Effective Larger Context for English
Since non-English tokens are removed, English text tokenizes more efficiently:
- Same text uses fewer tokens
- 262K context window goes further for English content
- Estimated 20-30% more English text fits in context
2. Faster Tokenization
- Smaller vocabulary = faster token lookup
- Reduced embedding table size
- Marginally faster inference
3. Preserved Capabilities
- All English language capabilities
- Programming/code tokens (ASCII preserved)
- JSON, XML, Markdown support
- Vision-language multimodal
- Chain-of-thought reasoning (think tokens)
- Tool calling support
Technical Details
Architecture
Vision Encoder
Vocabulary Pruning Details
Special Tokens Preserved
All special tokens are preserved for full functionality:
Usage
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
model = Qwen2VLForConditionalGeneration.from_pretrained(
"DavidrPatton/Qwen3-VL-4B-English-Thinking",
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained(
"DavidrPatton/Qwen3-VL-4B-English-Thinking"
)
# Text-only example
messages = [{"role": "user", "content": "Explain quantum computing in simple terms."}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=text, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(output[0], skip_special_tokens=True))
With Images
from PIL import Image
image = Image.open("example.jpg")
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Describe what you see in this image."}
]
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=text, images=[image], return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(output[0], skip_special_tokens=True))
Hardware Requirements
Recommended: NVIDIA RTX 4070 Ti or better (16GB VRAM)
Model Files
Limitations
- English Only: Non-English languages are not supported
- Not Fine-Tuned: This is a vocabulary-pruned version, not a fine-tuned model
- Token ID Remapping: Some applications may need the token_remapper for compatibility
- Inherits base model capabilities and limitations
How It Works
The vocabulary pruning process:
- Analyzed all 151,669 tokens in the original Qwen3-VL vocabulary
- Categorized tokens by script (ASCII, CJK, Cyrillic, Arabic, etc.)
- Preserved ASCII tokens (English + programming), special tokens, and essential symbols
- Removed 46,500 non-English tokens
- Remapped token IDs to maintain contiguous vocabulary
- Adjusted embedding layers to match new vocabulary size
License
Apache 2.0 - Same as the base Qwen model.
Acknowledgments