[論文レビュー] TextGrad: Automatic "Differentiation" via Text
TextGradは、LLMsからのテキストによるフィードバックを逆伝播させることにより、コード、QA、化学、医療タスクにわたる複合AIシステムの構成要素を改善する、フレームワークを変更せずに自動微分風の最適化を実現します。
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.
研究の動機と目的
- 複数の構成要素からなる複合AIシステムの原理に基づく自動最適化を促進する。
- 計算グラフ内の変数を更新する勾配としてテキストフィードバックを使用する枠組みを導入する。
- コード、推論、化学、医療計画を含む多様なタスクでTextGradを実証する。
提案手法
- AIシステムを入力/出力として変数を持つ計算グラフとして表現する。
- LLMから提供される自然言語フィードバックを用いて変数を更新する勾配演算子を定義する(テキスト勾配)。
- Textual Gradient Descent (TGD) 最適化子を用いてテキスト勾配に基づき変数を更新する。
- 目的関数は自然言語の記述、コード評価、シミュレーションなど、任意の形式を許容する。
- インスタンス最適化(解を直接最適化)とプロンプト最適化(モデル性能向上のためのプロンプト最適化)の両方をサポートする。
- 使いやすさを考慮した即用実装とPyTorchライクな抽象化を提供する。
実験結果
リサーチクエスチョン
- RQ1LLMsのテキストフィードバックを計算グラフを介してバックプロパゲーションし、複合AIシステムの個々の構成要素を改善できるか。
- RQ2コード、推論、化学、医療などの多様なタスクでTextGradを用いることで得られる実践的な性能向上はどの程度か。
- RQ3テキスト勾配に導かれたとき、インスタンス最適化とプロンプト最適化はどう比較されるか。
- RQ4TextGrad最適化におけるバッチ、制約、モーメンタム様拡張の効果はどう現れるか。
- RQ5ドメイン横断でタスク固有のプロンプトや膨大な手作業チューニングなしでTextGradは動作可能か。
主な発見
| タスク | 方法 | 指標 | 値 |
|---|---|---|---|
| LeetCode Hard | Zero-shot | Completion Rate | 0.26 |
| LeetCode Hard | Reflexion (1 demonstration, 5 iterations) | Completion Rate | 0.31 ± 0.012 |
| LeetCode Hard | TextGrad (0 demonstrations, 5 iterations) | Completion Rate | 0.36 ± 0.018 |
| GPQA (Google-proof QA) | TextGrad | Accuracy | 55.0 |
| MMLU-Machine Learning | TextGrad | Accuracy | 88.4 |
| MMLU-College Physics | TextGrad | Accuracy | 95.1 |
- Demonstrationsの有無にかかわらず、LeetCode Hardのソリューションを改善: TextGradはデモなしで0.36のCompletion率を達成し、ゼロショットの0.23およびReflexionの0.31を上回る。
- Google-proof Question Answering: GPT-4oでのTextGrad適用によりゼロショット精度が51%から55%に向上。
- MMLUベンチマーク: 機械学習サブセットの精度はTextGrad 88.4% vs CoT 85.7%で向上; College PhysicsはTextGrad 95.1% vs CoT 91.2%で向上。
- 放射線治療および分子設計のデモは、テキスト勾配を用いた問題固有の目的の最適化で改善を示す。
- TextGradはPyTorchライクなAPIを提供し、フレームワークレベルのプロンプト/チューニングなしで幅広いタスクに対する普遍性とアクセス性を実現する。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。