规模语言建模
Language Modeling at Scale
摘要:
我们展示了如何使用Zipf定律来扩展语言建模(LM),以利用更多的训练数据和更多的GPU。LM在许多重要的自然语言应用中起着关键作用,如语音识别和机器翻译。扩展LM很重要,因为社区广泛接受没有数据就像更多数据一样。最终,我们希望在TB(万亿字)的文本上进行训练。现代的训练方法离这个目标还很远,因为存在各种瓶颈,特别是内存(GPU内)和通信(跨GPU)。本文展示了齐普夫定律如何通过对常见单词和字符序列的参数进行分组来解决这些瓶颈,因为$U \ll N$,其中$U$是唯一单词(类型)的数量,$N$是训练集(标记)的大小。对于具有$G$ GPU和$D$维嵌入矩阵的本地批量$K$,我们将原始的每GPU存储器和通信渐近复杂度从$Θ(GKD)$降低到$Θ(GK + UD)$。经验上,我们发现$U \propto (GK)^{0.64}$在四个公开的大型数据集。当我们将GPU的数量增加到64个时,即8倍时,训练时间加快了6.7倍$\times$(对于字符LM)和6.3倍$\times$(对于单词LM),而精度损失可以忽略不计。我们在Tieba数据集上的192个GPU上进行的弱缩放显示,通过在93 GB的数据上进行训练,LM预测精度提高了35%(比公开的SOTA数据集大2.5 $\times$),但与在6个GPU上运行的3 GB相同数据集相比,训练时间仅增加了1.25 $\times$。
英文摘要:
We show how Zipf's Law can be used to scale up language modeling (LM) to take advantage of more training data and more GPUs. LM plays a key role in many important natural language applications such as speech recognition and machine translation. Scaling up LM is important since it is widely accepted by the community that there is no data like more data. Eventually, we would like to train on terabytes (TBs) of text (trillions of words). Modern training methods are far from this goal, because of various bottlenecks, especially memory (within GPUs) and communication (across GPUs). This paper shows how Zipf's Law can address these bottlenecks by grouping parameters for common words and character sequences, because $U \ll N$, where $U$ is the number of unique words (types) and $N$ is the size of the training set (tokens). For a local batch size $K$ with $G$ GPUs and a $D$-dimension embedding matrix, we reduce the original per-GPU memory and communication asymptotic complexity from $Θ(GKD)$ to $Θ(GK + UD)$. Empirically, we find $U \propto (GK)^{0.64}$ on four publicly available large datasets. When we scale up the number of GPUs to 64, a factor of 8, training time speeds up by factors up to 6.7$\times$ (for character LMs) and 6.3$\times$ (for word LMs) with negligible loss of accuracy. Our weak scaling on 192 GPUs on the Tieba dataset shows a 35\% improvement in LM prediction accuracy by training on 93 GB of data (2.5$\times$ larger than publicly available SOTA dataset), but taking only 1.25$\times$ increase in training time, compared to 3 GB of the same dataset running on 6 GPUs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。