Semantic Compositionality through Recursive Matrix-Vector Spaces

Richard Socher, Brody Huval, Christopher D. Manning, Andrew Y. Ng

Abstract

Traditional vector space models excel at identifying lexical similarities but struggle with compositionality—the principle that the meaning of a complex expression is determined by its constituent parts and the rules used to combine them. This paper introduces the Matrix-Vector Recursive Neural Network (MV-RNN), which represents every word and phrase as both a vector (meaning) and a matrix (operator). By recursively applying these operators according to syntactic structure, the model captures complex linguistic interactions like negation and intensification.

Introduction

While standard word embeddings can identify that "hotel" is similar to "motel," they often fail to model how words like "not" or "very" fundamentally transform the meaning of their neighbors. Previous Recursive Neural Networks (RNNs) attempted to solve this using a single global weight matrix for all combinations, but this approach lacked the flexibility to handle the diverse ways different parts of speech (e.g., adverbs vs. nouns) interact. The MV-RNN addresses this by treating words as functional operators.

The Matrix-Vector RNN Architecture

In the MV-RNN architecture, every node in a parse tree is associated with a vector $v \in \mathbb{R}^n$ and a matrix $M \in \mathbb{R}^{n \times n}$. This dual representation allows the model to maintain both the semantic content of a phrase and its capacity to modify other constituents.

The MV-RNN merges a phrase with another word at a non-terminal node of a parse tree, using specific equations for vector and matrix composition.

When two constituents are combined:

  1. Vector Composition: The matrix of the first word operates on the vector of the second, and vice versa. These transformed vectors are concatenated and passed through a global weight matrix and a non-linearity (such as $tanh$) to produce the parent vector.
  2. Matrix Composition: The two matrices are concatenated and multiplied by a global matrix $W_M$ to produce a parent matrix that represents the combined operator power of the phrase.

To ensure scalability, the authors utilize a low-rank matrix approximation, representing each word matrix as a product of two smaller matrices plus a diagonal component.

Experimental Evaluation

The model was evaluated on four distinct tasks to test its breadth:

  • Adverb-Adjective Sentiment: Predicting star-rating distributions (1-10) for 6,015 pairs extracted from IMDB.
  • Propositional Logic: A synthetic dataset testing the model's ability to learn boolean operators like $AND$, $OR$, and $NOT$.
  • Movie Review Polarity (MR): A benchmark of 10,000 positive/negative sentences.
  • SemEval-2010 Task 8: Classifying semantic relationships (e.g., Cause-Effect) between nouns based on syntactic paths.

Key Results and Insights

The MV-RNN achieved state-of-the-art performance, reaching 79.0% accuracy on movie reviews and an 82.4 F1 score on SemEval-2010 relationship classification. Notably, it outperformed systems that relied on extensive hand-designed semantic resources like WordNet.

Predicting sentiment distributions for adverb-adjective pairs like 'fairly awesome.' The MV-RNN accurately models the distribution across the 1-10 star rating scale.

A core insight of the work is the treatment of words as operators. For example, an intensifier like "very" has a matrix that scales up the vector of the word it modifies, while "not" can flip a vector's direction in sentiment space. Furthermore, the model's ability to learn truth tables for logical operators suggests a potential unification of formal semantics with deep learning.

Conclusion

The MV-RNN provides a robust framework for semantic compositionality. While it is more computationally intensive than standard embeddings and depends on high-quality parse trees, its ability to model complex linguistic phenomena and logical operations represents a significant advancement in natural language understanding.

Summary updated

BibTeX
@inproceedings{socher2012semantic,
  author = {Richard Socher and Brody Huval and Christopher D. Manning and Andrew Y. Ng},
  title = {{Semantic Compositionality through Recursive Matrix-Vector Spaces}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2012},
}
Figure