论文笔记
经典论文地图
Section titled “经典论文地图”flowchart TD A[Attention Is All You Need<br/>2017] --> B[BERT<br/>2018] A --> C[GPT 系列<br/>2018-2023] C --> D[InstructGPT<br/>2022] D --> E[RLHF 对齐] A --> F[ViT<br/>2020] F --> G[多模态]“Attention Is All You Need” (2017)
Section titled ““Attention Is All You Need” (2017)”作者:Vaswani et al. (Google Brain)
引用:超过 100,000 次
意义:提出 Transformer 架构,完全取代了 RNN 在序列建模中的地位。
- 完全基于 Attention 的架构:不使用任何循环或卷积
- Multi-Head Attention:多个注意力头并行捕捉不同粒度的关系
- 位置编码:用正弦函数编码位置信息
- 训练效率:可并行计算,训练速度远超 RNN
缩放点积注意力:
Multi-Head Attention:
其中
- Encoder:6 层,每层有 Self-Attention + FFN
- Decoder:6 层,每层有 Masked Self-Attention + Cross-Attention + FFN
- , 个头,
- 在 WMT 2014 英德翻译任务上达到 28.4 BLEU(当时最佳)
“BERT: Pre-training of Deep Bidirectional Transformers” (2018)
Section titled ““BERT: Pre-training of Deep Bidirectional Transformers” (2018)”作者:Devlin et al. (Google AI)
意义:提出双向预训练范式,在 11 项 NLP 任务上刷新纪录。
- Masked Language Model (MLM):随机 mask 15% 的 token,训练模型预测被 mask 的词
- Next Sentence Prediction (NSP):判断两句话是否连续
- 双向上下文:与 GPT 的单向不同,BERT 能同时看到前后文
- 数据:BooksCorpus (800M 词) + English Wikipedia (2.5B 词)
- 两个版本:BERT-base (110M 参数) / BERT-large (340M 参数)
- 输入格式:
[CLS] 句子A [SEP] 句子B [SEP]
BERT 通过添加一个简单的分类头即可适配各种下游任务:
- 单句分类:取
[CLS]的输出 - 句子对分类:同上
- 序列标注:取每个 token 的输出
- 问答:预测答案的起始和结束位置
“Training language models to follow instructions” (InstructGPT, 2022)
Section titled ““Training language models to follow instructions” (InstructGPT, 2022)”作者:Ouyang et al. (OpenAI)
意义:提出 RLHF 方法,让大模型对齐人类意图。
- SFT(监督微调):收集人类写的 prompt-answer 对,微调 GPT-3
- RM(奖励模型训练):让标注员对多个回答排序,训练奖励模型
- PPO(强化学习):用奖励模型通过 PPO 算法优化策略
- 1.3B 的 InstructGPT 比 175B 的 GPT-3 更受人类偏好
- RLHF 显著减少了有害输出和编造信息
- 在”真实性”(Truthfulness)指标上大幅提升
- RLHF 成为 ChatGPT、Claude 等产品的核心对齐技术
- DPO (2023) 提出了更简单的替代方案,无需显式训练奖励模型
论文阅读建议
Section titled “论文阅读建议”- 先读 Abstract + Conclusion,了解核心贡献
- 再看图和表,理解架构
- 最后读实验细节
- 配合代码实现加深理解