跳至内容

第 8 章 参考资料汇总

所属专题:本地大模型架构与推理框架详解

各章末尾已经列了本章用到的资料。这里按“先读什么、后读什么”重新组织,方便系统学习。

标记:

  • ★ = 强烈推荐,适合 BERT 背景的读者入门;
  • 【已核】= 研究时打开原文核对过;
  • 【未核】= 研究时没能打开(网页拦截或 JS 渲染),或编号凭记忆,引用前请自己确认;
  • 没有标记的 = 研究时确认过标题和链接,没有通读。

8.1 入门路线(按顺序读)

顺序资料为什么读
1★ Jay Alammar,The Illustrated Transformer:https://jalammar.github.io/illustrated-transformer/用图讲 Transformer,是一切的底图(你已经熟悉 BERT,可以快速过)
2★ Jay Alammar,The Illustrated GPT-2:https://jalammar.github.io/illustrated-gpt2/从 BERT 的“填空”过渡到“预测下一个 token”的因果生成
3★ kipply,Transformer Inference Arithmetic:https://kipp.ly/transformer-inference-arithmetic/为什么解码是带宽受限、KV 有多大,用算术讲清楚(对应第 5、7 章)
4★ Sebastian Raschka,The Big LLM Architecture Comparison:https://magazine.sebastianraschka.com/p/the-big-llm-architecture-comparison现代模型(DeepSeek、Qwen、Llama……)结构选择的逐个对比(对应第 1、2 章)
5★ Maarten Grootendorst,A Visual Guide to Quantization:https://newsletter.maartengrootendorst.com/p/a-visual-guide-to-quantization 【未核】量化的图解入门(对应第 3 章)
6★ Nathan Lambert,RLHF Book:https://rlhfbook.com从 SFT 到 RLHF、DPO、RLVR 的系统教材(对应第 4 章)
7★ vLLM 博客,Inside vLLM:https://blog.vllm.ai/2025/09/05/anatomy-of-vllm.html现代推理引擎的内部全景(对应第 5 章)
8★ Leviathan 等,推测解码论文:https://arxiv.org/abs/2211.17192速度公式和无损证明,篇幅短(对应第 6 章)

8.2 模型架构(第 1、2 章)

博客与教程

  • Harvard NLP,The Annotated Transformer(逐行代码对照论文):https://nlp.seas.harvard.edu/annotated-transformer/
  • Lilian Weng,The Transformer Family v2(位置编码、稀疏 / 线性注意力、MoE、长上下文):https://lilianweng.github.io/posts/2023-01-27-the-transformer-family-v2/
  • Sebastian Raschka,Coding the KV Cache in LLMs:https://magazine.sebastianraschka.com/p/coding-the-kv-cache-in-llms
  • Sebastian Raschka,Understanding Reasoning LLMs:https://magazine.sebastianraschka.com/p/understanding-reasoning-llms
  • Hugging Face,Mixture of Experts Explained:https://huggingface.co/blog/moe
  • EleutherAI,Rotary Embeddings: A Relative Revolution:https://blog.eleuther.ai/rotary-embeddings/
  • ★ Songlin Yang,DeltaNet Explained (Part I)(GDN 一作写的入门,理解 Qwen3.8 线性层最友好的资料):https://sustcsonglin.github.io/blog/2024/deltanet-1/
  • Lilian Weng,What are Diffusion Models?(第 2 章附录用):https://lilianweng.github.io/posts/2021-07-11-diffusion-models/

论文

  • GQA:https://arxiv.org/abs/2305.13245
  • DeepSeekMoE(细粒度专家 + 共享专家):https://arxiv.org/abs/2401.06066
  • Gated Delta Networks(Qwen3.5/3.8 线性层的出处):https://arxiv.org/abs/2412.06464
  • Gated Attention for LLMs(注意力输出门控):https://arxiv.org/abs/2505.06708
  • Kimi Linear / KDA(GLM-5.3-Flash 的线性层):https://arxiv.org/abs/2510.26692
  • Engram(n-gram 查表记忆,对应 Flash-Next 的 51B 表):https://arxiv.org/abs/2601.07372
  • DeepSeek-V3(MLA、MTP):https://arxiv.org/abs/2412.19437
  • DiT:https://arxiv.org/abs/2212.09748 ;Flow Matching:https://arxiv.org/abs/2210.02747

一手资料

  • ★ Qwen3.8-Flash-Next 技术报告(GDN 公式、QSA、门控残差、n-gram 消融):https://github.com/QwenLM/Qwen3.8-Flash-Next/blob/main/tech_report.pdf
  • Qwen3.8-27B 模型卡:https://huggingface.co/Qwen/Qwen3.8-27B
  • Qwen3.8-Flash-Next 模型卡:https://huggingface.co/Qwen/Qwen3.8-Flash-Next
  • Qwen 官方博客 qwen.ai/blog(JS 渲染,研究时没读到正文)【未核】

8.3 量化(第 3 章)

入门

  • Hugging Face Transformers 量化文档(各后端对照):https://huggingface.co/docs/transformers/en/quantization/overview 【未核】
  • LLM Inference Unveiled: Survey and Roofline Model Insights(Roofline 视角):https://arxiv.org/abs/2402.16363

llama.cpp 的量化(想看懂 GGUF 必读)

  • PR #1684 k-quants(超级块设计):https://github.com/ggml-org/llama.cpp/pull/1684
  • PR #4773 i-quants(E8 格点码本):https://github.com/ggml-org/llama.cpp/pull/4773
  • PR #4861 imatrix:https://github.com/ggml-org/llama.cpp/pull/4861
  • Discussion #5617(i-quant 作者讲不同后端为什么快 / 慢):https://github.com/ggml-org/llama.cpp/discussions/5617
  • ggml-common.h(每种量化的真实块结构,算 bpw 的权威):https://github.com/ggml-org/llama.cpp/blob/master/ggml/src/ggml-common.h
  • quantize 工具 README(整文件 bpw 表):https://github.com/ggml-org/llama.cpp/blob/master/tools/quantize/README.md

论文

  • GPTQ:https://arxiv.org/abs/2210.17323
  • AWQ:https://arxiv.org/abs/2306.00978
  • LLM.int8()(离群特征):https://arxiv.org/abs/2208.07339
  • SmoothQuant:https://arxiv.org/abs/2211.10438
  • QuaRot:https://arxiv.org/abs/2404.00456 ;SpinQuant:https://arxiv.org/abs/2405.16406
  • QuIP#:https://arxiv.org/abs/2402.04396
  • FP8 格式:https://arxiv.org/abs/2209.05433
  • GSQ:https://arxiv.org/abs/2604.18556 ;RCO:https://arxiv.org/abs/2605.00649

厂商与工具

  • NVIDIA,Pushing Intelligence to 4-bit(MXFP4 对 NVFP4):https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/ 【未核】
  • Unsloth Dynamic 2.0:https://unsloth.ai/docs/basics/unsloth-dynamic-2.0-ggufs
  • Unsloth Qwen3.5 GGUF 基准(“困惑度不等于任务分”):https://unsloth.ai/docs/models/qwen3.5/gguf-benchmarks

8.4 后训练与微调(第 4 章)

论文

  • InstructGPT(RLHF + PPO、对齐税):https://arxiv.org/abs/2203.02155
  • DPO:https://arxiv.org/abs/2305.18290
  • SimPO:https://arxiv.org/abs/2405.14734 【已核】
  • RLOO(Back to Basics):https://arxiv.org/abs/2402.14740 【已核】
  • GRPO(DeepSeekMath):https://arxiv.org/abs/2402.03300
  • DeepSeek-R1(读 R1-Zero 一节):https://arxiv.org/abs/2501.12948
  • ★ Tulu 3(完整开放的后训练配方,RLVR):https://arxiv.org/abs/2411.15124 【已核】
  • 知识蒸馏(Hinton):https://arxiv.org/abs/1503.02531
  • 在线策略蒸馏综述:https://arxiv.org/abs/2604.00626 (没有精读)
  • LoRA:https://arxiv.org/abs/2106.09685 ;QLoRA:https://arxiv.org/abs/2305.14314
  • Do NOT Think That Much for 2+3=?(过度思考):https://arxiv.org/abs/2412.21187 【已核】
  • s1(预算强制):https://arxiv.org/abs/2501.19393 【已核】
  • Kimi k1.5(long2short):https://arxiv.org/abs/2501.12599 【已核】
  • 拒答由单一方向控制(abliteration):https://arxiv.org/abs/2406.11717 【已核】
  • 模型合并综述:https://arxiv.org/abs/2408.07666
  • LiveCodeBench(抗污染):https://arxiv.org/abs/2403.07974 【已核】

博客

  • Lilian Weng 的奖励黑客、测试时计算系列:https://lilianweng.github.io (具体文章没逐个核对)

第 4 章提到的变体与模板

  • Swift-1.5:https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-27B
  • ThinkingCap:https://huggingface.co/bottlecapai/ThinkingCap-Qwen3.8-27B
  • Signal:https://huggingface.co/agentionai/Signal-3.8-27B
  • AREX-2:https://huggingface.co/BAAI/AREX-2
  • Coder390:https://huggingface.co/nerkyor/Qwen3.8-27B-Coder390-EfficientThink-Opus5.5-GPT6Astra-Grok4.7-DSV4Pro-K3-SFT-RLOO-MTP-DFlash2
  • Qwen-Sharp 模板:https://huggingface.co/peculiar-ragdoll/Qwen-Sharp-Chat-Templates
  • JetBrains blend:https://huggingface.co/JetBrains/Qwen3.8-3.6-27B-blend

8.5 推理引擎(第 5 章)

论文

  • Orca(连续批处理):https://www.usenix.org/conference/osdi22/presentation/yu
  • ★ PagedAttention / vLLM:https://arxiv.org/abs/2309.06180
  • Sarathi-Serve(分块预填充):https://arxiv.org/abs/2403.02310
  • SGLang / RadixAttention:https://arxiv.org/abs/2312.07104 ;博客:https://lmsys.org/blog/2024-01-17-sglang/
  • FlashAttention:https://arxiv.org/abs/2205.14135 ;FlashAttention-2:https://arxiv.org/abs/2307.08691
  • KTransformers(SOSP'25):https://madsys.cs.tsinghua.edu.cn/publication/ktransformers-unleashing-the-full-potential-of-cpu/gpu-hybrid-inference-for-moe-models/

博客与教程

  • vLLM 首篇博客:https://blog.vllm.ai/2023/06/20/vllm.html
  • Hugging Face,Optimizing LLMs for Speed and Memory:https://huggingface.co/docs/transformers/llm_tutorial_optimization

官方文档

  • llama.cpp server 参数:https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md
  • llama.cpp 多 GPU:https://github.com/ggml-org/llama.cpp/blob/master/docs/multi-gpu.md
  • llama.cpp 编译与后端:https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md
  • GGUF 规范:https://github.com/ggml-org/ggml/blob/master/docs/gguf.md
  • vLLM 设计文档(插件、前缀缓存、CUDA Graphs):https://github.com/vllm-project/vllm/tree/main/docs/design
  • AMD GPUOpen,WMMA on RDNA3:https://gpuopen.com/learn/wmma_on_rdna3/
  • LLVM AMDGPU 文档(gfx1201 定义):https://llvm.org/docs/AMDGPUUsage.html
  • ROCm Radeon 兼容性列表:https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/compatibility/compatibilityrad/native_linux/native_linux_compatibility.html

社区实测

  • llama.cpp ROCm 记分板:https://github.com/ggml-org/llama.cpp/discussions/15021
  • llama.cpp Vulkan 记分板:https://github.com/ggml-org/llama.cpp/discussions/10879
  • Phoronix,R9700 上 ROCm 7.1 对 Vulkan:https://www.phoronix.com/review/rocm-71-llama-cpp-vulkan/2 【未核:网页 403】

第 5 章比较的引擎和项目

  • ★ rdna-boosts 补丁集(README、patches/README.md、GREEDY-PURITY.md):https://github.com/stew675/llama-cpp-rdna-boosts
  • Paiton:https://github.com/Eliovp-BV/paiton-vllm-plugin
  • ★ Strata(docs/HOW_IT_WORKS.md 讲专家缓存讲得很清楚):https://github.com/Niko1221/Strata
  • R9V:https://github.com/Dyluhn/R9V
  • NInfer:https://github.com/Neroued/ninfer
  • ninfer-fusion-kvmem:https://github.com/1314521gjy/ninfer-fusion-kvmem
  • Project Maya:https://github.com/mw00/project-maya
  • KTransformers:https://github.com/kvcache-ai/ktransformers
  • llama.cpp 的 Flash-Next 支持:https://github.com/ggml-org/llama.cpp/pull/27742

8.6 推测解码(第 6 章)

  • ★ Leviathan 等:https://arxiv.org/abs/2211.17192
  • Chen 等,Speculative Sampling:https://arxiv.org/abs/2302.01318
  • Medusa:https://arxiv.org/abs/2401.10774
  • EAGLE:https://arxiv.org/abs/2401.15077 ;EAGLE-2:https://arxiv.org/abs/2406.16858 ;EAGLE-3:https://arxiv.org/abs/2503.01840
  • DFlash:https://arxiv.org/abs/2602.06036 ;项目页:https://z-lab.ai/projects/dflash/
  • Inco AI,DFlash 2: Keep Drafting Parallel:https://inco.ai/blog/dflash2/
  • DFlash2-FP8 模型卡(并发扫描数据):https://huggingface.co/tcclaviger/Qwen3.8-27B-DFlash2-FP8
  • ★ llama.cpp 推测解码文档:https://github.com/ggml-org/llama.cpp/blob/master/docs/speculative.md
  • ★ llama.cpp PR #27210(自适应 MTP 深度,2 × R9700 实测和长讨论):https://github.com/ggml-org/llama.cpp/pull/27210
  • llama.cpp PR #22105(DFlash):https://github.com/ggml-org/llama.cpp/pull/22105
  • vLLM 推测解码文档:https://github.com/vllm-project/vllm/blob/main/docs/features/speculative_decoding/README.md
  • 文本退化与 nucleus 采样:https://arxiv.org/abs/1904.09751 ;min-p:https://arxiv.org/abs/2407.01082

8.7 评测与统计(第 7 章)

  • McNemar 检验:https://en.wikipedia.org/wiki/McNemar%27s_test
  • Dror 等,The Hitchhiker’s Guide to Testing Statistical Significance in NLP:https://aclanthology.org/P18-1128/ 【未核】
  • Evan Miller,Adding Error Bars to Evals:仅作题名检索线索;未核对出版记录,不据记忆附论文号。

8.8 作者测量与公开数据表

标作【本机实测】的数字来自作者在撰写时的非公开测量,原始日志不随文提供。读者可以核对已列出的配置、样本与计算口径:


8.9 研究中没能确认的事

写作时如实标注了这些不确定点,引用前请自己核对:

架构

  • Qwen 官方博客是 JS 渲染,没读到正文,用 HF 模型卡和技术报告代替;
  • Qwen3.8-27B 等的发布日期只有聚合站的数据;
  • Flash-Next 的 qwen-community-1.0 许可、Qwen-Image-2.1 和 MiniMax H3 的许可全文没读;
  • n-gram 门控融合的精确公式、h2o-lightning-4b 的具体微调方式没读到;
  • Mamba-2、Pre-LN 等少数论文编号是凭记忆写的。

量化

  • RDNA4 有没有 FP4 矩阵指令,只是“没看到”,需要查 AMD ISA 文档确认;
  • NVIDIA NVFP4 博客、OCP MX 规范、AMD R9700 产品页研究时都没能打开。

引擎

  • R9700 和 3090 的显存带宽(文中用的 640 / 936 GB/s)没有从官方规格页逐项核对;
  • “R9700 上 Vulkan 为什么比 HIP 快”没有一手分析,第 5 章的解释是推断;
  • CUDA 和 HIP 能不能在同一个 llama.cpp 进程里一起用,没有找到明确说法;
  • Paiton 的 Flash-Next 3 位文档自称“116 GB 权重全在显存”,和 2 × 32 GB 对不上,需要再读原文;
  • Paiton、R9V、Strata、Maya 的速度数字全部是作者自报(本机实测过的 Paiton、Strata 除外)。

后训练

  • Swift、ThinkingCap 的训练数据和方法细节没有公开;
  • Signal 开 MTP 要加 --no-spec-draft-backend-sampling 的说法只在社区看到,模型卡里没找到。

本文写作中使用了 AI 辅助。文字采用 CC BY-NC-SA 4.0 许可。

最后更新于