[Paper Review] N-gram Language Modeling using Recurrent Neural Network Estimation
This paper proposes using LSTM-based neural networks to smooth n-gram language models, replacing traditional back-off methods like Kneser-Ney. The LSTM effectively captures long-context dependencies, achieving performance comparable to full recurrent LSTMs at n=13, with improved perplexity that increases with n-gram order—outperforming classical smoothing techniques.
We investigate the effective memory depth of RNN models by using them for $n$-gram language model (LM) smoothing. Experiments on a small corpus (UPenn Treebank, one million words of training data and 10k vocabulary) have found the LSTM cell with dropout to be the best model for encoding the $n$-gram state when compared with feed-forward and vanilla RNN models. When preserving the sentence independence assumption the LSTM $n$-gram matches the LSTM LM performance for $n=9$ and slightly outperforms it for $n=13$. When allowing dependencies across sentence boundaries, the LSTM $13$-gram almost matches the perplexity of the unlimited history LSTM LM. LSTM $n$-gram smoothing also has the desirable property of improving with increasing $n$-gram order, unlike the Katz or Kneser-Ney back-off estimators. Using multinomial distributions as targets in training instead of the usual one-hot target is only slightly beneficial for low $n$-gram orders. Experiments on the One Billion Words benchmark show that the results hold at larger scale: while LSTM smoothing for short $n$-gram contexts does not provide significant advantages over classic N-gram models, it becomes effective with long contexts ($n > 5$); depending on the task and amount of data it can match fully recurrent LSTM models at about $n=13$. This may have implications when modeling short-format text, e.g. voice search/query LMs. Building LSTM $n$-gram LMs may be appealing for some practical situations: the state in a $n$-gram LM can be succinctly represented with $(n-1)*4$ bytes storing the identity of the words in the context and batches of $n$-gram contexts can be processed in parallel. On the downside, the $n$-gram context encoding computed by the LSTM is discarded, making the model more expensive than a regular recurrent LSTM LM.
Motivation & Objective
- To investigate the effective memory depth of RNN models by using them to smooth n-gram language models.
- To evaluate whether LSTM-based models can outperform traditional n-gram smoothing methods like Katz and Kneser-Ney in terms of perplexity and scalability.
- To explore the trade-offs between training efficiency, inference speed, and model performance when using LSTMs to encode n-gram contexts.
- To determine if neural smoothing can effectively improve with increasing n-gram order, unlike classical back-off methods.
- To assess the practical viability of LSTM n-gram models in low-resource or short-sequence applications such as voice search.
Proposed method
- LSTM networks are trained to predict the next word given a fixed-length n-gram context, replacing the traditional n-gram probability estimation.
- The LSTM processes the embedding of each word in the n-gram context sequentially, maintaining a hidden state that encodes the context history.
- Dropout is applied to the LSTM cell to improve generalization and reduce overfitting during training.
- The model is trained using multinomial targets (soft labels) instead of one-hot vectors to improve learning efficiency.
- For inference, the LSTM state is computed once per n-gram context and stored as a compact 4*(n-1)-byte representation of word identities.
- Experiments compare performance under two settings: sentence independence (resetting at <S>) and straddling sentence boundaries to allow cross-sentence context.
Experimental results
Research questions
- RQ1What is the effective memory depth of an LSTM when used to smooth n-gram language models?
- RQ2How does LSTM-based n-gram smoothing compare in performance to classical back-off methods like Kneser-Ney and Katz smoothing?
- RQ3Does the performance of LSTM-smoothed n-gram models improve with increasing n-gram order, unlike traditional smoothing techniques?
- RQ4Can LSTM n-gram models achieve performance close to that of full recurrent LSTM language models, and at what n-gram order?
- RQ5What are the trade-offs in training and inference efficiency when using LSTM-based n-gram models versus standard recurrent LSTMs?
Key findings
- The LSTM with dropout outperforms feedforward and vanilla RNN models in encoding n-gram states, achieving the lowest perplexity on the UPenn Treebank.
- For n=9, the LSTM n-gram matches the performance of a full recurrent LSTM LM under sentence independence; for n=13, it slightly outperforms it.
- When allowing context to span sentence boundaries, the LSTM 13-gram achieves a perplexity of 49 on the One Billion Words benchmark, nearly matching the full recurrent LSTM LM (48).
- The LSTM n-gram model shows consistent improvement with increasing n-gram order, unlike Kneser-Ney or Katz back-off, which saturate at lower n.
- On the One Billion Words benchmark, LSTM smoothing becomes effective for n>5, matching full recurrent LSTM performance at n≈13.
- Using multinomial targets instead of one-hot labels provides only marginal gains, especially for higher n-gram orders.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.