[Paper Review] Language Models with Pre-Trained (GloVe) Word Embeddings
This paper presents a recurrent neural network (RNN) language model using pre-trained GloVe word embeddings, specifically leveraging GRU units for sequence modeling. It achieves significantly lower cosine distance errors in next-word prediction compared to random baseline, with training times under 2.5 minutes and inference under 1 second, demonstrating the effectiveness of combining GloVe embeddings with RNNs for language modeling tasks.
In this work we implement a training of a Language Model (LM), using Recurrent Neural Network (RNN) and GloVe word embeddings, introduced by Pennigton et al. in [1]. The implementation is following the general idea of training RNNs for LM tasks presented in [2], but is rather using Gated Recurrent Unit (GRU) [3] for a memory cell, and not the more commonly used LSTM [4].
Motivation & Objective
- To implement a language model using RNNs and pre-trained GloVe word embeddings for improved sequence prediction.
- To evaluate the performance of the model on both general and domain-specific text corpora using cosine distance as a metric.
- To compare the model's prediction accuracy against random baseline using error distributions.
- To demonstrate the feasibility and efficiency of training such models with minimal labeled data using a supervised-like paradigm on auto-generated labels.
- To provide a reproducible implementation using Keras and Theano/TensorFlow for researchers to extend and test the approach.
Proposed method
- The model uses 300-dimensional and 50-dimensional pre-trained GloVe word embeddings from a 42-billion-token corpus, with out-of-vocabulary words initialized to random vectors.
- A GRU-based RNN is trained to predict the next word vector in a sequence, using a fixed context window size (default 10) of prior words.
- The training employs a shifted input-output scheme where the target is the input sequence shifted by one time step, enabling supervised learning without external labels.
- The loss function is mean squared error (MSE), with RMSProp optimization and 0.8 dropout regularization on the hidden layer.
- The model is trained on 70% of the text and evaluated on 30%, with error measured via cosine distance between predicted and true word vectors.
- A domain-specific model is also trained on 1.5 million tokens from ICTIR-2015 and SIGIR-2015 proceedings to assess performance on specialized text.
Experimental results
Research questions
- RQ1Can a GRU-based RNN effectively learn to predict the next word vector using pre-trained GloVe embeddings?
- RQ2How does the model's prediction error compare to random baseline in both general and domain-specific text?
- RQ3What is the impact of hidden unit size (30 vs. 300) on training time and prediction accuracy?
- RQ4How does fine-tuning on domain-specific corpora affect the model’s performance on next-word prediction?
- RQ5What are the computational efficiency characteristics of training and inference in this setup?
Key findings
- The RNN model with 300 GRU units achieved significantly lower cosine distance errors in next-word prediction compared to random baseline, as shown in Figure 3.
- Training the model with 300 hidden units took 1298 seconds (about 21.6 minutes), while inference on the test set took only 0.49 seconds.
- On a domain-specific corpus, the model with 50 hidden units achieved even better performance, with error distributions clearly separated from random prediction (Figure 4).
- The domain-specific model trained in only 10 seconds and produced predictions in 0.04 seconds, demonstrating high efficiency for specialized tasks.
- The model trained on Wikipedia's Anarchism article with 30 hidden units achieved stable performance after 300 epochs, with training time of 125 seconds.
- The use of pre-trained GloVe embeddings significantly improved prediction accuracy over random initialization, as evidenced by the error distribution shifts in all figures.
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.