Qwen3.8 4B Distilled is a 4-billion-parameter reasoning model created by distilling outputs from Qwen3.8-Max into the smaller Qwen3-4B-Thinking-2507 student model.
This is a Qwen3-architecture student model distilled from Qwen3.8-Max-generated outputs.
The repository does not claim that the underlying architecture or original weights are from Qwen3.8-Max. Qwen3.8-Max is the teacher whose generated responses and reasoning traces were used as training targets for the 4B student.
This is an independently fine-tuned community model and is not an official Qwen or Alibaba release.
The dataset contains teacher-generated examples across areas including:
Mathematics
Programming
General reasoning
Scientific reasoning
Instruction following
Limited tool use
Teacher responses were generated by qwen3.8-max-preview. Visible <think>...</think> reasoning traces were retained when present in the dataset.
What “Distilled” Means Here
This model uses sequence-level knowledge distillation.
The smaller student was trained on complete responses produced by the larger teacher. This transfers parts of the teacher's behavior, reasoning patterns, solution structure, and response style without copying the teacher's architecture or weights.
Therefore:
The architecture and original student weights come from Qwen3-4B-Thinking-2507.
The distillation targets come from Qwen3.8-Max-generated outputs.
The resulting checkpoint remains a 4B Qwen3 model.
The model is not expected to reproduce the full capabilities of Qwen3.8-Max.
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
34MODEL_ID ="Ma7ee7/Qwen3.8_4B_Distilled"56tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)78model = AutoModelForCausalLM.from_pretrained(9 MODEL_ID,10 torch_dtype="auto",11 device_map="auto",12)1314messages =[15{16"role":"user",17"content":(18"A farmer has 120 meters of fencing and wants to build a "19"rectangular enclosure. What dimensions maximize the area?"20),21}22]2324prompt = tokenizer.apply_chat_template(25 messages,26 tokenize=False,27 add_generation_prompt=True,28)2930inputs = tokenizer(prompt, return_tensors="pt").to(model.device)3132with torch.inference_mode():33 output_ids = model.generate(34**inputs,35 max_new_tokens=4096,36 do_sample=True,37 temperature=0.6,38 top_p=0.95,39 top_k=20,40 repetition_penalty=1.05,41)4243new_tokens = output_ids[0, inputs["input_ids"].shape[-1]:]44response = tokenizer.decode(new_tokens, skip_special_tokens=True)4546print(response)
Pipeline Usage
python
1from transformers import pipeline
23MODEL_ID ="Ma7ee7/Qwen3.8_4B_Distilled"45generator = pipeline(6 task="text-generation",7 model=MODEL_ID,8 device_map="auto",9 torch_dtype="auto",10)1112messages =[13{14"role":"user",15"content":"Explain why the square root of 2 is irrational.",16}17]1819result = generator(20 messages,21 max_new_tokens=4096,22 do_sample=True,23 temperature=0.6,24 top_p=0.95,25 top_k=20,26 repetition_penalty=1.05,27)2829print(result[0]["generated_text"])
Recommended Generation Settings
Setting
Recommended value
Temperature
0.6
Top-p
0.95
Top-k
20
Repetition penalty
1.0–1.1
Maximum new tokens
4096 or higher
For difficult mathematics, programming, or long-form reasoning, allow enough output tokens for the model to complete both its reasoning and final answer.
Thinking Output
The model inherits a thinking-oriented chat format from Qwen3-4B-Thinking-2507. Depending on the inference application and reasoning parser, visible reasoning may be displayed in a form similar to:
text
1<think>
2Reasoning process
3</think>
45Final answer
Some applications may hide the thinking section or render it separately from the final answer.
This is a 4B student model and does not contain the complete knowledge or capabilities of Qwen3.8-Max.
Distillation transfers patterns from teacher-generated outputs; it does not copy the teacher's architecture or weights.
Teacher-generated answers may contain factual, mathematical, or programming errors.
Visible reasoning traces should not automatically be assumed to be correct.
The model may hallucinate or produce confidently incorrect answers.
Tool-use examples represent only a small portion of the training data.
The training mixture is primarily English.
The training dataset may include prompts derived from common evaluation benchmarks.
Results on overlapping benchmarks should not be treated as uncontaminated evaluations without additional controls.
Outputs should be reviewed before use in high-stakes medical, financial, legal, or security-sensitive settings.
License and Training-Data Notice
This repository is published under the Apache License 2.0.
That license does not override any separate licenses, attribution requirements, or usage terms associated with:
The Qwen3 base model
The Qwen3.8-Max teacher provider
The distillation dataset
Upstream datasets from which prompts were sourced
Users are responsible for reviewing the base model license, the distillation dataset card, its provenance documentation, and any applicable upstream terms before use or redistribution.
Acknowledgements
This model builds upon work from:
The Qwen team for Qwen3-4B-Thinking-2507
r0b0tlab for the Qwen3.8-Max Distillation 50K dataset