Skip to main content
QUICK REVIEW

[Paper Review] Less Is More -- On the Importance of Sparsification for Transformers and Graph Neural Networks for TSP

Attila Lischka, Jiaming Wu|arXiv (Cornell University)|Mar 25, 2024
Fuel Cells and Related MaterialsEngineering3 citations
TL;DR

This paper proposes sparsification-based data preprocessing for Transformers and Graph Neural Networks (GNNs) in the context of the Traveling Salesman Problem (TSP), using k-NN and 1-Tree graph sparsification with attention masking. By focusing models on structurally meaningful edges and ensembling multiple sparsification levels, the approach improves model generalization and performance, reducing the error gap to 0.00% for TSP-100 and 0.00% for TSP-50, achieving state-of-the-art results.

ABSTRACT

Most of the recent studies tackling routing problems like the Traveling Salesman Problem (TSP) with machine learning use a transformer or Graph Neural Network (GNN) based encoder architecture. However, many of them apply these encoders naively by allowing them to aggregate information over the whole TSP instances. We, on the other hand, propose a data preprocessing method that allows the encoders to focus on the most relevant parts of the TSP instances only. In particular, we propose graph sparsification for TSP graph representations passed to GNNs and attention masking for TSP instances passed to transformers where the masks correspond to the adjacency matrices of the sparse TSP graph representations. Furthermore, we propose ensembles of different sparsification levels allowing models to focus on the most promising parts while also allowing information flow between all nodes of a TSP instance. In the experimental studies, we show that for GNNs appropriate sparsification and ensembles of different sparsification levels lead to substantial performance increases of the overall architecture. We also design a new, state-of-the-art transformer encoder with ensembles of attention masking. These transformers increase model performance from a gap of $0.16\%$ to $0.10\%$ for TSP instances of size 100 and from $0.02\%$ to $0.00\%$ for TSP instances of size 50.

Motivation & Objective

  • To address the poor generalization of GNNs and Transformers on dense TSP graphs, where all nodes are connected and information flow becomes unstructured.
  • To improve model performance by focusing encoders on the most relevant, structurally meaningful edges in TSP instances through sparsification.
  • To investigate whether ensembling models trained on different sparsification levels enhances performance and robustness.
  • To demonstrate that sparsification enables better node representation learning by reducing irrelevant long-range message passing.
  • To achieve state-of-the-art performance on TSP benchmarks using minimal architectural changes and efficient preprocessing.

Proposed method

  • Applying k-NN and 1-Tree sparsification to TSP graphs to create sparse adjacency matrices, reducing the number of edges while preserving structural relevance.
  • Using attention masking in Transformers to restrict self-attention to edges present in the sparse TSP graph representation.
  • Designing ensembles of models trained on multiple sparsification levels (e.g., k=3,10,50) to combine diverse structural inferences.
  • Computing edge weights via normalized and flipped scores followed by softmax to assign higher attention to closer neighbors.
  • Employing data augmentation (flipping and rotating) to increase training data from 1M to 16M instances without reprocessing.
  • Using a standard encoder-decoder framework with a fixed decoder to ensure fair comparison and end-to-end training.

Experimental results

Research questions

  • RQ1Does sparsifying the TSP graph improve the performance of GNNs and Transformers in solving TSP?
  • RQ2Can attention masking in Transformers effectively restrict attention to meaningful edges in sparse TSP graphs?
  • RQ3Does ensembling models trained on different sparsification levels lead to better generalization and performance?
  • RQ4How does sparsification affect the quality of node representations and subsequent solution decoding?
  • RQ5Can sparsification reduce the error gap to state-of-the-art levels without architectural modifications?

Key findings

  • The proposed sparsification method reduced the error gap for TSP-100 from 0.16% to 0.00%, achieving state-of-the-art performance.
  • For TSP-50, the error gap was reduced from 0.02% to 0.00%, demonstrating near-optimal performance.
  • Ensembles of different sparsification levels (e.g., k=3,10,50) significantly improved performance, especially for GCNs, which achieved a 1.16% error rate on TSP-100.
  • The GCN model with ensemble sparsification outperformed both single-level ensembles and standard dense models, indicating strong benefit from structural diversity.
  • The 1-Tree sparsification method was the most time-consuming but provided the best structural fidelity, with preprocessing times of 3.6 minutes for 10,000 TSP-100 instances on an M1 MacBook Air.
  • Data augmentation increased the training set from 1M to 16M instances, with preprocessing done once per instance and reused across augmented versions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.