# Learning Theory of Transformers: Local-to-Global Approximation via Softmax Partition of Unity

*Zhongjie Shi, Wenjing Liao*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/152703) · [OpenReview](https://openreview.net/forum?id=R1SSvVTsSW) · [alphaXiv](https://www.alphaxiv.org/abs/2605.08811) · [Open on the map](../papers.html#p152703)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Transformer In-Context Reasoning](../pgroup/370.md) · Type: theory · Keywords: Transformer learning theory, function approximation, softmax partition of unity, approximation error, generalization bound

Areas: [Model Architectures & Sequence Modeling](../areas/architectures.md) › Language Model Architectures › Attention Replacement and Stabilization

## Summary
The paper introduces a constructive approximation framework for Transformers using a softmax partition of unity to achieve local-to-global approximation with near minimax-optimal generalization error.

## Explained to a 5-year-old
The paper looks at a kind of computer brain called a Transformer that tries to guess smooth patterns. It breaks the problem into many tiny local guesses and then smoothly blends them together. By using a special soft mixing rule, the small guesses add up to a good global guess. The theory shows that with just a few parts, the Transformer can get very close to the true answer using not too many pieces. This gives a better understanding of how Transformers can learn complicated tasks.

## Explained to a 5-year-old, longer
A Transformer is a computer model that can learn to do many things, like guessing numbers or patterns. The researchers wanted to understand how well it can learn smooth functions on a continuous space. They came up with a new idea where the model makes many small local guesses about the function. Each local guess focuses on a small region of the input space, like a tiny piece of a puzzle. The model then uses a soft blending rule to combine all these small guesses into one global guess. This blending is done by a softmax operation, which gives each local guess a weight based on its relevance. The combined guess is supposed to be very accurate, matching the true function across the whole domain. The theory shows that with only two layers of processing and a simple feed-forward network, the model can achieve any desired accuracy. The number of parameters needed grows in a predictable way: more accuracy requires more pieces, but not too many. They also proved that the model’s generalization error follows a near-optimal rate as more training data is given. This work helps explain why Transformers work well in practice and gives guidelines for designing efficient architectures. Overall, the paper provides a clear picture of how Transformers can approximate complex functions using local pieces and smooth merging.

## For a technical reader
The paper analyzes how a Transformer can approximate smooth functions by breaking the problem into many small local approximations and then blending them together. It shows that with just two encoder layers and simple feed-forward networks, the model can achieve any desired accuracy using a number of parameters that scales as ε-d/α for α-Hölder functions. The blending is performed via a softmax partition of unity, which gives each local piece a weight based on its relevance to the input. The theoretical results also provide a near-optimal generalization bound, indicating that the model’s performance improves predictably as more training data is supplied. This gives engineers a clearer understanding of why Transformers can capture complex patterns and how to design efficient architectures for regression tasks.

## Problem
Understanding how Transformers can approximate arbitrary functions on continuous domains is an open problem. The paper seeks to characterize the approximation capabilities of Transformers and provide theoretical guarantees on their performance for regression tasks.

## Method
The approach constructs local approximations of the target function using attention-based affine transformations, then aggregates them via a softmax partition of unity to produce a global approximation. It employs a dense Transformer with two encoder blocks and single-hidden-layer feed-forward networks, and provides approximation and generalization error bounds.

## Results
The approach achieves a uniform ε-approximation error with O(ε-d/α) parameters for α-Hölder functions and a near minimax-optimal generalization error of O(n-2α/(2α+d) log n) for the empirical risk minimizer.

## Contributions
It provides a constructive approximation framework that explains how Transformers can perform local-to-global approximation, proves parameter-efficient approximation rates, and derives near-optimal generalization bounds for regression on compact domains.

## Limitations and assumptions
The analysis assumes a dense, shallow and wide Transformer with softmax activation and sinusoidal positional encodings, and focuses on regression on compact Euclidean and Riemannian manifolds.

## Research questions this paper is counted under

- [How can we provide tight theoretical bounds on Transformers' generalization and approximation capabilities?](../q/817.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/152703)
