Skip to main content
QUICK REVIEW

[Paper Review] Sketching Word Vectors Through Hashing

Behrang QasemiZadeh, Laura Kallmeyer|arXiv (Cornell University)|May 11, 2017
Music and Audio ProcessingComputer Science52 references4 citations
TL;DR

This paper proposes a fast, low-complexity method for learning word vectors using hash-based random projections, where context words are assigned to random buckets via hashing, and word vectors are built by counting co-occurrences with these buckets. The approach achieves performance competitive with neural network-based methods like GloVe and CBOW in downstream NLP tasks, while being significantly faster and requiring far fewer computations.

ABSTRACT

We propose a new fast word embedding technique using hash functions. The method is a derandomization of a new type of random projections: By disregarding the classic constraint used in designing random projections (i.e., preserving pairwise distances in a particular normed space), our solution exploits extremely sparse non-negative random projections. Our experiments show that the proposed method can achieve competitive results, comparable to neural embedding learning techniques, however, with only a fraction of the computational complexity of these methods. While the proposed derandomization enhances the computational and space complexity of our method, the possibility of applying weighting methods such as positive pointwise mutual information (PPMI) to our models after their construction (and at a reduced dimensionality) imparts a high discriminatory power to the resulting embeddings. Obviously, this method comes with other known benefits of random projection-based techniques such as ease of update.

Motivation & Objective

  • To develop a simple, efficient alternative to neural network-based word representation learning that avoids complex optimization.
  • To explore whether random projections via hashing can capture linguistically meaningful distributional patterns in word co-occurrence.
  • To evaluate the method’s performance in both intrinsic (e.g., word relatedness) and extrinsic (e.g., sentiment classification) NLP tasks.
  • To demonstrate that the method achieves competitive results with significantly reduced computational cost and memory usage compared to existing methods.

Proposed method

  • Word vectors are constructed by assigning each context word to a random bucket using a hash function, specifically the modulus of the hash code modulo the desired vector dimension $ m $.
  • For each word $ w $, the algorithm initializes a zero vector of size $ m $, then increments the component at index $ d = \text{abs}(\text{hash}(c) \mod m) $ for every context word $ c $ co-occurred with $ w $.
  • The method leverages the distributive property of multiplication over addition to frame the process as a form of dimensionality reduction via random projection.
  • The hash function used is the Jenkins hash, chosen for its low collision rate on short words and good distributional properties.
  • After vector construction, PPMI weighting is applied to normalize frequencies and enhance discriminative power, improving performance on downstream tasks.
  • The algorithm is highly parallelizable and stream-friendly, enabling efficient online updates and distributed computation without solving optimization problems.

Experimental results

Research questions

  • RQ1Can a simple hashing-based random projection method produce word vectors that are competitive with state-of-the-art neural network-based methods in both intrinsic and extrinsic evaluations?
  • RQ2How does the performance of the proposed method compare to GloVe and CBOW in downstream NLP tasks such as sentence-level sentiment classification?
  • RQ3To what extent does the method reduce computational cost and memory usage compared to traditional co-occurrence counting and neural network training?
  • RQ4Does the use of PPMI weighting significantly improve the quality of the learned word vectors in the proposed framework?
  • RQ5How does vector dimensionality affect the performance of the proposed method in comparison to CBOW and GloVe in different neural network architectures?

Key findings

  • The proposed method outperforms GloVe in extrinsic evaluation on the Large Movie Review Dataset, achieving an F1-score of 86.54 with a 1000-dimensional vector representation using a CNN model.
  • With 1000-dimensional vectors, the method surpasses CBOW in the CNN model (86.54 vs. 85.14 F1), though CBOW remains superior in the RNN model at lower dimensions.
  • The method is significantly faster than random indexing, requiring only one addition per co-occurrence compared to at least two operations in random indexing.
  • PPMI-weighted vectors can be computed in seconds for a vocabulary of 6,000 words, whereas the same task takes hours in the high-dimensional count model.
  • The method requires less memory than traditional co-occurrence counting because it does not store exact word-word counts, only bucket counts.
  • Despite avoiding optimization, the method achieves performance competitive with GloVe and CBOW in both intrinsic and extrinsic evaluations, demonstrating its robustness and efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.