Evaluating Curriculum Learning Strategies in Neural Combinatorial Optimization
Abstract
Neural combinatorial optimization (NCO) aims at designing problem-independent and efﬁcient neural network-based strategies for solving combinatorial problems.
The ﬁeld recently experienced growth by successfully adapting architectures originally designed for machine translation.
Even though the results are promising, a large gap still exists between NCO models and classic deterministic solvers, both in terms of accuracy and efﬁciency.
One of the drawbacks of current approaches is the inefﬁciency of training on multiple problem sizes.
Curriculum learning strategies have been shown helpful in increasing performance in the multi-task setting.
In this work, we focus on designing a curriculum learning-based training procedure that can help existing architectures achieve competitive performance on a large range of problem sizes simultaneously.
We provide a systematic investigation of several training procedures and use the insights gained to motivate application of a psychologically-inspired approach to improve upon the classic curriculum method.
Introduction
Attention and sequence-to-sequence models have recently been shown capable of approximating solutions to combinatorial problems [3, 19, 28].
However, a large performance gap still exists between those models and the exact [1] or heuristic [5, 12, 17, 22, 24] solvers.
So far, researchers have mostly focused on training separate models for each problem size.
The ability of a model to perform well across a larger range of sizes simultaneously has been mostly overlooked.
Training and testing on individual problem sizes misleadingly diminishes the performance gap between neural combinatorial optimization (NCO) solutions and solvers.
While algorithms are often designed to provide bounded approximation [5, 17, 24], NCO requires an ensemble of models to achieve similar performance, which can be prohibitive in industrial applications [2].
Curriculum learning (CL) is based on the premise that neural networks learn faster from tasks gradually increasing in complexity [4, 9].
CL algorithms used for scheduling tasks are called sampling strategies .
The naïve strategy often leads to catastrophic forgetting and decline of efﬁciency.
Adaptive staircase [21], a strategy developed in psychophysics, incorporates rehearsal and adjustment of difﬁculty to the current capacity, which were shown to signiﬁcantly improve performance in multitask learning [20].
In this work we assess CL as an effective training procedure to help a recent state-ofthe-art NCO model [19] achieve competitive performance on a range of problem sizes simultaneously.
We provide a novel application of the CL framework in NCO.
Our assessment of the model’s performance on problem sizes other than it was trained on shows that the extent of knowledge that can be transferred between tasks changes smoothly with problem size.
Investigation of several baseline strategies shows a clear beneﬁt from rehearsal and training on problems of increasing difﬁculty.
These insights serve to motivate a psychologically-inspired approach that improves upon classic CL.
Background
Travelling Salesperson Problem.
The travelling salesperson problem (TSP) is a combinatorial problem in which we look for the shortest path through n cities, visiting each city exactly once, and return to the origin.
The NCO model we utilize was designed to operate on the Euclidean TSP, which requires the distances between the cities to be deﬁned using the Euclidean metric.
Imposing such a restriction allows for clear visualizations and direct comparison of the results with previous research.
The problem was shown to be NP-complete [1], but in practice we can ﬁnd solutions within a reasonable time frame, using highly optimized solvers, like Concorde [1].
TSP can be formulated as a search for an optimal permutation of input cities.
Following the notation from [19], let π = { π 1 , . . .
π n } , where each element π i ∈ { 1 , .
. . , n } is a node index, such that π i (cid:54) =
π j ∀ i (cid:54) =
j .
Given a distance matrix D , where input elements D ij correspond to a cost of travel between a city i and a city j , our objective is to ﬁnd a permutation resulting in a tour of minimal length L ( π ) = (cid:80)
ni
=1 D π i π i +1 .
Evaluation Metric.
Comparing the performance of combinatorial problems that differ in complexity is challenging and often requires domain-speciﬁc knowledge.
A commonly used metric is the approximation ratio R ( x, y )
=
f ( y ) OPT ( x ) between the score f ( y ) of an approximate feasible solution y to a problem instance x , and the score of an optimal solution OPT ( x ) [16, 18].
Constant factor approximation algorithms are expected to be no worse than a given ratio, independent of the problem size.
For TSP the objective f
( y ) =
L ( π ) .
Most of the previous work in NCO [3, 19, 28] uses a variant of the approximation ratio, called the optimality gap (cid:0) R ( x, y ) − 1 (cid:1) , and propose using a
Concorde solution as a reference point in the ratio [3, 19, 28].
In this work we calculate the optimality gap w.r.t.
the Held-Karp (HK) lower bound [11], as it is independent of any software, well understood in the combinatorial optimization community [6], and easy to implement.
Neural Combinatorial Optimization.
Most of the recent advances in NCO are based on sequenceto-sequence models [3, 15, 28], attention models [19], or graph neural networks 2 (GNN) [8, 14].
Solutions inspired by successful applications in machine translation [25] do not carry forward directly to TSP, as the the models depend on a ﬁxed dictionary.
Pointer Networks [28] train an attention mechanism to point back to the input, which eschews the need for a separate dictionary and allows for training on graphs of variable size.
Reinforcement learning was later shown to provide a more suitable speciﬁcation of the objective function for combinatorial problems than supervised learning [3, 19].
The attention model (AM), proposed by [19], builds upon the empirical evidence that pure attention-based models tend to outperform their recurrent neural network counterparts on sequence prediction tasks [7, 26], mainly due to improvements in algorithmic efﬁciency and regularization effects.
While graph convolutional networks show better performance on individual problem sizes, the attention-based methods provide comparable results with better generalization [13, 14].
Curriculum Learning.
Curriculum learning (CL) is a training procedure that utilizes knowledge transfer between tasks of increasing difﬁculty and devises an efﬁcient task sampling strategy.
While the difﬁculty of a problem can be deﬁned with respect to the capability of a model to solve it, we impose a further restriction and assume a global ordering of tasks, with a direct correspondence between the problem’s size and its difﬁculty level.
CL attemps to exploit a neural network’s ability to facilitate learning solutions to difﬁcult tasks with the knowledge of simpler ones.
Recently, there has been a lot of focus on algorithms that can automate the process of designing curricula for speciﬁc applications, particularly those stemming from reinforcement learning [10, 23].
Adaptive staircase.
Adaptive staircase is an improved CL strategy adapted from psychophysics to deep reinforcement learning [21].
At each step, the strategy determines if it is either: ready to advance to a more difﬁcult task, backtrack, or train on a task at the current difﬁculty level.
In the base case, the agent is always trained on a task of the current difﬁculty level t .
The alternative is a probe case, where the task is sampled uniformly from a range [1 , t ] .
The base and probe cases are chosen equiprobably at each trial.
The level is incremented to t + 1 when the agent achieves a certain performance threshold α after observing N base base trials.
Probe trials contribute to training, but the agent is not evaluated on them.
The number of base trials per task can either be constant or can be proportional to the current difﬁculty level: N base ∝ t .
Experiments and discussion
To test the effectiveness of CL in improving NCO performance on a range of problem sizes, we performed two experiments.
We started by analyzing the ability of the AM model [19] to solve tasks on which it was not trained.
The results showed the limitations of knowledge transfer between the models, which prompted our investigation of several different sampling strategies: (i) single task, (ii) stochastically sampled range of tasks, and (iii) two curriculum learning approaches.
In all the experiments we used REINFORCE with a greedy rollout baseline with a learning rate η = 10 − 3 .
Training each of the methods for 100 epochs took ≈ 50 hours on 4 P100 GPUs, depending of the dominant size of the problem.
Following [19], we initialized parameters with Uniform ( − 1 / √ d, 1 / √ d ) for the input dimension d .
Every epoch the network used 2,500 batches of 512 samples.
As a metric we chose the optimality gap, reported as percentage, between the average cost returned by the model and the HK lower bound estimate computed over 10 4 TSPs per problem size.
For the smallest problem sizes (4–9) we ran exhaustive search over 10 5 TSPs to reduce the variability.
To quantify the capability of the model to generalize to other tasks we trained 147 models from TSP 4 to 150, and tested them on sizes 10 to 300.
HK lower bounds for this experiment were extrapolated from the available representative set.
Each of the models was initialized with the parameters of a model pretrained in a classic curriculum fashion, and subsequently trained for 20 epochs.
Fig.
2 shows the performance matrix, in a form of a heat map, where each row corresponds to the performance of a model trained on a single task when tested on a range of tasks from 10 to 300.
In the second experiment, we compared six sampling strategies (Fig. 1).
Following previous work [3, 19, 28], we ﬁrst trained three models on ﬁxed problem sizes 20, 50 and 100.
For the rest of the strategies, we trained the model on a set of TSPs from 4 (the minimal meaningful problem size) to 100.
We started with a baseline (uniform) stochastic model that selected a task randomly at each epoch.
Then we tested the two CL approaches — the classic approach of monotonically increasing problem sizes, and the adaptive staircase.
[Figure]
We start the discussion by observing that the performance of models trained on neighboring tasks is correlated (Fig. 3, Fig. 2).
The ﬁgures show that the performance of different models can be delineated by a skewed Gaussian centered at the task on which the model was trained.
The ability of the model to solve problems close in size suggests a large knowledge transfer, which occurs with widening spread but smaller magnitude as the problem size increases (Fig. 2).
Moreover, a drift from smaller problem sizes implies that a successful sampling strategy must be able to balance small and large problem sizes.
[Figure]
[Figure]
a i n i n g p r o b l e m s i z e
Test Optimality
(% over HK bound)
The optimality gap is measured with respect to the HK lower
[Figure]
Throughout the course of training (Fig. 1), the models that do not visit the previous problems along with the new ones show initial improvement in performance, but as soon as the network reaches a certain epoch the performance decays for the tasks that are further away.
This shows the limitation of knowledge transfer and exposes catastrophic forgetting.
The model trained with uniform sampling (Fig. 3) is the closest in performance to a constant factor approximator, but its optimality gap across all the problem sizes is larger than most of the other methods.
We conclude that balancing the problem sizes naïvely does not lead to an overall improvement in performance.
Knowledge transfer discrepancies, catastrophic forgetting and lack of efﬁciency prompted our investigation of curriculum-based methods.
Classic curriculum learning consolidates knowledge from observed tasks and delivers a more consistent performance across all the tasks as compared to the baseline.
However, the method still results in catastrophic forgetting (Fig. 1), as the cues learned from solving smaller problem sizes are not helpful enough to the model to retain that knowledge.
One way to alleviate forgetting is to combine rehearsing with incremental learning.
We propose to use adaptive staircase, a method previously applied to train a reinforcement learning agent in a psychophysics environment [21].
The experiment was run by scheduling tasks according to the probe case with α = 0 .
05 threshold on the optimality gap to advance the task difﬁculty.
If performance α was not attained after a full epoch we decremented the task.
We set the number of base trials (batches) per epoch to (10+current_graph_size - min_graph_size) /
(max_graph_size - min_graph_size) .
To make sure that the number of probe trials did not exceed the number of batches available to the other sampling strategies, we stopped training one epoch earlier than the other strategies.
This resulted in ≈ 1 .
6% reduction in the amount of data exposed to this strategy.
Fig. 1 and Fig.
3 both show that adaptive staircase results in the best trade-off between forgetting and average performance across problem sizes.
Conclusion
In this work we have assessed the ability of an attention-based NCO model to perform well on a large range of problem sizes.
We found that knowledge transfer between tasks is measurable and changes smoothly, but is otherwise limited and cannot be ignored when designing a sampling strategy.
Curriculum learning provides a convenient framework that takes into account complexity and knowledge transfer between tasks.
The classic approach of training on tasks monotonically increasing in complexity suffers from catastrophic forgetting.
Our analysis demonstrates the need for rehearsal of less complex samples during training.
By choosing an efﬁcient rehearsal-based sampling strategy, adaptive staircase, we were able to show both the usefulness of curriculum learning in neural combinatorial optimization and provide important evidence supporting the applicability of a biologically-inspired method to an emerging area of deep learning.
Acknowledgments and Disclosure of Funding
The authors would like to thank Vithursan Thangarasa for preliminary discussions.
We also thank
Irwan Bello from Google Brain as well as our lab colleagues, Magdalena Sobol and Angus Galloway, for their support in reviewing this manuscript.