A Compositional Distributional Semantics, Two Concrete Constructions, and some Experimental Evaluations

Mehrnoosh Sadrzadeh, Edward GrefenstettearXiv 2011

This paper, authored by Mehrnoosh Sadrzadeh and Edward Grefenstette, presents a significant step toward unifying two historically separate branches of linguistics: logical semantics and distributional semantics. By leveraging category theory—specifically the same mathematical structures used to model quantum information flow—the authors propose a way to calculate the meaning of a sentence as a direct function of its grammatical structure and the vector-based meanings of its constituent words.

TL;DR

The authors bridge the gap between structural logic and vector-based word meanings by treating grammar as a linear map that acts on word tensors. Their "categorical compositional distributional" model outperforms standard vector addition and multiplication methods in word-sense disambiguation tasks, particularly as sentence complexity increases.

What Problem Does This Paper Address?

Linguistics has long been divided between two powerful but incomplete models:

  1. Logical Models: These follow Frege’s principle that the meaning of a sentence is a function of its parts. They excel at handling grammatical structure (see the parse tree in Figure 1) but treat words as "empty" atomic symbols, failing to capture the nuanced, contextual meaning of words like "bank" or "run."
  2. Distributional Models: Based on the idea that "you shall know a word by the company it keeps," these models represent words as vectors in a high-dimensional space. While excellent at finding synonyms, they struggle with compositionality—they often treat "dogs chase cats" and "cats chase dogs" as identical because they contain the same word vectors.
Figure 1

The challenge is to create a hybrid model that respects both the nuance of word vectors and the structure of grammar.

Methods

The authors utilize Lambek pregroups to represent grammar. In this framework, words are assigned types (e.g., $n$ for nouns, $n^r s n^l$ for transitive verbs). The "reduction" of these types into a sentence type ($s$) is represented by a "wire diagram" or morphism.

The core innovation is mapping these grammatical morphisms to linear maps in vector spaces. Instead of treating every word as a flat vector, verbs are treated as higher-order tensors (matrices) that "act" on noun vectors.

Figure 2 illustrates this: the verb "chase" interacts with its subject and object via "cups" (representing inner products), producing a final sentence vector. This avoids the "dimensional explosion" typically associated with tensor products while preserving the non-commutative nature of language (i.e., word order matters).

Figure 2

The paper explores two concrete constructions:

  • Structured Vector Spaces: Basis vectors are annotated with specific dependency relations (e.g., "arg-fluffy"). A toy example of this is shown in Figure 3.
  • Plain Vector Spaces: A more scalable version using standard co-occurrence counts from a large corpus.
Figure 3

Datasets

  • British National Corpus (BNC): A massive corpus of ~6 million sentences used to build the "plain" vector space model.
  • Mitchell & Lapata (2008): A dataset of 120 intransitive sentence pairs used for the first disambiguation experiment.
  • New Transitive Dataset: The authors developed a new benchmark of 400 sentence pairs focusing on 20 ambiguous transitive verbs (e.g., "show" meaning "express" vs. "picture") to test the model's performance on more complex syntax.

Key Insights and Ideas

  • Verbs as Functions: The "aha moment" is that verbs shouldn't be points in space; they should be operators. By building verbs as matrices that relate subjects to objects, the model captures how a verb's meaning changes depending on its context.
  • Quantum Inspiration: The mathematical framework (compact closed categories) is identical to that used in quantum mechanics to describe entangled states. The "cups" in the diagrams are essentially modeling the "flow" of information between words, much like entanglement models non-local correlations.
  • Complexity Scaling: The model's advantage over simpler methods (like just multiplying vectors) increases as the syntax becomes more complex. This suggests that the categorical approach is capturing something fundamental about linguistic structure that simpler heuristics miss.

Key Results

The models were evaluated on how well their similarity scores correlated with human judgments (Spearman’s $\rho$):

  • Intransitive Sentences: The categorical model achieved a $\rho$ of 0.17, matching the best multiplicative models. Because the context was only one word, the structural advantages were less pronounced.
  • Transitive Sentences: The categorical model achieved a $\rho$ of 0.21, significantly outperforming the additive baseline (0.05) and the multiplicative model (0.17).
  • Qualitative Success: In the "plain" model, the system correctly assigned high similarity to "the table showed the result" and "the table expressed the result," while correctly distinguishing them from "the map showed the location."

Limitations and Future Work

  • Computational Cost: The "structured" construction is computationally expensive to implement at scale, which is why the authors pivoted to the "plain" model for the BNC evaluation.
  • Linguistic Scope: The current work primarily handles nouns, verbs, and adjectives. The authors note that future work is needed to incorporate "stop words" like relative pronouns (who, which), conjunctions (and, or), and quantifiers (every, some).
  • Corpus Size: They aim to move beyond the BNC to even larger datasets like the WaCKy corpus to improve the robustness of the underlying word vectors.

Summary updated

BibTeX
@misc{sadrzadeh2011compositional,
  author = {Mehrnoosh Sadrzadeh and Edward Grefenstette},
  title = {{A Compositional Distributional Semantics, Two Concrete Constructions, and some Experimental Evaluations}},
  year = {2011},
  eprint = {1105.1702},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1105.1702},
}
Figure