这是用户在 2024-5-26 1:42 为 https://app.immersivetranslate.com/pdf-pro/cdb9a8ce-cefc-4106-9fe9-6c71014e71a3 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?
2024_05_25_f72c16e1f7c2ae9ac271g

Efficient Estimation of Word Representations in Vector Space
在向量空间中高效估计单词表示

Tomas Mikolov 托马斯·米科洛夫Google Inc., Mountain View, CA
谷歌公司,加利福尼亚州山景城
tmikolov@google.comGreg Corrado 格雷格·科拉多Google Inc., Mountain View, CA
谷歌公司,加利福尼亚州山景城
gcorrado@google.com

Kai Chen 陈凯Google Inc., Mountain View, CA
谷歌公司,加利福尼亚州山景城
kaichen@google.comJeffrey Dean 杰弗里·迪恩Google Inc., Mountain View, CA
谷歌公司,加利福尼亚州山景城
jeff@google.com

Abstract 摘要

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 亿个单词的数据集中学习高质量单词向量不到一天的时间。此外,我们展示这些向量在测量句法和语义单词相似性的测试集上提供了最先进的性能。

1 Introduction 1 简介

Many current NLP systems and techniques treat words as atomic units - there is no notion of similarity between words, as these are represented as indices in a vocabulary. This choice has several good reasons - simplicity, robustness and the observation that simple models trained on huge amounts of data outperform complex systems trained on less data. An example is the popular -gram model used for statistical language modeling - today, it is possible to train -grams on virtually all available data (trillions of words [3]).
许多当前的自然语言处理系统和技术将单词视为原子单位 - 单词之间没有相似性的概念,因为它们在词汇表中表示为索引。这种选择有几个很好的理由 - 简单性、鲁棒性以及简单模型在大量数据上训练的观察结果优于在较少数据上训练的复杂系统。一个例子是用于统计语言建模的流行 -gram 模型 - 如今,可以在几乎所有可用数据上训练 -gram。
However, the simple techniques are at their limits in many tasks. For example, the amount of relevant in-domain data for automatic speech recognition is limited - the performance is usually dominated by the size of high quality transcribed speech data (often just millions of words). In machine translation, the existing corpora for many languages contain only a few billions of words or less. Thus, there are situations where simple scaling up of the basic techniques will not result in any significant progress, and we have to focus on more advanced techniques.
然而,在许多任务中,简单技术已经达到了极限。例如,用于自动语音识别的领域内相关数据量有限 - 性能通常由高质量转录语音数据的规模主导(通常仅为数百万字)。在机器翻译中,许多语言的现有语料库仅包含数十亿字或更少。因此,在某些情况下,简单扩展基本技术将不会带来任何显著进展,我们必须专注于更先进的技术。
With progress of machine learning techniques in recent years, it has become possible to train more complex models on much larger data set, and they typically outperform the simple models. Probably the most successful concept is to use distributed representations of words [10]. For example, neural network based language models significantly outperform -gram models [1, 27, 17].
近年来,随着机器学习技术的进步,现在可以在更大的数据集上训练更复杂的模型,它们通常优于简单模型。可能最成功的概念是使用单词的分布式表示[10]。例如,基于神经网络的语言模型明显优于 -gram 模型[1, 27, 17]。

1.1 Goals of the Paper
论文的目标

The main goal of this paper is to introduce techniques that can be used for learning high-quality word vectors from huge data sets with billions of words, and with millions of words in the vocabulary. As far as we know, none of the previously proposed architectures has been successfully trained on more
本文的主要目标是介绍一些技术,这些技术可以用于从包含数十亿单词的大型数据集和包含数百万单词的词汇表中学习高质量的词向量。据我们所知,先前提出的架构都没有成功地在更多的数据上进行训练。

than a few hundred of millions of words, with a modest dimensionality of the word vectors between .
比几亿字少得多,词向量的维度适中在 之间。
We use recently proposed techniques for measuring the quality of the resulting vector representations, with the expectation that not only will similar words tend to be close to each other, but that words can have multiple degrees of similarity [20]. This has been observed earlier in the context of inflectional languages - for example, nouns can have multiple word endings, and if we search for similar words in a subspace of the original vector space, it is possible to find words that have similar endings [13, [14].
我们使用最近提出的技术来衡量生成的向量表示的质量,期望不仅相似的词会彼此靠近,而且词语之间可能存在多个相似度程度[20]。这在屈折语言的背景下早已观察到 - 例如,名词可能有多个词尾,如果我们在原始向量空间的子空间中搜索相似的词,可能会找到具有相似词尾的词[13, 14]。
Somewhat surprisingly, it was found that similarity of word representations goes beyond simple syntactic regularities. Using a word offset technique where simple algebraic operations are performed on the word vectors, it was shown for example that vector("King") - vector("Man") + vector("Woman") results in a vector that is closest to the vector representation of the word Queen [20].
有点令人惊讶的是,发现单词表示的相似性超越了简单的句法规律。使用单词偏移技术,对单词向量执行简单的代数运算,例如,向量("King") - 向量("Man") + 向量("Woman") 的结果最接近单词 Queen 的向量表示[20]。
In this paper, we try to maximize accuracy of these vector operations by developing new model architectures that preserve the linear regularities among words. We design a new comprehensive test set for measuring both syntactic and semantic regularities and show that many such regularities can be learned with high accuracy. Moreover, we discuss how training time and accuracy depends on the dimensionality of the word vectors and on the amount of the training data.
在本文中,我们尝试通过开发新的模型架构来最大化这些向量操作的准确性,以保留单词之间的线性规律。我们设计了一个新的全面测试集,用于测量句法和语义规律,并展示许多这样的规律可以以高准确性学习。此外,我们讨论了训练时间和准确性如何取决于词向量的维度和训练数据的数量。

1.2 Previous Work 1.2 之前的工作

Representation of words as continuous vectors has a long history [10, 26, 8]. A very popular model architecture for estimating neural network language model (NNLM) was proposed in [1], where a feedforward neural network with a linear projection layer and a non-linear hidden layer was used to learn jointly the word vector representation and a statistical language model. This work has been followed by many others.
将单词表示为连续向量具有悠久的历史[10, 26, 8]。 用于估计神经网络语言模型(NNLM)的非常流行的模型架构是在[1]中提出的,其中使用前馈神经网络、线性投影层和非线性隐藏层共同学习单词向量表示和统计语言模型。 这项工作已被许多其他人跟随。
Another interesting architecture of NNLM was presented in [13, 14], where the word vectors are first learned using neural network with a single hidden layer. The word vectors are then used to train the NNLM. Thus, the word vectors are learned even without constructing the full NNLM. In this work, we directly extend this architecture, and focus just on the first step where the word vectors are learned using a simple model.
NNLM 的另一个有趣的架构是在[13, 14]中提出的,其中单隐藏层神经网络首先学习单词向量。然后使用这些单词向量来训练 NNLM。因此,即使没有构建完整的 NNLM,也可以学习单词向量。在这项工作中,我们直接扩展了这个架构,只关注第一步,即使用简单模型学习单词向量的过程。
It was later shown that the word vectors can be used to significantly improve and simplify many NLP applications [4, 5, 29]. Estimation of the word vectors itself was performed using different model architectures and trained on various corpora [4, 29, 23, 19, 9], and some of the resulting word vectors were made available for future research and comparison . However, as far as we know, these architectures were significantly more computationally expensive for training than the one proposed in [13], with the exception of certain version of log-bilinear model where diagonal weight matrices are used [23].
后来证明,词向量可以显著改进和简化许多自然语言处理应用[4, 5, 29]。词向量本身的估计是使用不同的模型架构进行的,并在各种语料库上进行了训练[4, 29, 23, 19, 9],一些生成的词向量可供未来研究和比较使用 。然而,据我们所知,这些架构在训练时的计算成本要比[13]中提出的模型显著更高,除了某些版本的对数双线性模型使用对角权重矩阵的情况[23]。

2 Model Architectures 2 个模型架构

Many different types of models were proposed for estimating continuous representations of words, including the well-known Latent Semantic Analysis (LSA) and Latent Dirichlet Allocation (LDA). In this paper, we focus on distributed representations of words learned by neural networks, as it was previously shown that they perform significantly better than LSA for preserving linear regularities among words [20, 31]; LDA moreover becomes computationally very expensive on large data sets.
许多不同类型的模型被提出来估计单词的连续表示,包括众所周知的潜在语义分析(LSA)和潜在狄利克雷分布(LDA)。在本文中,我们专注于由神经网络学习的单词的分布式表示,因为先前已经显示它们在保持单词之间的线性规律方面比 LSA 表现显著更好[20, 31];此外,LDA 在大数据集上变得计算非常昂贵。
Similar to [18], to compare different model architectures we define first the computational complexity of a model as the number of parameters that need to be accessed to fully train the model. Next, we will try to maximize the accuracy, while minimizing the computational complexity.
与[18]类似,为了比较不同的模型架构,我们首先将模型的计算复杂度定义为需要访问的参数数量,以完全训练模型。接下来,我们将尝试最大化准确性,同时最小化计算复杂度。
For all the following models, the training complexity is proportional to
对于所有以下模型,训练复杂度与
where is number of the training epochs, is the number of the words in the training set and is defined further for each model architecture. Common choice is and up to one billion. All models are trained using stochastic gradient descent and backpropagation [26].
其中 是训练周期数, 是训练集中的单词数, 对每个模型架构进一步定义。常见选择是 ,最多达十亿。所有模型均使用随机梯度下降和反向传播进行训练[26]。

2.1 Feedforward Neural Net Language Model (NNLM)
前馈神经网络语言模型(NNLM)

The probabilistic feedforward neural network language model has been proposed in [1]. It consists of input, projection, hidden and output layers. At the input layer, previous words are encoded using 1 -of- coding, where is size of the vocabulary. The input layer is then projected to a projection layer that has dimensionality , using a shared projection matrix. As only inputs are active at any given time, composition of the projection layer is a relatively cheap operation.
概率前馈神经网络语言模型已在[1]中提出。它由输入、投影、隐藏和输出层组成。在输入层, 个先前的单词使用 1-of- 编码进行编码,其中 是词汇表的大小。然后将输入层投影到一个投影层 ,其维度为 ,使用共享的投影矩阵。由于任何给定时间只有 个输入是活跃的,所以投影层的组合是一个相对廉价的操作。
The NNLM architecture becomes complex for computation between the projection and the hidden layer, as values in the projection layer are dense. For a common choice of , the size of the projection layer might be 500 to 2000 , while the hidden layer size is typically 500 to 1000 units. Moreover, the hidden layer is used to compute probability distribution over all the words in the vocabulary, resulting in an output layer with dimensionality . Thus, the computational complexity per each training example is
NNLM 架构在投影层和隐藏层之间的计算变得复杂,因为投影层中的值是密集的。对于常见的选择 ,投影层的大小 可能为 500 到 2000,而隐藏层的大小 通常为 500 到 1000 个单元。此外,隐藏层用于计算词汇表中所有单词的概率分布,导致具有维度 的输出层。因此,每个训练示例的计算复杂度是
where the dominating term is . However, several practical solutions were proposed for avoiding it; either using hierarchical versions of the softmax [25, 23, 18], or avoiding normalized models completely by using models that are not normalized during training [4, 9]. With binary tree representations of the vocabulary, the number of output units that need to be evaluated can go down to around . Thus, most of the complexity is caused by the term .
主导项是 。然而,有几种实际的解决方案可用于避免它;要么使用 softmax 的分层版本[25, 23, 18],要么完全避免使用在训练期间未归一化的模型[4, 9]。通过使用词汇的二叉树表示,需要评估的输出单元数量可以降至约 。因此,大部分复杂性是由项 引起的。
In our models, we use hierarchical softmax where the vocabulary is represented as a Huffman binary tree. This follows previous observations that the frequency of words works well for obtaining classes in neural net language models [16]. Huffman trees assign short binary codes to frequent words, and this further reduces the number of output units that need to be evaluated: while balanced binary tree would require outputs to be evaluated, the Huffman tree based hierarchical softmax requires only about Unigram_perplexity . For example when the vocabulary size is one million words, this results in about two times speedup in evaluation. While this is not crucial speedup for neural network LMs as the computational bottleneck is in the term, we will later propose architectures that do not have hidden layers and thus depend heavily on the efficiency of the softmax normalization.
在我们的模型中,我们使用分层 softmax,其中词汇被表示为赫夫曼二进制树。这遵循了先前的观察结果,即单词的频率对于在神经网络语言模型中获取类别非常有效。赫夫曼树为频繁出现的单词分配短的二进制代码,这进一步减少了需要评估的输出单元数量:而平衡的二叉树需要评估 个输出,基于赫夫曼树的分层 softmax 只需要评估约 个 Unigram_perplexity 。例如,当词汇量为一百万个单词时,这将导致评估速度提高约两倍。虽然这对于神经网络语言模型来说并不是关键的加速因素,因为计算瓶颈在 项中,但我们将在后面提出不具有隐藏层且严重依赖 softmax 归一化效率的架构。

2.2 Recurrent Neural Net Language Model (RNNLM)
2.2 循环神经网络语言模型(RNNLM)

Recurrent neural network based language model has been proposed to overcome certain limitations of the feedforward NNLM, such as the need to specify the context length (the order of the model ), and because theoretically RNNs can efficiently represent more complex patterns than the shallow neural networks [15, 2]. The RNN model does not have a projection layer; only input, hidden and output layer. What is special for this type of model is the recurrent matrix that connects hidden layer to itself, using time-delayed connections. This allows the recurrent model to form some kind of short term memory, as information from the past can be represented by the hidden layer state that gets updated based on the current input and the state of the hidden layer in the previous time step.
基于循环神经网络的语言模型已被提出,以克服前馈 NNLM 的某些限制,例如需要指定上下文长度(模型的阶数 ),并且从理论上讲,RNN 可以有效地表示比浅层神经网络更复杂的模式[15, 2]。RNN 模型没有投影层;只有输入、隐藏和输出层。这种模型的特殊之处在于连接隐藏层与自身的循环矩阵,使用延迟连接。这使得循环模型能够形成某种短期记忆,因为过去的信息可以由隐藏层状态表示,该状态根据当前输入和上一个时间步的隐藏层状态进行更新。
The complexity per training example of the RNN model is
RNN 模型每个训练样本的复杂度是
where the word representations have the same dimensionality as the hidden layer . Again, the term can be efficiently reduced to by using hierarchical softmax. Most of the complexity then comes from .
单词表示 与隐藏层 具有相同的维度。同样,术语 可以通过使用分层 softmax 有效地减少到 。大部分复杂性来自

2.3 Parallel Training of Neural Networks
神经网络的并行训练

To train models on huge data sets, we have implemented several models on top of a large-scale distributed framework called DistBelief [6], including the feedforward NNLM and the new models proposed in this paper. The framework allows us to run multiple replicas of the same model in parallel, and each replica synchronizes its gradient updates through a centralized server that keeps all the parameters. For this parallel training, we use mini-batch asynchronous gradient descent with an adaptive learning rate procedure called Adagrad [7]. Under this framework, it is common to use one hundred or more model replicas, each using many CPU cores at different machines in a data center.
为了在庞大的数据集上训练模型,我们在一个名为 DistBelief 的大规模分布式框架上实现了几个模型,包括前馈 NNLM 和本文提出的新模型。该框架允许我们并行运行同一模型的多个副本,每个副本通过一个保留所有参数的中央服务器同步其梯度更新。对于这种并行训练,我们使用一种名为 Adagrad 的自适应学习率过程的小批量异步梯度下降。在这个框架下,通常会使用一百个或更多模型副本,每个副本在数据中心的不同机器上使用许多 CPU 核心。

3 New Log-linear Models
3 个新的对数线性模型

In this section, we propose two new model architectures for learning distributed representations of words that try to minimize computational complexity. The main observation from the previous section was that most of the complexity is caused by the non-linear hidden layer in the model. While this is what makes neural networks so attractive, we decided to explore simpler models that might not be able to represent the data as precisely as neural networks, but can possibly be trained on much more data efficiently.
在本节中,我们提出了两种新的模型架构,用于学习分布式单词表示,试图最小化计算复杂性。前一节的主要观察是,大部分复杂性是由模型中的非线性隐藏层引起的。虽然这正是神经网络如此吸引人的地方,但我们决定探索更简单的模型,这些模型可能无法像神经网络那样精确地表示数据,但可能能够更有效地在更多数据上进行训练。
The new architectures directly follow those proposed in our earlier work [13, 14], where it was found that neural network language model can be successfully trained in two steps: first, continuous word vectors are learned using simple model, and then the N-gram NNLM is trained on top of these distributed representations of words. While there has been later substantial amount of work that focuses on learning word vectors, we consider the approach proposed in [13] to be the simplest one. Note that related models have been proposed also much earlier [26, 8].
新的架构直接遵循我们早期工作中提出的那些[13, 14],在那里发现神经网络语言模型可以成功地通过两个步骤进行训练:首先,使用简单模型学习连续的词向量,然后在这些词的分布式表示之上训练 N-gram NNLM。虽然后来有大量工作集中在学习词向量上,但我们认为[13]中提出的方法是最简单的。请注意,相关模型也在更早时提出过[26, 8]。

3.1 Continuous Bag-of-Words Model
3.1 连续词袋模型

The first proposed architecture is similar to the feedforward NNLM, where the non-linear hidden layer is removed and the projection layer is shared for all words (not just the projection matrix); thus, all words get projected into the same position (their vectors are averaged). We call this architecture a bag-of-words model as the order of words in the history does not influence the projection. Furthermore, we also use words from the future; we have obtained the best performance on the task introduced in the next section by building a log-linear classifier with four future and four history words at the input, where the training criterion is to correctly classify the current (middle) word. Training complexity is then
第一个提出的架构类似于前馈 NNLM,其中去除了非线性隐藏层,并且投影层被所有单词共享(不仅仅是投影矩阵);因此,所有单词都被投影到相同的位置(它们的向量被平均)。我们将这种架构称为词袋模型,因为历史中单词的顺序不会影响投影。此外,我们还使用来自未来的单词;通过在输入处构建一个具有四个未来和四个历史单词的对数线性分类器,我们已经在下一节介绍的任务中获得了最佳性能,其中训练标准是正确分类当前(中间)单词。然后,训练复杂度是
We denote this model further as CBOW, as unlike standard bag-of-words model, it uses continuous distributed representation of the context. The model architecture is shown at Figure 1. Note that the weight matrix between the input and the projection layer is shared for all word positions in the same way as in the NNLM.
我们进一步将这个模型称为 CBOW,与标准的词袋模型不同,它使用上下文的连续分布表示。模型架构如图 1 所示。请注意,输入和投影层之间的权重矩阵与 NNLM 中的方式相同,对于所有单词位置都是共享的。

3.2 Continuous Skip-gram Model
3.2 连续 Skip-gram 模型

The second architecture is similar to CBOW, but instead of predicting the current word based on the context, it tries to maximize classification of a word based on another word in the same sentence. More precisely, we use each current word as an input to a log-linear classifier with continuous projection layer, and predict words within a certain range before and after the current word. We found that increasing the range improves quality of the resulting word vectors, but it also increases the computational complexity. Since the more distant words are usually less related to the current word than those close to it, we give less weight to the distant words by sampling less from those words in our training examples.
第二种架构类似于 CBOW,但不是基于上下文预测当前单词,而是试图最大化基于同一句子中另一个单词的单词分类。更准确地说,我们将每个当前单词用作连续投影层的对数线性分类器的输入,并预测当前单词之前和之后一定范围内的单词。我们发现增加范围可以提高生成的单词向量的质量,但也会增加计算复杂性。由于远离的单词通常与当前单词的关联性较低,我们在训练示例中从这些单词中采样较少,从而给予远离的单词较少的权重。
The training complexity of this architecture is proportional to
这种架构的训练复杂度与
where is the maximum distance of the words. Thus, if we choose , for each training word we will select randomly a number in range , and then use words from history and
其中 是单词的最大距离。因此,如果我们选择 ,对于每个训练单词,我们将在范围 内随机选择一个数字 ,然后使用 个历史单词。
Figure 1: New model architectures. The CBOW architecture predicts the current word based on the context, and the Skip-gram predicts surrounding words given the current word.
图 1:新模型架构。CBOW 架构基于上下文预测当前单词,而 Skip-gram 预测给定当前单词的周围单词。
words from the future of the current word as correct labels. This will require us to do word classifications, with the current word as input, and each of the words as output. In the following experiments, we use .
个来自当前单词未来的单词作为正确标签。这将要求我们进行 个单词分类,以当前单词作为输入,每个 个单词作为输出。在接下来的实验中,我们使用

4 Results 4 个结果

To compare the quality of different versions of word vectors, previous papers typically use a table showing example words and their most similar words, and understand them intuitively. Although it is easy to show that word France is similar to Italy and perhaps some other countries, it is much more challenging when subjecting those vectors in a more complex similarity task, as follows. We follow previous observation that there can be many different types of similarities between words, for example, word big is similar to bigger in the same sense that small is similar to smaller. Example of another type of relationship can be word pairs big - biggest and small - smallest [20]. We further denote two pairs of words with the same relationship as a question, as we can ask: "What is the word that is similar to small in the same sense as biggest is similar to big?"
为了比较不同版本的词向量质量,先前的论文通常使用一个表格来展示示例词和它们最相似的词,并直观地理解它们。虽然很容易展示出单词“法国”与“意大利”以及可能一些其他国家相似,但当将这些向量置于更复杂的相似性任务中时,情况就会变得更具挑战性。我们遵循先前的观察,单词之间可能存在许多不同类型的相似性,例如,单词“大”与“更大”在相同意义上相似,就像“小”与“更小”相似一样。另一种关系类型的示例可以是单词对“大 - 最大”和“小 - 最小”。我们进一步将具有相同关系的两对单词称为一个问题,因为我们可以问:“与最大类似的单词与大类似的单词相同意义上的小是什么?”
Somewhat surprisingly, these questions can be answered by performing simple algebraic operations with the vector representation of words. To find a word that is similar to small in the same sense as biggest is similar to big, we can simply compute vector vector("biggest") - vector("big") + vector ("small"). Then, we search in the vector space for the word closest to measured by cosine distance, and use it as the answer to the question (we discard the input question words during this search). When the word vectors are well trained, it is possible to find the correct answer (word smallest) using this method.
有些令人惊讶的是,这些问题可以通过对单词的向量表示进行简单的代数运算来回答。要找到一个与“small”类似的单词,就像“biggest”与“big”类似一样,我们可以简单地计算向量("biggest") - 向量("big") + 向量("small")。然后,我们在向量空间中寻找与 最接近的单词,通过余弦距离进行测量,并将其用作问题的答案(在此搜索过程中丢弃输入的问题单词)。当单词向量训练得很好时,可以通过这种方法找到正确答案(单词"smallest")。
Finally, we found that when we train high dimensional word vectors on a large amount of data, the resulting vectors can be used to answer very subtle semantic relationships between words, such as a city and the country it belongs to, e.g. France is to Paris as Germany is to Berlin. Word vectors with such semantic relationships could be used to improve many existing NLP applications, such as machine translation, information retrieval and question answering systems, and may enable other future applications yet to be invented.
最后,我们发现当我们在大量数据上训练高维词向量时,生成的向量可以用来回答单词之间非常微妙的语义关系,比如一个城市和它所属的国家,例如法国对应巴黎,德国对应柏林。具有这种语义关系的词向量可以用来改进许多现有的自然语言处理应用,比如机器翻译、信息检索和问答系统,并且可能促成其他尚未被发明的未来应用。
Table 1: Examples of five types of semantic and nine types of syntactic questions in the SemanticSyntactic Word Relationship test set.
表 1:SemanticSyntactic 词语关系测试集中五种语义问题和九种句法问题的示例。
Type of relationship 关系类型 Word Pair 1 词对 1 Word Pair 2 词对 2
Common capital city 常见的首都 Athens Greece Oslo Norway
All capital cities 所有首都 Astana Kazakhstan Harare Zimbabwe
Currency Angola kwanza Iran rial
City-in-state 城市在州内 Chicago Illinois Stockton California
Man-Woman brother sister grandson granddaughter 孙女
Adjective to adverb 形容词转副词 apparent apparently rapid rapidly
Opposite possibly impossibly ethical unethical
Comparative 比较 great greater tough tougher
Superlative 最高级 easy easiest lucky luckiest
Present Participle 现在分词 think thinking read reading
Nationality adjective 国籍形容词 Switzerland 瑞士 Swiss Cambodia Cambodian
Past tense 过去时 walking walked swimming swam
Plural nouns 复数名词 mouse mice dollar dollars
Plural verbs 复数动词 work works speak speaks

4.1 Task Description 4.1 任务描述

To measure quality of the word vectors, we define a comprehensive test set that contains five types of semantic questions, and nine types of syntactic questions. Two examples from each category are shown in Table 1. Overall, there are 8869 semantic and 10675 syntactic questions. The questions in each category were created in two steps: first, a list of similar word pairs was created manually. Then, a large list of questions is formed by connecting two word pairs. For example, we made a list of 68 large American cities and the states they belong to, and formed about questions by picking two word pairs at random. We have included in our test set only single token words, thus multi-word entities are not present (such as New York).
为了衡量词向量的质量,我们定义了一个包含五种语义问题和九种句法问题的综合测试集。每个类别中各展示了两个示例,如表 1 所示。总共有 8869 个语义问题和 10675 个句法问题。每个类别中的问题是通过两个步骤创建的:首先,手动创建了一组相似的词对列表。然后,通过连接两个词对形成了一个大量的问题列表。例如,我们制作了一个包含 68 个美国大城市及其所属州的列表,通过随机选择两个词对形成了约 个问题。我们的测试集中仅包含单词标记,因此不包括多词实体(如纽约)。
We evaluate the overall accuracy for all question types, and for each question type separately (semantic, syntactic). Question is assumed to be correctly answered only if the closest word to the vector computed using the above method is exactly the same as the correct word in the question; synonyms are thus counted as mistakes. This also means that reaching accuracy is likely to be impossible, as the current models do not have any input information about word morphology. However, we believe that usefulness of the word vectors for certain applications should be positively correlated with this accuracy metric. Further progress can be achieved by incorporating information about structure of words, especially for the syntactic questions.
我们评估所有问题类型的整体准确性,以及每种问题类型单独(语义,句法)。只有当使用上述方法计算的向量最接近的单词与问题中的正确单词完全相同时,问题被认为回答正确;因此,同义词被视为错误。这也意味着达到 准确度可能是不可能的,因为当前模型没有关于单词形态的任何输入信息。然而,我们相信单词向量对于某些应用的有用性应该与这个准确性指标呈正相关。通过合并有关单词结构的信息,特别是对于句法问题,可以实现进一步的进展。

4.2 Maximization of Accuracy
准确性的最大化

We have used a Google News corpus for training the word vectors. This corpus contains about 6B tokens. We have restricted the vocabulary size to 1 million most frequent words. Clearly, we are facing time constrained optimization problem, as it can be expected that both using more data and higher dimensional word vectors will improve the accuracy. To estimate the best choice of model architecture for obtaining as good as possible results quickly, we have first evaluated models trained on subsets of the training data, with vocabulary restricted to the most frequent words. The results using the CBOW architecture with different choice of word vector dimensionality and increasing amount of the training data are shown in Table 2.
我们使用了 Google 新闻语料库来训练词向量。这个语料库包含大约 60 亿个标记。我们将词汇量限制在 100 万个最常见的词汇。显然,我们面临着时间受限的优化问题,因为可以预期使用更多数据和更高维度的词向量将提高准确性。为了估计获取尽可能好的结果的最佳模型架构的选择,我们首先评估了在训练数据子集上训练的模型,词汇量限制为最常见的 个词汇。使用 CBOW 架构的结果,不同选择的词向量维度和增加的训练数据量在表 2 中显示。
It can be seen that after some point, adding more dimensions or adding more training data provides diminishing improvements. So, we have to increase both vector dimensionality and the amount of the training data together. While this observation might seem trivial, it must be noted that it is currently popular to train word vectors on relatively large amounts of data, but with insufficient size
可以看到,在某个点之后,增加更多维度或增加更多训练数据会带来递减的改进。因此,我们必须同时增加向量维度和训练数据的数量。虽然这一观察可能看似琐碎,但必须指出的是,目前流行的做法是在相对大量的数据上训练词向量,但规模不足。
Table 2: Accuracy on subset of the Semantic-Syntactic Word Relationship test set, using word vectors from the CBOW architecture with limited vocabulary. Only questions containing words from the most frequent words are used.
表 2:使用 CBOW 架构的词向量在语义-句法词关系测试集的子集上的准确性,使用有限词汇表。仅使用包含来自最常见 个词的问题。
Dimensionality / Training words
维度 / 训练词
50 13.4 15.7 18.6 19.1 22.5 23.2
100 19.4 23.1 27.8 28.7 33.4 32.2
300 23.2 29.2 35.3 38.6 43.7 45.9
600 24.0 30.1 36.5 40.8 46.6 50.4
Table 3: Comparison of architectures using models trained on the same data, with 640-dimensional word vectors. The accuracies are reported on our Semantic-Syntactic Word Relationship test set, and on the syntactic relationship test set of [20]
表 3:使用在相同数据上训练的模型进行架构比较,使用 640 维词向量。准确率报告在我们的语义-句法词关系测试集上,以及[20]的句法关系测试集上。
{
Model
Architecture
} 模型架构
Semantic-Syntactic Word Relationship test set
语义-句法词关系测试集
MSR Word Relatedness MSR 词相关性
Semantic Accuracy [%] 语义准确性 [%] Syntactic Accuracy [%] 句法准确性 [%] Test [20] 测试 [20]
RNNLM 9 36 35
NNLM 23 53 47
CBOW 24 64 61
Skip-gram 55 59 56
(such as 50 - 100). Given Equation 4, increasing amount of training data twice results in about the same increase of computational complexity as increasing vector size twice.
(例如 50-100)。根据方程 4,训练数据量增加一倍导致计算复杂度大约增加一倍,与向量大小增加一倍的情况大致相同。
For the experiments reported in Tables 2 and 4 , we used three training epochs with stochastic gradient descent and backpropagation. We chose starting learning rate 0.025 and decreased it linearly, so that it approaches zero at the end of the last training epoch.
在表 2 和表 4 中报告的实验中,我们使用了三个训练周期,采用随机梯度下降和反向传播。我们选择了初始学习率 0.025,并线性减小,使其在最后一个训练周期结束时接近零。

4.3 Comparison of Model Architectures
4.3 模型架构比较

First we compare different model architectures for deriving the word vectors using the same training data and using the same dimensionality of 640 of the word vectors. In the further experiments, we use full set of questions in the new Semantic-Syntactic Word Relationship test set, i.e. unrestricted to the 30k vocabulary. We also include results on a test set introduced in [20] that focuses on syntactic similarity between word
首先,我们比较不同的模型架构,使用相同的训练数据和相同维度为 640 的词向量来推导单词向量。在进一步的实验中,我们使用新的语义-句法词关系测试集中的全部问题集,即不受限于 30k 词汇表。我们还包括了一项在[20]中引入的测试集的结果,该测试集侧重于单词之间的句法相似性。
The training data consists of several LDC corpora and is described in detail in [18] (320M words, vocabulary). We used these data to provide a comparison to a previously trained recurrent neural network language model that took about 8 weeks to train on a single CPU. We trained a feedforward NNLM with the same number of 640 hidden units using the DistBelief parallel training [6], using a history of 8 previous words (thus, the NNLM has more parameters than the RNNLM, as the projection layer has size ).
训练数据包括几个 LDC 语料库,详细描述见[18](320M 字, 词汇量)。我们使用这些数据与之前训练的递归神经网络语言模型进行比较,后者在单个 CPU 上训练大约 8 周。我们使用 DistBelief 并行训练训练了一个具有相同数量的 640 个隐藏单元的前馈 NNLM,使用了 8 个先前单词的历史(因此,NNLM 的参数比 RNNLM 多,因为投影层的大小为 )。
In Table 3, it can be seen that the word vectors from the RNN (as used in [20]) perform well mostly on the syntactic questions. The NNLM vectors perform significantly better than the RNN - this is not surprising, as the word vectors in the RNNLM are directly connected to a non-linear hidden layer. The CBOW architecture works better than the NNLM on the syntactic tasks, and about the same on the semantic one. Finally, the Skip-gram architecture works slightly worse on the syntactic task than the CBOW model (but still better than the NNLM), and much better on the semantic part of the test than all the other models.
在表 3 中,可以看到 RNN(如[20]中使用的)的词向量在句法问题上表现良好。NNLM 的向量比 RNN 明显好得多-这并不令人惊讶,因为 RNNLM 中的词向量直接连接到非线性隐藏层。CBOW 架构在句法任务上比 NNLM 表现更好,在语义任务上大致相同。最后,Skip-gram 架构在句法任务上略逊于 CBOW 模型(但仍优于 NNLM),在语义测试的部分比所有其他模型表现都要好得多。
Next, we evaluated our models trained using one CPU only and compared the results against publicly available word vectors. The comparison is given in Table 4 The CBOW model was trained on subset
接下来,我们评估了仅使用一个 CPU 训练的模型,并将结果与公开可用的词向量进行了比较。比较结果如表 4 所示。CBOW 模型是在子集上训练的。
Table 4: Comparison of publicly available word vectors on the Semantic-Syntactic Word Relationship test set, and word vectors from our models. Full vocabularies are used.
表 4:在语义-句法词关系测试集上公开可用的词向量与我们模型的词向量进行比较。使用完整词汇表。
Model
 矢量维度
Vector
Dimensionality
 训练词汇
Training
words
Accuracy [%] 准确率 [%]
Semantic Syntactic Total
Collobert-Weston NNLM 50 9.3 12.3 11.0
Turian NNLM 图里安 NNLM 50 1.4 2.6 2.1
Turian NNLM 图里安 NNLM 200 1.4 2.2 1.8
Mnih NNLM 50 1.8 9.1 5.8
Mnih NNLM 100 3.3 13.2 8.8
Mikolov RNNLM 80 4.9 18.4 12.7
Mikolov RNNLM 640 8.6 36.5 24.6
Huang NNLM 黄 NNLM 50 13.3 11.6 12.3
Our NNLM 我们的 NNLM 20 12.9 26.4 20.3
Our NNLM 我们的 NNLM 50 27.9 55.8 43.2
Our NNLM 我们的 NNLM 100 6B 34.2 50.8
CBOW 300 15.5 53.1 36.1
Skip-gram 300 55.9
Table 5: Comparison of models trained for three epochs on the same data and models trained for one epoch. Accuracy is reported on the full Semantic-Syntactic data set.
表 5:对同一数据进行三个时期训练的模型和一个时期训练的模型进行比较。准确率报告在完整的语义-句法数据集上。
Model
 矢量维度
Vector
Dimensionality
 训练词汇
Training
words
Accuracy [%] 准确率 [%]
Training time 培训时间
Semantic Syntactic Total
3 epoch CBOW 3 个时代的 CBOW 300 15.5 53.1 36.1 1
3 epoch Skip-gram 3 个时代的跳字模型 300 50.0 55.9 53.3 3
1 epoch CBOW 1 个时代的 CBOW 300 13.8 49.9 33.6 0.3
1 epoch CBOW 1 个时代的 CBOW 300 16.1 52.6 36.1 0.6