How to Do a Vocab Swap? A Study of Embedding Replacement for Pre-trained Transformers
Abstract
There are a wide range of different tokenizers and vocabularies that have been used to train language models, and training a language model on just one of these can be prohibitively expensive. The ability to swap the vocabulary of a model after it has been trained enables models to be adapted to different tokenizers, and even different languages, without the computational or data cost of from-scratch training. In this paper, we ask when such swaps are possible, and how to perform them effectively? The major challenge of performing a vocab swap is re-learning the parameters of the embedding layer for the vocabulary. We observe that it is possible to re-learn the embedding for a vocabulary using a naive initialization, and we investigate strong initialization strategies that enable learning of new embeddings for swapped vocabularies, even when those vocabularies come from a different source language than the original language model.
BibTeX
@misc{jain2022how,
author = {Neel Jain and John Kirchenbauer and Jonas Geiping and Tom Goldstein},
title = {{How to Do a Vocab Swap? A Study of Embedding Replacement for Pre-trained Transformers}},
year = {2022},
url = {https://openreview.net/forum?id=MsjB2ohCJO1},
howpublished = {OpenReview},
}Ask Althea to put this paper to the test.
Loading related content...