Image-Text-to-Text
Transformers
Safetensors
qwen3_vl
knowledge-distillation
multimodal-reasoning
conversational
Instructions to use SeonghoonYu/Masking-KD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SeonghoonYu/Masking-KD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SeonghoonYu/Masking-KD") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("SeonghoonYu/Masking-KD") model = AutoModelForMultimodalLM.from_pretrained("SeonghoonYu/Masking-KD", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SeonghoonYu/Masking-KD with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SeonghoonYu/Masking-KD" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SeonghoonYu/Masking-KD", "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/SeonghoonYu/Masking-KD
- SGLang
How to use SeonghoonYu/Masking-KD 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 "SeonghoonYu/Masking-KD" \ --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": "SeonghoonYu/Masking-KD", "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 "SeonghoonYu/Masking-KD" \ --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": "SeonghoonYu/Masking-KD", "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 SeonghoonYu/Masking-KD with Docker Model Runner:
docker model run hf.co/SeonghoonYu/Masking-KD
|
Download README.md from SeonghoonYu/Masking-KD: direct link, hf CLI and curl.
- Browser
- Download file 2.7 kB
-
https://huggingface.co/SeonghoonYu/Masking-KD/resolve/main/README.md
- Command line
-
hf download hf://SeonghoonYu/Masking-KD/README.md
-
curl -L -o README.md https://huggingface.co/SeonghoonYu/Masking-KD/resolve/main/README.md
2.7 kB
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-VL-2B-Thinking | |
| datasets: | |
| - SeonghoonYu/Masking-KD-Rollouts | |
| pipeline_tag: image-text-to-text | |
| library_name: transformers | |
| tags: | |
| - knowledge-distillation | |
| - multimodal-reasoning | |
| - qwen3_vl | |
| # Masking-KD (Qwen3-VL-2B-Thinking) | |
| Checkpoint for **Hide to See: Reasoning-prefix Masking for Visual-anchored Thinking in VLM Distillation** (NeurIPS 2026). | |
| [Qwen3-VL-2B-Thinking](https://huggingface.co/Qwen/Qwen3-VL-2B-Thinking) distilled from [Qwen3-VL-8B-Thinking](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking) with Masking-KD. | |
| Paper: https://arxiv.org/abs/2605.11651 | Code: https://github.com/Seonghoon-Yu/Masking-KD | |
| ## Training | |
| | | | | |
| |---|---| | |
| | Student / Teacher | Qwen3-VL-2B-Thinking / Qwen3-VL-8B-Thinking | | |
| | Data | [SeonghoonYu/Masking-KD-Rollouts](https://huggingface.co/datasets/SeonghoonYu/Masking-KD-Rollouts): 19,387 correct greedy teacher rollouts on ViRL39K | | |
| | Schedule | 2 epochs (76 steps), global batch size 512, learning rate 1e-6 | | |
| ## Usage | |
| The model was trained with the reasoning instruction below appended to each question. | |
| ```python | |
| from transformers import AutoModelForImageTextToText, AutoProcessor | |
| model = AutoModelForImageTextToText.from_pretrained("SeonghoonYu/Masking-KD", dtype="auto", device_map="auto") | |
| processor = AutoProcessor.from_pretrained("SeonghoonYu/Masking-KD") | |
| question = "Find x." | |
| instruction = ( | |
| "You first think through the reasoning process as an internal monologue, enclosed within <think> </think> tags. " | |
| "Then, provide your final answer enclosed within \\boxed{}." | |
| ) | |
| messages = [{ | |
| "role": "user", | |
| "content": [ | |
| {"type": "image", "image": "path/to/image.png"}, | |
| {"type": "text", "text": f"{question}\n\n{instruction}"}, | |
| ], | |
| }] | |
| inputs = processor.apply_chat_template( | |
| messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt" | |
| ).to(model.device) | |
| outputs = model.generate(**inputs, max_new_tokens=4096, do_sample=False) | |
| print(processor.decode(outputs[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| To reproduce the benchmark evaluation (Geo3K, MathVista, We-Math, MMK12, MathVerse, LogicVista, MMMU-Pro): | |
| ```bash | |
| git clone https://github.com/Seonghoon-Yu/Masking-KD && cd Masking-KD | |
| python evaluation/prepare_data.py | |
| bash scripts/eval.sh SeonghoonYu/Masking-KD | |
| ``` | |
| ## Citation | |
| ```bibtex | |
| @inproceedings{yu2026hide, | |
| title = {Hide to See: Reasoning-prefix Masking for Visual-anchored Thinking in VLM Distillation}, | |
| author = {Yu, Seonghoon and Nam, Dongjun and Lee, Byung-Kwan and Son, Jeany}, | |
| booktitle = {Advances in Neural Information Processing Systems (NeurIPS)}, | |
| year = {2026} | |
| } | |
| ``` | |