Hash embeddings for efficient word representations

Dan Tito Svenstrup, Jonas Meinertz Hansen, Ole Winther

Research output: Chapter in Book/Report/Conference proceedingArticle in proceedingsResearchpeer-review

Abstract

We present hash embeddings, an efficient method for representing words in a continuous vector form. A hash embedding may be seen as an interpolation between a standard word embedding and a word embedding created using a random hash function (the hashing trick). In hash embeddings each token is represented by k d-dimensional embeddings vectors and one k dimensional weight vector. The final d dimensional representation of the token is the product of the two. Rather than fitting the embedding vectors for each token these are selected by the hashing trick from a shared pool of B embedding vectors. Our experiments show that hash embeddings can easily deal with huge vocabularies consisting of millions of tokens. When using a hash embedding there is no need to create a dictionary before training nor to perform any kind of vocabulary pruning after training. We show that models trained using hash embeddings exhibit at least the same level of performance as models trained using regular embeddings across a wide range of tasks. Furthermore, the number of parameters needed by such an embedding is only a fraction of what is required by a regular embedding. Since standard embeddings and embeddings constructed using the hashing trick are actually just special cases of a hash embedding, hash embeddings can be considered an extension and improvement over the existing regular embedding types.
Original languageEnglish
Title of host publicationProceedings of the 31st International Conference on Neural Information Processing Systems
PublisherAssociation for Computing Machinery
Publication date2017
Pages4929-4937
ISBN (Print)978-1-5108-6096-4
Publication statusPublished - 2017
Event31st Conference on Neural Information Processing Systems - Long Beach, United States
Duration: 4 Dec 20179 Dec 2017

Conference

Conference31st Conference on Neural Information Processing Systems
Country/TerritoryUnited States
CityLong Beach
Period04/12/201709/12/2017

Fingerprint

Dive into the research topics of 'Hash embeddings for efficient word representations'. Together they form a unique fingerprint.

Cite this