Table of Contents
Fetching ...

Solving General Natural-Language-Description Optimization Problems with Large Language Models

Jihai Zhang, Wei Wang, Siyan Guo, Li Wang, Fangquan Lin, Cheng Yang, Wotao Yin

TL;DR

OptLLM tackles the barrier of translating natural-language optimization problems into solvable mathematical formulations by coupling LLMs with external solvers. The framework's Interaction Refinement, Converter, and Responser modules enable end-to-end modeling and solving with multi-round dialogue, while preserving data privacy and supporting both online and open-source LLMs. In experiments, a fine-tuned Qwen model (via LoRA) achieves higher formula-generation accuracy than prompt-based baselines and matches or surpasses GPT-4 on several tasks; the approach is deployed on Alibaba Cloud and demonstrated across three example applications. The work highlights a practical, privacy-aware path to democratize optimization problem solving with LLMs, and suggests future directions in richer data integration and reasoning.

Abstract

Optimization problems seek to find the best solution to an objective under a set of constraints, and have been widely investigated in real-world applications. Modeling and solving optimization problems in a specific domain typically require a combination of domain knowledge, mathematical skills, and programming ability, making it difficult for general users and even domain professionals. In this paper, we propose a novel framework called OptLLM that augments LLMs with external solvers. Specifically, OptLLM accepts user queries in natural language, convert them into mathematical formulations and programming codes, and calls the solvers to calculate the results for decision-making. In addition, OptLLM supports multi-round dialogues to gradually refine the modeling and solving of optimization problems. To illustrate the effectiveness of OptLLM, we provide tutorials on three typical optimization applications and conduct experiments on both prompt-based GPT models and a fine-tuned Qwen model using a large-scale selfdeveloped optimization dataset. Experimental results show that OptLLM works with various LLMs, and the fine-tuned model achieves an accuracy boost compared to the promptbased models. Some features of OptLLM framework have been available for trial since June 2023 (https://opt.alibabacloud.com/chat or https://opt.aliyun.com/chat).

Solving General Natural-Language-Description Optimization Problems with Large Language Models

TL;DR

OptLLM tackles the barrier of translating natural-language optimization problems into solvable mathematical formulations by coupling LLMs with external solvers. The framework's Interaction Refinement, Converter, and Responser modules enable end-to-end modeling and solving with multi-round dialogue, while preserving data privacy and supporting both online and open-source LLMs. In experiments, a fine-tuned Qwen model (via LoRA) achieves higher formula-generation accuracy than prompt-based baselines and matches or surpasses GPT-4 on several tasks; the approach is deployed on Alibaba Cloud and demonstrated across three example applications. The work highlights a practical, privacy-aware path to democratize optimization problem solving with LLMs, and suggests future directions in richer data integration and reasoning.

Abstract

Optimization problems seek to find the best solution to an objective under a set of constraints, and have been widely investigated in real-world applications. Modeling and solving optimization problems in a specific domain typically require a combination of domain knowledge, mathematical skills, and programming ability, making it difficult for general users and even domain professionals. In this paper, we propose a novel framework called OptLLM that augments LLMs with external solvers. Specifically, OptLLM accepts user queries in natural language, convert them into mathematical formulations and programming codes, and calls the solvers to calculate the results for decision-making. In addition, OptLLM supports multi-round dialogues to gradually refine the modeling and solving of optimization problems. To illustrate the effectiveness of OptLLM, we provide tutorials on three typical optimization applications and conduct experiments on both prompt-based GPT models and a fine-tuned Qwen model using a large-scale selfdeveloped optimization dataset. Experimental results show that OptLLM works with various LLMs, and the fine-tuned model achieves an accuracy boost compared to the promptbased models. Some features of OptLLM framework have been available for trial since June 2023 (https://opt.alibabacloud.com/chat or https://opt.aliyun.com/chat).
Paper Structure (22 sections, 7 figures, 2 tables)

This paper contains 22 sections, 7 figures, 2 tables.

Figures (7)

  • Figure 1: OptLLM framework consists of three main modules: (1) Interaction Refinement Module, Step 1 to 4 (marked in orange), interact with the user to get a complete problem description in natural language; (2) Converter Module, Step 5 to 9 (marked in blue), converts problem description to math formulas and codes; and (3) Responser Module, Step 10 to 15 (marked in green), calls the solver, checks and interprets its results, and responses to the user.
  • Figure 2: Overview of Application 1. The user provides a complete description for an optimization problem. The 'Formulator' translates it into formulas, then 'Coder' generates the corresponding MAPL code. At last, 'Interpreter' receives the solver output and interprets it with natural language. The user input, formulas and code can be directly edited and the rest parts will be re-generated.
  • Figure 3: Overview of Application 2. OptLLM attempts to guide user to provide the necessary information for an optimization problem and then provide the answer directly to the user. The math formulas and codes are hidden.
  • Figure 4: Overview of LoRA (low-rank adaption).
  • Figure 5: Flowchart for data collection.
  • ...and 2 more figures