跳到主要內容
AI 武林
影片高階EN2.3 萬 次觀看

Build A Reasoning Model From Scratch 8: Distillation

來源 Sebastian Raschka人物 Sebastian Raschka

看影片(在新分頁開啟原站)連到 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 產生

  1. 00:00Introduction and series recap
  2. 01:07Why distill a reasoning model?
  3. 02:51Soft vs. hard distillation
  4. 11:06On-policy vs. off-policy distillation
  5. 18:09Preparing data for reasoning distillation
  6. 22:35Loading the DeepSeek R1 MATH dataset
  7. 28:04Inspecting reasoning traces and final answers
  8. 31:27Tokenization and chat templates
  9. 35:58Pre-tokenizing the training dataset
  10. 39:01Sequence lengths and the 2,048-token limit
  11. 42:38Creating training and validation splits
  12. 45:32Loading the Qwen3-0.6B base model
  13. 46:24Computing answer-token log probabilities
  14. 54:10Cross-entropy loss for distillation
  15. 57:25Training and validation loss helpers
  16. 1:02:03Implementing the distillation training loop
  17. 1:07:26Running the standalone training script
  18. 1:09:41Plotting training and validation losses
  19. 1:11:31Evaluating checkpoints on MATH-500
  20. 1:14:09Comparing teachers and distillation results
  21. 1:16:34Future directions for reasoning models
  22. 1:19:41Bonus exercises and next steps

提到的工具與公司

適合誰看

適合希望以較低計算成本訓練小型推理模型,或對模型蒸餾技術感興趣的開發者。

摘要依據

講者
Sebastian Raschka
依據
人工字幕

為什麼排在這裡

人氣
0.62
新鮮
0.85

在主題頁與搜尋結果裡,名次由相關、人氣、新鮮三個分數決定;這一頁沒有搜尋的關鍵字,所以沒有相關分數。排序怎麼算

這個來源最近的內容

Sebastian Raschka 的所有內容

摘要由 AI 根據原文產生,可能有誤;完整內容請看原站。看影片(在新分頁開啟原站)