The Distributional Hypothesis › The Co-occurrence Matrix as a Word Representation
Language AI HandbookAll chapters The Distributional Hypothesis › The Co-occurrence Matrix as a Word RepresentationOne section · Sections in this chapter10 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
It is worth stepping back and thinking about what we have built. A co-occurrence matrix is a matrix where is the vocabulary size. The entry at row , column records how often word appears in the context of word .
where is the number of times word appears within a window of size around word across the entire corpus.
This matrix is the distributional representation of the entire vocabulary. Each row is the distributional vector for one word. The columns represent context dimensions. The whole matrix is the computational realization of the distributional hypothesis.
This representation has some striking properties:
- Symmetry: If we use a symmetric context window, because every time word appears in the context of word , word also appears in the context of word . The matrix is symmetric.
- Sparsity: In any real vocabulary, most word pairs never co-occur. A vocabulary of 100,000 words would require a -entry matrix, the vast majority of whose entries are zero. This sparsity is one motivation for the dimensionality reduction techniques covered in later chapters.
- High dimensionality: Even for our toy corpus, the matrix has thousands of entries. For real corpora, the vocabulary might have hundreds of thousands of words, making the full matrix computationally expensive to store and compare.
- Frequency bias: The matrix directly reflects word frequencies. Common words like "the" have large counts everywhere, distorting similarity estimates toward high-frequency vocabulary.
The progression from raw co-occurrence matrices to PMI-weighted matrices to dense word embeddings (word2vec, GloVe) is the story of how the field addressed these limitations while preserving the core distributional insight.