[KongchangAI]
· 2 min read· 1,029 words

Autoregressive Token Regression: How Transformers Learn Optimal Transport Plans

Autoregressive Token Regression: How Transformers Learn Optimal Transport Plans

ToR-OT uses an autoregressive Transformer to reformulate discrete optimal transport plan prediction as sequence generation, enabling zero-shot generalization and sparse decoding.

ToR-OT proposes using an autoregressive Transformer to directly predict discrete optimal transport (OT) plans, turning constrained optimization into sequence generation. The model exploits the sparsity of exact discrete OT solutions by decoding only non-zero elements, avoiding dense coupling outputs. After pretraining on synthetic OT instances, a single model generalizes zero-shot to unseen distribution pairs and heterogeneous cost metrics, achieving accuracy comparable to per-instance neural OT baselines on low-dimensional discrete problems. The authors explicitly state that ToR-OT is not a replacement for classical solvers, but a preliminary exploration of whether learned amortized models can internalize OT problem structure, offering new ideas for learned optimizers.

Optimal Transport (OT) is a classic framework for finding minimum-cost couplings between probability distributions, and traditional solvers have long held the gold standard. But a new paper proposes a different approach: using an autoregressive Transformer to directly predict discrete OT plans, turning the optimization problem into a sequence generation task. This method, called ToR-OT, does not aim to replace classical solvers, but rather to explore whether learned amortized models can internalize the structure of constrained optimization problems.

ToR-OT paper overview

Why OT is an ideal testbed for learned solvers

OT problems have a natural advantage: the true solution is known, marginal constraints are explicitly defined, and exact discrete solutions have well-characterized sparsity. This provides a clear evaluation benchmark for studying amortized models—whether the model truly learns the structure of the OT problem, rather than merely fitting the data distribution.

The authors point out that OT is an ideal testbed for studying whether learned amortized models can internalize the structure of OT-type problems. Because in this setting, we can directly compare model outputs with exact solutions from classical solvers, without relying on downstream task metrics for indirect evaluation.

Optimal transport problems are typically formulated as: given two probability distributions (or empirical samples), find a joint distribution (coupling) whose marginals equal the two given distributions and whose expectation with respect to some cost function is minimized. In the discrete case, this is equivalent to a linear programming problem with constraints including marginal constraints (fixed row and column sums) and non-negativity constraints. A key property of exact discrete OT solutions is that there exists an optimal solution whose number of non-zero elements does not exceed the sum of the support sizes of the two distributions minus one; this sparsity arises from the extreme point structure of basic feasible solutions in linear programming. It is precisely this explicit constraint and sparsity that make OT an ideal benchmark for evaluating whether amortized models learn the problem structure.

Core design of ToR-OT: turning OT into sequence generation

The core innovation of ToR-OT lies in problem reformulation: it decodes OT plans as structured sequences, rather than solving an optimization task at test time. Specifically, the model adopts autoregressive token regression, predicting the non-zero elements of the transport plan one by one.

This design exploits the inherent sparsity of discrete OT solutions—exact discrete solutions contain only a few non-zero entries. Therefore, the decoder only needs to predict non-zero terms, avoiding outputting a dense coupling matrix and significantly reducing the complexity of the output space.

Three key properties

The paper focuses on three properties of ToR-OT:

  1. Zero-shot generalization: After pretraining on a large corpus of synthetic OT instances, a single model can generalize to unseen distribution pairs and heterogeneous cost metrics without retraining.
  2. Sparse primal decoding: Leveraging the sparsity of exact discrete OT solutions, the decoder predicts only non-zero entries, avoiding dense coupling outputs.
  3. Amortized inference: On low-dimensional discrete problems, ToR-OT can produce accurate approximate plans, competitive with per-instance neural OT baselines.

Autoregressive token regression is a sequence generation paradigm in which the model predicts the next token based on the previously generated token sequence, commonly used in language modeling. In ToR-OT, the non-zero elements of each OT plan are serialized as tokens, and the model learns to generate these non-zero terms and their positions one by one, conditioned on the problem instance (such as the cost matrix and marginal distributions). Compared with directly regressing a dense matrix, this serialization reduces the output space from continuous high-dimensional to discrete sequences, and naturally fits the Transformer's attention mechanism. Amortized inference refers to the model learning a mapping from problem instances to solutions during training, so that at inference time only a single forward pass is needed to obtain an approximate solution, rather than rerunning iterative optimization algorithms for each new instance as traditional solvers do.

Experimental performance and positioning

On low-dimensional discrete problems, the accuracy of ToR-OT's approximate plans is comparable to neural OT baselines that require per-instance optimization. This means that after pretraining, the model can quickly produce good-quality solutions without re-solving for each new instance.

However, the authors explicitly state that ToR-OT is not yet a replacement for classical solvers. Its value lies in being a step of exploration: understanding how autoregressive Transformers learn the structure of constrained optimization problems like OT. This candid positioning is commendable—it does not overclaim superior performance, but places the work within a broader research context.

Implications for learned optimizers

The ToR-OT approach raises a more general question: can autoregressive models learn the structure of other constrained optimization problems? The sparsity and explicit constraints of OT problems make them an ideal starting point. If this method can be extended to more complex problems, it may open new paths for learned solvers.

However, the current limitations are also obvious: experiments focus on low-dimensional discrete problems, still far from high-dimensional continuous OT in practical applications. The scope of zero-shot generalization also needs more systematic validation. The paper itself acknowledges that this is preliminary exploration, and follow-up work is worth watching.

For researchers interested in AI for Science and learned optimizers, ToR-OT offers an interesting perspective: rather than designing complex neural architectures to approximate solvers, it is better to reformulate the problem as sequence generation, letting the Transformer learn the sparse structure of solutions at the token level.

One-line Summary

ToR-OT reformulates discrete optimal transport plan prediction as a sequence generation task using an autoregressive Transformer, achieving zero-shot generalization and sparse decoding.

Paragraph Summary

ToR-OT proposes using an autoregressive Transformer to directly predict discrete optimal transport (OT) plans, turning constrained optimization problems into sequence generation tasks. The model exploits the sparsity of exact discrete OT solutions by decoding only non-zero elements, avoiding dense coupling matrix outputs. After pretraining on synthetic OT instances, a single model can generalize zero-shot to unseen distribution pairs and heterogeneous cost metrics, and achieves accuracy comparable to per-instance neural OT baselines on low-dimensional discrete problems. The authors explicitly state that ToR-OT is not a replacement for classical solvers, but a preliminary attempt to explore whether learned amortized models can internalize the structure of OT problems, offering new ideas for learned optimizers.

#optimal transport#autoregressive Transformer#ToR-OT#sequence generation#learned optimizer#amortized inference#zero-shot generalization
Share:

Related articles