{
  "schema_version": "1.0",
  "id": "T-293e16661ae7",
  "url": "https://gpuatlas.top/articles/T-293e16661ae7/",
  "title": "LLaMA-Factory 第一次微调，怎么选一个显存能承受的配置？",
  "summary": "LLaMA-Factory首次微调先建立小型完整循环，再逐项扩大长度与批量，模板、监督和恢复比最大模型更优先。",
  "language": "zh-Hans",
  "category": {
    "id": "c-09",
    "name": "框架配置与故障",
    "url": "https://gpuatlas.top/categories/c-09/"
  },
  "topics": [
    {
      "id": "task-e33d9598da",
      "name": "微调",
      "kind": "task",
      "description": "让模型适应自己的任务，从训练方式、样本和显存预算入手，最后验证适配器是否真正起效。",
      "url": "https://gpuatlas.top/topics/task-e33d9598da/"
    }
  ],
  "body_text": "LLaMA-Factory第一次微调，先选框架明确支持的模型和一份小而干净的数据，完成端到端基线。先确认学什么、怎样保存和部署，再寻找容量边界，能减少训练运行了却没有可用结果的情况。\n\n按任务比较LoRA或受支持的QLoRA，核对目标模块、rank、量化后端与计算精度。LoRA通常冻结基础参数，低位方案也仍有激活和适配器状态，不能把量化文件大小当训练预算。\n\n抽查模板与分词后的样本，确认回答、特殊标记和损失范围正确。使用单样本微批量和较短真实序列，完成前向、反向、更新、验证和保存，记录峰值阶段，首次更新可能才分配部分状态。\n\n新进程加载基础模型和适配器，检查固定问题，再恢复训练确认接续。之后每次只增加长度、微批量或一种受支持策略，梯度累积按实际数据并行副本核算，有效监督内容不能因省显存被截掉。\n\n第一次作业完成后，用未参加训练的新问题比较基础模型与适配器，模板和生成条件保持一致。如果目标是让模型遵循某种回答格式，就看新问题是否也遵循，而不是只复述训练样本。确认保存的适配器能在新进程中使用，再决定增加序列长度还是扩大作业。",
  "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": "llamafactory",
      "url": "https://raw.githubusercontent.com/hiyouga/LLaMA-Factory/main/README.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "peft-quantization",
      "url": "https://raw.githubusercontent.com/huggingface/peft/main/docs/source/developer_guides/quantization.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+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"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-293e16661ae7/",
    "json": "https://gpuatlas.top/data/articles/T-293e16661ae7.json",
    "markdown": "https://gpuatlas.top/data/articles/T-293e16661ae7.md"
  }
}
