                                             Neural Genetic Search in Discrete Spaces

range of self-improvement approaches, such as beam search               Table 1. Results on TSP and CVRP. Gap (%) is measured using
(Joshi et al., 2021; Choo et al., 2022), sampling (also called          Concorde (Applegate et al., 2006) for TSP and PyVRP (Wouda
best-of-N) (Kool et al., 2019), and Monte Carlo Tree Search             et al., 2024) for CVRP. “Time” shows the average duration needed
(Qiu et al., 2022), and active searches (Bello et al., 2016;            to solve a single instance.
                                                                                                               N = 200           N = 500
Hottung et al., 2022; Son et al., 2023) are also employed for
refining solutions at test time.                                                                         Gap (%)     Time     Gap (%)    Time
                                                                                Concorde                     -         1s        -       10s
                                                                                LKH3 (Helsgaun, 2017)      0.001      10s      0.022     32s
5. Experiments                                                                  GNN (Kim et al., 2025)
                                                                                 + Sampling                0.307      2s       1.827     10s
To verify the effectiveness and versatility of the proposed                      + BS (w = 1000)           1.378       4s      20.637    18s
method, we conduct extensive experiments on solving rout-




                                                                         TSP
                                                                                 + MCTS                    0.164      20s      1.324     60s
ing problems (Section 5.1), red-teaming language models                          + ACO                     0.294       5s      1.733     17s
(Section 5.2), and molecular optimization (Section 5.3). The                     + NGS (Ours)              0.028      5s       0.322     17s
code is available at https://github.com/hyeonahkimm/ngs.                         + Sampling (long)         0.130      16s      1.479     101s
                                                                                 + MCTS (long)             0.126      100s     1.268     300s
                                                                                 + ACO (long)              0.102       47s     1.162     167s
5.1. Routing Problems                                                            + NGS (Ours, long)        0.011      50s      0.110     170s
                                                                                PyVRP                        -       4.0m        -      21.0m
In this section, we evaluate ours on various routing problems
                                                                                LKH3 (Helsgaun, 2017)      0.304     2.4m      0.182    18.6m
to verify how NGS efficiently explores the combinatorial
                                                                                GNN (Kim et al., 2025)
solution space at test time. We consider four classic routing                    + Sampling                1.487       4s      1.982      7s
                                                                         CVRP
problems — Traveling Salesman Problem (TSP), Capaci-                             + BS (w = 1000)           2.659       4s      2.624      7s
tated Vehicle Routing Problem (CVRP), Prize-Collecting                           + ACO                     1.485       7s      1.975     14s
TSP (PCTSP), and Orienteering Problem (OP) — all of                              + NGS (Ours)              0.981       8s      1.840     15s

which have been widely studied in both genetic algorithm                         + Sampling (long)         1.104     0.7m      1.738     1.2m
                                                                                 + ACO (long)              1.055     1.2m      1.684     2.3m
and deep learning research. Detailed descriptions for each                       + NGS (Ours, long)        0.126     1.3m      1.502     2.5m
task are provided in Appendix C.
                                                                        Table 2. Experiment on TSP with an autoregressive model. We
5.1.1. E XPERIMENTAL S ETUP                                             adopt the pretrained model from LEHD. “Time” is measured as
Implementation details. Following Joshi et al. (2021), we               the average duration needed to solve a single instance.
adopt a graph neural network (GNN) to generate an edge                                               N = 200              N = 500
heatmap for a given problem instance G. The heatmap                                                   Gap (%)      Time      Gap (%)    Time
serves as a policy that provides the conditional distribution             LEHD + RRC                   0.020       5.07m      0.172     16.5m
of which edge to select. This heatmap-based approach has                  LEHD + Sampling              0.022       0.14m      0.376     1.46m
been widely adopted in prior works (Kool et al., 2022; Ye                 LEHD + NGS (Ours)            0.004       0.18m      0.152     1.48m
et al., 2023; Kim et al., 2025) thanks to its simplicity and
scalability to large instances.3 We train the GNN for each
setting of the problem following the advanced off-policy                5.1.2. R ESULTS
reinforcement learning algorithm suggested by Kim et al.                As shown in Table 1, in TSP and CVRP with the number
(2025) to obtain the pretrained GNN. All training and testing           of nodes 200 and 500, NGS achieves significantly smaller
are performed three times independently.                                optimality gaps than the search baselines. Notably, NGS out-
Baselines. To validate the effectiveness of our method as               performs both Sampling (long) and ACO (long), which used
a test-time search method, we compare ours against var-                 10× larger search budget except for CVRP with N = 500,
ious search algorithms while using the same pretrained                  demonstrating its search efficiency. Moreover, Figure 4 illus-
GNN. These search algorithms include sampling (best-of-                 trates that NGS consistently delivers significant performance
N), beam search (BS; Joshi et al., 2021), Monte Carlo Tree              gains in all routing problems considered. These results un-
Search (MCTS; Qiu et al., 2022), and ant colony optimiza-               derscore the flexibility and broad applicability of NGS. It
tion (ACO; Ye et al., 2023; Kim et al., 2025). Note that the            is noteworthy that all the search algorithms are based on
ACO-based search of Kim et al. (2025) has already achieved              the same pre-trained neural network, i.e., all searches start
comparable results to state-of-the-art learning-based meth-             from the same heatmap; the only difference resulting in the
ods for routing problems; see details in Appendix B.1.                  huge performance gaps between the algorithms is the search
                                                                        procedure. We omit standard deviations for this benchmark
   3
    Heatmap-based approaches are often referred to as “non-             due to their negligible values, but Figure 5 shows ± 1-std
autoregressive” methods in that they only call the neural network       error ranges across three independent runs. More results are
once to generate a heatmap.
                                                                        provided in Appendix E.1.

                                                                    6
