Neural Combinatorial Optimization (NCO) has promised to revolutionize how we solve complex logistics problems like the Traveling Salesman Problem (TSP). By training neural networks to "learn" heuristics, we can solve problems faster than traditional solvers. However, there’s a catch: a model trained on 100 cities usually fails miserably when asked to route 10,000.
A new paper from researchers at the Southern University of Science and Technology introduces Test-Time Projection Learning (TTPL), a framework that uses Large Language Models (LLMs) to bridge this scalability gap without ever needing to retrain the underlying neural network.
TL;DR
The authors introduce TTPL, a framework that uses LLMs to automatically design "projection strategies" (coordinate transformations) that make massive, complex routing problems look like the small, simple ones a neural network was trained on. This approach allows a model trained on just 100 nodes to achieve state-of-the-art performance on problems with up to 100,000 nodes, reducing optimality gaps by over 80% in some cases.
What Problem Does This Paper Address?
The core issue in NCO is distributional shift. When we solve a massive 10,000-node problem, we usually use a "divide and conquer" approach: look at a small neighborhood (K-Nearest Neighbors) of the current city and decide where to go next.
However, the distribution of these local neighborhoods in a 10,000-node map looks nothing like the uniform 100-node maps used during training. To the neural network, the test data looks unfamiliar, leading to poor decisions and massive "optimality gaps" (the difference between the AI's solution and the best possible solution). Traditionally, fixing this required manual engineering of normalization functions or expensive retraining.
Methods
The authors propose a two-pronged "distribution adapter" that works entirely during the inference (testing) phase:
- Test-Time Projection Learning (TTPL): Instead of a human writing a normalization function, the authors use an LLM as an evolutionary optimizer. The LLM is prompted to write Python code for coordinate projection. The framework evaluates the code's performance on a small validation set, provides feedback to the LLM, and iterates. Over several generations, the LLM "evolves" a highly specialized projection strategy that transforms test-time subgraphs into a distribution the pre-trained model understands.
- Multi-View Decision Fusion (MVDF): To handle local density variations (like clusters of cities), the authors use data augmentation. They rotate and flip the local subgraph to create multiple "views." The model predicts the best next move for each view, and these are fused together to make a more robust final decision.
Datasets
The study evaluates the method on a variety of challenging scenarios:
- Synthetic Benchmarks: TSP and Capacitated Vehicle Routing Problems (CVRP) ranging from 1,000 to 100,000 nodes.
- Real-World Benchmarks: Standard libraries including TSPLIB and CVRPLIB, which contain non-uniform, real-world city distributions.
- Cross-Distribution Sets: Instances featuring specific patterns like "clusters," "explosions," and "implosions" to test robustness.
Key Insights and Ideas
- LLMs as Heuristic Designers: The most striking idea is using LLMs not to solve the routing problem directly, but to write the preprocessing code that helps another AI solve it. LLMs prove surprisingly adept at geometric reasoning and code synthesis for normalization.
- Zero-Shot Scalability: The framework is "plug-and-play." You can take a model trained years ago on 100 nodes and, using TTPL, suddenly apply it to 100,000 nodes without touching the original model's weights.
- Distribution Alignment is Everything: The paper proves that the failure of NCO on large scales isn't necessarily a lack of "intelligence" in the model, but a simple failure to align the input data with what the model saw during its "childhood" (training).
Key Results
The results are a significant leap over previous "direct generalization" methods:
- Massive Gap Reduction: On TSP100K (100,000 nodes), a standard backbone model (LEHD) had a staggering 121.42% optimality gap. With the TTPL projection, that gap plummeted to just 3.24%.
- Outperforming Heuristics: TTPL-enhanced models outperformed traditional strong heuristics and other NCO baselines across almost all scales.
- Real-World Success: On the TSPLIB benchmark, the method reduced the average optimality gap from 17.72% to 3.88% in greedy mode. When combined with post-search techniques, the gap dropped to a tiny 1.37%.
Limitations and Future Work
- Optimization Time: While the inference is fast, the "evolutionary" phase where the LLM searches for the best projection strategy is relatively slow, taking several hours to find the optimal code for a specific scale.
- LLM Dependency: The quality of the projection depends on the LLM's ability to follow complex geometric instructions and write bug-free PyTorch code.
- Future Directions: The authors plan to investigate more efficient LLM optimization operators to speed up the "evolution" phase and explore even more complex routing constraints.
Source Code: https://github.com/CIAM-Group/TTPL
Summary updated