Minimax-Optimal Transformer Classification for Functional Data with a Dense-Sparse Phase Transition

Shuoyang Wang, Yidan Tian, Guanqun CaoNeurIPS 2026

TL;DR

Transformers dominate discrete sequences like text, yet we barely understand their statistical limits when classifying continuous, infinite-dimensional data like brain scans or audio waves. The authors introduce a Functional Transformer (FT) classifier and prove it achieves near-optimal error rates without arbitrarily throwing away dimensions beforehand. Better yet, they uncover the exact mathematical tipping point where taking higher-resolution measurements of each sample stops improving your model.

What Problem Does This Paper Address?

Imagine classifying a patient’s health using an EEG wave or a 3D PET scan. In statistics, these inputs are treated as functional data—continuous curves or surfaces that live in an infinite-dimensional space, even though our sensors only record them on discrete, sometimes sparse grids.

Historically, to make the math work, statisticians relied on dimension-reduction techniques like Functional Principal Component Analysis (FPCA) or deep networks that assume a "finite truncation": the idea that only the top handful of underlying features matter, and the rest can be ignored. In messy scientific reality, however, the true decision boundary might depend on subtle, localized variations spread across infinitely many directions. Furthermore, while transformers are empirically great at sequence modeling, we have lacked rigorous statistical guarantees ("minimax excess-risk bounds"—essentially, proof that no algorithm could perform fundamentally better in the worst-case scenario) for classifying functional data under both sparse and dense sensor sampling.

Methods

To bridge the infinite-dimensional world of continuous functions and the sequence-based world of transformers, the authors build the Functional Transformer (FT) classifier from three sequential blocks:

Fig. 1: Schematic illustration of the proposed functional transformer (FT) classifier.
  • Functional Embedding Layer (New): Instead of chopping an image into raw pixel patches like a Vision Transformer (ViT), FT projects the input function onto an orthonormal basis (specifically, Fourier bases in their experiments). It passes these projection scores through a logistic function to neatly bound them between 0 and 1, then linearly maps them into a sequence of latent tokens. In theory, this sequence is infinite; in practice, it is truncated to a large number $J$ for computation.
  • Expanding Window Self-Attention (Modified): Rather than letting every token attend to every other token globally, FT uses multi-head self-attention restricted to a local window of size $U$ around each token's index. Crucially, $U$ isn't static—it scales up alongside your sample size ($n$) and sensor resolution ($m$).
  • Token Scoring & Readout (Standard): A shared, sparse ReLU neural network scores each attention-refined token individually. A weighted sum aggregates these scores into a final binary classification (+1 or -1), trained via standard hinge loss.

Datasets

The authors do not introduce new benchmarks, instead evaluating FT across simulated and established real-world datasets spanning 1D, 2D, and 3D domains:

  • Simulations: Six synthetic data-generating processes (DGP1–DGP6) covering 1D curves, 2D surfaces, and 3D volumes across varying sample sizes and grid resolutions.
  • Speech Recognition (1D): Log-periodogram curves for pairwise classification of spoken phonemes (aa vs. ao, aa vs. iy, and ao vs. iy).
  • Chest Radiographs (2D): Medical X-ray images classified as normal vs. abnormal.
  • ADNI PET Imaging (3D): Volumetric brain scans from the Alzheimer's Disease Neuroimaging Initiative, distinguishing Alzheimer's disease (AD) from early mild cognitive impairment (EMCI).

Key Insights and Ideas

  • You don't need hard cutoffs to tame infinity: By letting the attention window expand dynamically as more data arrives, self-attention naturally captures multiscale interactions across infinitely many functional directions—achieving minimax-optimal error rates (up to logarithmic factors) without upfront dimension-reduction assumptions.
  • The Dense-to-Sparse Phase Transition: Suppose you have $n$ subjects, and you measure each subject at $m$ grid points (resolution). How high does $m$ need to be? The authors prove a sharp phase transition. Below a critical threshold $m^*$, your error is bottlenecked by poor sensor resolution (the sparse regime). Above that threshold (the dense regime), discretization error becomes negligible, and your model performs just as well as if you had continuous, infinite-resolution measurements!
Fig. 2: Schematic illustration of the phase transition in excess risk for fixed n as m increases. The two transition thresholds are close, and their discrepancy is due only to a log n factor.
  • Less attention is sometimes more: In empirical ablations across 15 truncation levels, restricting the transformer to a local attention window consistently yielded lower error than using full, global attention, validating their theoretical architecture.

Key Results

Across simulations, FT achieved the lowest misclassification rates in all 1D settings and most 2D/3D settings. On real-world benchmarks, it proved both accurate and remarkably lightweight compared to standard vision backbones:

  • 1D Speech: FT swept all three tasks, dropping error on the tough aa vs. ao task to 19.13%, beating Functional DNNs (20.74%), CNNs (23.70%), and ViTs (24.47%).
  • 2D Chest X-Rays: FT took first place with a 22.14% error rate (beating ViT's 25.40% and CNN's 26.59%), while using ~23x less memory than ViT (83 MB vs. 1,898 MB) and ~41x less than CNN (3,426 MB).
  • 3D Brain Scans (ADNI): Under its initial tuning grid, FT came in a close second (11.61% error) to CNN (10.31%), while running 20x faster (0.26 mins vs. 5.27 mins) and using 21x less memory (87 MB vs. 1,867 MB). With an expanded hyperparameter validation grid, FT edged out CNN with a 10.02% error rate.

Limitations and Future Work

The authors note that their theoretical framework and architecture currently focus strictly on binary classification with evenly spaced, homogeneous functional inputs and single-layer local attention. Real-world medical records, however, often feature irregularly timed measurements or mixed data types (e.g., combining a 3D brain scan with scalar blood biomarkers). Extending this minimax theory to multi-class settings, irregular sampling grids, and deeper, multi-layer attention stacks is the natural next frontier.

Summary updated

Abstract

Despite the remarkable empirical success of transformer models in natural language processing, their theoretical foundations for functional data classification remain largely unexplored. This paper takes a first step toward closing this gap by developing a rigorous statistical framework for transformer-based functional classifiers. We show that a transformer architecture with an expanding attention window in the latent representation attains minimax-optimal excess-risk rates up to logarithmic factors in infinite-dimensional functional classification, without relying on conventional dimension-reduction procedures. Our analysis further reveals a dense-to-sparse phase transition: when the sampling frequency exceeds a critical threshold relative to the sample size, the proposed classifier achieves the optimal dense-observation rate; otherwise, we precisely characterize the degradation in convergence under sparse sampling. Extensive simulations and real-data experiments support the theory and demonstrate that transformers provide a competitive and theoretically justified approach to functional classification.
BibTeX
@inproceedings{wang2026minimax,
  author = {Shuoyang Wang and Yidan Tian and GUANQUN CAO},
  title = {{Minimax-Optimal Transformer Classification for Functional Data with a Dense-Sparse Phase Transition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=OXHtCTuaLv},
}
Figure