We present a Lipschitz continuous Transformer, called LipsFormer, to pursue training stability both theoretically and empirically for Transformer-based models. In contrast to previous practical tricks that address training instability by learning rate warmup, layer normalization, attention formulation, and weight initialization, we show that Lipschitz continuity is a more essential property to ensure training stability. In LipsFormer, we replace unstable Transformer component modules with Lipschitz continuous counterparts: CenterNorm instead of LayerNorm, spectral initialization instead of Xavier initialization, scaled cosine similarity attention instead of dot-product attention, and weighted residual shortcut. We prove that these introduced modules are Lipschitz continuous and derive an upper bound on the Lipschitz constant of LipsFormer. Our experiments show that LipsFormer allows stable training of deep Transformer architectures without the need of careful learning rate tuning such as warmup, yielding a faster convergence and better generalization. As a result, on the ImageNet 1K dataset, LipsFormer-Swin-Tiny based on Swin Transformer training for 300 epochs can obtain 82.7\% without any learning rate warmup. Moreover, LipsFormer-CSwin-Tiny, based on CSwin, training for 300 epochs achieves a top-1 accuracy of 83.5\% with 4.7G FLOPs and 24M parameters. The code will be released at \url{https://github.com/IDEA-Research/LipsFormer}.


翻译:我们提出了一种Lipschitz连续的Transformer,称为LipsFormer,以在理论和经验上追求Transformer-based模型的训练稳定性。与以前解决训练不稳定性的实用技巧不同,这些技巧包括学习率预热、层规范化、注意力公式和权重初始化,我们展示了Lipschitz连续性作为确保训练稳定性的更重要的属性。在LipsFormer中,我们用Lipschitz连续的替代不稳定的Transformer组件模块:CenterNorm代替LayerNorm,谱初始化代替Xavier初始化,缩放余弦相似性注意代替点积注意力,以及加权残差快捷方式。我们证明这些引入的模块是Lipschitz连续的,并推导出LipsFormer的Lipschitz常数的上界。我们的实验表明,LipsFormer允许稳定训练深Transformer架构,无需仔细调整学习率,例如预热,从而实现更快的收敛和更好的泛化。因此,在ImageNet 1K数据集上,基于Swin Transformer的LipsFormer-Swin-Tiny训练300个epochs,可以获得82.7%的结果,而没有任何学习率预热。此外, 基于CSwin的LipsFormer-CSwin-Tiny,在训练300个epochs,并在4.7G FLOPs和24M参数的情况下,实现了83.5%的Top-1精度。 代码将在\url{https://github.com/IDEA-Research/LipsFormer}上发布。

0
下载
关闭预览

相关内容

【CVPR 2022】视觉提示调整(VPT),Vision Prompt Tuning
专知会员服务
29+阅读 · 2022年3月12日
【ICLR2022】Transformers亦能贝叶斯推断
专知会员服务
24+阅读 · 2021年12月23日
【Google】平滑对抗训练,Smooth Adversarial Training
专知会员服务
47+阅读 · 2020年7月4日
专知会员服务
61+阅读 · 2020年3月4日
【Google论文】ALBERT:自我监督学习语言表达的精简BERT
专知会员服务
22+阅读 · 2019年11月4日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
Ladder Side-Tuning:预训练模型的“过墙梯”
PaperWeekly
0+阅读 · 2022年6月24日
【ICML2019】IanGoodfellow自注意力GAN的代码与PPT
GAN生成式对抗网络
18+阅读 · 2019年6月30日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
19篇ICML2019论文摘录选读!
专知
28+阅读 · 2019年4月28日
Self-Attention GAN 中的 self-attention 机制
PaperWeekly
12+阅读 · 2019年3月6日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
vae 相关论文 表示学习 1
CreateAMind
12+阅读 · 2018年9月6日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2023年6月1日
Arxiv
0+阅读 · 2023年6月1日
VIP会员
相关资讯
Ladder Side-Tuning:预训练模型的“过墙梯”
PaperWeekly
0+阅读 · 2022年6月24日
【ICML2019】IanGoodfellow自注意力GAN的代码与PPT
GAN生成式对抗网络
18+阅读 · 2019年6月30日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
19篇ICML2019论文摘录选读!
专知
28+阅读 · 2019年4月28日
Self-Attention GAN 中的 self-attention 机制
PaperWeekly
12+阅读 · 2019年3月6日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
vae 相关论文 表示学习 1
CreateAMind
12+阅读 · 2018年9月6日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员