Skip to main content
QUICK REVIEW

[论文解读] Convolutional neural network compression for natural language processing

Krzysztof Wróbel, Marcin Pietroń|arXiv (Cornell University)|May 28, 2018
Speech Recognition and Synthesis参考文献 9被引用 10
一句话总结

本文提出了一种用于自然语言处理中卷积神经网络(CNNs)的混合压缩框架,结合量化和剪枝技术,以减小模型尺寸,便于在资源受限的嵌入式系统中部署。该方法在精度损失低于1%的情况下实现了高达93%的内存压缩,表明5位量化可保持性能,且FPGA实现支持高效的硬件映射,使触发器使用量减少3.3倍,查找表(LUT)使用量减少4.2倍。

ABSTRACT

Convolutional neural networks are modern models that are very efficient in many classification tasks. They were originally created for image processing purposes. Then some trials were performed to use them in different domains like natural language processing. The artificial intelligence systems (like humanoid robots) are very often based on embedded systems with constraints on memory, power consumption etc. Therefore convolutional neural network because of its memory capacity should be reduced to be mapped to given hardware. In this paper, results are presented of compressing the efficient convolutional neural networks for sentiment analysis. The main steps are quantization and pruning processes. The method responsible for mapping compressed network to FPGA and results of this implementation are presented. The described simulations showed that 5-bit width is enough to have no drop in accuracy from floating point version of the network. Additionally, significant memory footprint reduction was achieved (from 85% up to 93%).

研究动机与目标

  • 为解决在内存和功耗受限的嵌入式系统中部署大型、内存密集型NLP卷积神经网络的挑战。
  • 评估在FPGA上部署压缩后NLP模型的可行性和效率。
  • 研究量化和剪枝对情感分析任务中模型尺寸和精度的影响。
  • 识别在保持高精度的同时最小化模型体积的最优精度设置和剪枝阈值。

提出的方法

  • 作者对权重和激活值应用训练后量化,使用动态定点格式将浮点数值映射为低比特定点表示(例如5位、8位)。
  • 采用随机重启爬山算法搜索每层的最优位宽配置,使精度下降低于0.2%的阈值。
  • 采用基于大小的剪枝方法,将低于阈值的权重设为零,从而减少乘累加(MAC)操作和模型尺寸。
  • 在FPGA(Xilinx Virtex-7 VC707)上实现联合量化与剪枝流水线,以评估硬件资源利用率和性能表现。
  • 在多个NLP数据集上评估压缩效果,分析各层对量化和剪枝的敏感性。
  • 定义了一个通用的量化映射函数:$ q_{\text{fxp}} = \mu + \sigma \cdot \text{round}(\sigma^{-1} \cdot (x - \mu)) $,以支持动态定点表示。

实验结果

研究问题

  • RQ1保持与全精度模型几乎相同精度所需的最小位宽是多少?
  • RQ2量化与剪枝的联合使用如何影响NLP任务中的模型尺寸和推理精度?
  • RQ3每层最优的位宽和剪枝阈值配置是什么,能够在可接受的精度损失下最小化模型尺寸?
  • RQ4基于FPGA的部署在保持模型性能的同时,能在多大程度上减少硬件资源使用?

主要发现

  • 5位量化使模型精度保持在全精度浮点版本的1%以内,性能无显著下降。
  • 在各数据集上,模型尺寸减少了84%至93%,其中词嵌入占模型内存占用的93%以上。
  • 联合量化与剪枝使FPGA的触发器使用量减少3.3倍,查找表(LUT)使用量减少4.2倍,且对精度影响极小。
  • 随机重启爬山算法成功识别出最优位宽配置,在精度损失低于0.2%的情况下实现高比例压缩。
  • 剪枝阈值在0.03至0.035之间时,精度出现显著下降;而阈值高于0.055时,性能迅速恶化。
  • 研究发现,同时压缩权重和激活值的效果优于单独压缩策略,尤其在低比特宽度下表现更优。

更好的研究,从现在开始

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

无需绑定信用卡

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