arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.10098cs.CLcs.LG
收藏

面向Transformer掩码微调的梯度稀疏化

Gradient Sparsification For Masked Fine-Tuning of Transformers

Huawei Ireland Research Center(华为爱尔兰研究中心)

James O' Neill, Sourav Dutta

AI总结:

针对Transformer微调中渐进解冻方案是否最优的问题,提出梯度稀疏化方法GradDrop,通过反向传播时随机掩码梯度正则化模型,在XGLUE基准上性能优于标准微调与渐进解冻,可提升低资源语言表现。

摘要:

对预训练自监督语言模型进行微调是迁移学习到下游任务时被广泛采用的方法。微调可通过冻结预训练网络的梯度、仅更新新增分类层的梯度实现,也可对所有参数执行梯度更新。渐进解冻(gradual unfreezing)通过在训练过程中逐步解冻整层的梯度,在二者之间取得权衡,这是一种在存储、训练速度与泛化性能之间做权衡的有效策略。但目前尚不清楚,与可能提升微调性能的渐进解冻稀疏变体相比,训练过程中逐层渐进解冻是否为最优方案。本文提出通过随机掩码梯度来正则化预训练语言模型,以提升整体微调性能。我们提出了GradDrop及其变体,这是一类梯度稀疏化方法,会在反向传播过程中掩码梯度,起到梯度噪声的作用;与渐进冻结不同,GradDrop具备稀疏性与随机性。在使用XLMR-Large模型的多语言XGLUE基准上开展的大量实验表明,GradDrop的性能与使用额外翻译数据进行中间预训练的方法相当,且优于标准微调和渐进解冻方法。事后分析揭示了GradDrop如何提升在未训练过的语言(如资源匮乏语言)上的性能。

英文摘要:

Fine-tuning pretrained self-supervised language models is widely adopted for transfer learning to downstream tasks. Fine-tuning can be achieved by freezing gradients of the pretrained network and only updating gradients of a newly added classification layer, or by performing gradient updates on all parameters. Gradual unfreezing makes a trade-off between the two by gradually unfreezing gradients of whole layers during training. This has been an effective strategy to trade-off between storage and training speed with generalization performance. However, it is not clear whether gradually unfreezing layers throughout training is optimal, compared to sparse variants of gradual unfreezing which may improve fine-tuning performance. In this paper, we propose to stochastically mask gradients to regularize pretrained language models for improving overall fine-tuned performance. We introduce GradDrop and variants thereof, a class of gradient sparsification methods that mask gradients during the backward pass, acting as gradient noise. GradDrop is sparse and stochastic unlike gradual freezing. Extensive experiments on the multilingual XGLUE benchmark with XLMR-Large show that GradDrop is competitive against methods that use additional translated data for intermediate pretraining and outperforms standard fine-tuning and gradual unfreezing. A post-analysis shows how GradDrop improves performance with languages it was not trained on, such as under-resourced languages.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑