Vocabulary-level Memory Efficiency for Language Model Fine-tuning

Miles Williams, Nikolaos Aletras
9/15/2023
cs.CL

No official code found. Best implementation: mlsw/partial-embedding-matrix-adaptation (8 stars, MIT, PyTorch, last commit 2025-03-24).

Abstract

The extensive memory footprint of language model (LM) fine-tuning poses a challenge for both researchers and practitioners. LMs use an embedding matrix to represent extensive vocabularies, forming a substantial proportion of the model parameters. While previous work towards memory-efficient fine-tuning has focused on minimizing the number of trainable parameters, reducing the memory footprint of the embedding matrix has yet to be explored. We first demonstrate that a significant proportion of the vocabulary remains unused during fine-tuning. We then propose a simple yet effective approach that leverages this finding to minimize memory usage. We show that our approach provides substantial reductions in memory usage across a wide range of models and tasks. Notably, our approach does not impact downstream task performance, while allowing more efficient use of computational resources.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

Vocabulary-level memory efficiency for language model fine-tuning.

80PythonSep 19, 20231 years agoMIT
berthuggingfacenlptransformers

Similar Papers

Cite this paper

@article{williams2023vocabularylevel,
  title  = {Vocabulary-level Memory Efficiency for Language Model Fine-tuning},
  author = {Miles Williams and Nikolaos Aletras},
  year   = {2023},
  eprint = {2309.08708},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.08708v2}
}

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/2309.08708.svg)](https://codeofpaper.com/paper/2309.08708)

Discussion