mlsanityData to 14 Oct 2026

HashFormers: Towards Vocabulary-independent Pre-trained Transformers

arXiv 2210.07904 ↗First posted 14 Oct 2022cs.CLcited by 6

Not on the map. Why?

Abstract (arXiv)

Transformer-based pre-trained language models are vocabulary-dependent, mapping by default each token to its corresponding embedding. This one-to-one mapping results into embedding matrices that occupy a lot of memory (i.e. millions of parameters) and grow linearly with the size of the vocabulary. Previous work on on-device transformers dynamically generate token embeddings on-the-fly without embedding matrices using locality-sensitive hashing over morphological information. These embeddings are subsequently fed into transformer layers for text classification. However, these methods are not pre-trained. Inspired by this line of work, we propose HashFormers, a new family of vocabulary-independent pre-trained transformers that support an unlimited vocabulary (i.e. all possible tokens in a corpus) given a substantially smaller fixed-sized embedding matrix. We achieve this by first introducing computationally cheap hashing functions that bucket together individual tokens to embeddings. We also propose three variants that do not require an embedding matrix at all, further reducing the memory requirements. We empirically demonstrate that HashFormers are more memory efficient compared to standard pre-trained transformers while achieving comparable predictive performance when fine-tuned on multiple text classification tasks. For example, our most efficient HashFormer variant has a negligible performance degradation (0.4% on GLUE) using only 99.1K parameters for representing the embeddings compared to 12.3-38M parameters of state-of-the-art models.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 28 of its 39 references that are in the map. First posted on arXiv 14 Oct 2022.

Builds on

28 of 39 references.

References · 28

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  4. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,899
  5. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
  6. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
  7. 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
  8. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  9. 2020Reformer: The Efficient Transformercited by 1,668
  10. 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
  11. 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
  12. 2015Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Bookscited by 1,043
16 more
  1. 2019Green AIcited by 627
  2. 2021Datasets: A Community Library for Natural Language Processingcited by 530
  3. 2021ByT5: Towards a token-free future with pre-trained byte-to-byte modelscited by 509
  4. 2021CANINE: Pre-training an Efficient Tokenization-Free Encoder for Language Representationcited by 232
  5. 2019Combating Adversarial Misspellings with Robust Word Recognitioncited by 163
  6. 2021Charformer: Fast Character Transformers via Gradient-based Subword Tokenizationcited by 160
  7. 2020Rethinking embedding coupling in pre-trained language modelscited by 103
  8. 2020Compressing Large-Scale Transformer-Based Models: A Case Study on BERTcited by 96
  9. 2020CharacterBERT: Reconciling ELMo and BERT for Word-Level Open-Vocabulary Representations From Characterscited by 87
  10. 2020Adv-BERT: BERT is not robust on misspellings! Generating nature adversarial samples on BERTcited by 69
  11. 2017Hash Embeddings for Efficient Word Representationscited by 55
  12. 2017Compressing Word Embeddings via Deep Compositional Code Learningcited by 35
  13. 2021Frustratingly Simple Pretraining Alternatives to Masked Language Modelingcited by 17
  14. 2022How does the pre-training objective affect what large language models learn about linguistic properties?cited by 16
  15. 2020ProFormer: Towards On-Device LSH Projection Based Transformerscited by 9
  16. 2020Compressing Transformer-Based Semantic Parsing Models using Compositional Code Embeddingscited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 3; 2024: 1; 2025: 1; 2026: 1.

6 papers.