NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compositional Approaches for Representing Relations Between Words: A Comparative Study

Huda Hakami, Danushka Bollegala · DOI

Abstract

Identifying the relations that exist between words or entities is fundamental to various natural language processing tasks, including relational search, noun-modifier classification, and analogy detection. Traditionally, relations were represented using "holistic" approaches that extract co-occurrence patterns from a corpus. However, these methods suffer from data sparseness and limited scalability. In contrast, compositional approaches represent relations by combining the attributes of individual words. This study systematically compares four unsupervised mathematical operators—subtraction, addition, multiplication, and concatenation—across several benchmark datasets for word analogy and knowledge base completion (KBC). Our findings reveal that the optimal operator is highly task-dependent, with vector subtraction dominating analogy tasks while element-wise multiplication excels in KBC.

Introduction

In Natural Language Processing, understanding how words relate (e.g., lion is to cat as ostrich is to bird) is crucial. Historically, researchers relied on lexical patterns (e.g., "X is a type of Y") found in massive corpora. This approach hits a wall when word pairs do not co-occur frequently, a phenomenon known as data sparseness.

Compositional models offer a solution by using the individual embeddings of words—vectors representing their semantic meaning—and combining them via a mathematical operator to represent the relation. This study investigates which operators best capture the "essence" of a relationship across different linguistic and structural tasks.

Methodology

The study evaluates four non-parametric (unsupervised) compositional operators that transform two word vectors ($v_a$ and $v_b$) into a single relation vector ($v_r$):

  1. PairDiff (Subtraction): $v_r = v_b - v_a$. This is the standard "offset" method used in famous analogies like King - Man + Woman ≈ Queen.
  2. Add (Addition): $v_r = v_a + v_b$. This assumes relations are the sum of the attributes of both words.
  3. Mult (Multiplication): $v_r = v_a \odot v_b$. Element-wise multiplication acts as a logical "AND," highlighting dimensions where both words have high values.
  4. Concat (Concatenation): $v_r = [v_a; v_b]$. This method retains all information from both vectors without merging their dimensions.

These operators were tested using various input embeddings, including CBOW, Skip-gram, GloVe, and count-based methods like SVD and Non-negative Matrix Factorization (NMF), all trained on the 2-billion-word ukWaC corpus.

Experimental Setup

The operators were benchmarked across a diverse suite of tasks:

  • Relational Similarity: SAT and SemEval 2012 Task 2.
  • Analogy Completion: MSR and Google Analogy datasets.
  • Relation Classification: The DiffVecs dataset, covering 15 relation types.
  • Knowledge Base Completion (KBC): WN18 (WordNet) and FB15k (FreeBase).

Key Insights and Results

The Task-Dependency of Operators

The most significant finding is that there is no universal "best" operator. PairDiff is the clear winner for analogy tasks. When combined with CBOW embeddings, it achieved a high accuracy of 87.38% on the DiffVecs classification task. Its success is partly due to its non-commutative nature ($v_b - v_a \neq v_a - v_b$), which allows it to encode the directionality of a relation (e.g., hypernymy).

Conversely, Mult dominates in Knowledge Base Completion. In the WN18 task, Mult achieved a Mean Rank of 812, whereas PairDiff lagged significantly at 13,198. This suggests that KBC requires a stricter matching of attributes than analogy detection.

Sparsity and Noise Filtering

The study highlights how operators handle high-dimensional spaces. As dimensionality increases, the Mult operator acts as a "low-pass filter." It only preserves dimensions that are strong in both the head and tail entities, making it robust against the noisy fluctuations that often plague PairDiff in KBC tasks. However, Mult can suffer from the "sparsity trap" in extremely high dimensions; if one word has a near-zero value in a specific dimension, that dimension is effectively silenced in the relation vector.

For PairDiff, performance on analogy tasks often saturates or declines as dimensions increase beyond 200–300 due to the accumulation of noise. In contrast, Mult’s performance on specific tasks can improve with higher dimensions as its filtering mechanism becomes more selective.

Conclusion

This comparative study demonstrates that the choice of compositional operator must be aligned with the specific requirements of the NLP task. While subtraction is ideal for capturing the directional offsets required for analogies, element-wise multiplication provides a robust mechanism for the attribute-matching required in knowledge base completion. Future research should investigate supervised compositional operators, where the transformation function itself contains learnable parameters, potentially offering even greater representational power.

Summary updated

BibTeX
@article{hakami2017compositional,
  author = {Huda Hakami and Danushka Bollegala},
  title = {{Compositional Approaches for Representing Relations Between Words: A Comparative Study}},
  journal = {Knowledge-Based Systems},
  year = {2017},
  doi = {10.1016/j.knosys.2017.09.008},
}
Figure