Abstract
Tabular Prior-Data Fitted Network (TabPFN) is a foundation model designed for small to medium-sized tabular data. This paper investigates its application in Combinatorial Optimization (CO), specifically the Travelling Salesman Problem (TSP). By adopting a node-based adaptation strategy, we demonstrate that TabPFN can be fine-tuned in just two minutes using a single training sample. Our results show that this approach generalizes effectively across varying instance sizes (from 50 to 1000 nodes) and achieves solution quality comparable to state-of-the-art models that require significantly more data and compute.
Introduction
The Travelling Salesman Problem (TSP) remains one of the most studied NP-hard problems in combinatorial optimization. While exact solvers like Concorde provide optimal solutions, their computational cost scales poorly with problem size. Conversely, modern Machine Learning (ML) approaches offer rapid inference but are often hampered by intensive training requirements, sometimes requiring weeks of GPU time and millions of solved instances.
This research introduces a novel application of TabPFN—a Transformer-based foundation model originally designed for tabular classification and regression—to the TSP. The goal is to bridge the gap between the efficiency of ML-based solvers and the resource constraints of real-world deployment.
The Barriers to ML in Combinatorial Optimization
Traditional neural network architectures for TSP, such as Pointer Networks or Diffusion models, face four primary challenges:
- Prohibitive Training Time: High-end models often require over 20 days of training on specialized hardware (e.g., A100 GPUs).
- Scalability Issues: Models trained on small graphs (e.g., 50 nodes) frequently fail to generalize to larger graphs (e.g., 500+ nodes).
- Data Hunger: Learning the underlying spatial logic typically requires millions of labeled examples.
- Encoding Complexity: Representing a global graph structure leads to variable input sizes that are difficult for standard architectures to process efficiently.
Methodology: Adapting TabPFN
The authors leverage TabPFN-v2, which is pre-trained on synthetic datasets to perform Bayesian inference in a single forward pass. To apply this to TSP, the problem is reframed as a tabular task using a node-based approach.
Feature Engineering and Prediction
Instead of processing the entire graph, the model focuses on local context. For any given node, the input features consist of its 2D coordinates and the coordinates/distances of its $k$-closest neighbors. The model is then tasked with predicting the 2D coordinates of the next node in the optimal sequence.
Adaptation Strategy
The adaptation process is remarkably lean. The model is fine-tuned using only one 500-city TSP instance solved by Google’s OR-Tools. Because TabPFN-v2 is designed for single-output tasks, two separate models are trained: one for the X-coordinate and one for the Y-coordinate. This entire adaptation process is completed within approximately two minutes.
Decoding and Route Construction
During inference, the model predicts a "target" coordinate. The system then identifies the nearest unvisited node to this target using Euclidean distance and a softmax function. This sequential decoding continues until the route is complete.
Experimental Results
The model was evaluated against standard benchmarks (TSP-50, 100, 500, and 1000) and compared with baselines including Concorde (exact), LKH-3 (heuristic), and ML models like AM, DIFUSCO, and Fast-T2T.
Generalization and Performance
A key finding is the model's ability to generalize across scales. While many whole-instance models see performance collapse when moving from 50 to 1000 nodes, TabPFN remains stable. On TSP-1000, TabPFN (augmented with a standard 2-opt local search refinement) achieved a gap of only 5.31% from the optimal solution. In contrast, models like AM or Eformer showed gaps exceeding 30% on the same scale.
Sensitivity to Local Context
The choice of $k$ (number of neighbors) proved critical. Performance peaked at $k=5$. The authors noted that too few neighbors provide insufficient spatial context, while too many neighbors introduce "noise" that obscures the optimal path logic.
Discussion and Limitations
The success of this approach highlights the power of "local" context in CO. By focusing on neighborhoods rather than the entire map, the model becomes size-agnostic, allowing a model adapted on 500 nodes to perform well on 50 or 1000 nodes.
However, some limitations remain:
- Sequential Bottleneck: Node-by-node prediction prevents full parallelization during route construction, which may impact inference speed for extremely large problems.
- Coordinate Independence: Training separate models for X and Y coordinates is a workaround for current architectural limits; a native multi-output version might better capture spatial correlations.
- State Information: Future iterations could benefit from including "visited" status directly in the input features to improve global decision-making.
Conclusion
This study demonstrates that foundation models like TabPFN can be successfully adapted for complex combinatorial tasks with minimal resources. By requiring only a single training sample and minutes of fine-tuning, this methodology offers a promising path for deploying ML-based optimization solvers in environments where data and compute are limited. Future work will explore applying this framework to more complex problems, such as the Vehicle Routing Problem (VRP).
Summary updated