NL4Opt Competition: Formulating Optimization Problems Based on Their Natural Language Descriptions

Rindranirina Ramamonjison, Timothy T. L. Yu, Raymond Li, Haley Li, Giuseppe Carenini, Bissan Ghaddar, Shiqi He, Mahdi Mostajabdaveh, Amin Banitalebi-Dehkordi, Zirui Zhou, Yong ZhangNeurIPS 2021 · DOI

Abstract

The NL4Opt competition at NeurIPS 2022 addressed the challenge of automatically converting natural language optimization problem descriptions into formal algebraic models. The competition was structured into two sub-tasks: Named Entity Recognition (NER) to identify problem components and a generation task to produce the mathematical formulation. This paper reviews the winning methodologies, including transformer ensembles and XML-tagging strategies. Notably, the study finds that general-purpose large language models like ChatGPT can surpass specialized models in formulation accuracy, highlighting new directions for accessible operations research tools.

Introduction

Operations Research (OR) provides mathematical frameworks for solving complex decision-making problems in fields such as supply chain management and urban planning. However, a significant "accessibility gap" exists because translating a business problem described in natural language into a machine-interpretable algebraic model typically requires a domain expert. This manual process is often slow, costly, and prone to error. The NL4Opt competition sought to automate this semantic parsing task, enabling non-experts to leverage powerful optimization solvers directly from text descriptions.

Methodology

The competition decomposed the problem into two sequential sub-tasks to facilitate modular development and evaluation.

Task 1: Named Entity Recognition (NER)

The first task involved identifying the fundamental "building blocks" of an optimization problem within the text. Models were required to label specific spans as variables, constraint limits, constraint directions (e.g., "at least", "no more than"), and objective names.

Task 1 workflow for recognizing problem entities from natural language descriptions.

Winning approaches for NER primarily utilized ensembles of transformer models, such as DeBERTa and XLM-RoBERTa. These teams improved model robustness through extensive data augmentation—including synonym replacement—and adversarial training techniques.

Task 2: Generation of Mathematical Formulations

The second task required taking the identified entities and generating a precise logical representation of the linear programming (LP) problem.

Task 2 workflow for generating mathematical formulations from recognized entities.

The most successful strategies for generation moved beyond standard sequence-to-sequence architectures. Instead, they employed "entity tagging," where input text was augmented with XML-like markers (e.g., <var>savings</var>) to help the model align textual mentions with mathematical variables. Models like BART-large were then used to generate the final algebraic formulation.

Dataset and Evaluation

The competition introduced the NL4Opt Dataset, which contains 1,101 annotated Linear Programming Word Problems (LPWPs) spanning six domains: sales, advertising, investment, production, transportation, and sciences. To evaluate the generalizability of the models, the dataset was split into 713 training samples from three "source" domains, while the development (99 samples) and test (289 samples) sets included three entirely different "target" domains.

Results and Discussion

The competition results demonstrated significant improvements over baseline models. In the NER task, the top F1 score reached 0.939 (Team Infrrd AI Lab), compared to a baseline of 0.906. For the generation task, Team UIUC-NLP achieved a top accuracy of 0.899, a substantial increase over the BART-base baseline of 0.610.

A key finding emerged from post-competition analysis: ChatGPT (GPT-3.5-turbo) achieved an accuracy of 0.927 on the combined task using zero-shot prompting. This performance surpassed the winning specialized models, suggesting that large-scale general models are increasingly effective for complex semantic parsing tasks without the need for task-specific fine-tuning.

Conclusion

While the NL4Opt competition showed that automated formulation is becoming feasible, several challenges remain. Current datasets focus on well-defined word problems, whereas real-world descriptions are often ambiguous or contain irrelevant information. Furthermore, while LLMs show high accuracy, they can still produce "silly" errors in coefficients or constraints that would be catastrophic in high-stakes optimization. Future research must focus on improving the reliability and verifiability of these systems to build trust with non-expert users.

Summary updated

BibTeX
@misc{ramamonjison2021nl,
  author = {Rindranirina Ramamonjison and Timothy T. L. Yu and Raymond Li and Haley Li and Giuseppe Carenini and Bissan Ghaddar and Shiqi He and Mahdi Mostajabdaveh and Amin Banitalebi-Dehkordi and Zirui Zhou and Yong Zhang},
  title = {{NL4Opt Competition: Formulating Optimization Problems Based on Their Natural Language Descriptions}},
  year = {2021},
  eprint = {2303.08233},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.08233},
}
Figure