Skip to main content
QUICK REVIEW

[Paper Review] Large Scale Language Modeling: Converging on 40GB of Text in Four Hours

Raul Puri, Robert M. Kirby|arXiv (Cornell University)|Aug 3, 2018
Topic ModelingComputer Science39 references15 citations
TL;DR

This paper demonstrates training a 4096-dimensional multiplicative LSTM on 40GB of Amazon Reviews text in just four hours using 128 NVIDIA V100 GPUs with mixed-precision training and distributed data parallelism. It achieves convergence with a 32k batch size through a custom learning rate schedule, enabling large-scale unsupervised language modeling suitable for commercial and research deployment.

ABSTRACT

Recent work has shown how to train Convolutional Neural Networks (CNNs) rapidly on large image datasets, then transfer the knowledge gained from these models to a variety of tasks. Following [Radford 2017], in this work, we demonstrate similar scalability and transfer for Recurrent Neural Networks (RNNs) for Natural Language tasks. By utilizing mixed precision arithmetic and a 32k batch size distributed across 128 NVIDIA Tesla V100 GPUs, we are able to train a character-level 4096-dimension multiplicative LSTM (mLSTM) for unsupervised text reconstruction over 3 epochs of the 40 GB Amazon Reviews dataset in four hours. This runtime compares favorably with previous work taking one month to train the same size and configuration for one epoch over the same dataset. Converging large batch RNN models can be challenging. Recent work has suggested scaling the learning rate as a function of batch size, but we find that simply scaling the learning rate as a function of batch size leads either to significantly worse convergence or immediate divergence for this problem. We provide a learning rate schedule that allows our model to converge with a 32k batch size. Since our model converges over the Amazon Reviews dataset in hours, and our compute requirement of 128 Tesla V100 GPUs, while substantial, is commercially available, this work opens up large scale unsupervised NLP training to most commercial applications and deep learning researchers. A model can be trained over most public or private text datasets overnight.

Motivation & Objective

  • To enable large-scale unsupervised language model pretraining for RNNs using distributed training and mixed-precision arithmetic.
  • To investigate the feasibility of training large RNNs with very large batch sizes (up to 32k) and achieve convergence.
  • To develop a learning rate schedule that enables stable training with large batches, overcoming issues of divergence or poor generalization.
  • To demonstrate that commercial-scale hardware (128 V100s) can train large language models on public NLP datasets in hours rather than months.
  • To enable transfer learning for downstream NLP tasks by pretraining a robust, scalable language model on large text corpora.

Proposed method

  • Utilizes mixed-precision training (FP16/FP32) to accelerate training by 4.2x per GPU compared to FP32.
  • Employs distributed data parallelism across 128 NVIDIA Tesla V100 GPUs using NCCL2, NVLink, and InfiniBand for high-bandwidth communication.
  • Applies a 32k batch size across all GPUs, achieving a 109x increase in data throughput over single-GPU training.
  • Designs a custom, non-linear learning rate schedule that avoids divergence and improves convergence with large batches.
  • Trains a character-level multiplicative LSTM (mLSTM) on the 40GB Amazon Reviews dataset for 3 epochs.
  • Evaluates transfer performance on sentiment classification tasks using the Stanford Sentiment Treebank and IMDB datasets.

Experimental results

Research questions

  • RQ1Can large-batch training with 32k batch size be made stable and convergent for RNN-based language models using only learning rate scaling?
  • RQ2How does mixed-precision training affect convergence speed and model quality in large-scale RNN language modeling?
  • RQ3What learning rate schedule enables effective training with very large batch sizes without degradation in generalization?
  • RQ4To what extent does distributed data parallelism scale for RNNs, and what are the limits of wall time reduction?
  • RQ5Can large-scale unsupervised pretraining on 40GB of text be completed in under four hours using commercially available hardware?

Key findings

  • The model converges on the 40GB Amazon Reviews dataset in just four hours using 128 V100 GPUs and a 32k batch size.
  • Mixed-precision training accelerates training by 4.2x per GPU compared to FP32, enabling higher throughput.
  • A 109x speedup in data throughput is achieved over single-GPU training through distributed data parallelism with 128 GPUs.
  • The model achieves a bits per character (BPC) of 1.038 on the Amazon Reviews dataset and 93.8% accuracy on the SST sentiment classification task.
  • Simply scaling the learning rate with batch size leads to divergence or poor convergence; a custom learning rate schedule is essential for stability.
  • Even with the largest public corpus, the condition $B \ll N$ is not satisfied at 32k batch size, suggesting limitations in large-batch generalization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.