Measure-to-measure interpolation using Transformers
Borjan Geshkovski, Philippe Rigollet, Domènec Ruiz-Balet
TL;DR
This work treats Transformers as measure-to-measure flows on the unit sphere, formalizing token sequences as evolving probability measures under a nonlinear continuity equation. It provides a constructive, explicit parameter scheme—piecewise-constant in time—that enables a single Transformer to approximately map N input measures to N target measures, under transport-compatibility assumptions. The key steps are disentangling overlapping supports, clustering inputs into discrete atoms, and then matching these atoms to targets via neural-ODE flows, with rigorous bounds on the number of switches and the resulting approximation error in Wasserstein distance. The results illuminate the expressive power of attention-based models for arbitrary input measures and offer a principled protocol for measure transport using deep architectures, with detailed complexity considerations for the required controls.
Abstract
Transformers are deep neural network architectures that underpin the recent successes of large language models. Unlike more classical architectures that can be viewed as point-to-point maps, a Transformer acts as a measure-to-measure map implemented as specific interacting particle system on the unit sphere: the input is the empirical measure of tokens in a prompt and its evolution is governed by the continuity equation. In fact, Transformers are not limited to empirical measures and can in principle process any input measure. As the nature of data processed by Transformers is expanding rapidly, it is important to investigate their expressive power as maps from an arbitrary measure to another arbitrary measure. To that end, we provide an explicit choice of parameters that allows a single Transformer to match $N$ arbitrary input measures to $N$ arbitrary target measures, under the minimal assumption that every pair of input-target measures can be matched by some transport map.
