---
title: Qwen3.8-0.8B-Distill
canonical_url: "https://www.modelscope.cn/models/conanfans/Qwen3.8-0.8B-Distill"
md_url: "https://www.modelscope.cn/models/conanfans/Qwen3.8-0.8B-Distill.md"
repository: conanfans/Qwen3.8-0.8B-Distill
last_updated: 2026-09-11
license: apache-2.0
pipeline_tag: image-text-to-text
tasks:
  - image-text-to-text
model_type:
  - qwen3_5_text
architectures:
  - Qwen3_5ForCausalLM
base_model:
  - Qwen/Qwen3.5-0.8B
base_model_relation: finetune
parameters: 752.4M
tensor_type:
  - BF16
library_name:
  - pytorch
  - transformer
  - safetensors
frameworks:
  - Pytorch
language:
  - en
downloads: 27
stars: 2
tags:
  - qwen3.8
  - qwen3.5
  - distillation
  - reasoning
  - sft
  - edge
  - conanfans
---

# Qwen3.8-0.8B-Distill

> Qwen3.8-0.8B-Distill - conanfans 在 ModelScope 开源的模型。Qwen3.8-0.8B-Distill

conanfans/Qwen3.8-0.8B-Distill 是 ModelScope 魔搭社区上的 752.4M 参数image-text-to-text模型，采用 apache-2.0 许可，基于 Qwen/Qwen3.5-0.8B 构建。

- **Repository**: conanfans/Qwen3.8-0.8B-Distill
- **License**: apache-2.0
- **Tasks**: image-text-to-text
- **Parameters**: 752.4M
- **Base model**: Qwen/Qwen3.5-0.8B
- **Tags**: qwen3.8, qwen3.5, distillation, reasoning, sft, edge, conanfans
- **Downloads**: 27
- **Stars**: 2
- **Last updated**: 2026-09-11

Source: https://www.modelscope.cn/models/conanfans/Qwen3.8-0.8B-Distill

---

# Qwen3.8-0.8B-Distill

> 将 Qwen3.8-Max 的推理能力全参蒸馏进 Qwen3.5-0.8B 的单卡复现实验。

**Qwen3.8-0.8B-Distill** 是把 **Qwen3.8-Max**（蒸馏数据来源）的推理轨迹，通过全参数 SFT 蒸馏进 **Qwen3.5-0.8B** 架构的成果。训练数据为 [r0b0tlab/qwen3.8-max-distillation-50k](https://modelscope.cn/datasets/r0b0tlab/qwen3.8-max-distillation-50k) 的 train split 全量 **44,796 条**教师推理轨迹（math 33% / code 28% / reasoning 24% / instruction 15%，84% 含 `<think>` 推理段），轨迹由 Qwen3.8-Max 生成并带质量分标注。

目标：把教师模型的推理课程装进更小的身体，跑在消费级硬件上。

## Highlights

- **蒸馏思维链** — 回答以 `<think>` 推理段开篇的能力直接学自 Qwen3.8-Max 轨迹，非自我生成
- **全参微调** — 每个参数都更新了，不是 adapter；bf16 权重约 1.4GB
- **低成本可复现** — 消费级单卡（WSL2）约 7.5 小时完成训练
- **262,144-token 原生上下文**，继承自 Qwen3.5 base
- **双协议评测** — 同时给出标准对话协议与 lm-eval 裸补全协议的对照数据，避免"卷子不同"造成的误读

## Model Overview

- Type: Causal LM（Qwen3.5 多模态 base 的文本路径，本次微调仅用文本）
- Base: [Qwen/Qwen3.5-0.8B](https://modelscope.cn/models/Qwen/Qwen3.5-0.8B)
- Parameters: 0.8B
- Training: 全参 SFT（off-policy 蒸馏），seq 4096，有效 batch 32，lr 1e-5 cosine，2 epochs，44,796 条
- Teacher: Qwen3.8-Max（经 r0b0tlab/qwen3.8-max-distillation-50k 数据集）
- Context Length: 262,144（继承）
- Hardware: 消费级单卡，WSL2 + flash-linear-attention 快速内核，约 7.5 小时

## Benchmark Results

主评测：**EvalScope 1.11.1 + vLLM 0.29.0**，标准对话协议（chat 模板 + few-shot CoT），temperature=0，全量测试集。基线与蒸馏模型设置完全一致。

| 任务 | Qwen3.5-0.8B (base) | **Qwen3.8-0.8B-Distill** | Δ |
|---|---:|---:|---:|
| GSM8K (CoT, 4-shot, 1319 题) | 49.28 | **56.56** | **+7.28** |
| MMLU (CoT, 5-shot, 14042 题) | 49.34 | **49.82** | +0.48 |

协议敏感性对照：另用 **lm-evaluation-harness** 同款协议（`gsm8k_cot` 8-shot / `mmlu_flan_cot_zeroshot` 0-shot，temperature=0.6, top_p=0.95, top_k=20 采样，exact_match flexible-extract 口径，与社区 Qwen3.8-2B 蒸馏项目所用的评测协议一致）复测：

| 任务 | base | **Distill** | Δ |
|---|---:|---:|---:|
| gsm8k_cot (flexible) | 0.350 | **0.416** | +0.066 |
| mmlu_flan_cot_zeroshot (flexible) | 0.238 | **0.409** | +0.171 |

⚠️ **协议说明**：裸补全 0-shot 协议对 base 模型的格式极不友好（strict-match 基线接近 0，大量样本因 "The answer is 4" ≠ 标准登记 "(A)" 被判错，或陷入复读未输出答案）。跨论文比较分数时请务必确认协议一致，详见下方 Best Practices。

蒸馏主要提升的是**数学推理**（与数据构成一致，math 域占 33%，STEM 涨幅最大）；MMLU 知识广度基本持平——推理轨迹蒸馏"炼"的是推理过程，不是知识本身。

## Quickstart

以下代码在本仓库权重上实测通过（transformers 5.9 + modelscope 下载）：

```python
from modelscope import snapshot_download
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_dir = snapshot_download("conanfans/Qwen3.8-0.8B-Distill")
tok = AutoTokenizer.from_pretrained(model_dir)
model = AutoModelForCausalLM.from_pretrained(model_dir, dtype=torch.bfloat16, device_map="auto")

messages = [{"role": "user", "content": "A snail is at the bottom of a 10-meter well. Each day it climbs 3 meters, each night it slips back 2. How many days until it escapes?"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True,
                                return_tensors="pt", return_dict=True).to(model.device)

out = model.generate(
    input_ids=inputs["input_ids"],
    attention_mask=inputs["attention_mask"],
    max_new_tokens=8192, do_sample=True,
    temperature=0.6, top_p=0.95, top_k=20,
)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```

> 注意：`generate` 需显式传 `input_ids` / `attention_mask`（部分 transformers 版本对 chat template 返回对象的解包不兼容）；`max_new_tokens` 建议给足，长生成推荐 8192。

需要支持 Qwen3.5（Gated DeltaNet 混合架构）的近期 `transformers` 版本，以及快速内核 [`flash-linear-attention`](https://github.com/fla-org/flash-linear-attention) 与 CUDA 匹配的 [`causal_conv1d`](https://github.com/Dao-AILab/causal-conv1d)——缺失时会静默回退到极慢的纯 torch 路径（实测差数百倍）。Windows 原生环境建议直接用 WSL2。

## Best Practices

- **采样**：`temperature=0.6, top_p=0.95, top_k=20`；长生成下贪心解码存在复读循环风险（base 模型尤甚）
- **输出长度**：给足 `max_new_tokens`（推荐 8192+）；回答可能以 `<think>...</think>` 开篇，面向终端用户时请解析并剥离该段
- **评测提示**：做 MMLU/GSM8K 评测时请使用对话模板 + few-shot CoT 协议，并注明协议；裸补全 0-shot 协议会系统性低估该模型
- **边界**：蒸馏轨迹以数学、推理、指令跟随为主（无代码域专精，tool_use 仅 0.3%）；知识广度类任务（MMLU）与基线基本持平；视觉行为继承自 base，本次未做评测与训练

## Provenance & licensing

权重以 **Apache-2.0** 发布（继承自 Qwen3.5-0.8B base），按"原样"共享，仅供研究实验使用。

## Acknowledgements

- Base model: [Qwen/Qwen3.5-0.8B](https://modelscope.cn/models/Qwen/Qwen3.5-0.8B)（阿里 Qwen 团队）
- 蒸馏数据: [r0b0tlab/qwen3.8-max-distillation-50k](https://modelscope.cn/datasets/r0b0tlab/qwen3.8-max-distillation-50k)（Qwen3.8-Max 推理轨迹）
- 训练: Transformers Trainer + flash-linear-attention（快速内核）
- 评测: EvalScope + vLLM + lm-evaluation-harness
