An Efficient Multilingual Language Model Compression through Vocabulary Trimming

Asahi Ushio, Yi Zhou, Jose Camacho-Collados
5/24/2023
cs.CL

No official code found. Best implementation: asahi417/lm-vocab-trimmer (70 stars, MIT, last commit 2024-10-25).

Abstract

Multilingual language model (LM) have become a powerful tool in NLP especially for non-English languages. Nevertheless, model parameters of multilingual LMs remain large due to the larger embedding matrix of the vocabulary covering tokens in different languages. On the contrary, monolingual LMs can be trained in a target language with the language-specific vocabulary only, but this requires a large budget and availability of reliable corpora to achieve a high-quality LM from scratch. In this paper, we propose vocabulary-trimming (VT), a method to reduce a multilingual LM vocabulary to a target language by deleting irrelevant tokens from its vocabulary. In theory, VT can compress any existing multilingual LM to build monolingual LMs in any language covered by the multilingual LM. In our experiments, we show that VT can retain the original performance of the multilingual LM, while being smaller in size (in general around 50% of the original vocabulary size is enough) than the original multilingual LM. The evaluation is performed over four NLP tasks (two generative and two classification tasks) among four widely used multilingual LMs in seven languages. Finally, we show that this methodology can keep the best of both monolingual and multilingual worlds by keeping a small size as monolingual models without the need for specifically retraining them, and even limiting potentially harmful social biases.

View on arXivView PDF

Code Implementations(1)

MIT

Vocabulary Trimming (VT) is a model compression technique, which reduces a multilingual LM vocabulary to a target language by deleting irrelevant tokens from its vocabulary. This repository contains a python-library vocabtrimmer, that remove irrelevant tokens from a multilingual LM vocabulary for the target language.

709Shell, PythonFeb 25, 20231 years agoMIT
bertgptlanguage-modelmodel-compressionnlp+1 more

Similar Papers

Cite this paper

@article{ushio2023efficient,
  title  = {An Efficient Multilingual Language Model Compression through Vocabulary Trimming},
  author = {Asahi Ushio and Yi Zhou and Jose Camacho-Collados},
  year   = {2023},
  eprint = {2305.15020},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.15020v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.15020.svg)](https://codeofpaper.com/paper/2305.15020)

Discussion