每日论文|在向量空间中高效估计词表示(Efficient Estimation of Word Representations in Vector Space, 2013)


This is the fifth piece in the Daily Paper series, after the 1986 back-propagation letter, the 1997 LSTM paper, the 1998 LeNet document-recognition survey, and yesterday’s 2012 AlexNet paper on ImageNet classification. One year after that convolutional net scaled supervised vision to 1.2 million photographs, this ICLR 2013 workshop paper asked a different scaling question: how to learn useful continuous word vectors from data sets with hundreds of millions or billions of tokens, far beyond what earlier neural language models had been trained on. The authors strip away the expensive non-linear hidden layer and propose two log-linear architectures, later widely known through the word2vec toolkit: continuous bag-of-words (CBOW) and continuous Skip-gram. Only the abstract is translated in full; the rest is a bilingual reading guide, not a line-by-line translation of the paper. The official text used here is arXiv:1301.3781v3, dated 7 September 2013. The arXiv record carries the standard non-exclusive distribution licence, not a Creative Commons licence that would allow free adaptation of the body, so this guide does not claim an open adaptation licence for the body text.

这是「每日论文」的第 5 篇,接在 1986 年反向传播短文、1997 年 LSTM 长文、1998 年 LeNet 文档识别综述,以及昨天的 2012 年 AlexNet ImageNet 分类论文之后。在那篇卷积网把有监督视觉放大到 120 万张照片的一年后,这篇 ICLR 2013 研讨会论文问的是另一个尺度问题:如何从数亿乃至数十亿词的数据中学到有用的连续词向量,远超此前神经语言模型实际训练过的规模。作者去掉代价高昂的非线性隐层,提出两种对数线性结构,后来因 word2vec 工具包而为人所知:连续词袋模型(CBOW)和连续 Skip-gram。下面只对摘要做完整的中英对照,其余是导读,不逐段翻译全文。本文依据的正式文本是 arXiv:1301.3781v3,日期为 2013 年 9 月 7 日。该 arXiv 记录使用的是标准非独占发布许可,并不是允许自由改编正文的知识共享许可,因此本导读不对正文主张可自由改编的开放许可。

Bibliographic details 论文信息

  • Title 标题:Efficient Estimation of Word Representations in Vector Space
  • Authors 作者:Tomas Mikolov、Kai Chen、Greg Corrado、Jeffrey Dean
  • Affiliations 单位:Google Inc., Mountain View, CA(四位作者均为此单位)
  • Venue 会议:International Conference on Learning Representations(ICLR 2013)workshop paper,列入 ICLR 2013 研讨会论文列表
  • Year 年份:2013
  • arXiv identifier 标识:arXiv:1301.3781v3 [cs.CL](submitted 16 January 2013 初稿提交于 2013 年 1 月 16 日;this version 本版 7 September 2013)
  • Pages 页数:12 pages in the arXiv v3 PDF 该 PDF 共 12 页
  • Official PDF 官方 PDF:https://arxiv.org/pdf/1301.3781
  • Abstract page 摘要页:https://arxiv.org/abs/1301.3781
  • ICLR 2013 workshop proceedings listing 研讨会论文列表:https://www.iclr.cc/archive/2013/workshop-proceedings.html
  • DOI:https://doi.org/10.48550/arXiv.1301.3781

The bibliographic details above were checked against the arXiv abstract page and the v3 PDF. The title, the four author names as printed on the PDF, the Google Inc. Mountain View affiliations, the 16 January 2013 submission date, and the 7 September 2013 v3 date all match. Workshop acceptance at ICLR 2013 is confirmed by the official ICLR 2013 workshop proceedings page, which lists this title and these four authors. Google’s research publication page also names the venue as ICLR 2013. The arXiv licence link is the standard non-exclusive distribution licence, not CC BY or a similar adaptation licence.

以上著录已对照 arXiv 摘要页与 v3 PDF 核对。标题、PDF 上刊出的四位作者姓名、Google Inc. Mountain View 单位、2013 年 1 月 16 日投稿日期以及 2013 年 9 月 7 日的 v3 日期均一致。ICLR 2013 研讨会录用可由官方研讨会论文列表确认,该页列出了同一标题与这四位作者。Google 的研究论文页面也将会议写作 ICLR 2013。arXiv 上的许可链接是标准非独占发布许可,不是 CC BY 或同类允许改编的许可。

Abstract 摘要

The English text below is the published abstract, quoted after checking the official arXiv v3 PDF. Line-end hyphenation has been removed so the wording can be read as continuous prose; no other wording has been changed. The Chinese that follows is a complete translation.

下面的英文是正式刊出摘要,已对照官方 arXiv v3 PDF 核对后引出。为便于阅读,只去掉了行末断词连字符,其余措辞未改。中文为对应全译。

We propose two novel model architectures for computing continuous vector representations of words from very large data sets. The quality of these representations is measured in a word similarity task, and the results are compared to the previously best performing techniques based on different types of neural networks. We observe large improvements in accuracy at much lower computational cost, i.e. it takes less than a day to learn high quality word vectors from a 1.6 billion words data set. Furthermore, we show that these vectors provide state-of-the-art performance on our test set for measuring syntactic and semantic word similarities.

我们提出两种新的模型结构,用于从超大规模数据集中计算词的连续向量表示。这些表示的质量在词相似度任务上衡量,并与此前基于不同类型神经网络、表现最好的技术进行比较。我们观察到准确率大幅提升,同时计算代价低得多,也就是说,可以从 16 亿词的数据集中在不到一天内学到高质量词向量。此外,我们表明这些向量在我们用于衡量句法与语义词相似度的测试集上达到了当时最好的水平。

Background and the problem 背景与要解决的问题

The opening contrast is between treating words as atomic indices, with no notion of similarity, and learning distributed representations in which similar words lie close together. Atomic symbols have real advantages: they are simple and robust, and a plain N-gram language model can already be trained on trillions of words. The authors argue that this strategy hits a wall when in-domain data are scarce. In automatic speech recognition, they note, performance is usually dominated by the size of high-quality transcribed speech, often just millions of words; in machine translation, many language pairs have only a few billion words or less. In those regimes, merely scaling the simplest methods is not enough.

开篇的对照是:把词当作原子式的编号、其中没有相似度概念,还是学习分布式表示,让相近的词靠在一起。原子符号确有好处:简单、稳健,而且普通 N-gram 语言模型已经可以在数万亿词上训练。作者认为,一旦领域内数据稀缺,这条路就会碰到天花板。他们指出,自动语音识别的表现通常受高质量转写语音规模主导,往往只有数百万词;机器翻译里,许多语言对只有数十亿词甚至更少。在这些情况下,只把最简单的方法放大并不足够。

Neural network language models that learn distributed word vectors had already been shown to outperform N-grams, following the line of work from Hinton, McClelland and Rumelhart on distributed representations and from Bengio and colleagues on feedforward neural net language models (NNLM). A later architecture associated with Mikolov’s earlier work first learned word vectors with a simple single-hidden-layer net, then trained an NNLM on top of those vectors. This paper extends that two-step idea and concentrates on the first step alone. The stated goal is to learn high-quality vectors from huge data sets with billions of words and millions of words in the vocabulary. The authors write that, as far as they knew, no previously proposed architecture had been successfully trained on more than a few hundred million words, and then usually with a modest vector size between 50 and 100 dimensions.

学习分布式词向量的神经语言模型,此前已被证明优于 N-gram,这一脉络上接 Hinton、McClelland 与 Rumelhart 的分布式表示,以及 Bengio 等人的前馈神经语言模型(NNLM)。与 Mikolov 早期工作相关的另一种结构,是先用带单隐层的简单网络学习词向量,再在这些向量之上训练 NNLM。本文延伸这一两步思路,并且只聚焦第一步。作者给出的目标是:从数十亿词的超大数据集、词表含数百万词的设定中,学到高质量向量。他们写道,据他们当时所知,此前提出的结构还没有在超过几亿词的数据上成功训练过,而且通常只用 50 到 100 维这种偏小的向量维度。

Quality is not judged only by nearest neighbours. The authors want vectors that support several kinds of similarity at once, including the linear regularities popularised in contemporaneous work: the now-famous offset example is that vector(“King”) − vector(“Man”) + vector(“Woman”) is closest to vector(“Queen”). They therefore introduce a new comprehensive test set for both semantic and syntactic regularities, and they study how accuracy and training time depend on vector dimensionality and on the amount of training data. They also note that neural distributed representations had already been shown to preserve linear regularities better than latent semantic analysis (LSA), while latent Dirichlet allocation (LDA) becomes very expensive on large data.

质量并不只看近邻词。作者希望向量能同时支持多种相似度,包括当时工作中已经引人注目的线性规律:如今广为人知的偏移例子是,vector(“King”) − vector(“Man”) + vector(“Woman”) 最接近 vector(“Queen”)。因此他们设计了一套同时衡量语义与句法规律的综合性测试集,并考察准确率和训练时间如何随向量维度与训练数据量变化。他们还指出,神经分布式表示在保持线性规律上已被证明优于潜在语义分析(LSA),而潜在狄利克雷分配(LDA)在大数据上会变得非常昂贵。

Core methods 核心方法

For every architecture they discuss, training complexity is written as proportional to O = E × T × Q, where E is the number of training epochs, T is the number of training tokens, and Q is the cost per example, defined separately for each model. A common choice, they say, is E between 3 and 50, with T up to one billion. All of the models are trained with stochastic gradient descent and back-propagation.

对他们讨论的每一种结构,训练复杂度都写成与 O = E × T × Q 成正比,其中 E 是训练轮数,T 是训练词数,Q 是每个样本的代价,并按模型分别定义。他们说常见选择是 E 取 3 到 50,T 可达十亿。所有模型都用随机梯度下降和反向传播训练。

Why the hidden layer is the bottleneck 为何隐层是瓶颈

A standard feedforward NNLM has input, projection, hidden, and output layers. With N previous words, a shared projection matrix, hidden size H, vector size D and vocabulary size V, the dominant term in Q is usually H × V, or, after a hierarchical softmax, the still-heavy N × D × H term between the dense projection and the non-linear hidden layer. Typical numbers cited in the paper are N = 10, a projection width of 500 to 2000, and H of 500 to 1000. A recurrent language model avoids a fixed context length, but its leading cost becomes H × H once the H × V term is reduced by hierarchical softmax. The authors therefore try simpler log-linear models that drop the non-linear hidden layer. They acknowledge that such models may represent the data less precisely than a full neural net, but they may be trained on much more data.

标准前馈 NNLM 有输入、投影、隐层和输出层。若上文为 N 个词,使用共享投影矩阵,隐层大小为 H,向量维度为 D,词表大小为 V,则 Q 中通常占主导的是 H × V;即便改用层次 softmax,稠密投影与非线性隐层之间的 N × D × H 仍然很重。文中举出的典型数字是 N = 10,投影宽度 500 到 2000,H 为 500 到 1000。循环语言模型不再需要固定上下文长度,但在用层次 softmax 压低 H × V 之后,主要代价变成 H × H。于是作者改试更简单的对数线性模型,去掉非线性隐层。他们承认这类模型对数据的刻画可能不如完整神经网络精确,但可以在更多数据上高效训练。

Output normalisation still matters once the hidden layer is gone. The models in this paper use hierarchical softmax, with the vocabulary organised as a Huffman binary tree so that frequent words receive shorter codes. The authors say this reduces the number of output units that must be evaluated from about log₂(V) for a balanced tree to about log₂ of the unigram perplexity of V; for a one-million-word vocabulary they estimate about a two-times speedup in evaluation.

一旦去掉隐层,输出归一化就更加关键。本文模型使用层次 softmax,并把词表组织成 Huffman 二叉树,让高频词获得更短的编码。作者说,这样需要计算的输出单元数,会从平衡树大约 log₂(V) 降到大约以 V 的 unigram 困惑度为底的 log₂;在一百万词的词表上,他们估计评估速度大约可提升一倍。

Continuous bag-of-words (CBOW) 连续词袋模型

CBOW is described as a feedforward NNLM with the non-linear hidden layer removed and with a projection layer that is shared across word positions, not only a shared projection matrix. All context words are projected to the same position and their vectors are averaged, so the order of words in the history does not affect the projection—hence the bag-of-words name. The model also uses future words. The authors report that they obtained the best performance on the task introduced later by a log-linear classifier with four history words and four future words at the input, trained to classify the current middle word. The per-example complexity is Q = N × D + D × log₂(V).

CBOW 被写成去掉非线性隐层的前馈 NNLM,而且不仅投影矩阵共享,投影层本身也对各个词位置共享。所有上下文词被投影到同一位置并对其向量取平均,因此历史上的词序并不影响投影——这就是「词袋」这一名称的来由。模型还使用未来词。作者报告,在后文引入的任务上,最好的结果来自一个对数线性分类器:输入为四个历史词和四个未来词,训练目标是正确分类当前的中间词。每个样本的复杂度为 Q = N × D + D × log₂(V)。

Continuous Skip-gram 连续 Skip-gram

Skip-gram reverses the prediction: the current word is the input to a log-linear classifier with a continuous projection layer, and the targets are words within a window before and after it. A larger range improves vector quality but raises computational cost. Distant words are usually less related, so they are down-weighted by being sampled less often. The complexity is Q = C × (D + D × log₂(V)), where C is the maximum distance. If C = 5, the procedure described in the paper is to draw an integer R in the closed range from 1 to C, then take R history words and R future words as labels, giving 2R classifications with the current word as input. In the experiments that follow, they use C = 10.

Skip-gram 把预测方向倒过来:当前词作为带连续投影层的对数线性分类器的输入,目标则是它前后一定范围内的词。增大范围会提高向量质量,但也增加计算量。较远的词通常关系更弱,因此通过更少地被采样来降低权重。复杂度为 Q = C × (D + D × log₂(V)),其中 C 是最大距离。若 C = 5,文中的做法是在 1 到 C 的闭区间内抽取整数 R,再取 R 个历史词和 R 个未来词作为标签,也就是以当前词为输入做 2R 次分类。后文实验中他们取 C = 10。

Training setup 训练设置

Large Google News experiments use a corpus of about 6 billion tokens, with the vocabulary restricted to the 1 million most frequent words. For the runs reported in Tables 2 and 4, the authors use three training epochs, a starting learning rate of 0.025, and a linear decay that reaches zero at the end of the last epoch. Later they also report one-epoch training, again with a linearly decaying rate. To scale still further, they implement both the older NNLMs and the new models on DistBelief, Google’s large-scale distributed framework, using mini-batch asynchronous gradient descent and Adagrad, commonly with one hundred or more model replicas.

大规模 Google News 实验使用约 60 亿词的语料,词表限制为最频繁的 100 万词。表 2 和表 4 中的结果使用三轮训练,初始学习率 0.025,并线性衰减,使其在最后一轮结束时接近零。后文也报告了只训一轮的设定,同样使用线性衰减的学习率。为了进一步放大,他们把原有的 NNLM 和本文新模型都实现在 Google 的大规模分布式框架 DistBelief 上,采用小批量异步梯度下降和 Adagrad,训练时常用一百个或更多模型副本。

Main results 主要结果

The new Semantic-Syntactic Word Relationship test set contains 8869 semantic questions and 10675 syntactic questions, built from five semantic relation types (for example common capital city, currency, city-in-state, man–woman) and nine syntactic types (for example adjective to adverb, comparative, past tense, plural nouns). A question is counted as correct only if the nearest word, by cosine distance, to the offset vector is an exact string match to the intended answer; synonyms are counted as errors, and the input question words are discarded during the search. The authors note that 100% accuracy is likely impossible under this rule, because the models are given no morphological information. Only single-token words are included, so multi-word names such as New York are absent. They also report numbers on a syntactic relatedness set from Mikolov, Yih and Zweig.

新的 Semantic-Syntactic Word Relationship 测试集包含 8869 道语义题和 10675 道句法题,由五类语义关系(例如常见首都、货币、城市所属州、男–女)和九类句法关系(例如形容词到副词、比较级、过去时、名词复数)构成。一道题只有在偏移向量按余弦距离找到的最近词与预定答案完全一致时才算对;同义词算错,而且搜索时会丢掉题面中的输入词。作者指出,在这一规则下很可能无法达到 100%,因为模型没有得到任何形态信息。测试集只收单标记词,因此像 New York 这样的多词专名并不出现。他们也在 Mikolov、Yih 与 Zweig 的句法相关测试集上报告了数字。

Dimensionality and data scale together 维度与数据量要一起增加

Table 2 studies CBOW vectors trained with a vocabulary limited to the 30 thousand most frequent words, evaluating only questions whose words all fall in that vocabulary. Accuracy rises when either the dimension or the training-token count grows, but the gains diminish if only one of the two is increased. With 50-dimensional vectors, accuracy moves from 13.4% on 24 million words to 23.2% on 783 million words; with 600-dimensional vectors, the same data range yields 24.0% to 50.4%. The authors conclude that vector size and data size should be increased together, and they warn against the then-common practice of training on fairly large corpora but with only 50 to 100 dimensions.

表 2 考察词表限制为最频繁 3 万词时训练的 CBOW 向量,并且只评测用词全部落在该词表内的题目。维度或训练词数增加,准确率都会上升,但只加大其中一项时收益会递减。50 维向量在 2400 万词上是 13.4%,在 7.83 亿词上是 23.2%;600 维向量在同一组数据量上则从 24.0% 升到 50.4%。作者的结论是,向量维度和数据量应当一起增加,并提醒当时一种常见做法——语料已经不小,却只用 50 到 100 维——是不够的。

Architecture comparison on the same data 同一数据上的结构比较

Table 3 compares 640-dimensional vectors trained on the same 320 million word LDC mix (82 thousand word vocabulary) used for an earlier recurrent language model that had taken about eight weeks on a single CPU. On the new test set and on the MSR syntactic set, the reported accuracies are: RNNLM 9% semantic, 36% syntactic, 35% MSR; NNLM 23%, 53%, 47%; CBOW 24%, 64%, 61%; Skip-gram 55%, 59%, 56%. CBOW is strongest on the syntactic columns; Skip-gram is far ahead on the semantic column and still better than the NNLM on syntax.

表 3 比较在同一份 3.20 亿词的 LDC 混合语料(词表 8.2 万)上训练的 640 维向量;这份数据也曾用于一个在单 CPU 上大约训练了八周的循环语言模型。在新测试集和 MSR 句法集上,文中报告的准确率为:RNNLM 语义 9%、句法 36%、MSR 35%;NNLM 为 23%、53%、47%;CBOW 为 24%、64%、61%;Skip-gram 为 55%、59%、56%。CBOW 在句法几列上最强;Skip-gram 在语义列上遥遥领先,句法上也仍优于 NNLM。

Public baselines and single-machine training 公开基线与单机训练

Table 4 compares publicly available vectors with the authors’ own models, now using the full question set. Several earlier released NNLMs, with 50 to 200 dimensions and 37 million to 990 million training words, stay in a total-accuracy band from 1.8% to 12.3%. A 640-dimensional RNNLM trained on 320 million words reaches 24.6% total. The authors’ own NNLMs trained on the 6 billion word Google News data reach 20.3%, 43.2% and 50.8% total at 20, 50 and 100 dimensions. A 300-dimensional CBOW model trained on 783 million words scores 15.5% semantic, 53.1% syntactic and 36.1% total, and took about one day on a single CPU. A 300-dimensional Skip-gram model on the same 783 million words scores 50.0%, 55.9% and 53.3%, and took about three days.

表 4 把已公开的词向量与作者自己的模型比较,并且改用完整题集。此前发布的若干 NNLM,维度 50 到 200、训练词数 3700 万到 9.90 亿,总体准确率多在 1.8% 到 12.3%。在 3.20 亿词上训练的 640 维 RNNLM 总体达到 24.6%。作者自己在 60 亿词 Google News 上训练的 NNLM,在 20、50、100 维时总体分别为 20.3%、43.2% 和 50.8%。300 维 CBOW 在 7.83 亿词上的成绩是语义 15.5%、句法 53.1%、总体 36.1%,单 CPU 大约一天。同样在 7.83 亿词上的 300 维 Skip-gram 为 50.0%、55.9% 和 53.3%,大约三天。

Table 5 then shows that one epoch on more data can match or beat three epochs on less data. A one-epoch 300-dimensional CBOW model trained on 1.6 billion words reaches 16.1% semantic, 52.6% syntactic and 36.1% total in 0.6 days—the “less than a day on 1.6 billion words” figure highlighted in the abstract. A one-epoch 300-dimensional Skip-gram model on the same 1.6 billion words reaches 52.2%, 55.1% and 53.8% in two days. Raising Skip-gram to 600 dimensions on 783 million words, still for one epoch, yields 56.7%, 54.5% and 55.5% in 2.5 days.

表 5 接着表明:在更多数据上只训一轮,可以达到或超过在较少数据上训三轮。300 维 CBOW 在 16 亿词上只训一轮,得到语义 16.1%、句法 52.6%、总体 36.1%,用时 0.6 天——也就是摘要里强调的「在 16 亿词上不到一天」。同样在 16 亿词上只训一轮的 300 维 Skip-gram 为 52.2%、55.1% 和 53.8%,用时两天。若把 Skip-gram 提到 600 维、仍在 7.83 亿词上训一轮,则得到 56.7%、54.5% 和 55.5%,用时 2.5 天。

Distributed training and sentence completion 分布式训练与句子补全

On the full 6 billion word Google News set, Table 6 reports DistBelief runs that used an estimated 50 to 100 replicas (the CPU-core counts are estimates, because the machines were shared). A 100-dimensional NNLM reaches 34.2% semantic, 64.5% syntactic and 50.8% total in 14 days on about 180 cores. A 1000-dimensional CBOW model reaches 57.3%, 68.9% and 63.7% in 2 days on about 140 cores. A 1000-dimensional Skip-gram model reaches 66.1%, 65.1% and 65.6% in 2.5 days on about 125 cores. The paper notes that a 1000-dimensional NNLM would have taken too long to finish.

在完整的 60 亿词 Google News 上,表 6 报告了 DistBelief 实验,大约使用 50 到 100 个副本(CPU 核数是估计值,因为机器与其他任务共享)。100 维 NNLM 得到语义 34.2%、句法 64.5%、总体 50.8%,约 180 核上用时 14 天。1000 维 CBOW 为 57.3%、68.9% 和 63.7%,约 140 核上用时 2 天。1000 维 Skip-gram 为 66.1%、65.1% 和 65.6%,约 125 核上用时 2.5 天。原文指出,1000 维的 NNLM 会太久而无法完成。

The Microsoft Research Sentence Completion Challenge has 1040 sentences, each with one missing word and five candidate fillers. A 640-dimensional Skip-gram model trained on the 50 million words supplied with the challenge scores 48.0%, which does not beat the 49% average LSA similarity baseline cited from Zweig and Burges, nor the 55.4% then state-of-the-art combination of recurrent nets. A weighted combination of Skip-gram scores with those RNNLMs reaches a new reported state of the art of 58.9% (59.2% on the development split and 58.7% on the test split). Other cited baselines are a 4-gram at 39% and a log-bilinear model at 54.8%.

微软研究院句子补全挑战包含 1040 个句子,每句缺一个词,并给出五个合理候选项。用该挑战提供的 5000 万词训练的 640 维 Skip-gram 得到 48.0%,并未超过 Zweig 与 Burges 引用的平均 LSA 相似度基线 49%,也低于当时由循环网络组合保持的 55.4% 最好成绩。把 Skip-gram 分数与这些 RNNLM 加权组合后,文中报告了新的最好成绩 58.9%(开发集 59.2%,测试集 58.7%)。文中引用的其他基线还有 4-gram 的 39%,以及对数双线性模型的 54.8%。

Qualitative examples in Table 8, using the best Skip-gram vectors from Table 4 (300 dimensions, 783 million words), include Paris − France + Italy giving Rome, and analogous capital, morphology, and entity relations. The authors caution that under their exact-match metric those examples would score only about 60%. Averaging ten example pairs, rather than one, to form the relation vector improved their best models by about 10 absolute percentage points on the semantic-syntactic test.

表 8 的定性例子使用的是表 4 中最好的 Skip-gram 向量(300 维,7.83 亿词),其中包括 Paris − France + Italy 得到 Rome,以及类似的首都、形态和实体关系。作者提醒,若按他们的精确匹配指标,这些例子大约只能得 60% 左右。用十对例子而不是一对来平均得到关系向量,使他们最好的模型在语义–句法测试上大约绝对提升了 10 个百分点。

Impact and later work 影响与后续工作

The conclusion emphasises that very simple architectures, compared with popular feedforward and recurrent neural language models, can produce high-quality word vectors, and that the lower computational cost makes it feasible to use both higher dimensionality and much larger data. The authors argue that, with DistBelief, CBOW and Skip-gram should be trainable even on corpora with one trillion words and a basically unlimited vocabulary, several orders of magnitude beyond the best previously published results for similar models. They point to possible use in machine translation, information retrieval, question answering, sentiment analysis, paraphrase detection, and the automatic extension or verification of facts in knowledge bases, and they offer the new test set as a public yardstick. A separate remark in the conclusion, about more than a 50% increase in Spearman’s rank correlation on SemEval-2012 Task 2, refers to earlier publicly available RNN vectors used with other techniques, not to a number measured on the CBOW or Skip-gram vectors in this paper.

结论强调:与当时流行的前馈和循环神经语言模型相比,非常简单的结构也能产出高质量词向量;而更低的计算代价使同时使用更高维度和大得多的数据成为可能。作者认为,借助 DistBelief,CBOW 与 Skip-gram 甚至可以在一万亿词、词表规模基本不受限的语料上训练,比此前同类模型已发表的最好结果高出数个数量级。他们提到这些向量可能用于机器翻译、信息检索、问答、情感分析、释义检测,以及知识库中事实的自动扩展或校验,并希望新测试集成为公共标尺。结论里另有一句,说在 SemEval-2012 Task 2 上 Spearman 等级相关提高了 50% 以上,指的是此前已公开的 RNN 向量与其他技术一起使用的结果,并不是本文 CBOW 或 Skip-gram 向量上测得的数字。

A short follow-up section added by v3 reports a single-machine multi-threaded C++ implementation of both architectures, with training speed “in the order of billions of words per hour” for typical hyperparameter choices, released at the word2vec project page, together with more than 1.4 million named-entity vectors trained on more than 100 billion words. The authors also point to an then-upcoming NIPS 2013 paper on distributed representations of words and phrases and their compositionality.

v3 增加的一小段后续工作报告了这两个结构的单机多线程 C++ 实现,并称在典型超参数下训练速度「大约每小时数十亿词」,发布在 word2vec 项目页面,同时还发布了在超过 1000 亿词上训练的 140 多万个命名实体向量。作者也指向当时即将发表的 NIPS 2013 论文,讨论词与短语的分布式表示及其组合性。

Later history sits outside this 2013 text, but the public afterlife of the work is clear. The word2vec toolkit made dense word vectors a default ingredient in NLP pipelines. The follow-up NIPS 2013 paper developed negative sampling and phrase vectors; later static methods such as GloVe and fastText, and still later contextual models, took different routes, but they all inherit the idea that a word’s meaning can be read from the company it keeps in a learned vector space, and that very large unlabelled corpora can supply that supervision.

2013 年正文之外的历史已不属于原文,但这篇工作进入公共文献的后续影响仍然清楚。word2vec 工具包让稠密词向量成为 NLP 流水线里的默认零件。后续的 NIPS 2013 论文发展了负采样和短语向量;再后来的静态方法如 GloVe 与 fastText,以及更晚的上下文模型,走了不同的路,但都继承了这样一个想法:词的意义可以从它在所学向量空间里的「邻居」中读出,而这种监督可以从超大规模未标注语料中获得。

Limitations 局限

The paper is candid about measurement and modelling limits. The official accuracy metric demands an exact lexical match, so synonyms are errors, and the authors themselves say that 100% is likely out of reach without morphological information. Multi-word entities are excluded from the test set. CBOW, despite strong syntactic scores, lags far behind Skip-gram on semantic questions in several tables, so the two architectures are not interchangeable. On the sentence-completion challenge, Skip-gram alone at 48.0% does not surpass LSA similarity at 49%; the new 58.9% figure is a combination with RNNLMs. DistBelief wall-clock comparisons use estimated core counts on shared machines. The authors also grant at the outset that dropping the non-linear hidden layer may sacrifice representational power, with the bet being that more data will compensate. Finally, this guide quotes only the abstract in full: the arXiv v3 PDF is the authoritative source for every number above, and the body is summarised rather than reproduced.

原文对测量与建模上的限制说得比较直白。官方准确率要求词面精确匹配,因此同义词也算错,作者自己也说,若没有形态信息,100% 很可能达不到。测试集排除了多词实体。CBOW 尽管句法成绩强,但在几张表的语义题上远落后于 Skip-gram,两种结构并不能互相替代。在句子补全挑战上,单独的 Skip-gram 以 48.0% 并未超过 LSA 相似度的 49%;新的 58.9% 是与 RNNLM 的组合结果。DistBelief 的耗时比较使用的是共享机器上的估计核数。作者一开始也承认,去掉非线性隐层可能牺牲表示能力,他们的赌注是更多数据可以补偿。最后,本导读只完整引出摘要:上文每个数字以 arXiv v3 PDF 为准,正文只做导读摘要而不复述原文。

Key terms 关键词

  • word2vec:The name of the publicly released toolkit, and the usual informal name for the CBOW and Skip-gram models introduced in this paper. 公开发布的工具包名称,也是对本论文提出的 CBOW 与 Skip-gram 模型的惯用非正式称呼。
  • Distributed representation / word vector 分布式表示 / 词向量:A continuous vector for each vocabulary word, learned so that similarity and, in this work, linear analogies can be read from geometry in the vector space. 为词表中每个词学习的连续向量,使得相似度以及本文中的线性类比可以从向量空间的几何关系中读出。
  • CBOW (Continuous Bag-of-Words) 连续词袋模型:A log-linear model that averages context-word vectors and predicts the middle word; word order in the window is ignored. 一种对数线性模型,对上下文词向量取平均并预测中间词;窗口内的词序被忽略。
  • Skip-gram:The complementary log-linear model that takes the current word as input and predicts surrounding words within a sampled window. 与之互补的对数线性模型,以当前词为输入,预测在采样窗口内的周围词。
  • Hierarchical softmax 层次 softmax:A tree-structured replacement for a full softmax over the vocabulary; this paper uses a Huffman tree so that frequent words have shorter codes. 用树结构替代在整个词表上做完整 softmax 的方法;本文使用 Huffman 树,使高频词具有更短编码。
  • Word offset / vector arithmetic 词偏移 / 向量运算:Answering analogy questions by cosine-nearest search for a vector such as biggest − big + small, which should land near smallest. 通过对 biggest − big + small 这类向量做余弦近邻搜索来回答类比问题,期望落在 smallest 附近。
  • Semantic-Syntactic Word Relationship test set 语义–句法词关系测试集:The authors’ exact-match benchmark of 8869 semantic and 10675 syntactic analogy questions, used as the main quality metric in the paper. 作者提出的精确匹配基准,含 8869 道语义类比题和 10675 道句法类比题,是本文的主要质量指标。
  • DistBelief:The distributed training framework used for the largest Google News runs in the paper, with many model replicas and Adagrad. 本文中最大规模 Google News 实验所使用的分布式训练框架,包含大量模型副本和 Adagrad。

Original paper 原文链接

arXiv PDF:https://arxiv.org/pdf/1301.3781
Abstract page 摘要页:https://arxiv.org/abs/1301.3781
arXiv HTML (experimental) 实验性 HTML:https://arxiv.org/html/1301.3781v3
DOI:https://doi.org/10.48550/arXiv.1301.3781
ICLR 2013 workshop proceedings listing 研讨会论文列表:https://www.iclr.cc/archive/2013/workshop-proceedings.html
Google Research page:https://research.google/pubs/efficient-estimation-of-word-representations-in-vector-space/

0 次浏览

发表回复