Dependency-Based Word Embeddings

Omer Levy, Yoav Goldberg

Introduction

Traditional word embedding models, such as the original Skip-Gram with Negative Sampling (SGNS) or word2vec, are built upon the distributional hypothesis: words appearing in similar contexts likely share similar meanings. In these models, "context" is typically defined as a linear "sliding window" of $k$ words surrounding a target word. While effective, this approach suffers from two primary limitations: it introduces noise by including coincidental neighbors and fails to capture long-range syntactic relationships that are physically distant in a sentence.

This paper proposes a generalization of the skip-gram model that replaces linear windows with syntactic dependency-based contexts. This shift fundamentally changes the nature of the learned representations from topical similarity (words in the same domain) to functional similarity (words sharing grammatical and semantic roles).

Methodology: From Windows to Dependencies

To move beyond the linear window, the authors utilize a dependency parser to identify the grammatical structure of training sentences. For any given target word, contexts are derived from its parent and children in the dependency tree rather than its immediate physical neighbors.

Extraction of dependency-based contexts from a parsed sentence.

As shown in the figure above, a sentence like "Australian scientist discovers star with telescope" yields specific labeled contexts. For example, the word "discovers" is linked to "scientist" as a subject (nsubj) and "star" as a direct object (dobj). To further refine these contexts, the authors "collapse" prepositions, creating a direct prep_with link between "discovers" and "telescope." This filtering mechanism ensures that only syntactically relevant words are considered as context, ignoring nearby but unrelated tokens.

Qualitative Shift: Functional vs. Topical Similarity

The core insight of this research is the distinction between topical and functional similarity. Standard bag-of-words (BOW) models tend to group words by topic. For instance, a BOW model might associate "Hogwarts" with "Dumbledore" or "Snape" because they appear in the same narrative context.

In contrast, the dependency-based model (DEPS) identifies functional equivalents. For "Hogwarts," the DEPS model suggests "Sunnydale" (from Buffy) or "Collinwood" (from Dark Shadows)—other fictional schools. Similarly, for the word "Florida," BOW models return cities within the state (meronyms), while the DEPS model returns other U.S. states (co-hyponyms). By focusing on syntactic roles, the model learns what a word is rather than just what it is about.

Quantitative Evaluation

The authors evaluated their models using the WordSim353 dataset and specific tests designed to distinguish between domain and functional similarities. The results demonstrate that dependency-based embeddings provide a cleaner, more focused representation of word meaning.

Precision-recall curves comparing dependency-based embeddings (Deps) to window-based models (K=2, K=5) on similarity (a) and relatedness (b) tasks.

As illustrated in the precision-recall curves, the Deps model consistently outperforms linear window models (where $K=2$ or $K=5$). The dependency model is significantly better at ranking "similar" pairs (functional) higher than "related" pairs (topical). While smaller linear windows ($K=2$) approximate some of this functional behavior, they still lack the precision afforded by true syntactic parsing.

Conclusion and Limitations

While dependency-based embeddings excel at capturing functional similarity and allow for model introspection (by examining which labeled contexts, like obj or subj, are most active), they are not a universal replacement for window-based models. Notably, they perform significantly worse on standard word analogy tasks (e.g., "King - Man + Woman = Queen"), suggesting that linear word order encodes semantic nuances that syntax alone misses. Furthermore, the computational overhead of dependency parsing makes this approach more difficult to scale to trillion-word datasets. Nonetheless, for tasks requiring precise semantic categorization and functional understanding, dependency-based contexts offer a powerful alternative to the sliding window.

Summary updated

BibTeX
@inproceedings{levy2014dependency,
  author = {Omer Levy and Yoav Goldberg},
  title = {{Dependency-Based Word Embeddings}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2014},
  doi = {10.3115/v1/p14-2050},
}
Figure