Introduction
Operations Research (OR) is essential for optimizing complex systems, from supply chain logistics to resource allocation. However, a significant "translation gap" exists between domain experts, who describe problems in natural language, and optimization solvers, which require precise mathematical formulations. Traditionally, bridging this gap requires specialized OR expertise to manually translate word problems into code—a process that is time-consuming, costly, and inaccessible to non-experts.
The OptGen Framework
To address this, we introduce OptGen, an augmented intelligence system designed to automatically translate natural language problem descriptions into mathematical optimization models. OptGen leverages a novel two-stage mapping approach ($p \to r \to f$) to ensure both linguistic context and mathematical precision are preserved.
Two-Stage Mapping and Technical Innovations
The core of OptGen is its transition through an Intermediate Representation (IR):
- Text-to-IR Mapping: The system first generates an IR using XML-like tags (e.g.,
<VAR> trust </VAR>). This format maintains the connection between the problem's narrative context and its mathematical components. - IR-to-Formulation: A deterministic parser converts the structured IR into a canonical tabular format (coefficients for variables and constraints) compatible with standard solvers.
Several key technical innovations power this process:
- Prompt-Guided Generation: Built on the BART architecture, the model utilizes "declaration prompts" from an initial Entity Tagger (XLM-RoBERTa). These prompts act as contextual triggers, guiding the decoder to focus on specific constraints or variables.
- Copy Mechanism: To ensure numerical accuracy—where a single decimal error can invalidate a model—a pointer-generator-style copy mechanism extracts parameters (e.g., "15%", "$60,000") directly from the source text.
- Human-in-the-Loop Interface: An intuitive UI allows users to review, edit, and validate suggested formulations before execution.
The LPWP Dataset
A major contribution of this work is the Linear Programming Word Problems (LPWP) dataset. Comprising 1,101 problems across diverse domains (e.g., investment, production, transportation), LPWP provides a high-quality benchmark for training and testing semantic parsing in OR. The dataset was meticulously verified by researchers to ensure mathematical correctness and linguistic diversity.
Experimental Results and Insights
OptGen was evaluated against standard BART baselines and state-of-the-art Text-to-Table (T2T) models. While T2T models often overfit to specific training domains, OptGen demonstrated superior generalization to out-of-domain tasks.
- Target (Out-of-Domain) Accuracy: OptGen achieved 63% accuracy on new application domains, significantly outperforming the T2T model's 39%.
- The Importance of IR: By maintaining a linguistic link between variables (e.g., "savings") and their mathematical representations ($y$), the IR prevents the loss of logic that occurs in direct math-table mapping.
- Criticality of Copying: Ablation studies revealed that removing the copy mechanism caused a 30% drop in accuracy on new domains, highlighting its necessity for mathematical reliability.
Conclusion and Future Directions
OptGen represents a significant step toward democratizing Operations Research. By automating the formulation process, it allows non-experts to leverage powerful optimization tools. Future work will focus on expanding the system's scope beyond Linear Programming to include Mixed-Integer and non-linear constraints, as well as developing automated error-correction models to further refine the human-in-the-loop experience.
Summary updated