Modelcore
Neural probabilistic language model
Also called Bengio language model, feedforward neural language model.
Bengio's model that concatenates learned vectors of the previous n - 1 words and feeds them through a hidden layer to a softmax over the vocabulary.
The neural probabilistic language model of Bengio, Ducharme, Vincent and Jauvin is the first widely used neural network language model. Like an n-gram model it predicts the next word from the previous words only. But instead of counting each n-gram, it maps each word to a learned real vector of dimensions, joins the vectors, passes them through a hidden layer with units, and gives a softmax over the whole vocabulary. Words that are used alike get similar vectors, so what the model learns about one sequence carries over to sequences with similar words that it never saw. This answers the curse of dimensionality that the counts of an n-gram model suffer from. The vectors are the word embeddings that later models made a field of their own.
The machine
Parameters. For a vocabulary , an order , a vector size and hidden units:
- , a table that holds the vector of each word;
- () and (), the hidden layer;
- (), the output weights of the hidden layer;
- (), optional direct connections from the word vectors to the output;
- (), the output biases.
The prediction. For the context :
The vector has entries. With there are no direct connections.
Size. The parameter count is : , , and give , and and give . It grows linearly in and in , while an n-gram model may need a number for each of up to sequences. For example, , , and give parameters.
Training. All parameters, the word vectors included, maximize the log-likelihood of the training text plus a weight decay penalty, by stochastic gradient ascent with backpropagation. Bengio and colleagues used a learning rate with and , and a weight decay of on Brown and on AP News. For their best results they mixed the network with an interpolated trigram model.
What it counts
The model is measured by its perplexity on test text. The cost of one prediction is the number of multiply-adds:
- the hidden layer, ;
- the output, with direct connections, without;
- the softmax, .
The output dominates by far. In the example above it is multiply-adds against for the hidden layer. Training has the same cost per word for the gradient, since every output weight gets a gradient through the normalizer. This is why the methods that followed attack the output: importance sampling (Bengio and Senécal, discussed in Section 5 of the paper), the hierarchical softmax of Morin and Bengio, and noise-contrastive estimation (Mnih and Teh).
Relation to other models
- n-gram models. Both models make the same Markov assumption of order . The n-gram model shares nothing between contexts except through backoff to shorter contexts; the neural model shares through the word vectors and the hidden layer.
- Class-based models. A class n-gram model, such as one built on Brown clustering, shares statistics between the words of one hard class. The word vectors are a soft, learned and many-dimensional version of the same idea.
- Softmax regression. Without the hidden layer, with only and , the model is softmax regression on the concatenated word vectors, with the vectors learned too.
- Maximum entropy models. A maximum entropy language model has the same softmax output over fixed hand-made features; the neural model learns its features.
- Recurrent models. A recurrent neural network language model replaces the fixed window of words with a state that summarizes the whole history.
- Word embedding models. The skip-gram and continuous bag of words models drop the hidden layer and the order of the words to learn vectors fast; they keep the idea of the table .
- Transformers. A transformer language model also starts from a table of word vectors and ends with a softmax over the vocabulary, but it lets every position use all the earlier ones through attention.
Known results in the model
- Brown corpus. With about 800,000 training words, 200,000 validation words and 181,041 test words, and , the best network, mixed with an interpolated trigram, reached a test perplexity of 252. The best n-gram model, a class-based model, had 312, and a Kneser-Ney backoff model had 321. The paper reports this as a difference of about 24 percent.
- AP News. With about 14 million training words and , the network reached 109 against 117 for the best n-gram model, a difference of about 8 percent. Five epochs took more than three weeks on 40 CPUs.
- Direct connections. Without the direct connections , training took twice as many epochs (20 instead of 10), and reached a slightly lower perplexity.
- Similar words. The model generalizes because similar words get nearby vectors, and a change of one word for a similar word changes the probability little. The paper gives this as the reason for the gains.
- The output bottleneck. The softmax over the vocabulary is the main cost of both prediction and training, linear in . Sampling methods cut the cost of training, and a tree cuts the cost of the probability of one word to .
References
- Bengio, Ducharme, Vincent and Jauvin 2003, the model y = b + W x + U tanh(d + H x) with a softmax output, the parameter count, the training by stochastic gradient ascent, the parallel implementation, the results on the Brown and AP News corpora, and Section 5 on speeding up the output with importance sampling
- Bengio, Ducharme and Vincent 2001, the first version of the model
- Morin and Bengio 2005, a tree over the vocabulary that replaces the flat softmax of the model
- Mnih and Teh 2012, noise-contrastive training of a log-bilinear neural language model, with the per-context normalizers fixed to 1
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag HD9NSW Edit this page History Report an error Markdown