Pré-treinamento de Modelos de Linguagem Base Pequenos com Menos Tokens
Pre-training Small Base LMs with Fewer Tokens
April 12, 2024
Autores: Sunny Sanyal, Sujay Sanghavi, Alexandros G. Dimakis
cs.AI
Resumo
Estudamos a eficácia de uma abordagem simples para desenvolver um modelo de linguagem base (LM) pequeno a partir de um LM base grande existente: primeiro herdar alguns blocos de transformadores do LM maior e, em seguida, treinar esse modelo menor em um subconjunto muito pequeno (0,1%) dos dados brutos de pré-treinamento do LM maior. Chamamos nossa receita simples de Inheritune e primeiro a demonstramos para construir um LM base pequeno com 1,5 bilhão de parâmetros usando 1 bilhão de tokens (e algumas camadas iniciais de um LM maior com 3 bilhões de parâmetros); fazemos isso usando uma única GPU A6000 por menos de meio dia. Em 9 conjuntos de dados de avaliação diversos, bem como no benchmark MMLU, o modelo resultante se compara favoravelmente a modelos base publicamente disponíveis de tamanho 1B-2B, alguns dos quais foram treinados usando 50 a 1000 vezes mais tokens.
Investigamos o Inheritune em um cenário ligeiramente diferente, onde treinamos LMs pequenos utilizando LMs maiores e seu conjunto de dados completo de pré-treinamento. Aqui mostramos que LMs menores treinados utilizando algumas das camadas do GPT2-medium (355M) e GPT-2-large (770M) podem efetivamente igualar a perda de validação de seus equivalentes maiores quando treinados do zero pelo mesmo número de passos de treinamento no conjunto de dados OpenWebText com 9 bilhões de tokens. Analisamos nossa receita com experimentos extensos e demonstramos sua eficácia em diversos cenários. Nosso código está disponível em https://github.com/sanyalsunny111/LLM-Inheritune.
English
We study the effectiveness of a simple approach to develop a small base
language model (LM) starting from an existing large base LM: first inherit a
few transformer blocks from the larger LM, and then train this smaller model on
a very small subset (0.1\%) of the raw pretraining data of the larger model. We
call our simple recipe Inheritune and first demonstrate it for building a small
base LM with 1.5B parameters using 1B tokens (and a starting few layers of
larger LM of 3B parameters); we do this using a single A6000 GPU for less than
half a day. Across 9 diverse evaluation datasets as well as the MMLU benchmark,
the resulting model compares favorably to publicly available base models of
1B-2B size, some of which have been trained using 50-1000 times more tokens.
We investigate Inheritune in a slightly different setting where we train
small LMs utilizing larger LMs and their full pre-training dataset. Here we
show that smaller LMs trained utilizing some of the layers of GPT2-medium
(355M) and GPT-2-large (770M) can effectively match the val loss of their
bigger counterparts when trained from scratch for the same number of training
steps on OpenWebText dataset with 9B tokens. We analyze our recipe with
extensive experiments and demonstrate it efficacy on diverse settings. Our code
is available at https://github.com/sanyalsunny111/LLM-Inheritune.