Learning to Progressively Plan

Xinyun Chen, Yuandong Tian

Abstract

Combinatorial optimization (CO) is fundamental to numerous industrial and scientific domains, yet remains challenging due to the NP-hard nature of many problems. Traditional solvers rely on hand-tuned heuristics, while recent neural approaches often struggle with "one-shot" global predictions as problem scales increase. This paper presents NeuRewriter, a reinforcement learning framework that iteratively improves solutions through local rewriting. By factorizing the improvement process into "where to change" (Region-Picker) and "how to change" (Rule-Picker), NeuRewriter achieves state-of-the-art results in symbolic simplification, scheduling, and routing, often outperforming industry-standard solvers like Z3 and Google OR-tools.

Introduction

Finding optimal solutions in discrete spaces—such as logistics, job scheduling, or compiler design—is a cornerstone of computational efficiency. However, the lack of gradients in discrete combinatorial optimization (CO) makes iterative improvement difficult compared to continuous domains like robotics. Existing methods typically fall into two categories: brittle, expert-designed heuristics or neural models that attempt to predict a complete solution in a single pass. The latter approach often fails to generalize as the number of variables grows, as predicting a perfect global structure from scratch becomes exponentially difficult.

NeuRewriter bridges this gap by mimicking the iterative refinement process. Instead of constructing a solution from a blank slate, it learns a neural policy to perform local rewriting, progressively transforming a feasible (but likely sub-optimal) starting solution into a better one.

Methods: The NeuRewriter Architecture

The core innovation of NeuRewriter is a policy that transforms a solution through a sequence of local modifications. This policy is factorized into two distinct neural components:

  1. The Region-Picker: This component analyzes the current state (e.g., a parse tree or a schedule) and assigns scores to different local regions. A high score identifies a region where a rewrite is likely to yield the greatest improvement in the global cost function.
  2. The Rule-Picker: Once a region is selected, this component selects the most effective "rewriting rule" from a predefined set to apply to that specific area.
The NeuRewriter framework factorizes the rewriting process into selecting a region and then applying a rule.

The model is trained using Advantage Actor-Critic (A2C), where the reward is defined as the cumulative improvement in the cost function (e.g., reduction in expression length or tour distance). To handle various data structures, the framework utilizes specialized encoders: Tree-LSTMs for symbolic expressions, DAG-structured LSTMs for job dependency graphs, and Bi-directional LSTMs for routing sequences.

Experimental Evaluation

NeuRewriter was evaluated across three diverse domains to test its versatility and generalization capabilities:

  • Expression Simplification: Minimizing code length for 1.36M expressions generated from the Halide domain-specific language.
  • Online Job Scheduling: Optimizing resource allocation for 100K job sequences based on the "DeepRM" benchmark.
  • Vehicle Routing Problem (VRP): Solving capacitated VRP instances with up to 100 customer nodes.
Illustrations of local rewriting for (a) expression simplification, (b) job scheduling, and (c) vehicle routing.

Key Results and Insights

NeuRewriter demonstrated superior performance and efficiency across all benchmarks:

  • Performance vs. Heuristics: In expression simplification, it reduced average length by 52%, significantly outperforming the Z3-simplify tactic. In VRP20, it achieved an average tour length of 6.16, nearly matching the exact optimal of 6.10 and beating other neural baselines like the Attention Model (AM).
  • Computational Speed: The model was nearly 10x faster than advanced Z3 solvers and orders of magnitude faster than Google OR-tools in scheduling tasks (0.037s vs. 10s per instance).
  • Structural Generalization: A key advantage of local rewriting is its ability to generalize. Models trained on small instances (e.g., short expressions) effectively simplified much larger, unseen structures by applying learned local patterns.
  • Learning "Uphill" Moves: Interestingly, the model learned to apply moves that temporarily increase the cost function to escape local optima—a behavior analogous to how momentum helps in gradient descent.

Conclusion

NeuRewriter provides a robust framework for discrete optimization by learning to iteratively refine solutions. While it currently relies on predefined rule sets and may face challenges with massive top-to-bottom structural changes, its ability to outperform specialized solvers across multiple domains highlights its potential. Future work may explore extending this approach to hardware circuit design and automated theorem proving.

Summary updated

Abstract

For problem solving, making reactive decisions based on problem description is fast but inaccurate, while search-based planning using heuristics gives better solutions but could be exponentially slow. In this paper, we propose a new approach that improves an existing solution by iteratively picking and rewriting its local components until convergence. The rewriting policy employs a neural network trained with reinforcement learning. We evaluate our approach in two domains: job scheduling and expression simplification. Compared to common effective heuristics, baseline deep models and search algorithms, our approach efficiently gives solutions with higher quality.
BibTeX
@misc{chen2018learning,
  author = {Xinyun Chen and Yuandong Tian},
  title = {{Learning to Progressively Plan}},
  year = {2018},
  url = {https://openreview.net/forum?id=Op15LIVnumi},
}
Figure