用推理梯度优化提示,让小模型也能高效提升性能
GReaTer: Gradients over Reasoning Makes Smaller Language Models Strong Prompt Optimizers
- 通过任务损失梯度直接优化提示,不依赖大模型文本反馈
- 在BBH、GSM8k等任务上超越现有最优方法,部分效果媲美大模型
- 适合想低成本提升小模型表现的研究者和开发者
大型语言模型的性能高度依赖提示设计,因此自动化提示优化至关重要。现有方法多依赖大模型的文本反馈来修正提示,但小型模型难以生成高质量反馈,导致对大模型的完全依赖。同时,这些方法仅在文本空间操作,未能利用更直接的梯度信息。为此,我们提出GReaTer,一种基于任务特定推理梯度的新型提示优化方法。通过使用任务损失梯度,GReaTer使开源轻量级语言模型可自主优化提示,无需依赖昂贵的闭源大模型。在包括BBH、GSM8k、FOLIO在内的多种推理任务上的实验表明,GReaTer持续优于此前最先进的提示优化方法,即使在某些情况下其优化后的提示性能达到或超过大型语言模型水平,验证了基于推理梯度指导的提示优化的有效性。代码已开源:https://github.com/psunlpgroup/GreaTer。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。