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

通过监测梯度方向变化动态调整Transformer批量

Dynamically Adjusting Transformer Batch Size by Monitoring Gradient Direction Change

Saarland University(萨尔兰大学);German Research Center for Artificial Intelligence(德国人工智能研究中心);Tianjin University(天津大学);China Mobile Online Services(中国移动在线服务公司)

Hongfei Xu, Josef van Genabith, Deyi Xiong, Qiuhui Liu

摘要:

超参数的选择影响神经模型的性能。虽然许多先前的研究(Sutskever等人,2013; Duchi等人,二〇一一年; Kingma and Ba,2015)关注于加速收敛和降低学习率的影响,相对较少的论文关注批量大小的影响。本文分析了批量的增加对梯度方向的影响,提出了用梯度的角度变化来评价梯度的稳定性。根据我们的观察,梯度方向的角度变化首先趋于稳定(即逐渐减小),同时积累小批次,然后开始波动。我们建议自动和动态地确定批量大小,通过累积小批量的梯度,并在梯度方向开始波动时执行优化步骤。为了提高我们的方法对大型模型的效率,我们提出了一种抽样方法来选择对批量大小敏感的参数梯度。我们的方法在训练过程中动态地确定适当和有效的批量大小。在我们对WMT 14英语到德语和英语到法语任务的实验中,我们的方法分别将具有固定25 k批量大小的Transformer提高了+0.73和+0.82 BLEU。

英文摘要:

The choice of hyper-parameters affects the performance of neural models. While much previous research (Sutskever et al., 2013; Duchi et al., 2011; Kingma and Ba, 2015) focuses on accelerating convergence and reducing the effects of the learning rate, comparatively few papers concentrate on the effect of batch size. In this paper, we analyze how increasing batch size affects gradient direction, and propose to evaluate the stability of gradients with their angle change. Based on our observations, the angle change of gradient direction first tends to stabilize (i.e. gradually decrease) while accumulating mini-batches, and then starts to fluctuate. We propose to automatically and dynamically determine batch sizes by accumulating gradients of mini-batches and performing an optimization step at just the time when the direction of gradients starts to fluctuate. To improve the efficiency of our approach for large models, we propose a sampling approach to select gradients of parameters sensitive to the batch size. Our approach dynamically determines proper and efficient batch sizes during training. In our experiments on the WMT 14 English to German and English to French tasks, our approach improves the Transformer with a fixed 25k batch size by +0.73 and +0.82 BLEU respectively.

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

↑