語彙規模のスケーリング則:大規模モデルには大規模な語彙が必要
Scaling Laws with Vocabulary: Larger Models Deserve Larger Vocabularies
July 18, 2024
著者: Chaofan Tao, Qian Liu, Longxu Dou, Niklas Muennighoff, Zhongwei Wan, Ping Luo, Min Lin, Ngai Wong
cs.AI
要旨
大規模言語モデル(LLM)のスケーリングに関する研究は、主にモデルパラメータとトレーニングデータのサイズに焦点を当てており、語彙サイズの役割を見落としてきた。直感的には、より大きな語彙は、文をより少ないトークンで表現することで効率的なトークン化を可能にするが、一方で希少なトークンの表現が不十分になるリスクも増大する。本研究では、33Mから3Bのパラメータを持つモデルを最大500B文字のデータでトレーニングし、さまざまな語彙構成がLLMのスケーリング則に与える影響を調査する。計算最適な語彙サイズを予測するために、IsoFLOPs分析、微分推定、および損失関数のパラメトリックフィットという3つの補完的なアプローチを提案する。これらのアプローチは、最適な語彙サイズが利用可能な計算予算に依存し、より大きなモデルにはより大きな語彙が適しているという同じ結論に収束する。しかし、ほとんどのLLMは語彙サイズが小さすぎる。例えば、Llama2-70Bの最適な語彙サイズは少なくとも216Kであるべきだと予測しており、これは実際に使用された32Kの語彙の7倍に相当する。3Bパラメータのモデルを異なるFLOPs予算でトレーニングすることで、これらの予測を実証的に検証する。予測された最適な語彙サイズを採用することで、一般的に使用される語彙サイズよりも下流タスクの性能が一貫して向上する。語彙サイズを従来の32Kから43Kに増やすことで、同じ2.3e21 FLOPsでARC-Challengeの性能を29.1から32.0に改善した。本研究は、効率的なスケーリングのためにモデルパラメータと語彙サイズを同時に考慮する必要性を強調している。
English
Research on scaling large language models (LLMs) has primarily focused on
model parameters and training data size, overlooking the role of vocabulary
size. % Intuitively, larger vocabularies enable more efficient tokenization by
representing sentences with fewer tokens, but they also increase the risk of
under-fitting representations for rare tokens. 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 same result that the
optimal vocabulary size depends on the available compute budget and that larger
models deserve larger vocabularies. However, most LLMs use too small 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 emphasizes the necessity of jointly considering model
parameters and vocabulary size for efficient scaling.