LLaMoCo: Instruction Tuning of Large Language Models for Optimization Code Generation (2403.01131v2)
Abstract: Recent research explores optimization using LLMs by either iteratively seeking next-step solutions from LLMs or directly prompting LLMs for an optimizer. However, these approaches exhibit inherent limitations, including low operational 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. Specifically, we establish a comprehensive instruction set containing well-described problem prompts and effective optimization codes. We then develop a novel two-phase learning strategy that incorporates a contrastive learning-based warm-up procedure before the instruction-tuning phase to enhance the convergence behavior during model fine-tuning. The experiment results demonstrate that a CodeGen (350M) model fine-tuned by our LLaMoCo achieves superior optimization performance compared to GPT-4 Turbo and the other competitors across both synthetic and realistic problem sets. The fine-tuned model and the usage instructions are available at https://anonymous.4open.science/r/LLaMoCo-722A.
- Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
- Optimus: Optimization modeling using mip solvers and large language models. arXiv preprint arXiv:2310.06116, 2023.
- Amari, S.-i. Backpropagation and stochastic gradient descent method. Neurocomputing, 1993.
- Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
- A study of the behavior of several methods for balancing machine learning training data. ACM SIGKDD Explorations Newsletter, 2004.
- Improving differential evolution through bayesian hyperparameter optimization. In 2021 IEEE Congress on evolutionary computation (CEC), 2021.
- Biswas, S. S. Role of chat gpt in public health. Annals of Biomedical Engineering, 2023a.
- Biswas, S. S. Potential use of chat gpt in global warming. Annals of Biomedical Engineering, 2023b.
- A progressive batching l-bfgs method for machine learning. In International Conference on Machine Learning, 2018.
- Convex optimization. Cambridge university press, 2004.
- Language models are few-shot learners. Advances in Neural Information Processing Systems, 2020.
- Evoprompting: Language models for code-level neural architecture search. arXiv preprint arXiv:2302.14838, 2023.
- Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
- Deep reinforcement learning from human preferences. Advances in Neural Information Processing Systems, 2017.
- Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416, 2022.
- Natural selection fails to optimize mutation rates for long-term adaptation on rugged fitness landscapes. PLoS Computational Biology, 2008.
- Trust region methods. SIAM, 2000.
- Pypop7: A pure-python library for population-based black-box optimization. arXiv preprint arXiv:2212.05652, 2022.
- Gpt-3: Its nature, scope, limits, and consequences. Minds and Machines, 2020.
- A hybrid particle swarm optimization and simulated annealing algorithm for the job shop scheduling problem with transport resources. European Journal of Operational Research, 2023.
- Deap: Evolutionary algorithms made easy. The Journal of Machine Learning Research, 2012.
- Incoder: A generative model for code infilling and synthesis. In The Eleventh International Conference on Learning Representations, 2023.
- Genetic learning particle swarm optimization. IEEE transactions on cybernetics, 2015.
- Unixcoder: Unified cross-modal pre-training for code representation. arXiv preprint arXiv:2203.03850, 2022.
- Metabox: A benchmark platform for meta-black-box optimization with reinforcement learning. In Thirty-seventh Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2023a.
- Towards optimizing with large language models. arXiv preprint arXiv:2310.05204, 2023b.
- Connecting large language models with evolutionary algorithms yields powerful prompt optimizers. arXiv preprint arXiv:2309.08532, 2023c.
- Instruction tuned models are quick learners. arXiv preprint arXiv:2306.05539, 2023.
- Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), 2006.
- Hansen, N. Benchmarking a bi-population cma-es on the bbob-2009 function testbed. In Proceedings of the 11th annual conference companion on genetic and evolutionary computation conference: late breaking papers, 2009.
- Completely derandomized self-adaptation in evolution strategies. Evolutionary Computation, 2001.
- Mmes: Mixture model-based evolution strategy for large-scale optimization. IEEE Transactions on Evolutionary Computation, 2020.
- Holland, J. H. Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence. 1992.
- LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022.
- Lawyer llama technical report. arXiv preprint arXiv:2305.15062, 2023.
- Phi-2: The surprising power of small language models, 2023.
- Mixtral of experts. arXiv preprint arXiv:2401.04088, 2024.
- Structgpt: A general framework for large language model to reason over structured data. arXiv preprint arXiv:2305.09645, 2023.
- Particle swarm optimization. In Proceedings of ICNN’95-International Conference on Neural Networks, 1995.
- Optimization by simulated annealing. science, 1983.
- Kraft, D. A software package for sequential quadratic programming. Forschungsbericht- Deutsche Forschungs- und Versuchsanstalt fur Luft- und Raumfahrt, 1988.
- A test-suite of non-convex constrained optimization problems from the real-world and some baseline results. Swarm and Evolutionary Computation, 2020.
- Ds-1000: A natural and reliable benchmark for data science code generation. In International Conference on Machine Learning, 2023.
- Lange, R. T. evosax: Jax-based evolution strategies. In Proceedings of the Companion Conference on Genetic and Evolutionary Computation, 2023.
- Evolution through large models. In Handbook of Evolutionary Machine Learning, 2023.
- Starcoder: may the source be with you! arXiv preprint arXiv:2305.06161, 2023.
- Competition-level code generation with alphacode. Science, 2022.
- Large language model for multi-objective evolutionary optimization. arXiv preprint arXiv:2310.12541, 2023a.
- Large language models as evolutionary optimizers. arXiv preprint arXiv:2310.19046, 2023b.
- Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
- Scikit-optimize, 2016. URL https://github.com/scikit-optimize/scikit-optimize.
- Double-track particle swarm optimizer for nonlinear constrained optimization problems. Information Sciences, 2023.
- Chatting about chatgpt: how may ai and gpt impact academia and libraries? Library Hi Tech News, 2023.
- Rethinking the role of demonstrations: What makes in-context learning work? arXiv preprint arXiv:2202.12837, 2022.
- Problem definitions and evaluation criteria for the cec 2021 on single objective bound constrained numerical optimization. In Proceedings of the IEEE Congress of Evolutionary Computation, 2021.
- Remark on “algorithm 778: L-bfgs-b: Fortran subroutines for large-scale bound constrained optimization”. ACM Transactions on Mathematical Software (TOMS), 2011.
- Codegen: An open large language model for code with multi-turn program synthesis. In The Eleventh International Conference on Learning Representations, 2023.
- Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 2022.
- Leveraging large language models for the generation of novel metaheuristic optimization algorithms. In Proceedings of the Companion Conference on Genetic and Evolutionary Computation, 2023.
- Powell, M. J. A view of algorithms for optimization without derivatives. Mathematics Today-Bulletin of the Institute of Mathematics and its Applications, 2007.
- Direct preference optimization: Your language model is secretly a reward model. arXiv preprint arXiv:2305.18290, 2023.
- Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 2020.
- A simple modification in cma-es achieving linear time and space complexity. In International conference on parallel problem solving from nature, 2008.
- Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950, 2023.
- R.Turner and D.Eriksson. Bayesmark: Benchmark framework to easily compare bayesian optimization methods on real machine learning tasks, 2019. URL https://github.com/uber/bayesmark.
- Multitask prompted training enables zero-shot task generalization. In International Conference on Learning Representations, 2022.
- Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
- Large language models encode clinical knowledge. Nature, 2023.
- Practical bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems, 2012.
- A new taxonomy of global optimization algorithms. Natural Computing, 2022.
- Differential evolution-a simple and efficient heuristic for global optimization over continuous spaces. Journal of Global Optimization, 1997.
- Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.
- Bayesian optimization is superior to random search for machine learning hyperparameter tuning: Analysis of the black-box optimization challenge 2020. In NeurIPS 2020 Competition and Demonstration Track, 2021.
- Simulated annealing. Springer, 1987.
- Attention is all you need. Advances in Neural Information Processing Systems, 2017.
- Scipy 1.0: fundamental algorithms for scientific computing in python. Nature methods, 2020.
- An improved genetic algorithm for constrained optimization problems. IEEE Access, 2023.
- Learning search space partition for black-box optimization using monte carlo tree search. Advances in Neural Information Processing Systems, 2020.
- Finetuned language models are zero-shot learners. In International Conference on Learning Representations, 2022.
- Huggingface’s transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771, 2019.
- Employing reinforcement learning to enhance particle swarm optimization methods. Engineering Optimization, 2022.
- Problem definitions and evaluation criteria for the cec 2017 competition on constrained real-parameter optimization. National University of Defense Technology, Changsha, Hunan, PR China and Kyungpook National University, Daegu, South Korea and Nanyang Technological University, Singapore, Technical Report, 2017.
- Generalized simulated annealing algorithm and its application to the thomson model. Physics Letters A, 1997.
- UnifiedSKG: Unifying and multi-tasking structured knowledge grounding with text-to-text language models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, 2022.
- Helper and equivalent objectives: Efficient approach for constrained optimization. IEEE transactions on cybernetics, 2020.
- Large language models as optimizers. arXiv preprint arXiv:2309.03409, 2023.
- Differential evolution with alternation between steady monopoly and transient competition of mutation strategies. Swarm and Evolutionary Computation, 2023.
- Large language models meet nl2code: A survey. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics, 2023.
- A survey on evolutionary computation for complex continuous optimization. Artificial Intelligence Review, 2022.
- Recommendation as instruction following: A large language model empowered recommendation approach. arXiv preprint arXiv:2305.07001, 2023.
- A survey of large language models. arXiv preprint arXiv:2303.18223, 2023.
- Codegeex: A pre-trained model for code generation with multilingual benchmarking on humaneval-x. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2023.
- Lima: Less is more for alignment. arXiv preprint arXiv:2305.11206, 2023.
- Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019.
- Zeyuan Ma (17 papers)
- Hongshu Guo (15 papers)
- Jiacheng Chen (37 papers)
- Guojun Peng (8 papers)
- Zhiguang Cao (48 papers)
- Yining Ma (31 papers)
- Yue-Jiao Gong (23 papers)