跳到主要导航 跳到搜索 跳到主要内容

Understanding the Failure of Batch Normalization for Transformers in NLP

  • Tsinghua University

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

Batch Normalization (BN) is a core and prevalent technique in accelerating the training of deep neural networks and improving the generalization on Computer Vision (CV) tasks. However, it fails to defend its position in Natural Language Processing (NLP), which is dominated by Layer Normalization (LN). In this paper, we are trying to answer why BN usually performs worse than LN in NLP tasks with Transformer models. We find that the inconsistency between training and inference of BN is the leading cause that results in the failure of BN in NLP. We define Training Inference Discrepancy (TID) to quantitatively measure this inconsistency and reveal that TID can indicate BN's performance, supported by extensive experiments, including image classification, neural machine translation, language modeling, sequence labeling, and text classification tasks. We find that BN can obtain much better test performance than LN when TID keeps small through training. To suppress the explosion of TID, we propose Regularized BN (RBN) that adds a simple regularization term to narrow the gap between batch statistics and population statistics of BN. RBN improves the performance of BN consistently and outperforms or is on par with LN on 17 out of 20 settings, involving ten datasets and two common variants of Transformer.

源语言英语
主期刊名Advances in Neural Information Processing Systems 35 - 36th Conference on Neural Information Processing Systems, NeurIPS 2022
编辑S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, A. Oh
出版商Neural information processing systems foundation
ISBN(电子版)9781713871088
出版状态已出版 - 2022
活动36th Conference on Neural Information Processing Systems, NeurIPS 2022 - New Orleans, 美国
期限: 28 11月 20229 12月 2022

出版系列

姓名Advances in Neural Information Processing Systems
35
ISSN(印刷版)1049-5258

会议

会议36th Conference on Neural Information Processing Systems, NeurIPS 2022
国家/地区美国
New Orleans
时期28/11/229/12/22

学术指纹

探究 'Understanding the Failure of Batch Normalization for Transformers in NLP' 的科研主题。它们共同构成独一无二的学术指纹。

引用此