arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.13623cs.CLcs.AI
收藏

词汇维度的缩放定律:更大的模型应匹配更大的词表

Scaling Laws with Vocabulary: Larger Models Deserve Larger Vocabularies

The University of Hong Kong(香港大学);Sea AI Lab(Sea AI实验室);Contextual AI;Stanford University(斯坦福大学);The Ohio State University(俄亥俄州立大学)

Chaofan Tao, Qian Liu, Longxu Dou, Niklas Muennighoff, Zhongwei Wan, Ping Luo, Min Lin, Ngai Wong

AI总结:

该研究聚焦大语言模型缩放中被忽略的词表大小因素,提出三种计算最优词表的预测方法,证实大模型需匹配更大词表,优化词表可在同等算力下提升下游性能,为高效预训练提供新方向。

摘要:

大语言模型(LLM)的缩放研究主要聚焦于模型参数与训练数据规模,忽略了词表大小的作用。我们通过训练参数规模从33M到3B、训练数据量最高达500B字符、配置不同词表的模型,探究词表大小对LLM缩放定律的影响。我们提出三种互补方法预测计算最优词表大小:IsoFLOPs分析、导数估计、损失函数参数拟合。三种方法得出一致结论:最优词表大小取决于计算预算,更大的模型需要更大的词表。然而当前大多数LLM的词表大小都不足。例如,我们预测Llama2-70B的最优词表大小至少应为216K,是其现有32K词表的7倍。我们通过在不同FLOPs预算下训练3B参数模型,实证验证了我们的预测。采用我们预测的最优词表大小,相比常用词表大小能持续提升下游任务性能。在相同的2.3e21 FLOPs下,将词表大小从传统的32K提升至43K,我们在ARC-Challenge上的性能从29.1提升至32.0。我们的工作凸显了在高效预训练中联合考虑分词与模型缩放的重要性。代码与演示可在https://github.com/sail-sg/scaling-with-vocab和https://hf.co/spaces/sail/scaling-with-vocab-demo获取。

英文摘要:

Research on scaling large language models (LLMs) has primarily focused on model parameters and training data size, overlooking the role of vocabulary size. We investigate how vocabulary size impacts LLM scaling laws by training models ranging from 33M to 3B parameters on up to 500B characters with various vocabulary configurations. We propose three complementary approaches for predicting the compute-optimal vocabulary size: IsoFLOPs analysis, derivative estimation, and parametric fit of the loss function. Our approaches converge on the conclusion that the optimal vocabulary size depends on the compute budget, with larger models requiring larger vocabularies. Most LLMs, however, use insufficient vocabulary sizes. For example, we predict that the optimal vocabulary size of Llama2-70B should have been at least 216K, 7 times larger than its vocabulary of 32K. We validate our predictions empirically by training models with 3B parameters across different FLOPs budgets. Adopting our predicted optimal vocabulary size consistently improves downstream performance over commonly used vocabulary sizes. By increasing the vocabulary size from the conventional 32K to 43K, we improve performance on ARC-Challenge from 29.1 to 32.0 with the same 2.3e21 FLOPs. Our work highlights the importance of jointly considering tokenization and model scaling for efficient pre-training. The code and demo are available at https://github.com/sail-sg/scaling-with-vocab and https://hf.co/spaces/sail/scaling-with-vocab-demo.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑