--- library_name: transformers pipeline_tag: text-generation base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B base_model_relation: finetune language: - en tags: - optd - on-policy-distillation - transition-distillation - reasoning - text-generation-inference --- # OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain [arXiv](https://arxiv.org/abs/2610.28048) · [Hugging Face Paper](https://huggingface.co/papers/2610.28048) · [All OPTD models](https://huggingface.co/collections/ModalityDance/optd) An OPTD model trained from [deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B) with specialists in **mathematics, coding, and instruction following**. This is a complete model that can be used directly for text generation. OPTD teaches a student both the teacher’s final prediction and how its predictions change across layers, using responses generated by the student. This checkpoint accompanies *On-Policy Transition Distillation*. **Three-domain** adds an instruction-following specialist to the math and coding teachers. Use the model’s **native reasoning chat template**, supplied with its tokenizer. ## Quick start Install PyTorch for your hardware, Transformers, and Accelerate: ```bash python -m pip install torch transformers accelerate ``` The example below uses BF16. Teacher models and the OPTD training framework are not required for inference. ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto" ) messages = [{"role": "user", "content": "Solve 2x + 5 = 17."}] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) inputs = tokenizer(text, add_special_tokens=False, return_tensors="pt").to(model.device) with torch.inference_mode(): output = model.generate( **inputs, max_new_tokens=1024, do_sample=True, temperature=0.7, top_p=0.95 ) response = output[0, inputs.input_ids.shape[-1]:] print(tokenizer.decode(response, skip_special_tokens=True)) ``` The short generation limit is for the example. Paper evaluation uses benchmark-specific token limits and sample counts. ## Download ```bash hf download ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain --local-dir models/optd-deepseek-r1-distill-qwen-1.5b-threedomain ``` Install `huggingface_hub` to use the `hf` command. To load a downloaded copy, replace `model_id` with its local directory. ## Training and release details
Configuration and file contents - Student initialization: `deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B`. - Training updates: 150. - Intermediate layers (zero-based): 11 / 15 / 19. - Training domains: mathematics, coding, and instruction following. - Full BF16 safetensors weights, tokenizer, and generation configuration are included. - `training_metadata.json` records the training configuration; `checksums.json` records checkpoint/tokenizer SHA256 hashes. - Optimizer state is not included.
## Evaluation Compare this checkpoint using the paper’s prompt mode, dataset revisions, sample counts, and graders. The example above demonstrates inference rather than reproducing benchmark scores. Generated answers can be incorrect; execute generated code only in an isolated sandbox. ## Citation ```bibtex @misc{optd2026, title = {On-Policy Transition Distillation}, author = {You, Runyang and Li, Yongqi and Yu, Tiezheng and Li, Wenjie}, year = {2026}, eprint = {2610.28048}, archivePrefix = {arXiv}, primaryClass = {cs.CL}, url = {https://arxiv.org/abs/2610.28048} } ``` ## License and attribution The underlying student and specialist models retain their respective upstream license terms. Consult the linked base model's license and notices before redistribution or deployment. No new license grant for upstream model weights is implied by this model card.