Skip to main content
QUICK REVIEW

[论文解读] LightRNN: Memory and Computation-Efficient Recurrent Neural Networks

Xiang Li, Tao Qin|arXiv (Cornell University)|Oct 31, 2016
Topic Modeling参考文献 28被引用 42
一句话总结

LightRNN 提出了一种两组件共享嵌入机制,通过在共享表中用行向量和列向量表示词汇表中的词,将 RNN 模型大小减少,并加速训练,仅需 $2\sqrt{|V|}$ 个向量,而非 $|V|$ 个。在 One-Billion-Word 基准测试中,其以 40-100 倍小的模型规模和 2 倍快的训练速度实现了最先进(SOTA)的困惑度,同时通过一种用于最优词分配的自举精炼框架保持了准确性。

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.

研究动机与目标

  • 解决在大规模词汇量自然语言处理任务中训练 RNN 所带来的高内存和计算成本问题,特别是当词汇量超过 1000 万词时。
  • 在不牺牲预测准确性的前提下,减少模型大小和训练时间,尤其适用于 GPU 和移动设备的部署。
  • 设计一种高效的词表示方法,以支持大规模语言建模任务中的可扩展训练和推理。
  • 开发一种自举框架,联合优化词分配与嵌入向量,以提升模型性能。

提出的方法

  • 将词汇表中的每个词表示为来自二维表的行向量和列向量的组合,将唯一向量的数量从 $|V|$ 减少到 $2\sqrt{|V|}$。
  • 使用自举训练循环:随机初始化词分配,固定嵌入向量,然后通过最小权重完美匹配算法优化分配以最小化训练损失。
  • 将词分配优化问题建模为图论中的最小权重完美匹配问题,实现高效优化。
  • 使用两组件共享嵌入训练 RNN,并在嵌入更新与分配优化之间交替进行,直至收敛。
  • 将该方法应用于语言建模任务,并在 One-Billion-Word 和 ACLW 等基准数据集上进行评估。
  • 使用 n-gram 模型的集成技术进一步提升困惑度得分。

实验结果

研究问题

  • RQ1共享嵌入机制是否能在不降低大规模词汇量语言建模任务性能的前提下,减少 RNN 模型大小和训练时间?
  • RQ2两组件共享嵌入在捕捉词与词之间语义和句法关系方面的有效性如何?
  • RQ3一种联合优化词分配与嵌入向量的自举框架,是否能提升模型的准确性和效率?
  • RQ4与标准 RNN 相比,使用两组件共享嵌入在模型大小、训练速度和困惑度之间的权衡关系如何?

主要发现

  • 在 One-Billion-Word 数据集上,LightRNN 实现了 66 的困惑度,与最先进模型 HSM(85)和 B-RNN(68)相当,但模型参数量仅为 4100 万。
  • 与 HSM 相比,LightRNN 将模型大小减少了 40 倍;与 B-RNN 相比,减少了 100 倍,实现了 4100 万参数的模型,而 B-RNN 为 41 亿参数。
  • 训练时间减少了一半:LightRNN 在 BillionW 上仅用 70 小时完成训练,而 HSM 需要 168 小时,且仅用 2.36% 的时间进行词重新分配。
  • 通过与 5-gram 模型的集成,LightRNN 在 One-Billion-Word 数据集上的测试困惑度达到 43,优于所有基线模型。
  • 词分配表能自动发现语义和句法聚类,如地名、时间表达和 URL,表明其具备隐式的结构学习能力。
  • 经过 3–4 轮自举精炼后,困惑度趋于稳定,表明优化过程具有收敛性和鲁棒性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。