Abstract
This paper is devoted to the prediction of solutions to a stochastic discrete optimization problem. Through an application, we illustrate how we can use a state-of-the-art neural machine translation (NMT) algorithm to predict the solutions by defining appropriate vocabularies, syntaxes and constraints. We attend to applications where the predictions need to be computed in very short computing time -- in the order of milliseconds or less. The results show that with minimal adaptations to the model architecture and hyperparameter tuning, the NMT algorithm can produce accurate solutions within the computing time budget. While these predictions are slightly less accurate than approximate stochastic programming solutions (sample average approximation), they can be computed faster and with less variability.
Introduction
In the field of Operations Research (OR), solving discrete optimization problems—such as determining how to pack containers onto a train—is relatively straightforward when all parameters are known. However, real-world logistics are inherently stochastic, involving significant uncertainty. For example, when a railway company accepts a booking, the exact weight of the containers is often unknown.
Traditional methods like Sample Average Approximation (SAA) can handle this uncertainty but are computationally expensive, often requiring seconds or minutes to converge. In high-volume environments where decisions must be made in a fraction of a second (e.g., real-time web booking), these solvers are too slow. This research aims to bridge this gap by using Machine Learning (ML) to "predict" near-optimal tactical solutions based on partial information, treating the optimization task as a translation problem.
Methodology: Optimization as Translation
The core innovation of this work is treating an optimization solution as a "sentence" in a specialized language. The authors adapt a state-of-the-art Neural Machine Translation (NMT) architecture—specifically an RNN-based model with an attention mechanism (the Bahdanau et al. architecture).
Key technical components include:
- Sequence-to-Sequence Mapping: The input "phrase" describes the available railcars and containers, while the output "phrase" is a sequence of loading patterns.
- Probability Masking: To ensure the model produces feasible solutions that obey physical rules (e.g., not exceeding container capacity), the authors implement a "mask" in the output layer. This mask zeros out the probability of invalid tokens during the search process, enforcing hard constraints.
- Beam Search: Instead of simply selecting the single most likely next token, the model explores multiple high-probability paths to find the best overall sequence of loading decisions.
Datasets and Training
The authors generated a massive synthetic dataset based on the North American rail fleet to train and evaluate the model:
- Class A (Primary): 10 million instances used for training (64%), validation (16%), and testing (20%).
- Classes B, C, and D: Independent sets of 100,000 instances each, representing increasingly difficult scenarios (excess demand, excess supply, and large-scale problems) to test generalization.
- Ground Truth: Labels were generated using a standard Integer Linear Programming (ILP) solver under "full information" assumptions to create target optimal solutions.
Research findings indicated that after training on 6.4 million examples, doubling the data to 12.8 million did not improve performance. This suggests that for these types of problems, the bottleneck is model capacity rather than data volume.
Key Results and Insights
The NMT approach offers a compelling alternative to traditional solvers in time-sensitive applications:
- Speed: The NMT model generates solutions in roughly 25 milliseconds. In contrast, the SAA approach takes between 4 and 93 seconds, representing a speedup of several orders of magnitude.
- Accuracy: The NMT model achieved a discrepancy score ($D$) of 0.101, close to the theoretical lower bound of 0.079. While slightly less accurate than a full stochastic solver, it is sufficiently precise for tactical decision-making.
- Reliability: Unlike traditional solvers with high variance in computation time, the NMT approach provides extremely consistent response times, which is critical for stable IT infrastructure.
- Generalization: A model trained on "easy" problems (Class A) performed well on "harder" problems (Class B), though performance degraded on significantly larger-scale problems (Class D).
Conclusion and Future Work
This study demonstrates that combinatorial solutions can be effectively represented as ordered sequences of tokens, allowing OR problems to leverage advancements in Natural Language Processing. By using a probability mask, the authors successfully combined the "intuition" of neural networks with the "rigor" of rule-based systems.
Future research may explore Transformer architectures to potentially offer even more speed and capacity. Additionally, while the current model predicts "tactical" descriptions (quantities of types), extending the approach to provide full "operational" detail (specific slot assignments) remains a challenge for future development.
Summary updated