Skip to main content
QUICK REVIEW

[论文解读] Improving BERT Fine-tuning with Embedding Normalization

Wenxuan Zhou, Junyi Du|arXiv (Cornell University)|Nov 10, 2019
Topic Modeling参考文献 9被引用 4
一句话总结

本文识别出 BERT 的 [CLS] token 存在分布偏差——其激活集中在少数维度上且未以零为中心——导致微调过程中优化不稳定。为解决此问题,本文提出简单的嵌入归一化技术,对 [CLS] 嵌入进行重新中心化和归一化,从而在不改变网络架构的前提下,在多个文本分类任务上实现性能提升。

ABSTRACT

Large pre-trained sentence encoders like BERT start a new chapter in natural language processing. A common practice to apply pre-trained BERT to sequence classification tasks (e.g., classification of sentences or sentence pairs) is by feeding the embedding of [CLS] token (in the last layer) to a task-specific classification layer, and then fine tune the model parameters of BERT and classifier jointly. In this paper, we conduct systematic analysis over several sequence classification datasets to examine the embedding values of [CLS] token before the fine tuning phase, and present the biased embedding distribution issue---i.e., embedding values of [CLS] concentrate on a few dimensions and are non-zero centered. Such biased embedding brings challenge to the optimization process during fine-tuning as gradients of [CLS] embedding may explode and result in degraded model performance. We further propose several simple yet effective normalization methods to modify the [CLS] embedding during the fine-tuning. Compared with the previous practice, neural classification model with the normalized embedding shows improvements on several text classification tasks, demonstrates the effectiveness of our method.

研究动机与目标

  • 调查 BERT 的 [CLS] token 嵌入在微调前的分布特性。
  • 识别出非零中心化、集中分布的 [CLS] 嵌入会阻碍微调过程中的优化。
  • 提出归一化技术以稳定训练过程,并提升序列分类任务的性能。
  • 在多个基准文本分类数据集上评估归一化 [CLS] 嵌入的有效性。

提出的方法

  • 分析微调前在多个序列分类数据集上 [CLS] token 嵌入的分布。
  • 在微调过程中对 [CLS] 嵌入向量应用归一化技术,如批量归一化和层归一化。
  • 通过从批量中减去其均值,对 [CLS] 嵌入进行重中心化,以实现零中心化。
  • 通过在输入分类头前对 [CLS] 表示进行归一化,修改分类头的输入。
  • 将归一化作为轻量级后处理步骤集成,不改变 BERT 的架构或预训练过程。
  • 使用标准基准评估归一化对下游分类性能的影响。

实验结果

研究问题

  • RQ1在序列分类任务中,BERT 的 [CLS] token 嵌入在微调前如何分布?
  • RQ2[CLS] 嵌入的非零中心化、集中分布对微调优化的影响程度如何?
  • RQ3简单的 [CLS] 嵌入归一化是否能改善微调的稳定性与模型性能?
  • RQ4归一化方法与标准微调相比,在多个文本分类数据集上的表现如何?

主要发现

  • [CLS] token 嵌入在微调前表现出有偏分布,激活高度集中于少数维度,且未以零为中心。
  • 这种有偏分布导致微调过程中梯度不稳定,性能下降。
  • 批量重中心化和层归一化等归一化技术能有效稳定优化过程。
  • 与标准微调相比,所提方法在多个文本分类基准上均实现一致性能提升。
  • 该方法无需架构修改或额外参数,具有轻量化和可部署性优势。

更好的研究,从现在开始

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

无需绑定信用卡

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