LLaMoCo: Instruction Tuning of Large Language Models for Optimization Code Generation
Abstract
Recent research on optimization using large language models (LLMs) typically involves either iterative next-step solution seeking or directly prompting LLMs to generate critical optimization codes. However, these methods often suffer from low computational efficiency, high sensitivity to prompt design, and a lack of domain-specific knowledge. We introduce LLaMoCo, the first instruction-tuning framework designed to adapt LLMs for solving optimization problems in a code-to-code manner. LLaMoCo features a comprehensive instruction set that includes code-style problem descriptions as input prompts and robust optimization codes from expert optimizers as target outputs. We then develop a novel two-phase learning strategy with a contrastive learning-based warm-up to enhance convergence during instruction tuning. Extensive experiments demonstrate that a CodeGen (350M) model tuned by our LLaMoCo yields a powerful domain-specific model for generating expert-level optimizers, achieving superior performance compared to GPT-4 Turbo and other competitors on both synthetic and realistic problem sets. The trained model and the usage instructions are available online.
BibTeX
@misc{ma2024llamoco,
author = {Zeyuan Ma and Hongshu Guo and Jiacheng Chen and Zhiguang Cao and Yining Ma and Yue-Jiao Gong},
title = {{LLaMoCo: Instruction Tuning of Large Language Models for Optimization Code Generation}},
year = {2024},
eprint = {2403.01131},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2403.01131},
}Ask Althea to put this paper to the test.