Memory-Efficient FastText: A Comprehensive Approach Using Double-Array Trie Structures and Mark-Compact Memory Management
Not on the map. Why?
Abstract (arXiv)
FastText remains a practical choice for industrial word representation because it can synthesize vectors for out-of-vocabulary words from character n-grams. Its original hash-bucket implementation, however, couples two engineering compromises that become painful at large scale: unrelated n-grams collide into the same row, while increasing the bucket count quickly turns the input matrix into the dominant memory cost. This paper presents a memory-efficient FastText variant based on an exact-then-compress principle: first give every observed word and n-gram an explicit identity, then compress only those rows whose learned vectors and lexical structure justify sharing. Concretely, we replace hash buckets with collision-free double-array trie indexes and compress the resulting n-gram matrix through structurally constrained prefix and suffix merging followed by mark-compact row reorganization. Unlike arbitrary hashing, the proposed method shares rows only after a high cosine-similarity test, preserving interpretable n-gram identities while reducing the number of live rows. We describe the full training and serving pipeline, including UTF-8 aware n-gram enumeration, double-array trie lookup, memory-mapped model loading, and vector reconstruction for words and sentences. On a large Chinese vocabulary benchmark with 30.1M words and 287.4M extracted n-grams, the compressed model reduces memory from 145.2GB to 28.9GB, improves load time from 12.3 minutes to 3.2 minutes, and preserves downstream quality within 0.3 points of a hash-free model. We position the result as a compact lexical memory layer for LLM-era retrieval systems and release the implementation as an extended FastText prototype.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 25 of its 38 references that are in the map. First posted on arXiv 2 Jun 2025.
Builds on
25 of 38 references.
References · 25
- 2015Distilling the Knowledge in a Neural Networkcited by 10,324
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,375
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
- 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,474
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2015Learning both Weights and Connections for Efficient Neural Networkscited by 2,031
- 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
- 2017Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inferencecited by 1,593
- 2016Enriching Word Vectors with Subword Informationcited by 1,583
13 more
- 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
- 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,253
- 2021BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Modelscited by 1,252
- 2016Bag of Tricks for Efficient Text Classificationcited by 876
- 2018Quantizing deep convolutional networks for efficient inference: A whitepapercited by 521
- 2017Deep Gradient Compression: Reducing the Communication Bandwidth for Distributed Trainingcited by 478
- 2024NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Modelscited by 472
- 2021SPLADE: Sparse Lexical and Expansion Model for First Stage Rankingcited by 286
- 2017TernGrad: Ternary Gradients to Reduce Communication in Distributed Deep Learningcited by 256
- 2018Adaptive Input Representations for Neural Language Modelingcited by 226
- 2024jina-embeddings-v3: Multilingual Embeddings With Task LoRAcited by 141
- 2025MMTEB: Massive Multilingual Text Embedding Benchmarkcited by 125
- 2017Compressing Word Embeddings via Deep Compositional Code Learningcited by 35
Built on by
Not cited yet.