The effectiveness of large language models (LLMs) is closely tied to the design of prompts, making prompt optimization essential for enhancing their performance across a wide range of tasks. Many existing approaches to automating prompt engineering rely exclusively on textual feedback, refining prompts based solely on inference errors identified by large, computationally expensive LLMs. Unfortunately, smaller models struggle to generate high-quality feedback, resulting in complete dependence on large LLM judgment. Moreover, these methods fail to leverage more direct and finer-grained information, such as gradients, due to operating purely in text space. To this end, we introduce GReaTer, a novel prompt optimization technique that directly incorporates gradient information over task-specific reasoning. By utilizing task loss gradients, GReaTer enables self-optimization of prompts for open-source, lightweight language models without the need for costly closed-source LLMs. This allows high-performance prompt optimization without dependence on massive LLMs, closing the gap between smaller models and the sophisticated reasoning often needed for prompt refinement. Extensive evaluations across diverse reasoning tasks including BBH, GSM8k, and FOLIO demonstrate that GReaTer consistently outperforms previous state-of-the-art prompt optimization methods, even those reliant on powerful LLMs. Additionally, GReaTer-optimized prompts frequently exhibit better transferability and, in some cases, boost task performance to levels comparable to or surpassing those achieved by larger language models, highlighting the effectiveness of prompt optimization guided by gradients over reasoning. Code of GReaTer is available at https://github.com/psunlpgroup/GreaTer.
Unleashing the Potential of Large Language Models as Prompt Optimizers: Analogical Analysis with Gradient-based Model Optimizers
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);International School, Beijing University of Posts and Telecommunications(北京邮电大学国际学院);Alibaba Group(阿里巴巴集团)
Rethinking Prompt Optimizers: From Prompt Merits to Optimization
School of Electrical and Electronic Engineering, Nanyang Technological University, Singapore(南洋理工大学电子与电气工程学院);Home Team Science and Technology Agency, Singapore(新加坡科技局)
School of Computer Science, Fudan University(复旦大学计算机科学学院);Tencent AI Lab(腾讯AI实验室);Institute of Modern Languages and Linguistics, Fudan University(复旦大学现代语言与语言学研究所)
StrategyLLM: Large Language Models as Strategy Generators, Executors, Optimizers, and Evaluators for Problem Solving
School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University(上海交通大学电子信息与电气工程学院);The Chinese University of Hong Kong(香港中文大学);Tencent AI Lab(腾讯AI实验室)
SIPDO: Closed-Loop Prompt Optimization via Synthetic Data Feedback
University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Hong Kong University of Science and Technology(香港科学与技术大学);University of South Florida(佛罗里达州立大学)
promptolution: A Unified, Modular Framework for Prompt Optimization
ELLIS Institute(ELLIS研究所);University of Freiburg(弗赖堡大学);LMU Munich(慕尼黑大学);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心);Technical University of Munich(慕尼黑技术大学);TU Dortmund University(多特蒙德技术大学);Lamarr Institute for Machine Learning and Artificial Intelligence(Lamarr机器学习与人工智能研究所)
REPRO: Reflective Evolutionary Prompt Optimizer for Automated LLM Red-Teaming
King Fahd University of Petroleum & Minerals(法赫德国王石油与矿产大学);Imam Abdulrahman Bin Faisal University(伊玛目阿卜杜勒拉赫曼·本·费萨尔大学);SDAIA-KFUPM Joint Research Center for Artificial Intelligence(SDAIA-KFUPM人工智能联合研究中心)
Skills-Coach: A Self-Evolving Skill Optimizer via Training-Free GRPO
University of Chinese Academy of Sciences(中国科学院大学);East China Normal University(华东师范大学);Zhongguancun Academy(中关村学院);Southeast University(东南大学);Hainan University(海南大学);Tsinghua University(清华大学)
Composable Cross-prompt Essay Scoring by Merging Models
National Key Laboratory for Multimedia Information Processing(国家多媒体信息处理重点实验室);Peking University School of Computer Science(北京大学计算机学院);Peking University(北京大学)
GLaPE: Gold Label-agnostic Prompt Evaluation and Optimization for Large Language Model
College of Zhiyuan, Shanghai Jiao Tong University(上海交通大学致远学院);School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University(上海交通大学电子信息与电气工程学院);Department of Computer Science and Engineering, Shanghai Jiao Tong University(上海交通大学计算机科学与工程系);Shanghai Key Laboratory of Trusted Data Circulation and Governance in Web3(上海市Web3可信数据流通与治理重点实验室)