Approximation Rate of the Transformer Architecture for Sequence Modeling
Haotian Jiang, Qianxiao Li
TL;DR
This work develops Jackson-type approximation rate results for a simplified, single-layer Transformer with one head, linking the model’s approximation power to a low-rank temporal coupling in target functions. By decomposing targets into pairwise temporal interactions and element-wise components via a POD-based temporal coupling, and by defining suitable complexity measures ($C_0$, $C_1^{(\alpha)}$, $C_2^{(\beta)}$), the authors derive explicit error bounds showing how the rate improves as the attention dimension $m_h$ and feed-forward budget $m_{FF}$ grow. The representation theorem confirms that any target can be expressed in the proposed target form, and numerical demonstrations with synthetic targets and ViT on CIFAR-10 support the theoretical insights, including practical low-rank patterns in real data. A comparative analysis with RNNs reveals that Transformers can be robust to temporal ordering changes but can be sensitive to temporal mixing, implying complementary strengths between the architectures. Collectively, the results illuminate when Transformers excel in sequence modeling and guide future work toward multi-heads, deeper architectures, and input preprocessing to mitigate temporal mixing.
Abstract
The Transformer architecture is widely applied in sequence modeling applications, yet the theoretical understanding of its working principles remains limited. In this work, we investigate the approximation rate for single-layer Transformers with one head. We consider a class of non-linear relationships and identify a novel notion of complexity measures to establish an explicit Jackson-type approximation rate estimate for the Transformer. This rate reveals the structural properties of the Transformer and suggests the types of sequential relationships it is best suited for approximating. In particular, the results on approximation rates enable us to concretely analyze the differences between the Transformer and classical sequence modeling methods, such as recurrent neural networks.
