[论文解读] Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws
本论文确立了一条基础性缩放定律:无论模型架构或量化方式(如int8)如何,大语言模型每参数恰好存储2比特的事实性知识。通过使用(名称,属性,值)三元组的受控合成数据集,研究发现70亿参数的模型可存储140亿比特的知识——超过英语维基百科与教科书的总和。同时揭示了训练时长、数据信噪比以及架构选择(如旋转位置编码)对模型容量的显著影响。
Scaling laws describe the relationship between the size of language models and their capabilities. Unlike prior studies that evaluate a model's capability via loss or benchmarks, we estimate the number of knowledge bits a model stores. We focus on factual knowledge represented as tuples, such as (USA, capital, Washington D.C.) from a Wikipedia page. Through multiple controlled datasets, we establish that language models can and only can store 2 bits of knowledge per parameter, even when quantized to int8, and such knowledge can be flexibly extracted for downstream applications. Consequently, a 7B model can store 14B bits of knowledge, surpassing the English Wikipedia and textbooks combined based on our estimation. More broadly, we present 12 results on how (1) training duration, (2) model architecture, (3) quantization, (4) sparsity constraints such as MoE, and (5) data signal-to-noise ratio affect a model's knowledge storage capacity. Notable insights include: * The GPT-2 architecture, with rotary embedding, matches or even surpasses LLaMA/Mistral architectures in knowledge storage, particularly over shorter training durations. This arises because LLaMA/Mistral uses GatedMLP, which is less stable and harder to train. * Prepending training data with domain names (e.g., wikipedia.org) significantly increases a model's knowledge capacity. Language models can autonomously identify and prioritize domains rich in knowledge, optimizing their storage capacity.
研究动机与目标
- 建立一个原则性、量化的框架,用于衡量大语言模型的事实性知识存储容量。
- 确定模型规模是否与知识容量呈线性缩放关系,若是,则确定确切的比例常数。
- 分离并量化训练时长、模型架构、量化、稀疏性(如MoE)以及数据质量对知识容量的影响。
- 提供一个独立于下游基准性能的模型知识存储效率比较基准。
提出的方法
- 从知识库生成(名称,属性,值)三元组的合成数据集,并转换为用于预训练的自然语言文本。
- 使用标准自回归语言建模范式,从随机初始化开始训练模型,数据集仅包含知识内容且无噪声。
- 通过信息论推导的概率界限,测量模型对(名称,属性)对恢复真实值的能力,以此估计知识容量。
- 理论分析采用集中不等式与基于熵的界限,推导出模型可表示的可区分知识状态数的下限。
- 该框架分别处理名称、属性和值的预测任务,实现总知识容量向不同组成部分的分解。
- 通过多种架构(GPT-2、LLaMA、Mistral)、量化级别(int8)和训练方案的实证验证,确认每参数2比特的极限。
实验结果
研究问题
- RQ1大语言模型的模型规模与事实性知识容量之间的确切缩放关系是什么?
- RQ2知识容量是否与模型规模呈线性缩放?若是,比例常数是多少?
- RQ3架构选择(如旋转位置编码与GatedMLP)如何影响知识存储效率?
- RQ4数据信噪比或领域特定前缀(如“wikipedia.org”)在多大程度上影响知识容量?
- RQ5知识容量能否在不依赖下游基准性能的前提下实现有意义的量化与测量?
主要发现
- 大语言模型每参数恰好存储2比特事实性知识,即使量化至int8,仍确立了普遍的上限。
- 70亿参数的模型可存储140亿比特知识,超过英语维基百科与教科书合计约100亿比特的估计值。
- 采用旋转位置编码的GPT-2架构在知识容量上优于或等同于LLaMA/Mistral架构,尤其在较短训练时长下表现更优。
- 在训练数据前添加领域标识符(如“wikipedia.org”)可显著提升知识容量,使模型能自主优先处理高知识密度领域。
- 基于GatedMLP的架构(如LLaMA、Mistral)稳定性较差且更难训练,导致有效知识容量低于简单MLP架构。
- 知识容量对量化和稀疏性(如MoE)具有鲁棒性,但对数据质量和信噪比极为敏感。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。