[Paper Review] A Lightweight CNN-Transformer Model for Learning Traveling Salesman Problems
This paper proposes a lightweight CNN-Transformer model that enhances spatial feature learning via a CNN embedding layer and reduces computational overhead through partial self-attention in the decoder. The model achieves state-of-the-art solution quality on TSP instances while reducing GPU memory usage by ~20% and inference time by 45% compared to prior Transformer-based models.
Several studies have attempted to solve traveling salesman problems (TSPs) using various deep learning techniques. Among them, Transformer-based models show state-of-the-art performance even for large-scale Traveling Salesman Problems (TSPs). However, they are based on fully-connected attention models and suffer from large computational complexity and GPU memory usage. Our work is the first CNN-Transformer model based on a CNN embedding layer and partial self-attention for TSP. Our CNN-Transformer model is able to better learn spatial features from input data using a CNN embedding layer compared with the standard Transformer-based models. It also removes considerable redundancy in fully-connected attention models using the proposed partial self-attention. Experimental results show that the proposed CNN embedding layer and partial self-attention are very effective in improving performance and computational complexity. The proposed model exhibits the best performance in real-world datasets and outperforms other existing state-of-the-art (SOTA) Transformer-based models in various aspects. Our code is publicly available at https://github.com/cm8908/CNN_Transformer3.
Motivation & Objective
- To address the high computational complexity and GPU memory usage of standard Transformer models in solving large-scale TSP instances.
- To improve spatial feature extraction in TSP by replacing standard embeddings with a CNN-based embedding layer.
- To reduce redundant attention computation in the decoder using partial self-attention, enhancing efficiency without sacrificing solution quality.
- To achieve better TSP solution quality with lower memory and faster inference than existing state-of-the-art Transformer-based models.
- To provide a more efficient and scalable deep learning solution for combinatorial optimization problems like TSP.
Proposed method
- Introduces a CNN-based embedding layer to better capture local spatial patterns in city coordinate inputs.
- Employs a modified Transformer decoder with partial self-attention that limits attention computation to only relevant tokens, reducing redundancy.
- Uses an auto-regressive decoding strategy with beam search to generate valid TSP tours while avoiding repeated city visits.
- Applies batch normalization in the encoder and decoder blocks, differing from standard layer normalization in prior models.
- Trains the model using supervised learning with tour length as the optimization objective.
- Enables larger batch sizes during training due to reduced memory consumption, improving training efficiency.

Experimental results
Research questions
- RQ1Can a CNN-Transformer hybrid model improve spatial feature learning for TSP compared to standard Transformers?
- RQ2Does partial self-attention in the decoder reduce computational overhead while maintaining or improving solution quality?
- RQ3Can the proposed model achieve better inference speed and lower GPU memory usage than state-of-the-art Transformer-based TSP solvers?
- RQ4How does the model perform on both synthetic random TSP instances and real-world TSP benchmarks like kroC100 and berlin52?
- RQ5To what extent can the model’s performance be enhanced by combining it with heuristic refinement techniques?
Key findings
- The proposed model reduces GPU memory usage by approximately 20% compared to the TSP Transformer model, enabling larger batch sizes.
- The model achieves 45% faster inference time than the TSP Transformer for TSP100, with an inference time of 51.33 seconds vs. 74.86 seconds.
- For kroC100, the model produces an average tour length of 21,523, outperforming the TSP Transformer’s 21,788.
- For berlin52, the model achieves an average tour length of 7,610, compared to 7,637 for the TSP Transformer.
- The model maintains a slightly higher number of parameters (1.43M) than the TSP Transformer (1.41M), but this is offset by improved efficiency and performance.
- The model demonstrates superior solution quality on both random and real-world TSP instances, with optimality gaps of 0.0004% for TSP50 and 0.39% for TSP100.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.