Negative sampling
Negative sampling is a training technique in machine learning in which a model learns to tell observed ("positive") examples apart from a small number of randomly drawn ("negative") examples, instead of computing a normalized probability over every possible output. In its narrow and original sense, the term names the NEG objective that Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado and Jeff Dean introduced in 2013 for training the Skip-gram model of word2vec, where it replaced the expensive full softmax over a vocabulary of up to millions of words with a handful of logistic regression problems per training pair.[1] The authors described it as a simplified variant of noise contrastive estimation (NCE).[1][2] In a broader sense, "negative sampling" also refers to the choice of negative examples in any objective that contrasts positives with negatives, a design decision that recurs in contrastive learning, recommendation systems, knowledge graph embedding and dense retrieval.
The method belongs to the family of candidate sampling techniques. Unlike NCE, it is not a consistent estimator of a normalized probability model: analyses published in 2014 showed that it should be understood as an objective for learning representations, and that its optimum for word vectors corresponds to factorizing a shifted pointwise mutual information matrix.[3][4]
Background: the cost of normalization
Many models predict one item out of a very large set: the next word out of a vocabulary, a context word for a target word, or a video out of a catalog. A softmax output layer turns scores into a probability distribution by dividing by a partition function, a sum over every candidate. In the Skip-gram model, the conditional probability of an output word $w_O$ given an input word $w_I$ is
where $v_w$ and $v'_w$ are the "input" and "output" vector representations of word $w$ and $W$ is the vocabulary size.[1] Mikolov and colleagues called this formulation impractical because the cost of the gradient grows with $W$, which they put at often 10^5 to 10^7 terms.[1]
Chris Dyer's 2014 notes describe the classic workaround as approximating the expectations in the log-likelihood gradient with importance sampling and related Monte Carlo methods, citing Bengio and Senecal (2003), and present NCE and negative sampling as an evolution of those techniques: both transform the expensive learning problem into a binary classification proxy problem that uses the same parameters but needs only cheap statistics.[3] Before negative sampling, word2vec's first paper had used hierarchical softmax, which replaces the flat output layer with a binary tree; the October 2013 paper used a binary Huffman tree because it assigns short codes to frequent words.[1]
Noise contrastive estimation
Noise contrastive estimation was introduced by Michael Gutmann and Aapo Hyvärinen at AISTATS 2010 as an estimation principle for unnormalized statistical models. The idea is to perform nonlinear logistic regression that discriminates observed data from artificially generated noise, with the model's log-density inside the regression; the authors showed that this gives a consistent estimator and that the normalization constant can be estimated like any other parameter.[5] Andriy Mnih and Yee Whye Teh applied NCE to neural probabilistic language models at ICML 2012, reporting that it cut training times on the Penn Treebank corpus by more than an order of magnitude without hurting model quality, and that it was more stable than importance sampling because it needed far fewer noise samples.[6] In Dyer's account, fixing the per-context normalizer to 1, as Mnih and Teh did, both reduces the number of parameters and encourages "self-normalized" outputs.[3]
Definition in word2vec
Mikolov et al. presented negative sampling in "Distributed Representations of Words and Phrases and their Compositionality", posted to arXiv on 16 October 2013 and published at NIPS 2013.[1] They noted that NCE can be shown to approximately maximize the log probability of the softmax, but that Skip-gram only needs high-quality vectors, so NCE could be simplified as long as vector quality was kept.[1] They defined NEG by the objective
which replaces every $\log p(w_O \mid w_I)$ term in the Skip-gram objective.[1] Here $\sigma(x) = 1/(1+e^{-x})$ is the sigmoid function, $k$ is the number of negative samples drawn for each positive pair, and $P_n(w)$ is the noise distribution. The task is to distinguish the true context word $w_O$ from $k$ draws from $P_n(w)$ using logistic regression.[1] Each training step therefore touches the output vectors of $k + 1$ words rather than all $W$.
The paper gives three practical prescriptions:
| Setting | Recommendation in Mikolov et al. (2013) |
|---|---|
| Number of negatives $k$ | 5-20 for small training datasets; as small as 2-5 for large datasets[1] |
| Noise distribution | Unigram distribution raised to the 3/4 power, $U(w)^{3/4}/Z$[1] |
| Difference from NCE | NCE needs samples and the numerical probabilities of the noise distribution; NEG uses only samples[1] |
The authors reported that $U(w)^{3/4}/Z$ "outperformed significantly" both the plain unigram and the uniform distribution, for NCE and NEG alike, on every task they tried, including language modeling results they did not report.[1] Raising frequencies to a power below 1 flattens the distribution. As an illustration, in a two-word vocabulary where one word has 90% of the occurrences and the other 10%, the 3/4 power gives the rarer word about 16% of the negative draws instead of 10%. The paper also linked the idea to earlier work: NCE's premise that a good model should separate data from noise by logistic regression is, in the authors' words, similar to the hinge loss Collobert and Weston used to rank data above noise.[1]
Reported results
The paper evaluated 300-dimensional Skip-gram models on the word analogy task, trained on an internal Google news dataset of one billion words with a vocabulary of 692,000 words after discarding words that occurred fewer than five times.[1]
| Method | Training time (min) | Syntactic (%) | Semantic (%) | Total (%) |
|---|---|---|---|---|
| NEG-5 | 38 | 63 | 54 | 59 |
| NEG-15 | 97 | 63 | 58 | 61 |
| HS-Huffman | 41 | 53 | 40 | 47 |
| NCE-5 | 38 | 60 | 45 | 53 |
| NEG-5, 10^-5 subsampling | 14 | 61 | 58 | 60 |
| NEG-15, 10^-5 subsampling | 36 | 61 | 61 | 61 |
| HS-Huffman, 10^-5 subsampling | 21 | 52 | 59 | 55 |
NEG-$k$ denotes negative sampling with $k$ negatives per positive sample; HS-Huffman is hierarchical softmax with a Huffman tree.[1] The authors concluded that negative sampling beat hierarchical softmax on the analogy task and did slightly better than NCE.[1] On a separate phrase-analogy dataset, hierarchical softmax performed worse without subsampling but became the best method once frequent words were downsampled, so the ranking depended on the setting.[1]
Subsampling of frequent words
The same paper introduced a companion technique, subsampling of frequent words, which discards each occurrence of word $w_i$ with probability
where $f(w_i)$ is the word's frequency and $t$ is a threshold, typically around $10^{-5}$.[1] The authors reported a speedup of around 2x to 10x and more accurate vectors for less frequent words.[1] Subsampling and negative sampling are separate mechanisms: one thins the positive training pairs, the other chooses the negatives. Goldberg and Levy later pointed out that because word2vec removes subsampled words before building context windows, subsampling also widens the effective window for the remaining words.[7]
Implementations
In the Python library gensim, the Word2Vec class enables negative sampling by default (negative=5, with hs=0 turning hierarchical softmax off) and describes the usual number of noise words as between 5 and 20.[8] Its ns_exponent parameter, default 0.75, sets the exponent of the noise distribution: 1.0 samples in proportion to frequency, 0.0 samples all words equally, and a negative value samples rare words more often than frequent ones.[8]
Derivation and theory
Goldberg and Levy's derivation
Mikolov et al. motivated the objective as a simplification of NCE but did not derive it, and Goldberg and Levy found the paper's description "somewhat cryptic and hard to follow". In February 2014, Yoav Goldberg and Omer Levy published a note on arXiv explaining it.[7] They framed each word-context pair $(w, c)$ as a binary question, whether the pair came from the corpus, with $p(D = 1 \mid w, c) = \sigma(v_c \cdot v_w)$. Maximizing this only over observed pairs has a trivial solution: set all vectors equal with a large dot product, which drives every probability to 1 (they note this happens once the dot product reaches roughly 40).[7] Adding a set $D'$ of random pairs that are assumed incorrect blocks that solution, and the name "negative sampling" comes from this set of randomly sampled negative examples.[7] The resulting objective,
matches Mikolov et al.'s equation once $D'$ is built with $k$ negatives per positive pair, contexts drawn from the unigram distribution raised to the 3/4 power.[7] Goldberg and Levy stressed that, although it is built on Skip-gram, negative sampling optimizes a different objective: it models a quantity related to the joint distribution of words and contexts rather than $p(c \mid w)$, and it is non-convex because word and context vectors are learned together.[7] Asked why this yields good word representations, their note answered that the authors did not really know, calling the distributional-hypothesis intuition "very hand-wavy".[7]
Implicit matrix factorization
At NIPS 2014, Levy and Goldberg showed that Skip-gram with negative sampling (SGNS) implicitly factorizes a word-context matrix. If the vectors have enough dimensions to reconstruct the matrix exactly, the objective is optimized when
for every pair, where $\mathrm{PMI}(w, c) = \log \frac{#(w,c) \cdot |D|}{#(w) \cdot #(c)}$ is the pointwise mutual information computed from corpus counts.[4] With $k = 1$ the matrix is the plain PMI matrix; with $k > 1$ it is shifted by $\log k$. By a similar derivation, NCE factorizes a shifted log-conditional-probability matrix, $\log P(w \mid c) - \log k$.[4] When exact reconstruction is impossible, SGNS behaves as a weighted factorization that penalizes errors on frequent pairs more than on rare ones.[4] Their analysis used the plain unigram distribution for negatives; they reported that the 3/4-power variant gave somewhat better results on some semantic tasks and showed similar trends in matrix-based methods.[4] Empirically, exact singular value decomposition of a shifted positive PMI matrix matched or beat SGNS on word similarity tasks, while SGNS stayed ahead on analogy questions.[4]
Relation to NCE
Dyer's 2014 notes compare the two objectives directly. NCE scores a candidate with $u_\theta(w, c) / (u_\theta(w, c) + k \cdot q(w))$, where $q$ is the noise distribution, while negative sampling uses $u_\theta(w, c) / (u_\theta(w, c) + 1)$, which is the logistic sigmoid of the score.[3] The two coincide only when $k = |V|$ and the noise distribution is uniform. Otherwise the conditional probabilities under negative sampling are inconsistent with the language model's, so training with it does not maximize the model's likelihood and lacks NCE's asymptotic consistency guarantees.[3] Dyer concluded that NCE suits language modeling, while for word representation learning both NCE and negative sampling are worth considering.[3]
Related sampling objectives
| Method | Core idea | Normalized model at the optimum? |
|---|---|---|
| Full softmax | Sum over every class in the denominator | Yes, exact |
| Hierarchical softmax | Binary tree over the vocabulary; about $\log_2(W)$ nodes evaluated per prediction[1] | Yes |
| Sampled softmax (importance sampling) | Softmax over the target plus sampled classes, with importance correction; Jean et al. used it for neural machine translation with very large target vocabularies[9] | Approximate; TensorFlow calls its sampled softmax loss "generally an underestimate" of the full loss[10] |
| Noise contrastive estimation | Logistic regression between data and noise using the noise probabilities[5] | Yes, asymptotically[3] |
| Negative sampling (NEG) | Logistic regression between data and noise using only samples[1] | No[3] |
| InfoNCE | Categorical cross-entropy for picking the one positive among $N$ samples, with $N - 1$ negatives[11] | Learns a density ratio rather than a normalized model[11] |
Library implementations follow the same split between training and inference. TensorFlow's tf.nn.sampled_softmax_loss is documented as a training-only operation, and the documentation suggests computing the full softmax for evaluation or inference. By default it draws candidates with a log-uniform sampler and removes "accidental hits", sampled classes that equal a target class.[10]
InfoNCE, introduced by Aaron van den Oord, Yazhe Li and Oriol Vinyals in the 2018 Contrastive Predictive Coding paper, generalizes the binary data-versus-noise setup to a multi-class one. Given one positive and $N - 1$ negatives, it minimizes
where $X$ is the set of $N$ samples and $f$ is a learned score.[11] The authors showed that the optimal $f$ is proportional to a density ratio regardless of the number of negatives, and that $\log N - \mathcal{L}_N$ is a lower bound on the mutual information between the context and the target, which becomes tighter as $N$ grows.[11] Robinson et al. describe noise-contrastive objectives of this kind as the typical training objective in contrastive representation learning.[12]
Choosing the negatives
Later work treats the source of the negatives as a design choice in its own right. The main options are summarized below and described in the subsections that follow.
| Strategy | How negatives are obtained | Example |
|---|---|---|
| Frequency-based | Drawn from a smoothed frequency distribution | word2vec (3/4 power)[1] |
| In-batch | Positives of other examples in the same minibatch | DPR, SimCLR, CLIP[13][14][15] |
| Memory queue | Encodings from previous minibatches | MoCo[16] |
| Hard negatives | Candidates the current model scores as similar | FaceNet, DPR BM25 negatives, ANCE[17][13][18] |
| Model-weighted | Sampled or weighted by the current model's scores | Robinson et al., RotatE[12][19] |
| Bias-corrected | Reweighting to offset sampling bias or false negatives | Chuang et al., Yi et al.[20][21] |
Frequency-based noise distributions
The 3/4-power unigram distribution was chosen empirically for language tasks.[1] Hugo Caselles-Dupré, Florian Lesaint and Jimena Royo-Letelier tested SGNS on recommendation data at RecSys 2018 and found that the exponent mattered. On their 30Music dataset, the standard 0.75 was "clearly suboptimal" and the best value was -0.5, which makes unpopular items more likely to be drawn as negatives; on their Deezer and click-stream datasets the best exponent was also negative.[22] They concluded that the best settings for recommendation are noticeably different from those for natural language processing.[22] Gensim's documentation cites this paper in its description of ns_exponent.[8]
In-batch negatives
When both sides of a pair are produced by encoders, the positives of other examples in the same minibatch can serve as negatives at no extra encoding cost. In Dense Passage Retrieval (DPR), Vladimir Karpukhin and colleagues computed a $B \times B$ similarity matrix for a batch of $B$ questions and their relevant passages, which gives each question $B - 1$ negative passages.[13] They reported that in-batch training improved results substantially over a similar configuration with negatives drawn from the whole training set, and that accuracy improved consistently as the batch grew.[13] In SimCLR, Ting Chen and colleagues did not sample negatives explicitly: each augmented example treats the other $2(N - 1)$ augmented examples in the batch as negatives, so a batch size of 8,192 gives 16,382 negatives per positive pair.[14] CLIP applies the same construction to image-text pairs: for a batch of $N$ pairs it maximizes the similarity of the $N$ real pairs and minimizes that of the $N^2 - N$ incorrect pairings, with a minibatch size of 32,768.[15]
SigLIP (Zhai et al., 2023) replaced CLIP's softmax with a sigmoid loss that treats every image-text pair as an independent binary classification, positive for matching pairs and negative for all others.[23] With a batch of $|B|$ examples there are $|B|$ positives and $|B|^2 - |B|$ negatives; in the paper's 16k batch setting that comes to about 268 million negatives against 16k positives.[23] In masking experiments, randomly removing negatives to rebalance the classes hurt performance and keeping only the easiest negatives did not work at all. The authors concluded that the imbalance did not seem harmful, but that an efficient way of mining negatives might help.[23]
Memory queues
MoCo (Kaiming He and colleagues at Facebook AI Research) decouples the number of negatives from the batch size by keeping a queue of encoded keys: the current minibatch is enqueued and the oldest dequeued, and the keys come from a slowly updated momentum encoder.[16] In their comparisons, all three mechanisms they tested (end-to-end, memory bank and MoCo) benefited from a larger number of negatives $K$, and the main experiments used $K = 65{,}536$.[16]
Hard negatives
Negatives that are close to the anchor carry more training signal than random ones, but they are also harder to use safely. In FaceNet, Florian Schroff, Dmitry Kalenichenko and James Philbin found that selecting the hardest negatives early in training could lead to bad local minima and a collapsed model; they instead used "semi-hard" negatives, which are farther from the anchor than the positive but still inside the margin.[17] DPR added passages that score highly under BM25 but do not contain the answer: one such negative per question improved results substantially, while a second did not help further.[13]
ANCE (Lee Xiong, Chenyan Xiong and colleagues at Microsoft, 2020) argued that in dense retrieval, uninformative negatives sampled locally within a batch lead to diminishing gradient norms, high gradient variance and slow convergence. It instead selects hard negatives from the entire corpus using an asynchronously updated approximate nearest neighbor index.[18] For self-supervised learning, where true labels are unknown, Joshua Robinson, Ching-Yao Chuang, Suvrit Sra and Stefanie Jegelka (ICLR 2021) proposed an unsupervised method for sampling hard negatives with a user-controlled hardness, which they reported improves downstream performance with no computational overhead.[12]
False negatives and sampling bias
Random negatives are not guaranteed to be negative. In unlabeled data a sampled "negative" may share the anchor's class. Chuang and colleagues (NeurIPS 2020) found that sampling negatives from truly different labels improves performance in a synthetic setting, and proposed a debiased contrastive objective that corrects for same-label negatives without knowing the labels.[20] Robinson et al. describe a trade-off between using harder negatives and the damage from false negatives, which grows for harder samples because the correction is only approximate.[12] TensorFlow's remove_accidental_hits option addresses the simplest case, a sampled class equal to the target.[10]
Sampling also biases which items are penalized. Xinyang Yi and colleagues at Google (RecSys 2019) observed that in-batch items follow a power-law distribution in recommendation data, so popular items are overly penalized as negatives because they appear in batches more often. Following the "logQ correction" used with sampled softmax, they subtract the log of each item's estimated sampling probability from its logit, $s^c(x_i, y_j) = s(x_i, y_j) - \log p_j$, and estimate item frequencies from streaming data.[21]
Applications
Word, graph and item embeddings
Beyond word2vec, the Skip-gram-with-negative-sampling recipe was carried over to other kinds of sequences and graphs:
- LINE (Tang et al., WWW 2015) embeds large information networks and samples $K$ negative edges with probability proportional to $d_v^{3/4}$, where $d_v$ is the out-degree of vertex $v$, following word2vec; each optimization step costs $O(dK)$.[24]
- node2vec (Aditya Grover and Jure Leskovec, KDD 2016) optimizes its random-walk Skip-gram objective with SGD and negative sampling. In its experiments the authors switched DeepWalk from hierarchical softmax to negative sampling, which they called the de facto approximation in node2vec and LINE.[25]
- item2vec (Oren Barkan and Noam Koenigstein, 2016) applies SGNS to item-based collaborative filtering, learning item embeddings without user information, and the authors reported results competitive with SVD.[26]
Recommender systems
Implicit-feedback recommenders observe positive interactions (clicks, purchases, plays) but rarely explicit negatives, so negatives have to be sampled. Bayesian Personalized Ranking (Steffen Rendle and colleagues, UAI 2009) trains on triples of a user, an item the user interacted with and one the user did not. Its learning algorithm, LearnBPR, draws these triples uniformly at random with replacement (bootstrap sampling) instead of cycling through them.[27] In YouTube's 2016 deep candidate-generation model, Paul Covington, Jay Adams and Emre Sargin sampled negative classes from a background distribution and corrected for the sampling with importance weighting. They reported that several thousand negatives were sampled in practice, a speedup of more than 100 times over a traditional softmax.[28] Yi et al.'s bias-corrected in-batch training underpinned a retrieval system for YouTube.[21]
Knowledge graph embedding
Knowledge graph embedding models learn from true triples (head, relation, tail) and generate negatives by corruption. TransE (Bordes et al., NIPS 2013) builds corrupted triples by replacing either the head or the tail of a training triple with a random entity (never both) and samples one corrupted triple for each training triple.[29] RotatE (Zhiqing Sun and colleagues, ICLR 2019) uses a loss similar to word2vec's negative sampling loss. Its authors argued that uniform negative sampling is inefficient because many samples become obviously false as training goes on, and proposed self-adversarial negative sampling, which weights each negative triple by a softmax over the current model's scores at a temperature $\alpha$.[19] In their experiments, self-adversarial sampling was the most effective of the negative sampling techniques they compared.[19]
Dense retrieval and contrastive pretraining
The ANCE authors describe constructing proper negatives as a key challenge in dense retrieval, because a first-stage retriever must separate relevant documents from every irrelevant one in the corpus.[18] Dense retrievers and self-supervised learning methods combine the strategies described above (in-batch negatives, BM25 or ANN-mined hard negatives, and memory queues) with InfoNCE-style losses.[13][14][16][18]
Limitations
- Not a probability model. Negative sampling does not yield normalized probabilities and lacks NCE's consistency guarantees, so Dyer recommends NCE instead when the goal is language modeling.[3]
- Sensitivity to the noise distribution. The best number and distribution of negatives depend on the data: the 3/4 exponent chosen for text was suboptimal for some recommendation datasets.[1][22]
- False negatives and bias. Sampled negatives can be true positives, and frequency-dependent sampling over-penalizes popular items unless corrected.[20][21]
- Hard-negative instability. Overly hard negatives can collapse training, which is why methods such as FaceNet use semi-hard negatives.[17]
Reception
The 2013 paper that introduced negative sampling received the NeurIPS 2023 Test of Time Award.[2]
Continue reading
- word2vecword2vec is a family of shallow neural network models, published by Tomas Mikolov and colleagues at Google in 2013Mentioned 10 times above
- Full SoftmaxFull softmax (also called the standard softmax or exact softmax) is the softmax computation that calculates a probability for every possible output class in a classification modelMentioned 3 times above
- Importance samplingImportance sampling (often abbreviated IS) is a Monte Carlo method for estimating the expectation of a function under a target probability distribution…Mentioned 3 times above
- Candidate SamplingCandidate sampling is a family of training-time optimization techniques used in machine learning to reduce the computational cost of models that must choose among a very large number of output classes.Listed in See also
- Contrastive LearningContrastive learning is a family of machine learning methods that learn representations by pulling similar (positive) pairs of data points closer together in an embedding space while pushing dissimilar…Listed in See also
- Word EmbeddingA word embedding is a learned representation of text in which words are mapped to dense vectors of real numbers in a continuous vector space, so that words with similar meanings are positioned close together.Listed in See also
More from See also
More to read
Topics:Machine LearningNatural Language ProcessingTraining & Optimization
References
- ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16 ^17 ^18 ^19 ^20 ^21 ^22 ^23 ^24 ^25Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, Jeffrey Dean. "Distributed Representations of Words and Phrases and their Compositionality". arXiv:1310.4546; Advances in Neural Information Processing Systems 26 (NIPS 2013), 2013-10-16. arxiv.org/...1310.4546
- ^1 ^2NeurIPS. "Test of Time Award Talk: Distributed Representations of Words and Phrases and their Compositionality". NeurIPS 2023 virtual conference site, 2023. neurips.cc/...83333
- ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9Chris Dyer. "Notes on Noise Contrastive Estimation and Negative Sampling". arXiv:1410.8251, 2014-10-30. arxiv.org/...1410.8251
- ^1 ^2 ^3 ^4 ^5 ^6Omer Levy, Yoav Goldberg. "Neural Word Embedding as Implicit Matrix Factorization". Advances in Neural Information Processing Systems 27 (NIPS 2014), 2014. papers.nips.cc/...ceae55a8e87efb7cbfd9ad4-Abstract
- ^1 ^2Michael Gutmann, Aapo Hyvärinen. "Noise-contrastive estimation: A new estimation principle for unnormalized statistical models". Proceedings of AISTATS 2010, PMLR 9, 2010. proceedings.mlr.press/...gutmann10a
- ^Andriy Mnih, Yee Whye Teh. "A fast and simple algorithm for training neural probabilistic language models". Proceedings of the 29th International Conference on Machine Learning (ICML 2012). arXiv:1206.6426. arxiv.org/...1206.6426
- ^1 ^2 ^3 ^4 ^5 ^6 ^7Yoav Goldberg, Omer Levy. "word2vec Explained: Deriving Mikolov et al.'s Negative-Sampling Word-Embedding Method". arXiv:1402.3722, 2014-02-15. arxiv.org/...1402.3722
- ^1 ^2 ^3Gensim. "models.word2vec: Word2vec embeddings". gensim 4.3.3 documentation. radimrehurek.com/...word2vec
- ^Sébastien Jean, Kyunghyun Cho, Roland Memisevic, Yoshua Bengio. "On Using Very Large Target Vocabulary for Neural Machine Translation". arXiv:1412.2007, 2014-12-05. arxiv.org/...1412.2007
- ^1 ^2 ^3TensorFlow. "tf.nn.sampled_softmax_loss". TensorFlow API documentation (v2.21.0). tensorflow.org/...sampled_softmax_loss
- ^1 ^2 ^3 ^4Aaron van den Oord, Yazhe Li, Oriol Vinyals. "Representation Learning with Contrastive Predictive Coding". arXiv:1807.03748, 2018-07-10. arxiv.org/...1807.03748
- ^1 ^2 ^3 ^4Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, Stefanie Jegelka. "Contrastive Learning with Hard Negative Samples". ICLR 2021. arXiv:2010.04592. arxiv.org/...2010.04592
- ^1 ^2 ^3 ^4 ^5 ^6Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, Wen-tau Yih. "Dense Passage Retrieval for Open-Domain Question Answering". EMNLP 2020. arXiv:2004.04906. arxiv.org/...2004.04906
- ^1 ^2 ^3Ting Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey Hinton. "A Simple Framework for Contrastive Learning of Visual Representations". Proceedings of the 37th International Conference on Machine Learning (ICML 2020). arXiv:2002.05709. arxiv.org/...2002.05709
- ^1 ^2Alec Radford, Jong Wook Kim, Chris Hallacy, et al. "Learning Transferable Visual Models From Natural Language Supervision". ICML 2021. arXiv:2103.00020. arxiv.org/...2103.00020
- ^1 ^2 ^3 ^4Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, Ross Girshick. "Momentum Contrast for Unsupervised Visual Representation Learning". CVPR 2020. arXiv:1911.05722. arxiv.org/...1911.05722
- ^1 ^2 ^3Florian Schroff, Dmitry Kalenichenko, James Philbin. "FaceNet: A Unified Embedding for Face Recognition and Clustering". CVPR 2015. arXiv:1503.03832. arxiv.org/...1503.03832
- ^1 ^2 ^3 ^4Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, Arnold Overwijk. "Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrieval". arXiv:2007.00808, 2020. arxiv.org/...2007.00808
- ^1 ^2 ^3Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, Jian Tang. "RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space". ICLR 2019. arXiv:1902.10197. arxiv.org/...1902.10197
- ^1 ^2 ^3Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, Stefanie Jegelka. "Debiased Contrastive Learning". NeurIPS 2020. arXiv:2007.00224. arxiv.org/...2007.00224
- ^1 ^2 ^3 ^4Xinyang Yi, Ji Yang, Lichan Hong, Derek Zhiyuan Cheng, Lukasz Heldt, Aditee Kumthekar, Zhe Zhao, Li Wei, Ed Chi. "Sampling-Bias-Corrected Neural Modeling for Large Corpus Item Recommendations". RecSys '19, 2019. research.google/...rge-corpus-item-recommendations
- ^1 ^2 ^3Hugo Caselles-Dupré, Florian Lesaint, Jimena Royo-Letelier. "Word2Vec applied to Recommendation: Hyperparameters Matter". RecSys '18, 2018. arXiv:1804.04212. arxiv.org/...1804.04212
- ^1 ^2 ^3Xiaohua Zhai, Basil Mustafa, Alexander Kolesnikov, Lucas Beyer. "Sigmoid Loss for Language Image Pre-Training". ICCV 2023. arXiv:2303.15343. arxiv.org/...2303.15343
- ^Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, Qiaozhu Mei. "LINE: Large-scale Information Network Embedding". WWW 2015. arXiv:1503.03578. arxiv.org/...1503.03578
- ^Aditya Grover, Jure Leskovec. "node2vec: Scalable Feature Learning for Networks". KDD 2016. arXiv:1607.00653. arxiv.org/...1607.00653
- ^Oren Barkan, Noam Koenigstein. "Item2Vec: Neural Item Embedding for Collaborative Filtering". IEEE MLSP 2016. arXiv:1603.04259. arxiv.org/...1603.04259
- ^Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, Lars Schmidt-Thieme. "BPR: Bayesian Personalized Ranking from Implicit Feedback". UAI 2009. arXiv:1205.2618. arxiv.org/...1205.2618
- ^Paul Covington, Jay Adams, Emre Sargin. "Deep Neural Networks for YouTube Recommendations". RecSys '16, 2016. research.google.com/...45530.pdf
- ^Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, Oksana Yakhnenko. "Translating Embeddings for Modeling Multi-relational Data". Advances in Neural Information Processing Systems 26 (NIPS 2013). papers.nips.cc/...928ca8133fa24680a88d2f9-Abstract
Improve this article
Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.
2 revisions · v2 · 4,406 words · full history
Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify
Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here
Reviewer note: Independent fact-check before publication on November 18, 2026: 84 claims checked against 31 cited and independent sources; 0 material and 4 minor corrections applied before publication.
Cite this page: AI Wiki. "Negative sampling." aiwiki.ai, updated 18 Nov 2026, fact-checked 18 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/negative_sampling


