Memory-efficient Word Embedding Vectors

Jun Suzuki, Masaaki NagataNTT 2017

Abstract

Word embedding is a technique for identifying the semantic relationships between words by computer. Word embedding vectors enable computers to provide a guess similar to the intuition or common sense of human beings. This article introduces a method for reducing the required memory consumption of this important fundamental operation of word embedding vectors while maintaining the ability to calculate semantic relationships, which is an important property when this technique is applied to real world systems.

Introduction: The Scale of Word Embeddings

Word embeddings are the "common sense" engines of modern Natural Language Processing (NLP). By representing words as high-dimensional vectors, computers can perform "semantic arithmetic"—understanding that the relationship between "France" and "wine" is analogous to the relationship between "Germany" and "beer."

Semantic relationships are encoded as distances and angles in vector space.

However, there is a major hurdle for real-world deployment: scale. A typical high-quality model might involve 3 million words, each represented by a 300-dimensional vector. Using standard 4-byte floating-point numbers, this single module requires roughly 3.4 GB of memory. For a developer building a mobile app or a standalone communication robot, dedicating several gigabytes to just one NLP component is often impossible. Furthermore, traditional embeddings lack reproducibility and require total retraining if vector dimensions are changed.

Methods: Parameter Space Sharing

The authors propose a method to significantly reduce memory consumption by moving away from the idea that every word needs a unique, independent set of numbers. Instead of allowing every dimension of every word vector to be an arbitrary floating-point value, they introduce a constraint during the learning process called "parameter space sharing."

Word embedding vectors represented as points in a vector space derived from numerical tables.

This method forces the system to construct vectors using a pre-defined number ($K$) of distinct value sequence patterns. Think of it like a Lego set: instead of carving every word's representation from a unique block of wood, the system builds all words using a limited palette of shared "bricks" (value sequences). To make this work without destroying accuracy, the authors employ sophisticated optimization techniques:

  • Group Regularization: To encourage the grouping of similar values.
  • Dual Decomposition and Augmented Lagrangian Methods: To handle complex optimization constraints.
  • Clustering: To identify which words should share which patterns.

By storing only the unique patterns once and using small pointers for each word, the overall memory footprint drops drastically.

Key Insights and Results

The core innovation lies in the realization that word vectors contain massive amounts of redundant information. We do not need infinite precision for every word to maintain semantic relationships. Unlike traditional quantization which happens after training, this method integrates the memory constraint into the training process itself.

Key Results include: * Massive Compression: The authors demonstrate that it is feasible to aim for a 1/100th reduction in memory. In their example, a 3.4 GB module could be shrunk to just 34 MB. * Performance Retention: Despite the reduction in unique values, the vectors maintain their ability to perform semantic calculations (like the "man:woman" or "lion:lioness" analogies). * Hardware Benefits: Lower memory usage translates to lower power consumption and the ability to run sophisticated AI locally on mobile devices and robots without relying on a cloud connection.

Conclusion

While the training process involving Augmented Lagrangian methods is mathematically more complex than standard training, the resulting models prioritize "high usability." By bridging the gap between academic AI research and practical system engineering, this technology enables the deployment of advanced NLP on resource-constrained edge hardware.

Summary updated

BibTeX
@inproceedings{suzuki2017memory,
  author = {Jun Suzuki and Masaaki Nagata},
  title = {{Memory-efficient Word Embedding Vectors}},
  booktitle = {NTT},
  year = {2017},
  doi = {10.53829/ntr201711fa4},
}
Figure