Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers

Colin Wei, Yining Chen, Tengyu Ma

Introduction

For decades, "Universal Approximation" theorems have served as the foundational justification for neural network architectures. These theorems essentially guarantee that if a network is sufficiently large, it can represent any continuous function. However, this theoretical expressivity often fails to translate into practical utility. Many classical proofs rely on unrealistic assumptions, such as infinite precision—storing an infinite amount of information in a single weight—or exponentially large parameter counts to merely "memorize" a function.

In practice, machine learning relies on a model's ability to learn a function from a finite number of training samples. Recognizing the massive gap between a model being expressive enough to hold a solution and being statistically learnable enough to find it, researchers have introduced a new theoretical framework: Statistically Meaningful (SM) Approximation. This framework demands that an approximating network not only represent a target function but also exhibit strict statistical learnability.

The Framework: Statistically Meaningful Approximation

The core premise of SM-Approximation is that a function class successfully approximates a target only if there exists a surrogate loss such that the empirical risk minimizer (the model obtained after training) generalizes well to the broader population.

By forcing models to be statistically learnable, this framework naturally steers theoretical constructions away from the "precision trap" of infinite-precision weights and toward more realistic, finite-precision representations. To prove their results under this new framework, the authors introduce several novel methodological techniques:

  • All-Layer Margin: Traditional analyses often evaluate the margin only at the output layer. This paper introduces a "parameter-based all-layer margin" to measure how stable the entire network is to perturbations in any of its weights.
  • Correction Functions: In very deep networks—such as a Transformer executing many computational steps—errors compound rapidly. The authors insert "correction layers" that act as rounding functions. This resets the internal signal to a clean state, ensuring a large margin is maintained throughout the network's depth.
  • Binary Positional Encodings: Previous work often used high-precision scalars to represent time steps when simulating Turing Machines. By utilizing binary encodings instead, the model can operate with significantly lower precision requirements (scaling with $\log \log T$ rather than $\log T$).

Case Studies and Key Results

Because this is a theoretical exploration, the paper does not evaluate standard empirical datasets like ImageNet or GLUE. Instead, it tests the SM-Approximation framework on abstract functional classes: Layered Boolean Circuits and Bounded Turing Machines. The "data" consists of input-output pairs generated by these mathematical constructs.

1. Boolean Circuits and the Distraction of Width

In classical VC-dimension theory, increasing a network's width generally weakens its generalization guarantees. However, under the SM-Approximation framework, the authors prove that overparameterized feedforward ReLU networks can approximate Boolean circuits with a sample complexity that depends on the intrinsic complexity of the target (the circuit size $s$), and is only logarithmic with respect to the network's width $w$. This demonstrates that massive overparameterization does not inherently destroy learnability if the target function is simple.

2. Transformers and Turing Machines

The most striking insight of the paper is its application to Transformers simulating Turing Machines. The authors demonstrate that encoder-decoder Transformers can SM-approximate any Turing Machine with a computation time $T$.

Crucially, the required sample complexity is polynomial in the alphabet size, the state space size, and—most importantly—only scales with $\text{poly}(\log T)$. This logarithmic scaling means that learning to simulate a process that runs for a billion steps is not exponentially harder than learning one that runs for a thousand steps, provided the underlying computational logic remains the same. This is an exponential improvement over previous theories that relied on infinite precision.

Limitations and Future Directions

While SM-Approximation provides a powerful new lens for theoretical machine learning, the authors acknowledge several limitations and avenues for future work:

  • Discrete vs. Continuous Functions: The "correction function" trick relies on rounding, which works beautifully for discrete logic like Boolean gates and Turing Machines. It remains unclear how to adapt this technique for continuous functions (e.g., fluid dynamics or smooth manifolds) where signals cannot simply be rounded to the nearest bit.
  • The Optimization Gap: The paper successfully addresses the statistical problem of generalization, assuming we can find the empirical risk minimizer. However, it leaves the algorithmic problem unresolved: it does not guarantee that standard optimization techniques like gradient descent will actually converge to these large-margin solutions in a reasonable timeframe.
  • Architectural Comparisons: The authors propose that SM-Approximation could serve as a rigorous metric for comparing different neural architectures. Future research could use this framework to mathematically explain why Transformers outperform RNNs on specific tasks by comparing their respective sample complexities under SM-Approximation.

Ultimately, this work introduces vital new tools for generalization bounds—providing much tighter sample complexity guarantees than typical VC-dimension or norm-based bounds—and takes a significant step toward aligning neural network approximation theory with practical machine learning.

Summary updated

BibTeX
@inproceedings{wei2022statistically,
  author = {Colin Wei and Yining Chen and Tengyu Ma},
  title = {{Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=VOyYhoN_yg},
}
Figure