The Ups and Downs of Large Language Model Inference with Vocabulary Trimming by Language Heuristics

Nikolay Bogoychev, Pinzhen Chen, Barry Haddow, Alexandra Birch


Abstract
Deploying large language models (LLMs) encounters challenges due to intensive computational and memory requirements. Our research examines vocabulary trimming (VT) inspired by restricting embedding entries to the language of interest to bolster time and memory efficiency. While such modifications have been proven effective in tasks like machine translation, tailoring them to LLMs demands specific modifications given the diverse nature of LLM applications. We apply two language heuristics to trim the full vocabulary—Unicode-based script filtering and corpus-based selection—to different LLM families and sizes. The methods are straightforward, interpretable, and easy to implement. It is found that VT reduces the memory usage of small models by nearly 50% and has an upper bound of 25% improvement in generation speed. Yet, we reveal the limitations of these methods in that they do not perform consistently well for each language with diminishing returns in larger models.
Anthology ID:
2024.insights-1.17
Volume:
Proceedings of the Fifth Workshop on Insights from Negative Results in NLP
Month:
June
Year:
2024
Address:
Mexico City, Mexico
Editors:
Shabnam Tafreshi, Arjun Akula, João Sedoc, Aleksandr Drozd, Anna Rogers, Anna Rumshisky
Venues:
insights | WS
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
148–153
Language:
URL:
https://aclanthology.org/2024.insights-1.17
DOI:
10.18653/v1/2024.insights-1.17
Bibkey:
Cite (ACL):
Nikolay Bogoychev, Pinzhen Chen, Barry Haddow, and Alexandra Birch. 2024. The Ups and Downs of Large Language Model Inference with Vocabulary Trimming by Language Heuristics. In Proceedings of the Fifth Workshop on Insights from Negative Results in NLP, pages 148–153, Mexico City, Mexico. Association for Computational Linguistics.
Cite (Informal):
The Ups and Downs of Large Language Model Inference with Vocabulary Trimming by Language Heuristics (Bogoychev et al., insights-WS 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.insights-1.17.pdf