Authors: Yawen Li, Tao Hu, Zhouhui Lian, Wan Tian, Yijie Peng, Huiming Zhang, Zhongyi Li
Organizations: School of Mathematical Sciences, Capital Normal University, 100048 Beijing, China · Wangxuan Institute of Computer Technology, Peking University, China, 100871 · Advanced Institute of Information Technology, Peking University · PKU-Wuhan Institute for Artificial Intelligence · Xiangjiang Laboratory, Changsha 410000, China · Guanghua School of Management, Peking University, Beijing, China, 100871 · School of Artificial Intelligence, Beihang University, 100191 Beijing, China
This paper studies generalization error bounds for Transformer models. Based on the offset Rademacher complexity, we derive sharper generalization bounds for different Transformer architectures, including single-layer single-head, single-layer multi-head, and multi-layer Transformers. We first express the excess risk of Transformers in terms of the offset Rademacher complexity. By exploiting its connection with the empirical covering numbers of the corresponding hypothesis spaces, we obtain excess risk bounds that achieve optimal convergence rates up to constant factors. We then derive refined excess risk bounds by upper bounding the covering numbers of Transformer hypothesis spaces using matrix ranks and matrix norms, leading to precise, architecture-dependent generalization bounds. Finally, we relax the boundedness assumption on feature mappings and extend our theoretical results to settings with unbounded (sub-Gaussian) features and heavy-tailed distributions.
Figures & tables
Model
Definition
Parameters
Single-Head
Eq. ( 2 )
WQK∈Rd×d,
Wv∈Rd×k,Wc∈Rk×d
Multi-Head
Eq. ( 3 )
{Wh,QK,Wh,v,Wh,c}h=1H
Multi-Layer
Eq. ( 5 )
{WQK(l),Wv(l),Wc(l)}l=1L
Table 1: Classification accuracies for naive Bayes and flexible Bayes on various data sets.