[GH-ISSUE #113] 关于 DeepSeek-R1 蒸馏过程的疑问 #95

Closed
opened 2026-10-26 21:13:50 +00:00 by bsakaguchi · 13 comments
Owner

Originally created by @Alphayellowcat on GitHub (Jan 28, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/113

描述
您好,感谢 DeepSeek 团队开源这么强大的模型!我在阅读 DeepSeek-R1 的论文时,对其中的蒸馏过程产生了一些疑问,希望能获得更多详细信息。

问题背景
在论文的蒸馏部分,提到:

We directly fine-tuned open-source models like Qwen and Llama using the 800k samples curated with DeepSeek-R1. Our findings indicate that this straightforward distillation method significantly enhances the reasoning abilities of smaller models.

同时,实验结果表明,蒸馏出的 Qwen-32B 在推理任务上明显优于直接用 RL 训练的版本。

然而,论文并未详细说明蒸馏的具体过程,例如:

  • 蒸馏时是否使用了 KL 散度(KL Divergence)等方法来匹配输出分布?
  • 小模型在训练时是否仅基于最终答案,还是学习了完整的 Chain-of-Thought(CoT)?
  • 训练过程是否调整了温度(Temperature Softening)来避免过拟合?
  • 是否有特定的损失函数(Loss Function)或优化策略?

我的疑问

  • 论文中只提到 SFT(监督微调),但没有提到如何确保小模型能够继承 DeepSeek-R1 的推理模式。
  • 蒸馏的 80 万条数据中是否包含多个不同推理路径,以避免小模型仅仅学习到固定答案?
  • 蒸馏过程中是否有额外的数据增强(Data Augmentation)或模型正则化(Regularization)策略?

期待的帮助
如果可以的话,希望团队能够提供:

  1. 更详细的蒸馏流程,包括数据处理、训练策略、损失函数等细节。
  2. 代码参考(如果开源的话),帮助我们更好地理解小模型的蒸馏过程。
  3. 是否有计划在后续版本或技术报告中进一步公开蒸馏相关信息?

再次感谢 DeepSeek 团队的工作,希望能收到您的解答!🙏

Originally created by @Alphayellowcat on GitHub (Jan 28, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/113 **描述** 您好,感谢 DeepSeek 团队开源这么强大的模型!我在阅读 DeepSeek-R1 的论文时,对其中的蒸馏过程产生了一些疑问,希望能获得更多详细信息。 **问题背景** 在论文的蒸馏部分,提到: > *We directly fine-tuned open-source models like Qwen and Llama using the 800k samples curated with DeepSeek-R1. Our findings indicate that this straightforward distillation method significantly enhances the reasoning abilities of smaller models.* 同时,实验结果表明,蒸馏出的 Qwen-32B 在推理任务上明显优于直接用 RL 训练的版本。 然而,论文并未详细说明蒸馏的具体过程,例如: - **蒸馏时是否使用了 KL 散度(KL Divergence)等方法来匹配输出分布?** - **小模型在训练时是否仅基于最终答案,还是学习了完整的 Chain-of-Thought(CoT)?** - **训练过程是否调整了温度(Temperature Softening)来避免过拟合?** - **是否有特定的损失函数(Loss Function)或优化策略?** **我的疑问** - 论文中只提到 SFT(监督微调),但没有提到如何确保小模型能够继承 DeepSeek-R1 的推理模式。 - 蒸馏的 80 万条数据中是否包含多个不同推理路径,以避免小模型仅仅学习到固定答案? - 蒸馏过程中是否有额外的数据增强(Data Augmentation)或模型正则化(Regularization)策略? **期待的帮助** 如果可以的话,希望团队能够提供: 1. **更详细的蒸馏流程**,包括数据处理、训练策略、损失函数等细节。 2. **代码参考**(如果开源的话),帮助我们更好地理解小模型的蒸馏过程。 3. **是否有计划在后续版本或技术报告中进一步公开蒸馏相关信息?** 再次感谢 DeepSeek 团队的工作,希望能收到您的解答!🙏
bsakaguchi 2026-10-26 21:13:50 +00:00
Author
Owner

@xidongyuandong commented on GitHub (Feb 5, 2025):

paper提到的就是 sft 得到的蒸馏数据

<!-- gh-comment-id:2636115066 --> @xidongyuandong commented on GitHub (Feb 5, 2025): paper提到的就是 sft 得到的蒸馏数据
Author
Owner

@Syno8 commented on GitHub (Feb 5, 2025):

话说你们有测试,这样蒸馏后的模型,除了推理能力,对于通用任务的能力提升是如何的嘛?

<!-- gh-comment-id:2636147432 --> @Syno8 commented on GitHub (Feb 5, 2025): 话说你们有测试,这样蒸馏后的模型,除了推理能力,对于通用任务的能力提升是如何的嘛?
Author
Owner

@QuantaoYao commented on GitHub (Feb 8, 2025):

I am also confused by this question. I would greatly appreciate it if the Deepseek team could provide some clarification. Thank you in advance for your response

<!-- gh-comment-id:2644750082 --> @QuantaoYao commented on GitHub (Feb 8, 2025): I am also confused by this question. I would greatly appreciate it if the Deepseek team could provide some clarification. Thank you in advance for your response
Author
Owner

@xpdd123 commented on GitHub (Feb 10, 2025):

看了论文中的描述,也看了girhub开源的复现代码,感觉只是用DeepSeek-R1的数据,因此问题1和3不存在,论文中提到蒸馏用到了推理数据和非推理数据,因此有COT数据,训练过程loss和普通的LLM训练应该一样

<!-- gh-comment-id:2647137304 --> @xpdd123 commented on GitHub (Feb 10, 2025): 看了论文中的描述,也看了girhub开源的复现代码,感觉只是用DeepSeek-R1的数据,因此问题1和3不存在,论文中提到蒸馏用到了推理数据和非推理数据,因此有COT数据,训练过程loss和普通的LLM训练应该一样
Author
Owner

@CzsGit commented on GitHub (Feb 10, 2025):

Nevertheless, he introduced novel tokens and made modifications to the prompt concatenation format during inference. These alterations suggest that the process deviates from standard LLM distillation practices, or certain details have not been disclosed.

<!-- gh-comment-id:2648077613 --> @CzsGit commented on GitHub (Feb 10, 2025): Nevertheless, he introduced novel tokens and made modifications to the prompt concatenation format during inference. These alterations suggest that the process deviates from standard LLM distillation practices, or certain details have not been disclosed.
Author
Owner

@GuoYi0 commented on GitHub (Feb 11, 2025):

我使用llama_factory库,对Qwen2.5-Math-1.5B进行蒸馏,使用的数据集在这里。发现总是有很多幻想。求大神指教。有兴趣的老哥可以加我微信,一起学习 guoyi19930

<!-- gh-comment-id:2649717159 --> @GuoYi0 commented on GitHub (Feb 11, 2025): 我使用llama_factory库,对Qwen2.5-Math-1.5B进行蒸馏,使用的数据集在[这里](https://pan.baidu.com/s/1ACn16-UUwtNupPBP_h7l4A?pwd=vq7n#list/path=%2F%E4%B9%9D%E5%A4%A9%E8%80%81%E5%B8%88DeepSeek%20v3%26R1%E5%85%AC%E5%BC%80%E8%AF%BE%2FPart%20%207.DeepSeek%20R1%20Distil%E6%A8%A1%E5%9E%8B%E8%92%B8%E9%A6%8F%E5%AE%9E%E6%88%98%2FSFT%E6%95%B0%E6%8D%AE%E9%9B%86%2Fdataset)。发现总是有很多幻想。求大神指教。有兴趣的老哥可以加我微信,一起学习 guoyi19930
Author
Owner

@haichuan1221 commented on GitHub (Feb 13, 2025):

我使用llama_factory库,对Qwen2.5-Math-1.5B进行蒸馏,使用的数据集在这里。发现总是有很多幻想。求大神指教。有兴趣的老哥可以加我微信,一起学习 guoyi19930

模型大于3B才有推理能力

<!-- gh-comment-id:2655549636 --> @haichuan1221 commented on GitHub (Feb 13, 2025): > 我使用llama_factory库,对Qwen2.5-Math-1.5B进行蒸馏,使用的数据集在[这里](https://pan.baidu.com/s/1ACn16-UUwtNupPBP_h7l4A?pwd=vq7n#list/path=%2F%E4%B9%9D%E5%A4%A9%E8%80%81%E5%B8%88DeepSeek%20v3%26R1%E5%85%AC%E5%BC%80%E8%AF%BE%2FPart%20%207.DeepSeek%20R1%20Distil%E6%A8%A1%E5%9E%8B%E8%92%B8%E9%A6%8F%E5%AE%9E%E6%88%98%2FSFT%E6%95%B0%E6%8D%AE%E9%9B%86%2Fdataset)。发现总是有很多幻想。求大神指教。有兴趣的老哥可以加我微信,一起学习 guoyi19930 模型大于3B才有推理能力
Author
Owner

@zhufeizzz commented on GitHub (Feb 13, 2025):

其实我也有疑问,根据论文描述是80w数据集直接进行SFT,并没有用到Token概率分布的软标签。这算传统意义上的蒸馏吗?

<!-- gh-comment-id:2656432961 --> @zhufeizzz commented on GitHub (Feb 13, 2025): 其实我也有疑问,根据论文描述是80w数据集直接进行SFT,并没有用到Token概率分布的软标签。这算传统意义上的蒸馏吗?
Author
Owner

@wingjson commented on GitHub (Feb 13, 2025):

话说你们有测试,这样蒸馏后的模型,除了推理能力,对于通用任务的能力提升是如何的嘛?

该啥样啥样,推理强了

<!-- gh-comment-id:2657928837 --> @wingjson commented on GitHub (Feb 13, 2025): > 话说你们有测试,这样蒸馏后的模型,除了推理能力,对于通用任务的能力提升是如何的嘛? 该啥样啥样,推理强了
Author
Owner

@freedom-cui commented on GitHub (Feb 23, 2025):

Hello 我想和大家请教一个问题DeepSeek R1的蒸馏,到底是teacher-student这种传统意义上的蒸馏,还是说指用一个较大模型(或者是具有推理能力模型)推理的数据进行训练的过程

<!-- gh-comment-id:2676913912 --> @freedom-cui commented on GitHub (Feb 23, 2025): Hello 我想和大家请教一个问题DeepSeek R1的蒸馏,到底是teacher-student这种传统意义上的蒸馏,还是说指用一个较大模型(或者是具有推理能力模型)推理的数据进行训练的过程
Author
Owner

@rainfallLLF commented on GitHub (Mar 7, 2025):

Hello 我想和大家请教一个问题DeepSeek R1的蒸馏,到底是teacher-student这种传统意义上的蒸馏,还是说指用一个较大模型(或者是具有推理能力模型)推理的数据进行训练的过程

后者,所谓的“知识蒸馏”

<!-- gh-comment-id:2705420999 --> @rainfallLLF commented on GitHub (Mar 7, 2025): > Hello 我想和大家请教一个问题DeepSeek R1的蒸馏,到底是teacher-student这种传统意义上的蒸馏,还是说指用一个较大模型(或者是具有推理能力模型)推理的数据进行训练的过程 后者,所谓的“知识蒸馏”
Author
Owner

@github-actions[bot] commented on GitHub (Apr 9, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

<!-- gh-comment-id:2787911218 --> @github-actions[bot] commented on GitHub (Apr 9, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
Author
Owner

@github-actions[bot] commented on GitHub (May 9, 2025):

false

<!-- gh-comment-id:2864733657 --> @github-actions[bot] commented on GitHub (May 9, 2025): false
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-R1#95
No description provided.