{
  "schema_version": "1.0",
  "id": "T-aca09c5e6f18",
  "url": "https://gpuatlas.top/articles/T-aca09c5e6f18/",
  "title": "DeepSeek R1 蒸馏版 14B 微调时想保留长文本，哪些设置最占显存？",
  "summary": "R1蒸馏14B长文训练先核推理与答案有效范围，再看激活和微批量，48层推理缓存不能预测反向需求。",
  "language": "zh-Hans",
  "category": {
    "id": "c-18",
    "name": "模型微调",
    "url": "https://gpuatlas.top/categories/c-18/"
  },
  "topics": [
    {
      "id": "model-b64bc5faa8",
      "name": "DeepSeek R1",
      "kind": "model",
      "description": "完整版与蒸馏版的硬件需求不能混算。分别查看权重预算、多卡部署、量化运行及微调相关问题。",
      "url": "https://gpuatlas.top/topics/model-b64bc5faa8/"
    },
    {
      "id": "task-e33d9598da",
      "name": "微调",
      "kind": "task",
      "description": "让模型适应自己的任务，从训练方式、样本和显存预算入手，最后验证适配器是否真正起效。",
      "url": "https://gpuatlas.top/topics/task-e33d9598da/"
    },
    {
      "id": "task-a7bab8d8aa",
      "name": "长文本",
      "kind": "task",
      "description": "长文本训练会增加哪些中间开销？查看序列长度与 batch 的取舍，避免只按模型权重估算显存。",
      "url": "https://gpuatlas.top/topics/task-a7bab8d8aa/"
    }
  ],
  "body_text": "先查看处理后token、微批量和损失范围。DeepSeek-R1-Distill-Qwen-14B数据可能有较长推理与最终答案，模板、截断、填充和打包会改变实际学习内容，保材料但删回答不是有效保长文。\n\n基础权重、训练状态和反向激活分别预算。官方48层推理KV不能预测训练峰值，更不能套其他14B结构，QLoRA也不让激活与适配器状态同步变为低位。\n\n明确目标模块、rank、冻结范围和精度，用真实长样本完成前向、反向与更新，分别记录峰值。吞吐统一有效训练token，不只看每秒样本数，避免一套实际处理更少答案。\n\n驻留不足先核精度布局，反向不足再比较微批量、长度组织与检查点或分片。梯度累积不让单条过长输入自动装下，重计算、通信及主存也需加入完整时间，保存恢复另验。\n\n长材料中的约束和推理后的最终答案都值得保留，但应先在处理后的样本中确认它们确实存在。独立题若结论错误，检查是否漏掉约束；若思考未结束就截断，则核对输出和长度安排。以这些错误决定下一轮保留哪些内容，比只看48层推理缓存的数字更贴合训练目标。",
  "published_at": null,
  "modified_at": "2026-11-26T15:17:38.690397+00:00",
  "evidence": {
    "type": "documentation_and_conditional_estimates",
    "hardware_tested": false,
    "note": "资料解释与条件估算，非硬件实测。"
  },
  "sources": [
    {
      "id": "r1-distill-14b",
      "url": "https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B/raw/main/README.md",
      "retrieved_at": "2026-11-25T11:23:02.755600+00:00"
    },
    {
      "id": "r1-distill-14b-config",
      "url": "https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B/resolve/main/config.json",
      "retrieved_at": "2026-11-25T11:23:43.185064+00:00"
    },
    {
      "id": "transformers-training-memory",
      "url": "https://raw.githubusercontent.com/huggingface/transformers/main/docs/source/en/model_memory_anatomy.md",
      "retrieved_at": "2026-11-25T10:16:15.738480+00:00"
    },
    {
      "id": "torch-checkpoint",
      "url": "https://docs.pytorch.org/docs/2.15/checkpoint.html",
      "retrieved_at": "2026-11-25T10:16:15.738480+00:00"
    },
    {
      "id": "llamafactory-data-args",
      "url": "https://raw.githubusercontent.com/hiyouga/LLaMA-Factory/main/src/llamafactory/hparams/data_args.py",
      "retrieved_at": "2026-11-25T11:04:14.292936+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-aca09c5e6f18/",
    "json": "https://gpuatlas.top/data/articles/T-aca09c5e6f18.json",
    "markdown": "https://gpuatlas.top/data/articles/T-aca09c5e6f18.md"
  }
}
