We propose Generalized Primal Averaging (GPA), an extension of Nesterov's method in its primal averaging formulation that addresses key limitations of recent averaging-based optimizers such as single-worker DiLoCo and Schedule-Free (SF) in the non-distributed setting. These two recent algorithmic approaches improve the performance of base optimizers, such as AdamW, through different iterate averaging strategies. Schedule-Free explicitly maintains a uniform average of past weights, while single-worker DiLoCo performs implicit averaging by periodically aggregating trajectories, called pseudo-gradients, to update the model parameters. However, single-worker DiLoCo's periodic averaging introduces a two-loop structure, increasing its memory requirements and number of hyperparameters. GPA overcomes these limitations by decoupling the interpolation constant in the primal averaging formulation of Nesterov. This decoupling enables GPA to smoothly average iterates at every step, generalizing and improving upon single-worker DiLoCo. Empirically, GPA consistently outperforms single-worker DiLoCo while removing the two-loop structure, simplifying hyperparameter tuning, and reducing its memory overhead to a single additional buffer. On the Llama-160M model, GPA provides a 24.22% speedup in terms of steps to reach the baseline (AdamW's) validation loss. Likewise, GPA achieves speedups of 12% and 27% on small and large batch setups, respectively, to attain AdamW's validation accuracy on the ImageNet ViT workload. Furthermore, we prove that for any base optimizer with regret bounded by $O(\sqrt{T})$, where $T$ is the number of iterations, GPA can match or exceed the convergence guarantee of the original optimizer, depending on the choice of interpolation constants.


翻译:我们提出广义原始平均法,这是Nesterov方法在其原始平均表述上的扩展,旨在解决近期平均化优化器(如非分布式场景下的单机DiLoCo和Schedule-Free方法)的关键局限。这两种最新算法通过不同的迭代平均策略提升了基础优化器(如AdamW)的性能:Schedule-Free显式维护历史权重的均匀平均,而单机DiLoCo则通过周期性地聚合轨迹(称为伪梯度)来更新模型参数,实现隐式平均。然而,单机DiLoCo的周期性平均引入了双循环结构,增加了内存需求和超参数数量。GPA通过解耦Nesterov原始平均表述中的插值常数克服了这些限制,该解耦使GPA能在每一步平滑平均迭代,从而推广并改进了单机DiLoCo。实证表明,GPA在消除双循环结构、简化超参数调优、将内存开销降至单个额外缓冲区的条件下,始终优于单机DiLoCo。在Llama-160M模型上,GPA达到基线(AdamW)验证损失所需的步数减少了24.22%。同样,在ImageNet ViT任务中,GPA在小批量和大批量设置下分别以12%和27%的加速比达到了AdamW的验证准确率。此外,我们证明对于任何遗憾界为$O(\sqrt{T})$的基础优化器(其中$T$为迭代次数),GPA能匹配或超越原优化器的收敛保证,具体取决于插值常数的选择。

0
下载
关闭预览

相关内容

专知会员服务
44+阅读 · 2021年7月1日
【NeurIPS2019】图变换网络:Graph Transformer Network
NAACL 2019 | 一种考虑缓和KL消失的简单VAE训练方法
PaperWeekly
20+阅读 · 2019年4月24日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员