Skip to main content
QUICK REVIEW

[论文解读] Stagewise Enlargement of Batch Size for SGD-based Learning

Shen-Yi Zhao, Yin-Peng Xie|arXiv (Cornell University)|Feb 26, 2020
Machine Learning and Algorithms参考文献 27被引用 4
一句话总结

本文提出分阶段批量大小扩展(SEBS)方法,该方法在基于SGD的训练中按几何级数逐阶段增大批量大小。SEBS在不损失CIFAR-10和ImageNet测试准确率的前提下,将参数更新次数最多减少64%,优于经典的分阶段SGD和大批量基线方法。

ABSTRACT

Existing research shows that the batch size can seriously affect the performance of stochastic gradient descent~(SGD) based learning, including training speed and generalization ability. A larger batch size typically results in less parameter updates. In distributed training, a larger batch size also results in less frequent communication. However, a larger batch size can make a generalization gap more easily. Hence, how to set a proper batch size for SGD has recently attracted much attention. Although some methods about setting batch size have been proposed, the batch size problem has still not been well solved. In this paper, we first provide theory to show that a proper batch size is related to the gap between initialization and optimum of the model parameter. Then based on this theory, we propose a novel method, called \underline{s}tagewise \underline{e}nlargement of \underline{b}atch \underline{s}ize~(\mbox{SEBS}), to set proper batch size for SGD. More specifically, \mbox{SEBS} adopts a multi-stage scheme, and enlarges the batch size geometrically by stage. We theoretically prove that, compared to classical stagewise SGD which decreases learning rate by stage, \mbox{SEBS} can reduce the number of parameter updates without increasing generalization error. SEBS is suitable for \mbox{SGD}, momentum \mbox{SGD} and AdaGrad. Empirical results on real data successfully verify the theories of \mbox{SEBS}. Furthermore, empirical results also show that SEBS can outperform other baselines.

研究动机与目标

  • 解决SGD中选择最优批量大小的挑战,以在训练速度与泛化性能之间取得平衡。
  • 克服固定批量大小方法和缺乏理论保证的动态批量大小策略的局限性。
  • 提出一种在保持泛化性能的同时减少深度学习训练中参数更新次数的方法。
  • 为基于模型参数初始化到最优解之间差距的批量大小扩展提供理论依据。
  • 设计一个兼容SGD、动量SGD和AdaGrad的通用框架,以实现高效训练。

提出的方法

  • 提出一种多阶段训练方案,其中每个阶段的批量大小按比例ρ几何级数增加。
  • 从理论上将批量大小扩展与模型初始化与最优参数之间的差距联系起来,确保收敛且不增加泛化误差。
  • 在每个阶段保持恒定的学习率,与经典分阶段SGD中学习率递减的做法形成对比。
  • 推导出条件 η_s / b_s = O(ε_s),以确保在批量大小扩展过程中实现收敛与泛化稳定性。
  • 将该方法应用于标准优化器:SGD、动量SGD(mSGD)和AdaGrad,证明其广泛适用性。
  • 在预设的训练轮次(如80、120轮)处设置阶段转换,以平衡计算效率与模型性能。

实验结果

研究问题

  • RQ1几何级数递增的批量大小策略是否能在不损害泛化性能的前提下减少参数更新次数?
  • RQ2批量大小扩展比例对深度神经网络训练中收敛性和测试准确率的影响如何?
  • RQ3分阶段批量大小扩展策略是否能优于采用学习率递减的经典分阶段SGD?
  • RQ4与需要大量超参数调优的大批量训练方法相比,SEBS是否能保持泛化性能?
  • RQ5所提出的方法是否在SGD、动量SGD和AdaGrad等不同优化算法中均具有普适性?

主要发现

  • 在ImageNet(ResNet50)上,SEBS相比经典mSGD将参数更新次数减少64%,同时保持75.87%的测试准确率。
  • 在CIFAR-10上使用ResNet20时,SEBS在ρ=12时将参数更新次数从经典分阶段方法的62.5k减少至32.6k,且测试准确率相当。
  • SEBS优于DB-SGD(每轮增加批量大小),后者因泛化性能差而准确率较低。
  • mSEBS在CIFAR-10上实现91.74%的测试准确率,仅使用160k次参数更新,优于LARS(90.97%)尽管更新次数更少。
  • Smith等人(2018)提出的方法因快速扩展批量大小,导致ResNet50准确率降至73.44%,而mSEBS保持75.87%的准确率。
  • 实证结果证实,即使在较大的批量大小扩展比例(如ρ=12)下,SEBS仍能保持泛化性能,而此前的动态批量大小方法则无法做到。

更好的研究,从现在开始

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

无需绑定信用卡

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