GReaTer: 추론 위에 그래디언트를 사용하여 작은 언어 모델을 강화하는 프롬프트 최적화기
GReaTer: Gradients over Reasoning Makes Smaller Language Models Strong Prompt Optimizers
December 12, 2024
저자: Sarkar Snigdha Sarathi Das, Ryo Kamoi, Bo Pang, Yusen Zhang, Caiming Xiong, Rui Zhang
cs.AI
초록
대형 언어 모델(LLMs)의 효과는 프롬프트(prompt)의 설계와 밀접하게 관련되어 있어, 다양한 작업에서 성능을 향상시키기 위해 프롬프트 최적화가 필수적입니다. 자동 프롬프트 엔지니어링을 자동화하기 위한 많은 기존 방법은 대규모이며 계산 비용이 많이 드는 LLMs에 의해 식별된 추론 오류에만 기반하여 프롬프트를 개선합니다. 작은 모델은 고품질 피드백을 생성하는 데 어려움을 겪어 대형 LLM 판단에 완전히 의존해야 합니다. 더욱이 이러한 방법은 순수히 텍스트 공간에서 작동하기 때문에 그라디언트와 같은 더 직접적이고 세밀한 정보를 활용하지 못합니다. 이에 우리는 GReaTer를 소개합니다. 이는 과업 손실 그라디언트를 활용하여 과업별 추론을 직접적으로 통합하는 혁신적인 프롬프트 최적화 기술입니다. GReaTer를 사용하면 고비용의 폐쇄 소스 LLMs가 필요 없이 오픈 소스 경량 언어 모델을 위한 자체 최적화 프롬프트가 가능해집니다. 이를 통해 대형 LLMs에 의존하지 않고도 높은 성능의 프롬프트 최적화가 가능해지며, 작은 모델과 프롬프트 세분화에 필요한 정교한 추론 사이의 간극을 줄입니다. BBH, GSM8k, FOLIO를 포함한 다양한 추론 작업을 통한 폭넓은 평가 결과, GReaTer가 이전의 최첨단 프롬프트 최적화 방법을 일관되게 능가하며 강력한 LLMs에 의존하는 방법조차 능가함을 입증합니다. 게다가 GReaTer로 최적화된 프롬프트는 전이성이 더 뛰어나며, 경우에 따라 큰 언어 모델로 달성한 것과 비교 가능하거나 능가하는 수준의 작업 성능을 향상시킵니다. 그라디언트에 의해 이끌어지는 추론을 통한 프롬프트 최적화의 효과를 강조하며, GReaTer의 코드는 https://github.com/psunlpgroup/GreaTer에서 이용할 수 있습니다.
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.