Skip to main content
QUICK REVIEW

[Paper Review] word2vec Skip-Gram with Negative Sampling is a Weighted Logistic PCA

Andrew J. Landgraf, Jeremy Bellay|arXiv (Cornell University)|May 27, 2017
Topic ModelingComputer Science7 references13 citations
TL;DR

This paper establishes that word2vec skip-gram with negative sampling (SGNS) is mathematically equivalent to weighted logistic PCA, where word-context pairs are modeled as binomial trials with weights based on co-occurrence frequencies and negative sampling rates. The key contribution is a unified probabilistic interpretation that links SGNS to exponential family PCA, enabling improved understanding, comparison with other methods like GloVe, and extension to higher-order tensor factorizations.

ABSTRACT

We show that the skip-gram formulation of word2vec trained with negative sampling is equivalent to a weighted logistic PCA. This connection allows us to better understand the objective, compare it to other word embedding methods, and extend it to higher dimensional models.

Motivation & Objective

  • To clarify the underlying statistical mechanism of skip-gram with negative sampling (SGNS), which has been widely used but poorly understood in probabilistic terms.
  • To establish a formal connection between SGNS and exponential family PCA, specifically weighted logistic PCA with binomial likelihood.
  • To provide a principled interpretation of SGNS that explains its implicit regularization and weighting scheme.
  • To enable comparison with other word embedding methods such as GloVe and matrix factorization-based approaches by placing them under a common probabilistic framework.
  • To extend SGNS to higher-dimensional models, including joint learning of document, word, and context vectors via tensor factorization.

Proposed method

  • The paper derives the SGNS objective as a weighted log-likelihood maximization problem, where the response is the proportion of observed word-context pairs and the weights are the total number of opportunities for each pair.
  • It shows that the SGNS objective is equivalent to maximizing a weighted logistic PCA objective, with responses $ x_{w,c} = \frac{P_D(w,c)}{P_D(w,c) + kP_D(w)P_D(c)} $ and weights $ n_{w,c} + k n_w P_D(c) $.
  • The method interprets negative sampling as generating binomial trials with $ n_{w,c} $ successes and $ k n_w P_D(c) $ failures, leading to a maximum likelihood estimate of the log-odds.
  • It re-expresses the SGNS objective in terms of the logistic PCA log-likelihood, showing equivalence to $ \sum_{w,c} w_{w,c} (x_{w,c} \theta_{w,c} - \log(1 + \exp(\theta_{w,c}))) $, where $ \theta_{w,c} = \mathbf{v}_w^T \mathbf{v}_c $.
  • The paper proposes an alternative SGNS-LS variant using weighted least squares, which may improve computational efficiency and offer conceptual advantages over GloVe’s weighting scheme.
  • It suggests extending SGNS to higher-order tensor factorization by incorporating document-level vectors, analogous to extensions in Cotterell et al. (2017).

Experimental results

Research questions

  • RQ1Is there a probabilistic interpretation of skip-gram with negative sampling that explains its objective beyond empirical success?
  • RQ2How does the negative sampling process relate to binomial or logistic regression models?
  • RQ3Can SGNS be formally connected to existing matrix factorization or PCA methods, particularly in the exponential family framework?
  • RQ4What are the implications of this connection for model comparison, especially with GloVe and other embedding methods?
  • RQ5Can the SGNS framework be extended to include higher-order factors such as document vectors in a tensor factorization setting?

Key findings

  • SGNS is mathematically equivalent to weighted logistic PCA with binomial likelihood, where the response is the observed proportion of word-context co-occurrences and the weights reflect total opportunities.
  • The weighting scheme in SGNS implicitly regularizes rare co-occurrences by increasing the effective number of negative samples, with larger $ k $ reducing the influence of low-frequency pairs.
  • The log-odds of the estimated probability $ x_{w,c} $ corresponds to $ \text{PMI}(w,c) - \log k $, recovering the result from Levy and Goldberg (2014) under a unified probabilistic interpretation.
  • The proposed weighted logistic PCA framework provides a conceptual advantage over GloVe’s weighting scheme, as it accounts for marginal frequencies and better reflects the likelihood of rare co-occurrences.
  • An alternative SGNS-LS method using weighted least squares is proposed, which may offer computational benefits and better aligns with collaborative filtering approaches like Spotify’s logistic matrix factorization.
  • The connection to exponential family PCA enables extension of SGNS to higher-order models, such as joint learning of document, word, and context vectors through tensor factorization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.