Vision Transformers (ViTs) with self-attention modules have recently achieved great empirical success in many vision tasks. Due to non-convex interactions across layers, however, theoretical learning and generalization analysis is mostly elusive. Based on a data model characterizing both label-relevant and label-irrelevant tokens, this paper provides the first theoretical analysis of training a shallow ViT, i.e., one self-attention layer followed by a two-layer perceptron, for a classification task. We characterize the sample complexity to achieve a zero generalization error. Our sample complexity bound is positively correlated with the inverse of the fraction of label-relevant tokens, the token noise level, and the initial model error. We also prove that a training process using stochastic gradient descent (SGD) leads to a sparse attention map, which is a formal verification of the general intuition about the success of attention. Moreover, this paper indicates that a proper token sparsification can improve the test performance by removing label-irrelevant and/or noisy tokens, including spurious correlations. Empirical experiments on synthetic data and CIFAR-10 dataset justify our theoretical results and generalize to deeper ViTs.


翻译:具有自我注意模块的视觉Transformer(ViTs)最近在许多视觉任务中取得了巨大的实证成功。然而,由于层间的非凸交互,理论学习和泛化分析大多数是难以捉摸的。基于一个既包括标签相关又包括标签无关符号的数据模型,本文提供了第一个浅层ViT的理论分析,即一个自我注意层后跟一个两层感知器,用于分类任务。我们表征了实现零泛化误差所需的样本复杂度。我们的样本复杂度边界与标签相关符号的分数的倒数、符号噪声水平和初始模型误差呈正相关。我们还证明了使用随机梯度下降(SGD)的训练过程会产生稀疏的注意图,这是关于注意力成功的常规直觉的正式验证。此外,本文表明,适当的符号稀疏化可以通过消除标签无关和/或噪声符号,包括虚假相关性,来提高测试性能。对合成数据和CIFAR-10数据集的经验实验验证了我们的理论结果,并推广到更深的ViT。

0
下载
关闭预览

相关内容

【伯克利博士论文】学习在动态环境中泛化,103页pdf
专知会员服务
71+阅读 · 2022年10月12日
专知会员服务
35+阅读 · 2021年7月7日
专知会员服务
50+阅读 · 2020年12月14日
【Google】平滑对抗训练,Smooth Adversarial Training
专知会员服务
47+阅读 · 2020年7月4日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
笔记 | Deep active learning for named entity recognition
黑龙江大学自然语言处理实验室
24+阅读 · 2018年5月27日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
7+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
Arxiv
0+阅读 · 2023年5月9日
Arxiv
37+阅读 · 2021年9月28日
Arxiv
32+阅读 · 2021年3月8日
Feature Denoising for Improving Adversarial Robustness
Arxiv
15+阅读 · 2018年12月9日
VIP会员
相关资讯
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
笔记 | Deep active learning for named entity recognition
黑龙江大学自然语言处理实验室
24+阅读 · 2018年5月27日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
7+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员