어휘 크기에 따른 스케일링 법칙: 더 큰 모델은 더 큰 어휘를 필요로 한다
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 분석, 미분 추정, 그리고 손실 함수의 파라미터 적합입니다. 우리의 접근 방식은 동일한 결과로 수렴하는데, 최적의 어휘 크기는 사용 가능한 계산 예산에 의존하며 더 큰 모델은 더 큰 어휘를 필요로 한다는 것입니다. 그러나 대부분의 LLM은 너무 작은 어휘 크기를 사용하고 있습니다. 예를 들어, 우리는 Llama2-70B의 최적 어휘 크기가 32K의 어휘 크기보다 7배 큰 216K 이상이어야 한다고 예측합니다. 우리는 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.Summary
AI-Generated Summary