二值与三值自然语言生成
Binary and Ternary Natural Language Generation
AI总结:
本文提出权重统计量化与激活弹性量化结合的方法,首次构建用于摘要和机器翻译的三值、二值 transformer,并在效率与精度上取得强结果。
摘要:
三值和二值神经网络可实现无乘法计算,若部署在专用硬件上,有望比全精度网络带来多个数量级的效率提升。然而,由于参数空间和输出空间都被高度离散化,此类网络已被证明极难优化。对于 transformer 文本生成模型这一类别,困难还会进一步加剧,原因在于注意力运算对量化的敏感性,以及自回归解码在高基数输出空间中的噪声累积效应。我们通过结合面向权重的基于统计的量化与面向激活的弹性量化来解决该问题,并在摘要和机器翻译下游任务上展示了首批三值与二值 transformer 模型。我们的三值 BART base 在 CNN/DailyMail 基准上取得 41 的 R1 分数,仅落后完整模型 3.9 分,同时效率提升 16 倍。我们的二值模型虽然准确率较低,但取得了 35.6 这一相当可观的分数。在机器翻译方面,我们在 WMT16 En-Ro 基准上取得 21.7 和 17.6 的 BLEU 分数,而全精度 mBART 模型的分数为 26.8。我们还在 8 位激活设置下比较了所提方法,在该设置中,我们的三值乃至二值权重模型都能匹敌或超过文献中现有最佳的 8 位权重模型。代码和模型可在 https://github.com/facebookresearch/Ternary_Binary_Transformer 获取。
英文摘要:
Ternary and binary neural networks enable multiplication-free computation and promise multiple orders of magnitude efficiency gains over full-precision networks if implemented on specialized hardware. However, since both the parameter and the output space are highly discretized, such networks have proven very difficult to optimize. The difficulties are compounded for the class of transformer text generation models due to the sensitivity of the attention operation to quantization and the noise-compounding effects of autoregressive decoding in the high-cardinality output space. We approach the problem with a mix of statistics-based quantization for the weights and elastic quantization of the activations and demonstrate the first ternary and binary transformer models on the downstream tasks of summarization and machine translation. Our ternary BART base achieves an R1 score of 41 on the CNN/DailyMail benchmark, which is merely 3.9 points behind the full model while being 16x more efficient. Our binary model, while less accurate, achieves a highly non-trivial score of 35.6. For machine translation, we achieved BLEU scores of 21.7 and 17.6 on the WMT16 En-Ro benchmark, compared with a full precision mBART model score of 26.8. We also compare our approach in the 8-bit activation setting, where our ternary and even binary weight models can match or outperform the best existing 8-bit weight models in the literature. Our code and models are available at: https://github.com/facebookresearch/Ternary_Binary_Transformer
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。