影片高階EN2.3 萬 次觀看
Build A Reasoning Model From Scratch 8: Distillation
看影片(在新分頁開啟原站)連到 YouTube・Sebastian Raschka
摘要
由 Sebastian Raschka 講解如何透過模型蒸餾(Distillation)從大型教師模型(如 DeepSeek R1)學習,以低成本訓練小型推理模型。內容涵蓋軟蒸餾與硬蒸餾的差異、資料準備流程、Tokenization 設定、損失函式實作以及訓練迴圈的完整實作步驟。
This video tutorial explains how to train small reasoning models efficiently using model distillation from a large teacher model like DeepSeek R1, covering data preparation, tokenization, and the implementation of a cross-entropy training loop.
摘要、重點與章節標題由語言模型整理,細節(誰說的、數字、先後)可能有誤;要引用請以原始內容為準。
重點
- 比較軟蒸餾與硬蒸餾的機制與適用情境,並說明為何本教程採用硬蒸餾。
- 展示如何準備 DeepSeek R1 的推理資料並進行預 Tokenization 以最佳化訓練效率。
- 實作基於 Cross-entropy loss 的蒸餾訓練迴圈,並評估模型在 MATH-500 上的表現。
章節
依話題轉折切分,標題由 AI 產生
- 00:00Introduction and series recap
- 01:07Why distill a reasoning model?
- 02:51Soft vs. hard distillation
- 11:06On-policy vs. off-policy distillation
- 18:09Preparing data for reasoning distillation
- 22:35Loading the DeepSeek R1 MATH dataset
- 28:04Inspecting reasoning traces and final answers
- 31:27Tokenization and chat templates
- 35:58Pre-tokenizing the training dataset
- 39:01Sequence lengths and the 2,048-token limit
- 42:38Creating training and validation splits
- 45:32Loading the Qwen3-0.6B base model
- 46:24Computing answer-token log probabilities
- 54:10Cross-entropy loss for distillation
- 57:25Training and validation loss helpers
- 1:02:03Implementing the distillation training loop
- 1:07:26Running the standalone training script
- 1:09:41Plotting training and validation losses
- 1:11:31Evaluating checkpoints on MATH-500
- 1:14:09Comparing teachers and distillation results
- 1:16:34Future directions for reasoning models
- 1:19:41Bonus exercises and next steps
提到的工具與公司
- Qwen3-0.6B
- DeepSeek R1
- MATH-500
- PyTorch
- Hugging Face Hub
- Ollama
- OpenRouter
適合誰看
適合希望以較低計算成本訓練小型推理模型,或對模型蒸餾技術感興趣的開發者。
摘要依據
- 講者
- Sebastian Raschka
- 依據
- 人工字幕
為什麼排在這裡
- 人氣
- 0.62
- 新鮮
- 0.85
在主題頁與搜尋結果裡,名次由相關、人氣、新鮮三個分數決定;這一頁沒有搜尋的關鍵字,所以沒有相關分數。排序怎麼算
相關內容
- What Is Model Distillation? How Smaller AI Models Learn影片 ・ IBM Technology ・ 14 分鐘 ・
- How Small Models Learn to Think Like Giants | On-Policy Distillation影片 ・ Jia-Bin Huang ・ 31 分鐘 ・
- 学不如抄?Anthropic 为啥这么怕蒸馏!影片 ・ 林亦LYi ・ 13 分鐘 ・
- CoreWeave AI Training: Built for Training at Scale with Confidence影片 ・ CoreWeave ・ 7 分鐘 ・
- Distillation: Can A Small Model Beat A Bigger Model?影片 ・ Prompt Engineering ・ 23 分鐘 ・
- 【AI系列 Ep09】AI煉金術公開!從巨型模型提煉出智慧的「知識蒸餾」技術!影片 ・ Ku's Lab 古倫維老師研究室 ・ 16 分鐘 ・
這個來源最近的內容
- Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) ・ 影片 ・ 1 小時 46 分
- Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) ・ 影片 ・ 1 小時 27 分
- Build A Reasoning Model From Scratch 5: Inference Scaling 2 (Logprob Scoring, Self-Refinement) ・ 影片 ・ 1 小時 9 分
摘要由 AI 根據原文產生,可能有誤;完整內容請看原站。看影片(在新分頁開啟原站)
