Skip to main content
QUICK REVIEW

[论文解读] BiT: Robustly Binarized Multi-distilled Transformer

Zechun Liu, Barlas Oğuz|arXiv (Cornell University)|May 25, 2022
Topic ModelingComputer Science被引用 22
一句话总结

BiT 展示了具弹性激活与多蒸馏的完全二值化的 Transformer 模型,在 GLUE 上通过数据增强和强基线实现接近全精度的准确性。

ABSTRACT

Modern pre-trained transformers have rapidly advanced the state-of-the-art in machine learning, but have also grown in parameters and computational complexity, making them increasingly difficult to deploy in resource-constrained environments. Binarization of the weights and activations of the network can significantly alleviate these issues, however, is technically challenging from an optimization perspective. In this work, we identify a series of improvements that enables binary transformers at a much higher accuracy than what was possible previously. These include a two-set binarization scheme, a novel elastic binary activation function with learned parameters, and a method to quantize a network to its limit by successively distilling higher precision models into lower precision students. These approaches allow for the first time, fully binarized transformer models that are at a practical level of accuracy, approaching a full-precision BERT baseline on the GLUE language understanding benchmark within as little as 5.9%. Code and models are available at: https://github.com/facebookresearch/bit.

研究动机与目标

  • 在资源受限的环境中,激励对高效 Transformer 模型的需求。
  • 为 Transformer 的权重与激活开发一个鲁棒的二值化框架。
  • 提出一个多蒸馏计划,逐步从较高精度训练到较低精度。
  • 展示弹性激活二值化显著提升性能。
  • 在 GLUE 和 SQuAD 上评估 BiT,以建立二值化 Transformer 的最先进基线。

提出的方法

  • 提出一种两集合二值化方案,将 Softmax/ReLU(非负)之后的激活与其他激活(混合符号)分离。
  • 应用逐层激活缩放因子以最小化二值化误差。
  • 提出带可学习尺度 α 与阈值 β 的弹性二值化,使用直通估计器计算梯度。
  • 使用简化的知识蒸馏,结合 L_logits 和 L_reps 损失,避免复杂的两步蒸馏。
  • 采用多蒸馏策略,按照量化计划依次将高精度教师蒸馏到二值学生(例如 W32A32 → W1A2 → W1A1)。
  • 在 GLUE 和 SQuAD 上进行评估,以与全精度 BERT 和之前的二值化方法进行比较。

实验结果

研究问题

  • RQ1一个完全二值化的 Transformer 是否能够在像 GLUE 和 SQuAD 这样的 NLP 基准测试中实现实用精度?
  • RQ2两集合二值化和弹性二值化是否能改善二值化 Transformer 的优化和最终性能?
  • RQ3与单步蒸馏相比,多蒸馏课程是否更有效地缩小二值和全精度模型之间的差距?
  • RQ4数据增强对 GLUE 任务中量化 Transformer 性能的影响如何?
  • RQ5在 BiT 模型中,学习到的激活缩放在各层和组件(例如注意力与前馈)中的分布情况如何?

主要发现

  • BiT 在 GLUE 上取得具有竞争力的结果,权重全二值且激活为 1–2 位,显著缩小与全精度基线的差距。
  • 弹性二值化在消融实验中将 GLUE 平均准确率提升了可观的幅度(高达约 15.7%),超过强基线。
  • 多蒸馏在所报告的设置中进一步提升了 GLUE 性能,约提升 2.5 点。
  • 在数据增强条件下,BiT 将 GLUE 的平均差距从以往工作中的超过 15 点缩小到 5.9 点。
  • 在 SQuAD 上,BiT 仍落后于全精度基线,但相比先前的二值方法有显著改进(如 BiT 63.1 EM / 74.9 F1 对比 BERT base 82.6/89.7)。
  • 学习到的激活缩放因子按层变化;与注意力相关的比例倾向较小,而查询/键的缩放更大,极差可达 200 倍。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。