TextGrad: 텍스트를 통한 자동 "미분"
TextGrad: Automatic "Differentiation" via Text
June 11, 2024
저자: Mert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu, Zhi Huang, Carlos Guestrin, James Zou
cs.AI
초록
AI는 다중 대형 언어 모델(LLM)과 기타 복잡한 구성 요소들을 조율하는 시스템에 의해 획기적인 발전을 이루며 패러다임 전환을 겪고 있습니다. 그 결과, 복합 AI 시스템을 위한 원칙적이고 자동화된 최적화 방법을 개발하는 것이 가장 중요한 새로운 과제 중 하나가 되었습니다. 신경망도 초기에는 유사한 도전에 직면했으나, 역전파와 자동 미분이 최적화를 손쉽게 만들어 필드를 혁신했습니다. 이를 영감으로 삼아, 우리는 텍스트를 통한 자동 "미분"을 수행하는 강력한 프레임워크인 TextGrad를 소개합니다. TextGrad는 LLM이 제공하는 텍스트 피드백을 역전파하여 복합 AI 시스템의 개별 구성 요소를 개선합니다. 우리의 프레임워크에서 LLM은 코드 조각부터 분자 구조에 이르기까지 계산 그래프의 변수를 최적화하기 위해 풍부하고 일반적이며 자연어로 된 제안을 제공합니다. TextGrad는 PyTorch의 구문과 추상화를 따르며 유연하고 사용하기 쉽습니다. 이 프레임워크는 다양한 작업에서 즉시 사용 가능하며, 사용자는 프레임워크의 구성 요소나 프롬프트를 조정하지 않고도 목적 함수만 제공하면 됩니다. 우리는 질문 응답, 분자 최적화, 방사선 치료 계획 설계 등 다양한 응용 분야에서 TextGrad의 효과성과 일반성을 입증했습니다. 프레임워크를 수정하지 않고도 TextGrad는 GPT-4o의 Google-Proof 질문 응답에서 제로샷 정확도를 51%에서 55%로 향상시키고, LeetCode-Hard 코딩 문제 해결 최적화에서 20%의 상대적 성능 향상을 이끌어내며, 추론을 위한 프롬프트를 개선하고, 원하는 in silico 결합 특성을 가진 새로운 약물 유사 소분자를 설계하며, 높은 특이성을 가진 방사선 종양학 치료 계획을 설계합니다. TextGrad는 차세대 AI 시스템 개발을 가속화하기 위한 기반을 마련합니다.
English
AI is undergoing a paradigm shift, with breakthroughs achieved by systems
orchestrating multiple large language models (LLMs) and other complex
components. As a result, developing principled and automated optimization
methods for compound AI systems is one of the most important new challenges.
Neural networks faced a similar challenge in its early days until
backpropagation and automatic differentiation transformed the field by making
optimization turn-key. Inspired by this, we introduce TextGrad, a powerful
framework performing automatic ``differentiation'' via text. TextGrad
backpropagates textual feedback provided by LLMs to improve individual
components of a compound AI system. In our framework, LLMs provide rich,
general, natural language suggestions to optimize variables in computation
graphs, ranging from code snippets to molecular structures. TextGrad follows
PyTorch's syntax and abstraction and is flexible and easy-to-use. It works
out-of-the-box for a variety of tasks, where the users only provide the
objective function without tuning components or prompts of the framework. We
showcase TextGrad's effectiveness and generality across a diverse range of
applications, from question answering and molecule optimization to radiotherapy
treatment planning. Without modifying the framework, TextGrad improves the
zero-shot accuracy of GPT-4o in Google-Proof Question Answering from 51% to
55%, yields 20% relative performance gain in optimizing LeetCode-Hard
coding problem solutions, improves prompts for reasoning, designs new druglike
small molecules with desirable in silico binding, and designs radiation
oncology treatment plans with high specificity. TextGrad lays a foundation to
accelerate the development of the next-generation of AI systems.Summary
AI-Generated Summary