{
  "schema_version": "1.0",
  "id": "T-c8f616c1174d",
  "url": "https://gpuatlas.top/articles/T-c8f616c1174d/",
  "title": "Qwen3 4B Instruct 2507 想读长文档，上下文开多大才不容易爆显存？",
  "summary": "Qwen3 4B Instruct 2507长文缓存在256K可达36GiB，原生能力需与设备预算和证据利用分别验证。",
  "language": "zh-Hans",
  "category": {
    "id": "c-02",
    "name": "推理与上下文",
    "url": "https://gpuatlas.top/categories/c-02/"
  },
  "topics": [
    {
      "id": "model-3387ea7659",
      "name": "Qwen3",
      "kind": "model",
      "description": "从小模型到更大参数档位，按显卡搭配查看 Qwen3 的运行条件，并查找长文本微调与适配器验证问题。",
      "url": "https://gpuatlas.top/topics/model-3387ea7659/"
    }
  ],
  "body_text": "Qwen3-4B-Instruct-2507读长文，不要直接把长度设到262144。模型原生256K能力与设备承载是不同条件，权重、缓存、缓冲及其他程序都需要空间。\n\n官方36层、8个KV头、头维128，常规单序列16bit KV在8192 token约1.125GiB、32768约4.5GiB、262144约36GiB，假设完整历史，分页与临时计算未计。约4B权重小，不能抵消最大长度的缓存。\n\n权重量化减少另一部分驻留，KV精度需后端单独支持，不能自动按权重位宽计算。先确认实际材料、模板、历史和回答的token，再选择长度与活动请求，不把所有预算给正文。\n\n固定非思考模板、采样和输出，从短材料逐档增加，分别记录输入处理与生成峰值、首字和完整时间。缓存量化、卸载等策略一次改一项，CPU参与加入主存，显存下降也需看等待变化。\n\n拿一份确实要交给2507处理的长文，分别核对前、中、后的已知事实，再问一个跨段问题，检查引用、遗漏和截断。失败时留下原题、实际token数与缓存设置，便于复查是资源问题还是证据利用不足。即使接口接受256K，也要由这份完整答案和等待时间决定是否适合日常使用。",
  "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": "qwen3-4b-2507",
      "url": "https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507/raw/main/README.md",
      "retrieved_at": "2026-11-25T10:34:57.629275+00:00"
    },
    {
      "id": "qwen3-4b-2507-config",
      "url": "https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507/resolve/main/config.json",
      "retrieved_at": "2026-11-25T10:34:57.629275+00:00"
    },
    {
      "id": "transformers-kv-cache",
      "url": "https://raw.githubusercontent.com/huggingface/transformers/main/docs/source/en/kv_cache.md",
      "retrieved_at": "2026-11-25T10:07:29.175278+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-c8f616c1174d/",
    "json": "https://gpuatlas.top/data/articles/T-c8f616c1174d.json",
    "markdown": "https://gpuatlas.top/data/articles/T-c8f616c1174d.md"
  }
}
