Multi-task Representation Learning for Mixed Integer Linear Programming

Junyang Cai, Taoan Huang, Bistra Dilkina

TL;DR

This paper introduces the first multi-task learning framework for machine learning-guided Mixed Integer Linear Programming (MILP) solving. By training a shared Graph Attention Network (GAT) to generate general-purpose MILP embeddings, the framework successfully guides solvers across distinct tasks like branching, primal heuristics, and solver configuration. The resulting multi-task model matches specialized models on their training distributions while significantly outperforming them when generalizing to larger problem sizes and entirely new tasks.

What Problem Does This Paper Address?

Mixed Integer Linear Programs (MILPs) are the workhorses of combinatorial optimization, used to solve NP-hard problems ranging from scheduling to network design. Recently, researchers have used machine learning (ML) to replace hand-crafted solver heuristics, predicting decisions like which variable to branch on or how to configure solver parameters.

However, existing ML-for-MILP approaches suffer from a major limitation: they are strictly single-task and highly specialized. Each task requires its own computationally expensive data collection and offline training pipeline. Because these models overfit to specific task dynamics and problem sizes, they lack the scalability and adaptability needed for practical, real-world deployment. The authors address this gap by asking: Can we learn a single, unified representation of a MILP problem that benefits multiple downstream optimization tasks?

Methods

The authors propose a two-step multi-task representation learning framework based on a bipartite graph representation of MILPs, where variables and constraints form the nodes.

Directly training a shared network on multiple tasks simultaneously usually fails due to "task competition," which causes severe oscillations in the loss curves. To circumvent this, the authors introduce a novel two-step training strategy:

  1. Step 1 (Representation Learning): They train a shared Graph Attention Network (GAT) architecture alongside multiple fixed, randomly initialized task-specific output layers. Forcing the network to perform well across multiple random initializations prevents it from overspecializing, ensuring it learns a robust, generalized MILP embedding.
  2. Step 2 (Task Fine-Tuning): The shared GAT architecture is frozen, and the task-specific output heads are fine-tuned using an InfoNCE contrastive loss function. This loss trains the model to distinguish high-quality solver decisions (positive samples) from poor ones (negative samples).

The framework is evaluated across three distinct MILP tasks:

  • Backdoors: Identifying a small subset of crucial binary variables to prioritize for root-node branching.
  • Predict-and-Search (PaS): Predicting optimal variable assignments to guide primal heuristics.
  • Solver Configuration: Dynamically tuning internal solver parameters (e.g., for the SCIP solver) based on the instance structure.
The proposed two-step multi-task learning framework for MILPs.

Datasets

The authors used Distributional-MIPLIB to generate synthetic datasets across three classic NP-hard problem domains:

  1. Combinatorial Auction (CA)
  2. Maximum Independent Set (MIS)
  3. Minimum Vertex Cover (MVC)

For each domain and task, they generated 200 small (S) instances for training, 100 small instances for testing, and 100 large (L) instances to evaluate size generalization. For example, in the MIS domain, small instances contained 1,250 to 6,000 nodes, while large instances scaled up to 9,000 nodes.

Key Insights and Ideas

  • Structural Synergy: MILPs originating from the same problem domain share fundamental structural characteristics. A shared representation layer can successfully exploit these similarities to benefit completely different algorithmic tasks (e.g., branching vs. parameter tuning).
  • The Power of Freezing Random Heads: Instead of alternating gradient steps across tasks—which biases the model toward one task—freezing multiple random heads forces the encoder to learn a stable, task-agnostic feature space.
  • Regularization via Multi-Tasking: Single-task models heavily overfit to the specific instance sizes they are trained on. Multi-task pre-training acts as a powerful regularizer, preserving the model's geometric understanding when scaling up to larger, unseen problem sizes.

Key Results

  • Competitive Same-Task Performance: On small instances, the multi-task model (Multi-task-BAPAS) performed on par with or slightly better than specialized single-task models. For Backdoor solve times, it achieved improvements of 4.04% (CA-S) and 6.05% (MIS-S) over the single-task baseline.
  • Superior Size Generalization: When tested directly on large (L) instances without retraining, single-task models degraded significantly—sometimes performing worse than the vanilla Gurobi solver. In contrast, the multi-task model excelled. On the MIS-L benchmark for the PaS task, the multi-task model achieved a Primal Integral of 2.23, obliterating the single-task model's score of 50.83 (where lower is better).
  • Excellent Cross-Task Generalization: In cross-task evaluations (training on two tasks and fine-tuning on a third), the multi-task approach consistently beat specialized models trained from scratch. For the Solver Configuration task, Multi-task-BAPAS achieved an average 11.3% improvement in primal integral over the single-task model across all three benchmarks.

Limitations and Future Work

The primary limitation acknowledged by the authors is that their framework currently relies on static features and performs one-time inference at the root node of the search tree. While this keeps inference overhead low, it prevents the model from adapting dynamically as the solver explores the Branch-and-Bound tree.

Future work will focus on integrating dynamic features during the search process and expanding the framework to support cross-domain generalization, moving closer to a true "foundation model" for mathematical optimization.

Summary updated

BibTeX
@inproceedings{cai2025multi,
  author = {Junyang Cai and Taoan Huang and Bistra Dilkina},
  title = {{Multi-task Representation Learning for Mixed Integer Linear Programming}},
  booktitle = {CPAIOR},
  year = {2025},
  doi = {10.1007/978-3-031-95973-8\_9},
}
Figure