ChatPaper.aiChatPaper

Modelos de Lenguaje a Gran Escala como Optimizadores

Large Language Models as Optimizers

September 7, 2023
Autores: Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoc V. Le, Denny Zhou, Xinyun Chen
cs.AI

Resumen

La optimización es omnipresente. Si bien los algoritmos basados en derivadas han sido herramientas poderosas para diversos problemas, la ausencia de gradientes impone desafíos en muchas aplicaciones del mundo real. En este trabajo, proponemos Optimización mediante PROmpting (OPRO), un enfoque simple y efectivo para aprovechar los modelos de lenguaje de gran escala (LLMs, por sus siglas en inglés) como optimizadores, donde la tarea de optimización se describe en lenguaje natural. En cada paso de optimización, el LLM genera nuevas soluciones a partir del prompt que contiene las soluciones generadas previamente junto con sus valores; luego, las nuevas soluciones se evalúan y se añaden al prompt para el siguiente paso de optimización. Primero demostramos OPRO en problemas de regresión lineal y del viajante, y luego avanzamos hacia la optimización de prompts, donde el objetivo es encontrar instrucciones que maximicen la precisión de la tarea. Con una variedad de LLMs, demostramos que los mejores prompts optimizados por OPRO superan a los prompts diseñados por humanos en hasta un 8% en GSM8K y en hasta un 50% en tareas de Big-Bench Hard.
English
Optimization is ubiquitous. While derivative-based algorithms have been powerful tools for various problems, the absence of gradient imposes challenges on many real-world applications. In this work, we propose Optimization by PROmpting (OPRO), a simple and effective approach to leverage large language models (LLMs) as optimizers, where the optimization task is described in natural language. In each optimization step, the LLM generates new solutions from the prompt that contains previously generated solutions with their values, then the new solutions are evaluated and added to the prompt for the next optimization step. We first showcase OPRO on linear regression and traveling salesman problems, then move on to prompt optimization where the goal is to find instructions that maximize the task accuracy. With a variety of LLMs, we demonstrate that the best prompts optimized by OPRO outperform human-designed prompts by up to 8% on GSM8K, and by up to 50% on Big-Bench Hard tasks.
PDF773December 15, 2024