Instructions to use YutaSugimura/Kairyo-Qwen3.5-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YutaSugimura/Kairyo-Qwen3.5-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="YutaSugimura/Kairyo-Qwen3.5-9B") 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("YutaSugimura/Kairyo-Qwen3.5-9B") model = AutoModelForMultimodalLM.from_pretrained("YutaSugimura/Kairyo-Qwen3.5-9B", 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 YutaSugimura/Kairyo-Qwen3.5-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YutaSugimura/Kairyo-Qwen3.5-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YutaSugimura/Kairyo-Qwen3.5-9B", "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/YutaSugimura/Kairyo-Qwen3.5-9B
- SGLang
How to use YutaSugimura/Kairyo-Qwen3.5-9B 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 "YutaSugimura/Kairyo-Qwen3.5-9B" \ --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": "YutaSugimura/Kairyo-Qwen3.5-9B", "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 "YutaSugimura/Kairyo-Qwen3.5-9B" \ --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": "YutaSugimura/Kairyo-Qwen3.5-9B", "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 YutaSugimura/Kairyo-Qwen3.5-9B with Docker Model Runner:
docker model run hf.co/YutaSugimura/Kairyo-Qwen3.5-9B
Kairyo-Qwen3.5-9B
Unofficial. Kairyo-Qwen3.5-9B is Qwen/Qwen3.5-9B distilled with Qwen/Qwen3.8-27B as the teacher. It is not released by, affiliated with, or endorsed by the Qwen team or Alibaba Cloud. It is not a "Qwen3.8-9B".
Kairyo (ๆน่ฏ) means "improvement" in Japanese.
- Student / base model: Qwen/Qwen3.5-9B
- Teacher: Qwen/Qwen3.8-27B (served as Qwen/Qwen3.8-27B-FP8)
- Method: single-stage off-policy distillation โ supervised training on verified teacher responses plus a top-20 logit (KL) loss, on short reasoning tasks and long inputs (8kโ100k tokens) mixed from the start, with long-input samples weighted ร4 in the loss; one LoRA, merged back into the base weights
- Kept from the base checkpoint, unchanged: vision encoder (image input) and the MTP (multi-token prediction) head
- License: Apache 2.0
- GGUF: YutaSugimura/Kairyo-Qwen3.5-9B-GGUF (Q8_0 + mmproj)
Results
Thinking mode, maximum 16,384 new tokens, temperature 0.6, top_p 0.95, top_k 20, no presence penalty, vLLM, bf16 weights (the teacher in FP8). All three models were given the same prompts and settings.
| Qwen3.5-9B (base) | Kairyo-Qwen3.5-9B | Qwen3.8-27B (teacher) | |
|---|---|---|---|
| GSM8K (250, test) | 77.6 | 95.0 | 98.4 |
| MATH-500 (250) | 70.4 | 90.8 | 96.4 |
| MMLU-Pro (300) | 74.0 | 79.5 | 84.0 |
| HumanEval (164) | 93.9 | 94.7 | 99.4 |
| LongBench v2 short / medium (67 / 65) | 53.7 / 44.6 | 52.3 / 52.3 | 68.7 / 66.2 |
| MRCR 8-needle, 16k / 32k / 64k (16 / 17 / 17) | 0.999 / 0.946 / 0.882 | 0.837 / 0.646 / 0.659 | 0.839 / 0.819 / 0.777 |
| Responses cut off at 16k (GSM8K / MATH-500 / MMLU-Pro) | 20% / 30% / 16% | 0% / 4% / 2% | 0% / 2% / 0% |
| Mean response length, GSM8K / MATH-500 (tokens) | 5,951 / 8,762 | 407 / 2,285 | 385 / 1,633 |
- Numbers in parentheses are the number of items. Kairyo's GSM8K, MATH-500, MMLU-Pro, HumanEval and LongBench v2 short scores are the mean of 4 runs (ranges 94.4โ96.0, 89.6โ92.4, 78.3โ80.7, 92.1โ98.2 and 44.8โ59.7); everything else is a single run. Running the same model again moves LongBench v2 short by up to 14.9 points and MMLU-Pro by up to 4.7 points.
- For long inputs the maximum context was 131,072 tokens; LongBench v2 documents were truncated in the middle to 110k tokens. MRCR is OpenAI's multi-round co-reference task (find a specific earlier request in a long conversation and reproduce the reply).
- Grading: math answers with
math_verify, MMLU-Pro by the chosen letter, HumanEval by its unit tests. The evaluation harness is our own, so the numbers are not directly comparable with official reports.
How to read these numbers
- Most of the gain on short problems comes from shorter reasoning. Within a 16k budget the base model often runs out of tokens. On the items the base model finished, it is slightly better: GSM8K 97.0 vs 95.6, MATH-500 100.0 vs 96.9, MMLU-Pro 88.4 vs 84.1 (this subset favours the base model). Answering in a fraction of the tokens also makes Kairyo much faster in practice.
- Many of the base model's cut-off responses are repetition loops, e.g. it repeats
I'll box \boxed{8}.after reaching the answer (GSM8K 39 of 50, MATH-500 32 of 74). A larger budget does not end these. Even if every other cut-off response were correct, the base model would reach at most 82.0 on GSM8K and 87.2 on MATH-500. - On MMLU-Pro the advantage may not survive a larger budget: only 7 of the base model's 49 cut-off responses are loops, and with more tokens it could reach up to 88.0. We have not measured this.
- The base model was run with the same sampling as Kairyo, which matches Qwen's recommendation for precise coding tasks but not its general recommendation (temperature 1.0, presence penalty 1.5). A presence penalty may reduce the base model's loops.
- Mixing in long inputs from the start did not keep long-conversation retrieval. MRCR 8-needle is below the base model at all three lengths (see Known weaknesses). A two-stage variant we also trained (short reasoning first, then the long inputs at a lower learning rate; not released) scored higher on MRCR (0.893 / 0.775 / 0.776) and the same on the short tasks. The long-input data contains a synthetic task of the same form as MRCR, so the MRCR scores are partly in-distribution.
- Training prompts that share a 13-gram with any evaluation item were removed (for long documents, 20 or more shared 13-grams). The training data contains the same kinds of problems as GSM8K and MATH; MMLU-Pro has no counterpart.
Known weaknesses
- Long-conversation retrieval is below the base model at all three lengths (MRCR 8-needle 0.837 vs 0.999 at 16k, 0.646 vs 0.946 at 32k, 0.659 vs 0.882 at 64k). The differences at 32k (โ0.30 ยฑ 0.20, 95% interval) and 64k (โ0.22 ยฑ 0.19) are significant; at 16k (โ0.16 ยฑ 0.17) it is borderline.
- No significant gain on long-document reading. LongBench v2 is +3.0 ยฑ 6.5 points over the base model (132 items), far below the teacher.
- No gain on code generation (HumanEval is unchanged).
- Image input was not trained or benchmarked. The vision encoder is the base model's, unchanged; we only checked simple questions (e.g. identifying colours).
- Not evaluated in languages other than English. The training prompts are English.
- Hard math problems still hit the 16k limit about 4% of the time; allow 32k tokens or more for reasoning.
- The Q8_0 GGUF was not benchmarked separately (all scores above use the bf16 weights).
- No additional safety training was done; safety behaviour comes from the base model and the teacher's responses.
Training
Data
Two sets of teacher responses, mixed from the start and trained in a single stage (see Training below): 3,764 short-reasoning responses (math, code, science and general instructions) and 1,471 long-input responses (8kโ100k tokens: multi-hop QA, QA over books and movie scripts, and recall from long conversations). The inputs come from public datasets; the training data itself is not released.
Generating and filtering the teacher's responses
- Teacher: Qwen3.8-27B-FP8 on vLLM, thinking mode, temperature 1.0, top_p 0.95, top_k 20, returning the top-20 log-probabilities for every generated token.
- Short reasoning:
reasoning_effort: medium, up to 16,384 tokens. Of 6,120 responses, 3,764 were kept. Math answers were checked against the reference, code was run against its tests, and multiple-choice answers were matched. Responses that were cut off or looped (zlib compression ratio) were dropped. Prompts without a correct response were retried in up to two more rounds, and the shortest correct response was kept. General-instruction prompts have no reference answer, so their responses were kept unless they were cut off or looped. - Long inputs: up to 12,288 tokens,
reasoning_effort: mediumfor QA andxhighfor the conversation task. Of 2,610 responses, 1,471 were kept: QA answers by token F1 against the reference (โฅ 0.8 for multi-hop, โฅ 0.4 for QA over books and scripts), the conversation task by string similarity (โฅ 0.95) with the required prefix.
Training
- Loss: 0.5 ร cross-entropy on the teacher's tokens + 0.5 ร forward KL from the teacher's top-20 distribution (temperature 1.0), on response tokens only.
- LoRA (bf16, not quantized): r = 32, alpha = 32, dropout 0, on the language model's attention, linear-attention and MLP projections (200 modules, 80.2M trainable parameters). Vision encoder and MTP head frozen.
- Long-input samples weighted ร4 in the loss. The loss is averaged over response tokens and the long-input responses are short, so this weight brings them to about 21% of the loss.
- Single stage: AdamW (8-bit), learning rate 1e-4, warmup 3%, 1 epoch, effective batch size 16, max sequence length 114,688, 8,999 samples (3,764 ร 2 short-reasoning + 1,471 long-input), 563 steps. Unsloth on one H200 NVL, about 4 hours.
- The LoRA was merged into the bf16 base weights. Only the 200 LoRA-targeted tensors differ from Qwen/Qwen3.5-9B.
Usage
The model loads and runs like Qwen/Qwen3.5-9B; see its card for transformers, vLLM and SGLang examples. The chat template is unchanged, and thinking mode is on by default.
Recommended sampling (the settings used above): temperature 0.6, top_p 0.95, top_k 20, min_p 0. Allow at least 32k tokens of context so that reasoning is not cut off. Long inputs were tested up to 131,072 tokens.
Tested:
# vLLM 0.32.0 (text only)
vllm serve YutaSugimura/Kairyo-Qwen3.5-9B --language-model-only --max-model-len 131072
# llama.cpp with the GGUF repo: image input and MTP speculative decoding
llama-server -m Kairyo-Qwen3.5-9B-Q8_0.gguf --mmproj mmproj-Kairyo-Qwen3.5-9B-F16.gguf --spec-type draft-mtp -c 32768
License
Apache 2.0, the same as Qwen/Qwen3.5-9B and Qwen/Qwen3.8-27B (see LICENSE).
Acknowledgements
Thanks to the Qwen team for Qwen3.5-9B and Qwen3.8-27B, and to the Unsloth, vLLM and llama.cpp projects.
ๆฅๆฌ่ชใฎๆฆ่ฆ
Kairyo-Qwen3.5-9B ใฏใQwen3.8-27B ใๆๅธซใซใใฆ Qwen3.5-9B ใ่ธ็ใใ้ๅ ฌๅผใฎใขใใซใงใ๏ผQwen ใใผใ ใฎๅ ฌๅผใขใใซใงใฏใใใพใใ๏ผใ ็ญใๆจ่ซๅ้กใจ้ทใๅ ฅๅ๏ผ8kใ100k ใใผใฏใณ๏ผใฎๆๅธซใใผใฟใๆๅใใๆททใใฆใ1 ๆฎตใง่ธ็ใใฆใใพใใ
- ๅ็ญใฎไธ้ 16k ใใผใฏใณใฎๆกไปถใงใ่จ็ฎใปๆฐๅญฆใป็ฅ่ญๅ้กใๅ ใฎ 9B ใใไธใใ๏ผGSM8K 77.6โ95.0ใMATH-500 70.4โ90.8ใMMLU-Pro 74.0โ79.5๏ผใ ่ใใ็ญใใชใฃใใถใ้ใ็ญใใพใใไธใใฃใๅใฎๅคงๅใฏใๅ ใฎ 9B ใไธ้ใงๅใใฆใใ๏ผๅคใใฏๅใ่กใฎ็นฐใ่ฟใ๏ผใใจใซใใใพใใ
- ้ทใไผ่ฉฑใใ็นๅฎใฎไพ้ ผใๆขใ่ชฒ้ก๏ผMRCR๏ผใฏใ16kใป32kใป64k ใฎใฉใใงใๅ ใฎ 9B ใใไธใงใใ้ทใๆๆธใฎ่ชญ่งฃ๏ผLongBench v2๏ผใจใณใผใ๏ผHumanEval๏ผใฏๅ ใฎ 9B ใจๅคใใใพใใใ
- ็ปๅๅ ฅๅใจ MTP ใฏๅ ใฎใพใพไฝฟใใพใใใ็ปๅใฎๆง่ฝใฏๆธฌใฃใฆใใพใใใๆฅๆฌ่ชใฎๆง่ฝใๆธฌใฃใฆใใพใใใ
- Downloads last month
- 37