| 第213行: |
第213行: |
| | | | |
| | == 大语言模型 == | | == 大语言模型 == |
| − | 大型语言模型如 GPT、BERT、PaLM、Chinchilla等,基于 Transformer 架构,具备亿至千亿级参数量,并通过下一个token的预测来进行预训练。其在多个自然语言处理(NLP)任务上展现出跨任务、跨领域的强泛化能力。
| |
| | | | |
| − | ===Parameter–Loss Power Law === | + | === 训练阶段的规模法则(Training‑time Scaling Laws) === |
| − | Kaplan 等人在 2020 年提出,大语言模型的预测误差(例如交叉熵损失)与模型参数量 [math]\displaystyle{ N }[/math]、训练数据量 [math]\displaystyle{ D }[/math] 之间呈现出如下幂律关系:
| |
| | | | |
| − | [math]\displaystyle{ L(N, D) = A N^{-\alpha} + B D^{-\beta} + L_\infty }[/math]
| + | # OpenAI的研究表明,语言模型在无监督训练中的困惑度(即交叉熵损失)随着模型参数规模 N、训练数据量 D 和训练计算量 C 的增加呈幂律下降关系。 |
| | | | |
| − | 其中:
| + | === 推理阶段的规模法则(Post-training & Inference-time Scaling) === |
| | | | |
| − | * [math]\displaystyle{ \alpha \approx 0.076 }[/math], [math]\displaystyle{ \beta \approx 0.095 }[/math];
| + | === 断裂式规模法则(Broken Neural Scaling Laws, ''BNSL'') === |
| − | * [math]\displaystyle{ L_\infty }[/math] 是误差下界;
| |
| − | * 显示出收益递减,且 [math]\displaystyle{ \alpha < \beta }[/math],说明扩大模型参数比单纯增加数据更有效。
| |
| | | | |
| − | === Chinchilla Scaling === | + | === 微调阶段的规模法则(Finetuning Scaling Laws) === |
| − | Hoffmann 等人在 2022 年发现,在总计算预算 [math]\displaystyle{ C }[/math] 固定的情况下,最优策略是使模型参数 [math]\displaystyle{ N }[/math] 和训练数据量 [math]\displaystyle{ D }[/math] 成线性比例:
| |
| | | | |
| − | [math]\displaystyle{ N^\ast \propto D }[/math]
| + | === 记忆事实的规模法则(Fact-memorization Scaling Laws) === |
| | | | |
| − | [math]\displaystyle{ C \approx 6 N^\ast D }[/math]
| + | === 参数密度时间法则(Densing Law) === |
| | | | |
| − | Chinchilla 模型(70B 参数)遵循此定律,仅用 GPT-3 同级的算力,却在 MMLU 等 29 项任务中超越了参数更多的 Gopher(280B)和 GPT-3(175B)。
| + | === 其他方向的规模规律 === |
| − | | |
| − | === 涌现能力 === | |
| − | <nowiki>大语言模型在参数超过某一临界值 [math]\displaystyle{ N_{\text{crit}} }[/math] 后,会突然展现出此前未具备的能力,称为</nowiki>涌现能力(Emergent Abilities)。其概率可用逻辑斯蒂函数建模:
| |
| − | | |
| − | <nowiki>[math]\displaystyle{ P_{\text{success}}(N) \approx \frac{1}{1 + e^{-\kappa (\log N - \log N_{\text{crit}})} } }[/math]</nowiki>
| |
| − | | |
| − | 这类能力包括:
| |
| − | | |
| − | * zero-shot / few-shot 学习;
| |
| − | * 算术推理、代码生成、逻辑判断等;
| |
| − | * 性能在跨过特定规模后发生跳跃,无法通过小模型外推预测。
| |
| | | | |
| | = 参考文献 = | | = 参考文献 = |