STAR-4B / README.md
Yizou's picture
Upload 17 files
60b5c9b verified
|
Raw History Blame Contribute Delete
2.71 kB
---
library_name: transformers
pipeline_tag: image-text-to-text
base_model: Qwen/Qwen3.5-4B
base_model_relation: finetune
license: apache-2.0
tags:
- vision-language
- visual-question-answering
---
# STAR-Qwen3.5-4B
STAR-Qwen3.5-4B is a vision-language student fine-tuned from [Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B). This release contains the full BF16 student weights from training step 60, along with the tokenizer, image processor and chat template used for inference.
The student trained on 6,176 pairs of original and locally edited images. Each pair shares a question, with a different correct answer in each image. A frozen teacher uses an evidence crop and its mean-color control to form token-specific distillation targets. At inference the student answers directly from the image and question.
## Run locally
Install PyTorch and its matching torchvision build, Transformers with Qwen3.5 support, Accelerate and Pillow. Set model_dir to the downloaded repository. The example uses a generated red square. Its image and text preprocessing was verified with Transformers 5.20.1.
```python
import torch
from PIL import Image
from transformers import AutoModelForImageTextToText, AutoProcessor
model_dir = "./STAR-Qwen3.5-4B"
processor = AutoProcessor.from_pretrained(model_dir)
model = AutoModelForImageTextToText.from_pretrained(
model_dir, dtype=torch.bfloat16, device_map="auto"
).eval()
messages = [{"role": "user", "content": [
{"type": "image", "image": Image.new("RGB", (224, 224), "red")},
{"type": "text", "text": "What color is the square?"},
]}]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True, enable_thinking=False,
return_dict=True, return_tensors="pt",
).to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, do_sample=False, max_new_tokens=32)
answer = processor.batch_decode(
output[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True
)[0]
print(answer)
```
## Evaluation
Accuracy is expressed as a percentage. Avg6 is the unweighted mean of the six benchmark scores. These are the selected checkpoint's reported results under greedy, non-thinking evaluation with an 8,192-token output limit.
| Model | V* | Zoom | HR-Bench 4K | HR-Bench 8K | MME-RealWorld EN | MME-RealWorld CN | Avg6 |
|---|---:|---:|---:|---:|---:|---:|---:|
| Qwen3.5-4B | 81.68 | 49.35 | 86.25 | 82.75 | 63.81 | 63.77 | 71.27 |
| STAR-Qwen3.5-4B | 94.76 | 60.95 | 87.50 | 84.38 | 77.76 | 70.51 | 79.31 |
## License
These fine-tuned weights are released under the Apache License 2.0. See [LICENSE](./LICENSE) and the [upstream model card](https://huggingface.co/Qwen/Qwen3.5-4B).