Papers
Topics
Authors
Recent
Search
2000 character limit reached

Word–Context Matrices: Modeling Lexical Semantics

Updated 26 January 2026
  • Word–Context Matrices are foundational constructs in lexical semantics, encoding association strengths between words and contexts with count-based and PMI methods.
  • They enable efficient low-rank factorization techniques like SVD and negative sampling that boost performance in word similarity and analogy tasks.
  • Advanced variants extend these matrices with dependency, positional, and tensor-based contexts to capture richer syntactic and semantic nuances.

Word–context matrices are central to the quantitative modeling of lexical semantics and the construction of distributional word representations. Structurally, a word–context matrix is defined as MRV×CM \in \mathbb{R}^{|V| \times |C|}, where V|V| and C|C| are the sizes of the word and context vocabularies respectively. Each entry MwcM_{wc} quantifies the association strength between target word ww and context cc, most commonly by empirical co-occurrence counts or by statistics such as pointwise mutual information (PMI) and its positive variant PPMI. Modern embedding methodologies—matrix factorization, window sampling, negative sampling, and tensor generalizations—are built upon the foundational concept of this matrix, which encodes the observed word–context associations within a corpus.

1. Construction of the Word–Context Matrix

Let CC be a corpus, and let VV denote the vocabulary. Sliding a symmetric window of size winwin over CC, the number of times a word V|V|0 and context V|V|1 co-occur is accumulated as V|V|2, the raw co-occurrence count. The global statistics are

  • V|V|3 (row sum for word V|V|4),
  • V|V|5 (column sum for context V|V|6),
  • V|V|7 (total windowed pairs).

The transformation to probabilities is given by

V|V|8

and the positive pointwise mutual information matrix (PPMI) is defined entrywise as

V|V|9

or, more robustly with counts,

C|C|0

This matrix forms the basis for most count-based embeddings, including LexVec, GloVe, and their modern variants (Salle et al., 2016, Salle et al., 2016, Ibrahim et al., 2021).

2. Low-Rank Factorization and Embedding Learning

The high-dimensional, sparse word–context matrix must be compressed for practical representation. The classic approach is low-rank approximation:

  • SVD (Singular Value Decomposition): Given C|C|1 (PMI/PPMI), C|C|2 is truncated to the first C|C|3 singular values, yielding word embeddings as the rows of C|C|4 (Sorokina et al., 2019).
  • NMF (Non-negative Matrix Factorization): For C|C|5, C|C|6 with C|C|7. Row C|C|8 of C|C|9 gives the embedding for word MwcM_{wc}0; results are typically sparse and nonnegative but lags SVD in empirical semantic quality.
  • QR with Pivoting: MwcM_{wc}1; embeddings are either the rows of MwcM_{wc}2 or the relevant columns of MwcM_{wc}3 (Sorokina et al., 2019).
  • SGNS and Weighted Losses: Models such as LexVec minimize a weighted squared-error objective, penalizing frequent (positive) co-occurrences heavily and actively pushing apart negative (zero-PPMI) co-occurrences via negative sampling. In effect, stochastic sampling and local optimization sidestep explicit materialization of the full PPMI (Salle et al., 2016).

Truncated SVD has been empirically shown to outperform NMF and QR approaches in both word similarity (e.g., WordSim-353, Spearman ρ ≈ 0.70) and analogy completion tasks, with QR(Q) performing notably poorly (similarity ≈ 0.27, analogy < 0.02) (Sorokina et al., 2019).

3. Context Type, Structural Features, and Positional Extensions

The definition of "context" in MwcM_{wc}4 is extensible. Most frequently, MwcM_{wc}5 is a word appearing within a symmetric window around MwcM_{wc}6, but context can be generalized:

  • Dependency and Syntactic Features: Structural features from dependency parses augment the context set. The context MwcM_{wc}7 may encode dependency arcs, relation patterns, or subject-object links, treated as discrete features (Cross et al., 2015).
  • Positional Contexts: Rather than collapsing contexts by type, each occurrence is indexed by positional offset MwcM_{wc}8 relative to the focus word. The new context is MwcM_{wc}9, and the matrix becomes ww0 in size. Factorization and sampling definitions are updated accordingly, leading to large boosts in syntactic performance (e.g., GSyn analogy accuracy improves from .54/.56 to .63/.66) (Salle et al., 2016).
  • Word Order Representations: GloVe variants (e.g., WOVe) build separate co-occurrence matrices for each relative position ww1 in the window, then merge the resulting position-specific embeddings (usually via concatenation). This modification significantly improves analogy performance—direct concatenation achieves a 36.3% improvement over GloVe on analogy accuracy (Ibrahim et al., 2021).

A summary of context expansion strategies:

Context Formulation Matrix/Tensor Shape Notable Impact
Linear window ww2 Semantic similarity, standard in SVD/SGNS
Dependency features ww3 (ww4) Improved matching, compositional nuances
Positional (offset) ww5 Boosts syntactic analogy accuracy
Per-position order ww6 (fusion) Marked gains in analogy and rare-word synonymy

4. Memory, Scalability, and Q-Contexts

Materializing ww7 or its factorizations for large vocabularies is prohibitive. Several schemes address this:

  • External Memory Schemes: Aggregate all training pairs ww8—both positive and negative—to disk, then sort and aggregate. Training is performed by iterating through this external list, enabling embedding learning for unbounded corpus size with ww9 RAM (for marginal arrays) (Salle et al., 2016).
  • Q-Contexts (WEQ): Instead of full cc0 PMI/PPMI, randomly sample cc1 rows (contexts) according to their squared cc2 norm, forming a cc3 sketch cc4. Then, perform SVD on cc5 to approximate the optimal embeddings, with theoretical guarantees that cc6 in operator norm (Kong et al., 2021). Empirically, with cc7, performance is within 1-2pt of full-matrix methods but 10–30× faster in practice.

5. Higher-Order Generalizations and Matrix Theory

The word–context matrix generalizes to tensors to model cc8-way relationships:

  • Tensor Factorization: Extensions such as CP-S and JCP-S fit symmetric CP decompositions to order-2 (matrix) and order-3 (tensor) PPMI arrays, enabling modeling of rich cc9-way co-occurrence statistics. Third-order decompositions allow the extraction of sense-specific word compositionalities. For instance, outlier detection metrics (ODCC0) reveal that tensor-based embeddings outperform matrix-based methods for detecting trivariate semantic coherence (Bailey et al., 2017).
  • Linguistic Matrix Theory: For relational words (verbs, adjectives), a CC1 empirical matrix CC2 is constructed via regularized least squares regressions over noun arguments. Statistical analysis of the collection of such CC3 leads to permutation-symmetric Gaussian ensembles, with higher-order invariant moments serving as signatures for cross-corpora comparison. Deviations from Gaussianity are captured via perturbative invariants, suggesting a notion of universality classes in corpus linguistics (Kartsaklis et al., 2017).

6. Empirical Evaluation and Performance Benchmarks

Benchmarking across word similarity (WordSim-353, MEN, SimLex-999) and analogy completion tasks (Google Semantic/Syntactic, MSR) reveals key findings:

  • LexVec (PPMI plus weighted matrix factorization) achieves similarity scores CC4–CC5 and analogy accuracies CC6–CC7 (semantic) and CC8–CC9 (syntactic), matching or exceeding previous state-of-the-art on most tasks (Salle et al., 2016, Salle et al., 2016).
  • SVD-based PMI factorization (dimension VV0 or VV1) consistently outperforms nonnegative and QR-based factorization for both similarity (VV2) and analogy (VV3–VV4) (Sorokina et al., 2019).
  • WOVe (GloVe with explicit order modeling) offers a VV5 gain in analogy accuracy and a VV6 boost in synonym discovery rates over baseline GloVe, at the expense of larger embeddings and increased training cost (Ibrahim et al., 2021).

7. Complexity, Trade-offs, and Theoretical Insights

  • Context expansion (dependency/structural, positional, per-position fusion) increases model parameter count and, for WOVe, storage by up to VV7 over baseline embeddings. However, gains in syntactic or compositional capacity may be substantial (Salle et al., 2016, Ibrahim et al., 2021).
  • External memory and Q-contexts enable scaling to unrestricted corpora, trading disk I/O and shuffling complexity for main-memory savings (Salle et al., 2016, Kong et al., 2021).
  • The selection of factorization method has highly significant impact on downstream performance, more so than dimensionality increase beyond setup-specific thresholds (Sorokina et al., 2019).
  • Matrix-theoretic approaches, analyzing empirical word–context matrices via random matrix statistics, suggest a small space of geometric signatures that could systematically distinguish linguistic genres or languages (Kartsaklis et al., 2017).

Word–context matrices thus remain a foundational and continually evolving object, underlying both traditional and advanced distributional semantics models in computational linguistics and NLP.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Word--Context Matrices.