Skip to main content
QUICK REVIEW

[论文解读] GroupReduce: Block-Wise Low-Rank Approximation for Neural Language Model Shrinking

Patrick H. Chen, Si Si|arXiv (Cornell University)|Jun 18, 2018
Topic Modeling被引用 16
一句话总结

GroupReduce 提出了一种基于块的、频率感知的低秩近似方法,通过将高频词分组为聚类,并对每个块应用加权低秩近似,实现了对神经语言模型嵌入矩阵和 Softmax 矩阵的压缩。在结合量化技术后,该方法在 One-Billion-Word 基准测试中实现了嵌入和 Softmax 矩阵高达 26 倍的压缩率,整体模型大小减少 12.8 倍,同时困惑度下降极小。

ABSTRACT

Model compression is essential for serving large deep neural nets on devices with limited resources or applications that require real-time responses. As a case study, a state-of-the-art neural language model usually consists of one or more recurrent layers sandwiched between an embedding layer used for representing input tokens and a softmax layer for generating output tokens. For problems with a very large vocabulary size, the embedding and the softmax matrices can account for more than half of the model size. For instance, the bigLSTM model achieves state-of- the-art performance on the One-Billion-Word (OBW) dataset with around 800k vocabulary, and its word embedding and softmax matrices use more than 6GBytes space, and are responsible for over 90% of the model parameters. In this paper, we propose GroupReduce, a novel compression method for neural language models, based on vocabulary-partition (block) based low-rank matrix approximation and the inherent frequency distribution of tokens (the power-law distribution of words). The experimental results show our method can significantly outperform traditional compression methods such as low-rank approximation and pruning. On the OBW dataset, our method achieved 6.6 times compression rate for the embedding and softmax matrices, and when combined with quantization, our method can achieve 26 times compression rate, which translates to a factor of 12.8 times compression for the entire model with very little degradation in perplexity.

研究动机与目标

  • 为解决神经语言模型中大词表嵌入矩阵和 Softmax 矩阵带来的高内存占用问题,其参数量可超过总参数量的 90%。
  • 改进标准压缩技术(如低秩近似和剪枝)在词嵌入矩阵上的表现,因为这些技术在面对嵌入矩阵特有的统计结构时效果不佳。
  • 利用词语频率的幂律分布(齐普夫定律)设计一种更有效的压缩策略,以适配语言模型各层的特性。
  • 同时实现对输入嵌入矩阵和输出 Softmax 矩阵的高压缩率,从而实现在内存受限设备上的高效部署。
  • 证明基于块的加权低秩近似在压缩效率和精度保持方面显著优于现有方法。

提出的方法

  • 利用训练数据中词语的出现频次,将词语按频率分组为块,充分利用词语频率的幂律分布特性。
  • 对每个块应用加权低秩近似,其中加权机制强调高频词,以保持其表示质量。
  • 通过迭代优化聚类分配和低秩近似,提升每个块的子空间投影质量。
  • 将所得的低秩矩阵作为模型中原始嵌入和 Softmax 矩阵的压缩替代品。
  • 将 GroupReduce 压缩方法与训练后量化结合,进一步降低内存使用。
  • 先固定压缩层进行模型微调,随后对所有参数进行端到端微调以恢复性能。

实验结果

研究问题

  • RQ1与标准低秩方法相比,基于块的、频率感知的低秩近似是否能显著提升神经语言模型嵌入和 Softmax 矩阵的压缩效率?
  • RQ2利用词语频率的幂律分布是否能提升压缩质量并维持模型性能?
  • RQ3在压缩率和困惑度下降方面,GroupReduce 与当前最先进的压缩技术(如剪枝和量化)相比表现如何?
  • RQ4GroupReduce 是否能同时实现对输入和输出矩阵的高压缩,从而带来显著的整体模型大小缩减?
  • RQ5块状近似的最优聚类数是多少?性能对该超参数的敏感度如何?

主要发现

  • 在 One-Billion-Word (OBW) 数据集上,GroupReduce 实现了嵌入和 Softmax 矩阵 6.6 倍的压缩率,困惑度仅从 31.04 上升至 33.61。
  • 在结合量化后,GroupReduce 实现了嵌入和 Softmax 矩阵高达 26 倍的压缩率,内存使用减少超过 5GB。
  • 在 OBW-bigLSTM 模型上,整体模型压缩率达到 12.8 倍,困惑度仅从 31.04 上升至 33.61。
  • 在 DE-EN 神经机器翻译任务中,GroupReduce 实现了嵌入和 Softmax 矩阵 24 倍的压缩率,微调后 BLEU 分数仅从 30.33 下降至 29.68。
  • 在输入嵌入层上,GroupReduce 的压缩率比深度组合编码方法高出两倍,且可同时压缩输入和输出矩阵,而后者无法实现。
  • 该方法对聚类数量具有鲁棒性,在 5 至 30 个聚类范围内性能变化极小,且在大 OBW 词表上以 20 个聚类时表现最佳。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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