Skip to main content
QUICK REVIEW

[Paper Review] LightRNN: Memory and Computation-Efficient Recurrent Neural Networks

Xiang Li, Tao Qin|arXiv (Cornell University)|Oct 31, 2016
Topic ModelingComputer Science28 references42 citations
TL;DR

LightRNN proposes a 2-Component shared embedding mechanism that reduces RNN model size and accelerates training by representing vocabulary words via row and column vectors in a shared table, requiring only $2\sqrt{|V|}$ vectors instead of $|V|$. On the One-Billion-Word benchmark, it achieves state-of-the-art perplexity with a 40-100x smaller model and 2x faster training, while preserving accuracy through a bootstrap refinement framework for optimal word allocation.

ABSTRACT

Recurrent neural networks (RNNs) have achieved state-of-the-art performances in many natural language processing tasks, such as language modeling and machine translation. However, when the vocabulary is large, the RNN model will become very big (e.g., possibly beyond the memory capacity of a GPU device) and its training will become very inefficient. In this work, we propose a novel technique to tackle this challenge. The key idea is to use 2-Component (2C) shared embedding for word representations. We allocate every word in the vocabulary into a table, each row of which is associated with a vector, and each column associated with another vector. Depending on its position in the table, a word is jointly represented by two components: a row vector and a column vector. Since the words in the same row share the row vector and the words in the same column share the column vector, we only need $2 \sqrt{|V|}$ vectors to represent a vocabulary of $|V|$ unique words, which are far less than the $|V|$ vectors required by existing approaches. Based on the 2-Component shared embedding, we design a new RNN algorithm and evaluate it using the language modeling task on several benchmark datasets. The results show that our algorithm significantly reduces the model size and speeds up the training process, without sacrifice of accuracy (it achieves similar, if not better, perplexity as compared to state-of-the-art language models). Remarkably, on the One-Billion-Word benchmark Dataset, our algorithm achieves comparable perplexity to previous language models, whilst reducing the model size by a factor of 40-100, and speeding up the training process by a factor of 2. We name our proposed algorithm \emph{LightRNN} to reflect its very small model size and very high training speed.

Motivation & Objective

  • Address the high memory and computational cost of training RNNs on large-vocabulary NLP tasks, especially when vocabulary exceeds 10M words.
  • Reduce model size and training time without sacrificing prediction accuracy, particularly for GPU- and mobile-compatible deployment.
  • Design an efficient word representation method that enables scalable training and inference for large-scale language modeling.
  • Develop a bootstrap framework to jointly optimize word allocation and embedding vectors for improved performance.

Proposed method

  • Represent each word in the vocabulary as a combination of a row vector and a column vector from a 2D table, reducing the number of unique vectors from $|V|$ to $2\sqrt{|V|}$.
  • Use a bootstrap training loop: initialize word allocation randomly, fix embeddings, then refine allocation via minimum weight perfect matching to minimize training loss.
  • Solve the word allocation refinement as a minimum weight perfect matching problem in graph theory, enabling efficient optimization.
  • Train the RNN using the 2C shared embeddings and alternate between embedding updates and allocation refinements until convergence.
  • Apply the method to language modeling tasks and evaluate on benchmark datasets including One-Billion-Word and ACLW.
  • Use ensemble techniques with n-gram models to further improve perplexity scores.

Experimental results

Research questions

  • RQ1Can a shared embedding mechanism reduce RNN model size and training time without degrading performance on large-vocabulary language modeling tasks?
  • RQ2How effective is the 2-Component shared embedding in capturing semantic and syntactic relationships among words?
  • RQ3Can a bootstrap framework that jointly optimizes word allocation and embeddings improve model accuracy and efficiency?
  • RQ4What is the trade-off between model size, training speed, and perplexity when using 2C shared embeddings compared to standard RNNs?

Key findings

  • On the One-Billion-Word dataset, LightRNN achieves a perplexity of 66, comparable to state-of-the-art models like HSM (85) and B-RNN (68), while reducing model size to just 41M parameters.
  • LightRNN reduces model size by a factor of 40 compared to HSM and by a factor of 100 compared to B-RNN, achieving a 41M parameter model versus 4.1G for B-RNN.
  • Training time is reduced by a factor of 2: LightRNN completes training in 70 hours on BillionW, compared to 168 hours for HSM, with only 2.36% of time spent on word reallocation.
  • Through ensemble with a 5-gram model, LightRNN achieves a test perplexity of 43 on the One-Billion-Word dataset, surpassing all baselines.
  • The word allocation table automatically discovers semantic and syntactic clusters—such as place names, time expressions, and URLs—demonstrating implicit structure learning.
  • After 3–4 rounds of bootstrap refinement, perplexity stabilizes, indicating convergence and robustness of the optimization process.

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.