{
  "schema_version": "1.0",
  "id": "T-34451b69d474",
  "url": "https://gpuatlas.top/articles/T-34451b69d474/",
  "title": "Llama 3.2 3B 微调时想保留长文本，哪些设置最占显存？",
  "summary": "Llama 3.2 3B长文训练先核具体发布和有效答案，3.21B规模及推理窗口都不能代替反向预算。",
  "language": "zh-Hans",
  "category": {
    "id": "c-18",
    "name": "模型微调",
    "url": "https://gpuatlas.top/categories/c-18/"
  },
  "topics": [
    {
      "id": "model-0f6d0dcc07",
      "name": "Llama 3.2",
      "kind": "model",
      "description": "想从较小的 Llama 模型开始本地尝试？对照具体参数规模，查看显存、精度和运行方式的选择。",
      "url": "https://gpuatlas.top/topics/model-0f6d0dcc07/"
    },
    {
      "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，不照抄某个推理上限。Llama 3.2 3B普通与官方特定量化发布的上下文不同，第三方文件也要核配置，能接收长输入不是训练反向保证。\n\n模型实际约3.21B，权重之外仍有训练状态和激活。QLoRA不让激活同步低位，小模型也会因长度和微批量超预算，不能只凭3B名称选择长度。\n\n核模板、历史、回答、截断、填充、打包与损失范围，确认关键答案仍在。比较吞吐按有效训练token，不只看样本数，避免一套方案只是处理更少内容。\n\n固定真实长样本完成前向、反向与更新，观察阶段峰值。驻留不足先核精度布局，反向不足再比微批量、长度和受支持检查点，梯度累积不消除单条过长需求，重计算与通信需计时。\n\nLlama 3.2 3B普通版与特定量化版不能共用一条训练长度结论。恢复适配器后，先在所选发布上验证实际长文，检查遗漏或截断；换发布时重新核对处理后的样本及反向峰值。这样才能分清是发布条件变化，还是原来的数据组织不适合长文本。",
  "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": "llama32-card",
      "url": "https://raw.githubusercontent.com/meta-llama/llama-models/main/models/llama3_2/MODEL_CARD.md",
      "retrieved_at": "2026-11-25T11:28:43.769677+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-34451b69d474/",
    "json": "https://gpuatlas.top/data/articles/T-34451b69d474.json",
    "markdown": "https://gpuatlas.top/data/articles/T-34451b69d474.md"
  }
}
