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模型的训练稳定性。与先前通过学习率预热、层归一化、注意力机制设计和权重初始化等实用技巧来解决训练不稳定性的方法不同,我们证明Lipschitz连续性是确保训练稳定性的更本质属性。在LipsFormer中,我们将不稳定的Transformer组件模块替换为Lipschitz连续对应模块:用CenterNorm替代LayerNorm、用谱初始化替代Xavier初始化、用缩放余弦相似度注意力替代点积注意力,并采用加权残差跳跃连接。我们证明了这些引入的模块具有Lipschitz连续性,并推导了LipsFormer的Lipschitz常数上界。实验表明,LipsFormer无需精细调整学习率(如预热)即可稳定训练深层Transformer架构,实现更快的收敛速度和更好的泛化性能。在ImageNet 1K数据集上,基于Swin Transformer训练的LipsFormer-Swin-Tiny在300轮训练中无需任何学习率预热即可达到82.7%的准确率。此外,基于CSwin的LipsFormer-CSwin-Tiny在300轮训练中以4.7G FLOPs和24M参数实现了83.5%的top-1准确率。代码将发布于\url{https://github.com/IDEA-Research/LipsFormer}。

0
下载
关闭预览

相关内容

【CVPR 2022】视觉提示调整(VPT),Vision Prompt Tuning
专知会员服务
32+阅读 · 2022年3月12日
【ICLR2022】Transformers亦能贝叶斯推断
专知会员服务
25+阅读 · 2021年12月23日
【Google】平滑对抗训练,Smooth Adversarial Training
专知会员服务
49+阅读 · 2020年7月4日
专知会员服务
63+阅读 · 2020年3月4日
【Google论文】ALBERT:自我监督学习语言表达的精简BERT
专知会员服务
24+阅读 · 2019年11月4日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 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
27+阅读 · 2019年5月22日
19篇ICML2019论文摘录选读!
专知
28+阅读 · 2019年4月28日
Self-Attention GAN 中的 self-attention 机制
PaperWeekly
12+阅读 · 2019年3月6日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 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日
国家自然科学基金
1+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2023年6月1日
Arxiv
0+阅读 · 2023年6月1日
VIP会员
最新内容
对抗环境下超视距目标打击的情报支援
专知会员服务
8+阅读 · 7月22日
《无人机对海面作战影响评估》
专知会员服务
15+阅读 · 7月21日
印度精确打击与指挥架构的断层
专知会员服务
7+阅读 · 7月20日
美空军AI完成F-16战斗机自主空战历史性试飞
专知会员服务
8+阅读 · 7月20日
相关资讯
Ladder Side-Tuning:预训练模型的“过墙梯”
PaperWeekly
0+阅读 · 2022年6月24日
【ICML2019】IanGoodfellow自注意力GAN的代码与PPT
GAN生成式对抗网络
18+阅读 · 2019年6月30日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
19篇ICML2019论文摘录选读!
专知
28+阅读 · 2019年4月28日
Self-Attention GAN 中的 self-attention 机制
PaperWeekly
12+阅读 · 2019年3月6日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 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日
国家自然科学基金
1+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员