Skip to main content
QUICK REVIEW

[Paper Review] Speeding up Word Mover's Distance and its variants via properties of distances between embeddings

Matheus Werner, Eduardo Sany Laber|arXiv (Cornell University)|Dec 1, 2019
Topic ModelingComputer Science20 references11 citations
TL;DR

This paper proposes a novel method to accelerate Word Mover's Distance (WMD) and its relaxed variant (RWMD) by exploiting the empirical property that distances between word embeddings cluster into two groups: small distances for semantically related words and a uniform value for unrelated ones. By modeling this structure, the approach reduces computational complexity and memory usage, achieving up to 15x speedup over RWMD with no loss in classification accuracy across 10 datasets.

ABSTRACT

The Word Mover's Distance (WMD) proposed by Kusner et al. is a distance between documents that takes advantage of semantic relations among words that are captured by their embeddings. This distance proved to be quite effective, obtaining state-of-art error rates for classification tasks, but is also impracticable for large collections/documents due to its computational complexity. For circumventing this problem, variants of WMD have been proposed. Among them, Relaxed Word Mover's Distance (RWMD) is one of the most successful due to its simplicity, effectiveness, and also because of its fast implementations. Relying on assumptions that are supported by empirical properties of the distances between embeddings, we propose an approach to speed up both WMD and RWMD. Experiments over 10 datasets suggest that our approach leads to a significant speed-up in document classification tasks while maintaining the same error rates.

Motivation & Objective

  • To address the high computational cost of Word Mover's Distance (WMD) and its variants in large-scale document classification.
  • To reduce memory usage and speed up distance computation by exploiting structural properties of word embedding distances.
  • To maintain state-of-the-art classification performance while significantly improving runtime efficiency.
  • To enable practical deployment of WMD-like distances in real-world applications requiring fast document similarity computation.

Proposed method

  • Assumes that distances between word embeddings fall into two distinct groups: small values for related words and a constant value for unrelated words.
  • Reformulates the WMD and RWMD transportation problems using this two-group assumption to reduce the number of non-zero edge costs.
  • Introduces a clustering-based cache construction for large vocabularies, using k-means to group embeddings and precompute distances.
  • Proposes Rel-RWMD(S), a variant that uses a compact cache of size proportional to the number of clusters rather than full vocabulary pairs.
  • Employs a parameter $ r $ to control the number of related words considered per word, enabling trade-offs between speed and accuracy.
  • Uses a linear-time implementation for RWMD with caching, optimized via clustering to reduce preprocessing and storage costs.

Experimental results

Research questions

  • RQ1Can the distribution of distances between word embeddings be leveraged to reduce the complexity of WMD and RWMD?
  • RQ2Does assuming a uniform distance for unrelated word pairs preserve classification accuracy while enabling faster computation?
  • RQ3To what extent can memory usage and computation time be reduced by clustering embeddings and caching only relevant distances?
  • RQ4How does the proposed method compare in speed and accuracy to standard WMD and RWMD on real-world document classification tasks?

Key findings

  • The proposed method achieves an average speed-up of nearly 5 times over RWMD for one classification task and 15 times for another, with no degradation in test error.
  • For the Arxiv dataset, Rel-RWMD(S) was 27 times faster than RWMD(S), with a test error of 23.16% compared to 23.43% for RWMD(S).
  • For the Wikipedia dataset, Rel-RWMD(S) was 3 times faster than RWMD(S), achieving a test error of 26.90% versus 27.01% for RWMD(S).
  • The preprocessing phase of Rel-RWMD(S) dominates runtime, but once the cache is built, distance computation is 25–60 times faster than RWMD(S).
  • The method maintains competitive performance with WMD and RWMD, achieving test errors within 0.5% of the best baseline across all datasets.
  • The approach reduces memory usage significantly by caching only cluster-based distances instead of full pairwise distances, especially beneficial for large vocabularies.

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.