Decomposing word embedding with the capsule network

Xin Liu, Qingcai Chen, Yan Liu, Joanna Siebert, Baotian Hu, Xiangping Wu, Buzhou Tang

TL;DR

CapsDecE2S is a novel framework that uses capsule networks to "disentangle" the multiple meanings conflated within a single unsupervised word embedding. By decomposing these embeddings into basic semantic units and re-composing them using contextual attention, the model achieves new state-of-the-art results in Word Sense Disambiguation (WSD) and Word-in-Context (WiC) tasks.

What Problem Does This Paper Address?

In natural language processing, a single word often carries multiple meanings—think of "apple" as a fruit versus a tech giant. While modern language models like BERT produce contextualized embeddings, they often struggle to explicitly separate these overlapping senses.

Traditional approaches either use "multi-embeddings" (multiple vectors per word), which require massive, well-organized knowledge bases, or rely on massive classification layers with thousands of sense labels that are hard to train. The authors identify a missed opportunity: unsupervised word embeddings already contain these multiple senses in a conflated form. The challenge is how to effectively "decompose" that single vector into its constituent meanings based on the surrounding text.

Methods

The authors introduce CapsDecE2S, a model consisting of two primary modules:

  1. Embedding Decomposing Module: This module takes a standard unsupervised word embedding and passes it through a Capsule Network. Capsule networks are uniquely suited for this because they excel at recognizing highly overlapping features and performing "segmentation." Through a process called dynamic routing, the network decomposes the target word embedding into $p$ "morpheme-like vectors"—basic semantic units of meaning.
  2. Context Learning Module: Simultaneously, a neural encoder (like BERT) processes the sentence to extract global and local context representations.

These two modules meet in an Attention & L-2 Norm Composition layer. Here, the model uses the context to decide which "morpheme-like vectors" are relevant, weighting and combining them to form a final, context-specific sense representation.

The overall architecture shows how the target word embedding is decomposed by capsules and then re-integrated with context.

To train the model without needing a massive classification layer for every possible sense in the dictionary, the authors propose Word Sense Matching Training. Instead of predicting a specific sense ID, the model is trained on a binary task: "Do these two instances of the word $w$ in different sentences have the same meaning?" This approach is flexible and helps the model handle "zero-shot" scenarios where it encounters senses during testing that it didn't see during training.

Datasets

The model was evaluated on two major benchmarks:

  • Word-in-Context (WiC): A dataset specifically designed to evaluate if a model can tell when a word is used in the same or different sense across two sentences.
  • English All-Words WSD: A collection of cross-domain datasets including Senseval-2, Senseval-3, SemEval-07, SemEval-13, and SemEval-15.
  • SemCor3.0: Used as the primary manually-annotated training corpus for the WSD tasks.

Key Insights and Ideas

  • Capsules as Semantic Filters: The "aha moment" here is applying capsule networks—originally designed for computer vision—to word embeddings. Just as a capsule might recognize a "nose" as part of a "face," here it recognizes a specific semantic fragment as part of a larger "sense."
  • Decomposition vs. Selection: Unlike previous models that try to select a sense from a list, CapsDecE2S constructs the sense by decomposing the base embedding. Figure 2 illustrates this mathematical routing between capsule layers.
  • Local Context is King: The ablation studies revealed that local context (words immediately surrounding the target) is more influential than global context for disambiguation, as distant words often act as noise.
  • Robustness: The model proved more robust than standard BERT at maintaining high similarity for the same sense across different sentences, even when the surrounding vocabulary changed significantly.
The mathematical decomposition process within the capsule layers.

Key Results

CapsDecE2S achieved impressive gains across the board:

  • WiC Task: Reached an accuracy of 70.6%, outperforming previous contextualized models like TextCNNBERT and LMMS.
  • WSD Tasks: The large version of the model (CapsDecE2S$_{large}$ + LMMS) set new state-of-the-art F1-scores on nearly all test sets, notably achieving 78.6% on the "ALL" aggregate dataset, a significant jump over the previous best of 77.0%.
  • Ablation Impact: Removing the capsule network caused the F1-score to drop by 6.2%, confirming that the capsule-based decomposition is the "secret sauce" of the architecture.

Limitations and Future Work

Despite its success, the model has two main Achilles' heels:

  1. Linking Verbs: It struggles with common verbs like "be," "have," "make," and "see." These words are semantically "thin" and their meaning is heavily dependent on the syntax of the entire sentence rather than distinct semantic units.
  2. Fine-Grained Senses: When two senses of a word are extremely similar (e.g., two slightly different definitions of "plan"), the model occasionally mistakes one for the other.

Future work aims to merge these representations with other sense features and explore how these decomposed embeddings can improve downstream tasks like machine translation or information retrieval.

Summary updated

BibTeX
@article{liu2021decomposing,
  author = {Xin Liu and Qingcai Chen and Yan Liu and Joanna Siebert and Baotian Hu and Xiangping Wu and Buzhou Tang},
  title = {{Decomposing word embedding with the capsule network}},
  journal = {Knowledge-Based Systems},
  year = {2021},
  doi = {10.1016/j.knosys.2020.106611},
}
Figure