A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity. Li, H., Wang, M., Liu, S., & Chen, P.
Paper abstract bibtex 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.
@misc{li-arxiv2023,
title = {A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity},
url = {http://arxiv.org/abs/2302.06015},
shorttitle = {A Theoretical Understanding of Shallow Vision Transformers},
abstract = {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}.},
number = {{arXiv}:2302.06015},
author = {Li, Hongkang and Wang, Meng and Liu, Sijia and Chen, Pin-yu},
urldate = {2023-10-18},
date = {2023-03-19},
eprinttype = {arxiv},
eprint = {2302.06015 [cs, stat]},
file = {Li et al. - 2023 - A Theoretical Understanding of Shallow Vision Transformers Learning, Generalization, and Sample Complexity.pdf:/Users/ukreddy/Zotero/storage/C95LFDYK/Li et al. - 2023 - A Theoretical Understanding of Shallow Vision Transformers Learning, Generalization, and Sample Complexity.pdf:application/pdf},
}
Downloads: 0
{"_id":"rSDXyhi9QSXkfFbG9","bibbaseid":"li-wang-liu-chen-atheoreticalunderstandingofshallowvisiontransformerslearninggeneralizationandsamplecomplexity","author_short":["Li, H.","Wang, M.","Liu, S.","Chen, P."],"bibdata":{"bibtype":"misc","type":"misc","title":"A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity","url":"http://arxiv.org/abs/2302.06015","shorttitle":"A Theoretical Understanding of Shallow Vision Transformers","abstract":"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.","number":"arXiv:2302.06015","author":[{"propositions":[],"lastnames":["Li"],"firstnames":["Hongkang"],"suffixes":[]},{"propositions":[],"lastnames":["Wang"],"firstnames":["Meng"],"suffixes":[]},{"propositions":[],"lastnames":["Liu"],"firstnames":["Sijia"],"suffixes":[]},{"propositions":[],"lastnames":["Chen"],"firstnames":["Pin-yu"],"suffixes":[]}],"urldate":"2023-10-18","date":"2023-03-19","eprinttype":"arxiv","eprint":"2302.06015 [cs, stat]","file":"Li et al. - 2023 - A Theoretical Understanding of Shallow Vision Transformers Learning, Generalization, and Sample Complexity.pdf:/Users/ukreddy/Zotero/storage/C95LFDYK/Li et al. - 2023 - A Theoretical Understanding of Shallow Vision Transformers Learning, Generalization, and Sample Complexity.pdf:application/pdf","bibtex":"@misc{li-arxiv2023,\n\ttitle = {A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity},\n\turl = {http://arxiv.org/abs/2302.06015},\n\tshorttitle = {A Theoretical Understanding of Shallow Vision Transformers},\n\tabstract = {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}.},\n\tnumber = {{arXiv}:2302.06015},\n\tauthor = {Li, Hongkang and Wang, Meng and Liu, Sijia and Chen, Pin-yu},\n\turldate = {2023-10-18},\n\tdate = {2023-03-19},\n\teprinttype = {arxiv},\n\teprint = {2302.06015 [cs, stat]},\n\tfile = {Li et al. - 2023 - A Theoretical Understanding of Shallow Vision Transformers Learning, Generalization, and Sample Complexity.pdf:/Users/ukreddy/Zotero/storage/C95LFDYK/Li et al. - 2023 - A Theoretical Understanding of Shallow Vision Transformers Learning, Generalization, and Sample Complexity.pdf:application/pdf},\n}\n\n\n","author_short":["Li, H.","Wang, M.","Liu, S.","Chen, P."],"key":"li-arxiv2023","id":"li-arxiv2023","bibbaseid":"li-wang-liu-chen-atheoreticalunderstandingofshallowvisiontransformerslearninggeneralizationandsamplecomplexity","role":"author","urls":{"Paper":"http://arxiv.org/abs/2302.06015"},"metadata":{"authorlinks":{}},"downloads":0,"html":""},"bibtype":"misc","biburl":"https://bibbase.org/network/files/ERQPGxTT5rBCWeLFE","dataSources":["TJKHZ3TN7ogruuAa6"],"keywords":[],"search_terms":["theoretical","understanding","shallow","vision","transformers","learning","generalization","sample","complexity","li","wang","liu","chen"],"title":"A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexity","year":null}