Learning with Local Search MCMC Layers

Germain Vivier-Ardisson, Mathieu Blondel, Axel Parmentier · Submission to ICLR 2026 · Rejected

TL;DR

Bridging operations research heuristics and machine learning, this paper turns local search moves (like 2-opt or node relocations) into proposal distributions for discrete Metropolis-Hastings Markov Chain Monte Carlo (MCMC). This creates a differentiable, stochastic optimization layer that allows neural networks to learn end-to-end with inexact, heuristic solvers—slashing training times while maintaining theoretical guarantees.

What Problem Does This Paper Address?

Integrating combinatorial optimization (CO) algorithms directly into neural networks—often called decision-focused learning (DFL) or "predict-then-optimize"—allows models to make predictions tailored to downstream combinatorial tasks (e.g., predicting delivery times directly to minimize fleet routing costs).

However, existing differentiable combinatorial layers (such as perturbed optimizers or continuous relaxations) generally assume access to an exact solver or maximum a posteriori (MAP) oracle. In practice, real-world problems like vehicle routing, scheduling, or packing are NP-hard. Practitioners routinely rely on local search heuristics (like simulated annealing or genetic algorithms) rather than exact solvers. When inexact heuristics are plugged into current DFL frameworks, theoretical convergence guarantees break down, gradients become unreliable, and training can be prohibitively slow.

Methods

The authors open the "black box" of local search heuristics by framing them as MCMC samplers:

  1. Local Search as Metropolis-Hastings (MH): Traditional local search evaluates neighboring candidate solutions via predefined neighborhood moves. By fixing the temperature $t$ and adding an acceptance ratio, simulated annealing becomes a standard MH sampler targeting the Gibbs distribution: $$\pi_{\theta,t}(y) \propto \exp\left(\frac{\langle \theta, y \rangle + \varphi(y)}{t}\right)$$ The layer’s forward pass estimates the marginal expectation $\hat{y}_t(\theta) = \mathbb{E}_{\pi_{\theta,t}}[Y]$.

  2. Efficient Neighborhood Mixture MCMC: Real-world local searches combine multiple neighborhood operators (e.g., relocate, swap, 2-opt). Naively mixing them requires computing an intractable normalizer across all possible forward/reverse moves. The authors propose an efficient scheme: sample the move type $s$ first, then apply an individual correction ratio $\alpha_s(y, y')$, targeting the exact same stationary distribution with minimal compute.

  3. Fenchel-Young Losses & Contrastive Divergence:
  4. The gradient of the Fenchel-Young loss $\ell_t$ associated with $\hat{y}_t$ is simply $\nabla_\theta \ell_t(\theta; y) = \hat{y}_t(\theta) - y$.
  5. The authors prove that even when running a single MCMC iteration ($K=1$), the stochastic update is an unbiased gradient of an explicit target-dependent Fenchel-Young loss $\ell_{\Omega_y}$.
  6. To avoid slow mixing, chains are initialized using ground-truth targets (in conditional settings) or persistent chains (in unconditional settings).

Datasets

The authors evaluate their layer across three domains:

  • Dynamic Vehicle Routing Problem with Time Windows (DVRPTW): Benchmark from the EURO Meets NeurIPS 2022 Vehicle Routing Competition (30 training, 15 validation, 25 test instances; 50–100 requests per wave).
  • Multi-Dimensional Knapsack Problem (MKP): A synthetic benchmark of 5,000 instances generated with the PyEPO library ($d = 100$ items, $M = 50$ constraints), solved with Gurobi ILP for ground-truth labels.
  • Synthetic Polytope Prediction: Unconditional parameter estimation tasks on the binary hypercube $\{0, 1\}^d$ and top-$\kappa$ polytope / hypersimplex (tested up to $d = 1000$).

Key Insights and Ideas

  • Local search and MCMC are two sides of the same coin: Operations research metaheuristics already define sophisticated, feasibility-preserving graph neighborhoods. Reinterpreting these move operators as proposal distributions provides a natural transition kernel on discrete, constrained combinatorial spaces.
  • Bias does not prevent convergence: While a short-run Markov chain produces a biased estimate of the full Gibbs expectation, it provably still converges almost surely to the empirical loss minimizer under standard stochastic gradient assumptions.
  • Smart initialization is essential: Initializing MCMC chains at random solutions produces high-variance, biased gradients that degrade performance. Initializing at ground-truth solutions (akin to contrastive divergence) accelerates mixing and yields high performance even with small iteration budgets $K$.

Key Results

  • DVRPTW (Low-Budget Regimes): Under tight computational constraints during training, the proposed layer drastically outperforms the competition-winning perturbed heuristic baseline (PC-HGS). At a 1 ms forward-pass budget, the proposed method achieves 7.8% relative cost (compared to an offline optimal oracle) versus 65.2% for the baseline; at 10 ms, it achieves 6.3% vs. 8.7%.
  • Multi-Dimensional Knapsack:
  • Achieves the lowest test relative regret (18.42%, compared to 27.92%–31.15% for PyEPO baselines including SPO+, Perturbed Fenchel-Young, and NCE).
  • Decreases forward+backward runtime per batch to 0.005s (approx. 40× faster than Perturbed Fenchel-Young at 0.198s, and 8× faster than SPO+ at 0.044s).
  • Exhibits substantially lower gradient covariance trace, confirming stable training updates.

Limitations and Future Work

  • Neighborhood Design Overhead: The user must explicitly define symmetric/reversible proposal mechanisms and calculate individual proposal ratios for their specific combinatorial problem.
  • Highly Constrained Search Spaces: If valid moves between feasible solutions are sparse or disconnected, Markov chains can struggle to mix effectively without careful neighborhood engineering.
  • Future Work: The authors propose extending this MCMC framework to Large Neighborhood Search (LNS) heuristics, where subproblems within an expanded neighborhood are solved to optimality via exact sub-oracles.

Summary updated

BibTeX
@inproceedings{vivierardisson2025learning,
  author = {Germain Vivier-Ardisson and Mathieu Blondel and Axel Parmentier},
  title = {{Learning with Local Search MCMC Layers}},
  booktitle = {DiffCoALG @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=SksmqlJk00},
}
Figure