Efficient Training of Multi-task Neural Solver with Multi-armed Bandits

Chenguang Wang, Tianshu Yu · DOI

Abstract

Training a single neural network to solve multiple types of combinatorial optimization problems (COPs) is notoriously expensive and difficult to balance due to task interference. This paper introduces a novel training paradigm that utilizes Multi-Armed Bandits (MAB) and a gradient-based influence matrix to dynamically select the most impactful task to train at each step. By mathematically decomposing the loss and constructing a reward mechanism for the bandit algorithm, the proposed framework produces a unified solver that outperforms traditional multi-task and single-task approaches. Experimental results demonstrate that this method achieves superior generalization with significantly less computational overhead, being approximately 14x faster than standard multi-task baselines.

Introduction

Combinatorial Optimization Problems (COPs), such as the Traveling Salesman Problem (TSP) and the Vehicle Routing Problem (VRP), are fundamental challenges in logistics, finance, and manufacturing. While deep learning has enabled the creation of high-performing "neural solvers," these models are typically specialized for a single problem type and scale. Developing a "generalist" solver capable of handling diverse tasks simultaneously presents two major hurdles: extreme computational costs and task interference (negative transfer), where learning one task degrades performance on another.

Methods

The proposed framework employs an Encoder-Decoder architecture where a shared encoder extracts features across all tasks, while lightweight task-specific headers and decoders handle unique problem constraints.

Task Selection via Multi-Armed Bandits

The core innovation is a dynamic task selection strategy. Instead of training on all tasks in every iteration—a process that is both slow and memory-intensive—the authors treat task selection as a Multi-Armed Bandit problem.

  1. Influence Matrix: By calculating the cosine similarity of gradients, the model constructs an "intra-task influence matrix." This matrix quantifies the degree of knowledge transfer between any two tasks.
  2. Reward Construction: The authors prove through theoretical loss decomposition that the change in loss for a task set can be optimized by selecting tasks that provide the most beneficial transfer. This transfer value serves as the "reward" for the MAB.
  3. Exp3 Algorithm: The framework uses the Exp3 algorithm to sample one task to train at each time step, favoring those with higher predicted rewards for the overall system.
Overview of the proposed multi-task training framework. An encoder-decoder architecture is combined with a Multi-Armed Bandit (MAB) algorithm to select the most beneficial task for training at each step.

Experimental Setup and Results

The method was evaluated on 12 distinct tasks across four COP types: TSP, Capacitated VRP (CVRP), Orienteering Problem (OP), and Knapsack Problem (KP), at various scales (e.g., 20 to 200 nodes/items).

Performance and Generalization

Under a fixed training budget, the MAB-based approach achieved an average optimality gap of 0.643%, significantly better than single-task training (1.574%) and naive multi-task training (1.551%). Furthermore, the unified solver exhibited strong zero-shot generalization, outperforming specialized models on large-scale instances (e.g., TSPLib and CVRPLib) despite being trained primarily on smaller scales.

Computational Efficiency

A key advantage of this approach is its efficiency. By training only one task per iteration, the method avoids the linear scaling of complexity with the number of tasks ($N$). As shown in the complexity analysis, the proposed method reduces the basic training complexity from $\mathcal{O}(N(F+B))$ to $\mathcal{O}(F+B)$.

Comparison of computational complexity and GPU hours. The proposed method ('Ours') significantly reduces training time compared to state-of-the-art multi-task learning balancers.

Discussion and Key Insights

The influence matrix revealed that different COP types (e.g., TSP vs. KP) are often orthogonal, meaning they occupy distinct parameter subspaces and do not interfere—but also do not assist—one another. Conversely, tasks within the same problem type show high mutual influence, though training on vastly different scales can occasionally lead to negative transfer. The MAB algorithm effectively navigates these relationships to optimize the training schedule.

Limitations

While the encoder is shared, the model still relies on task-specific headers and decoders. Future work may explore fully unified architectures or "foundation models" for COPs. Additionally, while the framework is model-agnostic, further testing on diverse architectures like Graph Neural Networks or Pointer Networks is needed to confirm its broad applicability.

Conclusion

This research presents a scalable and efficient path toward general-purpose neural solvers for combinatorial optimization. By framing task selection as a bandit problem informed by gradient influence, the framework overcomes the traditional trade-offs between specialization and generalization in multi-task learning.

Summary updated

BibTeX
@misc{wang2023efficient,
  author = {Chenguang Wang and Tianshu Yu},
  title = {{Efficient Training of Multi-task Neural Solver with Multi-armed Bandits}},
  year = {2023},
  eprint = {2305.06361},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.06361},
}
Figure