Transformer 与大语言模型¶
第四阶段(6 → 8 周):LLM 原理 + 微调 + 应用
子目录¶
- Transformer架构 — Attention / 位置编码 / Transformer Block
- LLM微调 — LoRA / QLoRA / P-Tuning / 数据准备
- Prompt工程 — Zero-shot / Few-shot / CoT / 结构化 Prompt
- RAG — 文档分块 → 向量化 → 检索 → 生成
- Agent — ReAct / Function Calling / 多 Agent 协作
学习目标¶
- 手推多头注意力公式,理解 Q/K/V
- 从零实现 GPT-2 (nanoGPT)
- 用 LoRA 微调一个 7B 模型
- 构建一个 RAG 问答系统
- 实现一个带 Function Calling 的 Agent
推荐资源¶
| 资源 | 链接 |
|---|---|
| Attention Is All You Need | https://arxiv.org/abs/1706.03762 |
| Annotated Transformer | http://nlp.seas.harvard.edu/annotated-transformer/ |
| nanoGPT | https://github.com/karpathy/nanoGPT |
| HuggingFace NLP Course | https://huggingface.co/learn/nlp-course |
| LLaMA-Factory | https://github.com/hiyouga/LLaMA-Factory |
| LangChain | https://python.langchain.com/docs/ |