Exact sequence interpolation with transformers

Abstract We prove that transformers can exactly interpolate datasets of finite input sequences in $$\mathbb {R}^d$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msup> <mml:mrow> <mml:mi>R</mml:mi> </mml:mrow> <mml:mi>d</mml:mi> </mml:msup> </mml:math> , $$d\ge 2$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>d</mml:mi> <mml:mo>≥</mml:mo> <mml:mn>2</mml:mn> </mml:mrow> </mml:math> , with corresponding output sequences of smaller or equal length. Specifically, given N sequences of arbitrary but finite lengths in $$\mathbb {R}^d$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msup> <mml:mrow> <mml:mi>R</mml:mi> </mml:mrow> <mml:mi>d</mml:mi> </mml:msup> </mml:math> and output sequences of lengths $$m^1, \dots , m^N \in \mathbb {N}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:msup> <mml:mi>m</mml:mi> <mml:mn>1</mml:mn> </mml:msup> <mml:mo>,</mml:mo> <mml:mo>⋯</mml:mo> <mml:mo>,</mml:mo> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>N</mml:mi> </mml:msup> <mml:mo>∈</mml:mo> <mml:mi>N</mml:mi> </mml:mrow> </mml:math> , we construct a transformer with $$\mathcal {O}(\sum _{j=1}^N m^j)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:msubsup> <mml:mo>∑</mml:mo> <mml:mrow> <mml:mi>j</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> </mml:mrow> <mml:mi>N</mml:mi> </mml:msubsup> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>j</mml:mi> </mml:msup> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> blocks and $$\smash {\mathcal {O}(d \sum _{j=1}^N m^j)}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mpadded> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:mi>d</mml:mi> <mml:msubsup> <mml:mo>∑</mml:mo> <mml:mrow> <mml:mi>j</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> </mml:mrow> <mml:mi>N</mml:mi> </mml:msubsup> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>j</mml:mi> </mml:msup> <mml:mo>)</mml:mo> </mml:mpadded> </mml:math> 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 tasks.

Authors

Institutions

Publication Details

Journal
Mathematical Foundations of Machine Learning
Published
2026-05-11
DOI
https://doi.org/10.1007/s44439-026-00005-y
Primary Topic
Mathematical Analysis and Transform Methods
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Exact sequence interpolation with transformers

Giovanni Fantuzzi, Enrique Zuazua, Albert Alcalde
Mathematical Foundations of Machine Learning
Mathematical Analysis and Transform Methods
article

Exact sequence interpolation with transformers

Giovanni Fantuzzi, Enrique Zuazua, Albert Alcalde
article en

Abstract

Abstract We prove that transformers can exactly interpolate datasets of finite input sequences in $$\mathbb {R}^d$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msup> <mml:mrow> <mml:mi>R</mml:mi> </mml:mrow> <mml:mi>d</mml:mi> </mml:msup> </mml:math> , $$d\ge 2$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>d</mml:mi> <mml:mo>≥</mml:mo> <mml:mn>2</mml:mn> </mml:mrow> </mml:math> , with corresponding output sequences of smaller or equal length. Specifically, given N sequences of arbitrary but finite lengths in $$\mathbb {R}^d$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msup> <mml:mrow> <mml:mi>R</mml:mi> </mml:mrow> <mml:mi>d</mml:mi> </mml:msup> </mml:math> and output sequences of lengths $$m^1, \dots , m^N \in \mathbb {N}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:msup> <mml:mi>m</mml:mi> <mml:mn>1</mml:mn> </mml:msup> <mml:mo>,</mml:mo> <mml:mo>⋯</mml:mo> <mml:mo>,</mml:mo> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>N</mml:mi> </mml:msup> <mml:mo>∈</mml:mo> <mml:mi>N</mml:mi> </mml:mrow> </mml:math> , we construct a transformer with $$\mathcal {O}(\sum _{j=1}^N m^j)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:msubsup> <mml:mo>∑</mml:mo> <mml:mrow> <mml:mi>j</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> </mml:mrow> <mml:mi>N</mml:mi> </mml:msubsup> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>j</mml:mi> </mml:msup> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> blocks and $$\smash {\mathcal {O}(d \sum _{j=1}^N m^j)}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mpadded> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:mi>d</mml:mi> <mml:msubsup> <mml:mo>∑</mml:mo> <mml:mrow> <mml:mi>j</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> </mml:mrow> <mml:mi>N</mml:mi> </mml:msubsup> <mml:msup> <mml:mi>m</mml:mi> <mml:mi>j</mml:mi> </mml:msup> <mml:mo>)</mml:mo> </mml:mpadded> </mml:math> 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 tasks.

Mathematical Foundations of Machine LearningVol. 2(1)
Universidad de Deusto (ES), Friedrich-Alexander-Universität Erlangen-Nürnberg (DE), Universidad Autónoma de Madrid (ES)
Alexander von Humboldt-Stiftung, Deutsche Forschungsgemeinschaft, Ministerio de Economía y Competitividad, European Research Council, Air Force Office of Scientific Research, HORIZON EUROPE Marie Sklodowska-Curie Actions
Openalex Percentile: Top 4%
Mathematical Analysis and Transform Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.