Exact Sequence Interpolation with Transformers - Alcalde Zafra, Albert; Fantuzzi, Giovanni; Zuazua Iriondo, Enrique (2026)
We prove that transformers can exactly interpolate datasets of finite input sequences in ℝd, d≥2, with corresponding output sequences of smaller or equal length. Specifically, given N sequences of arbitrary but finite lengths in ℝd and output sequences of lengths m1,…,mN∈ℕ, we construct a transformer with (∑Nj=1mj) blocks and (d∑Nj=1mj) parameters that exactly interpolates the dataset. Our construction provides complexity estimates that are independent of the input sequence length, by alternating feed-forward and self-attention layers and by capitalizing on the clustering effect inherent to the latter. Our novel constructive method also uses low-rank parameter matrices in the self-attention mechanism, a common feature of practical transformer implementations. These results are first established in the hardmax self-attention setting, where the geometric structure permits an explicit and quantitative analysis, and are then extended to the softmax setting. Finally, we demonstrate the applicability of our exact interpolation construction to learning problems, in particular by providing convergence guarantees to a global minimizer under regularized training strategies. Our analysis contributes to the theoretical understanding of transformer models, offering an explanation for their excellent performance in exact sequence-to-sequence interpolation task
https://cris.fau.de/converis/publicweb/Publication/356157450