Scaling Laws with Vocabulary: Larger Models Deserve Larger Vocabularies

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Tao, Chaofan, Liu, Qian, Dou, Longxu, Muennighoff, Niklas, Wan, Zhongwei, Luo, Ping, Lin, Min, Wong, Ngai
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909374146936832
author Tao, Chaofan
Liu, Qian
Dou, Longxu
Muennighoff, Niklas
Wan, Zhongwei
Luo, Ping
Lin, Min
Wong, Ngai
author_facet Tao, Chaofan
Liu, Qian
Dou, Longxu
Muennighoff, Niklas
Wan, Zhongwei
Luo, Ping
Lin, Min
Wong, Ngai
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2407_13623
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Scaling Laws with Vocabulary: Larger Models Deserve Larger Vocabularies
Tao, Chaofan
Liu, Qian
Dou, Longxu
Muennighoff, Niklas
Wan, Zhongwei
Luo, Ping
Lin, Min
Wong, Ngai
Computation and Language
Artificial Intelligence
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.
title Scaling Laws with Vocabulary: Larger Models Deserve Larger Vocabularies
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2407.13623