arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.09722cs.CL
收藏

GReaTer:基于推理的梯度使小型语言模型成为强大的提示优化器

GReaTer: Gradients over Reasoning Makes Smaller Language Models Strong Prompt Optimizers

The Pennsylvania State University(宾夕法尼亚州立大学);Salesforce Research(Salesforce研究院)

Sarkar Snigdha Sarathi Das, Ryo Kamoi, Bo Pang, Yusen Zhang, Caiming Xiong, Rui Zhang

AI总结:

本文提出GReaTer,利用任务损失梯度对开源小型语言模型进行提示自优化,无需依赖大型闭源LLM,在BBH、GSM8k和FOLIO等推理任务上超越现有方法并提升可迁移性。

摘要:

大型语言模型(LLMs)的有效性与提示设计密切相关,因此提示优化对于提升其在广泛任务上的性能至关重要。许多现有的自动提示工程方法仅依赖文本反馈,只根据大型且计算昂贵的LLMs识别出的推理错误来改进提示。不幸的是,较小的模型难以生成高质量反馈,导致完全依赖大型LLM的判断。此外,这些方法由于仅在文本空间中操作,未能利用更直接、更细粒度的信息,例如梯度。为此,我们提出了GReaTer,这是一种新颖的提示优化技术,直接引入任务特定推理上的梯度信息。通过利用任务损失梯度,GReaTer使开源、轻量级语言模型能够自我优化提示,而无需昂贵的闭源LLMs。这使得高性能提示优化不再依赖大规模LLMs,缩小了较小模型与提示改进通常所需的复杂推理之间的差距。在包括BBH、GSM8k和FOLIO在内的多种推理任务上的广泛评估表明,GReaTer始终优于先前最先进的提示优化方法,甚至包括那些依赖强大LLMs的方法。此外,经GReaTer优化的提示通常表现出更好的可迁移性,在某些情况下,将任务性能提升到与更大语言模型相当或超越其水平,突显了基于推理梯度引导的提示优化的有效性。GReaTer的代码可在https://github.com/psunlpgroup/GreaTer获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑