Key Points

1. There is a paradigm shift in how AI systems are built, with breakthroughs achieved by systems orchestrating multiple large language models (LLMs) and other complex components.

2. Developing principled and automated optimization methods for these compound AI systems is one of the most important new challenges.

3. The paper introduces TextGrad, a framework that performs automatic "differentiation" via text, backpropagating textual feedback from LLMs to improve individual components of a compound AI system.

4. TextGrad allows LLMs to provide rich, general, natural language suggestions to optimize variables in computation graphs, ranging from code snippets to molecular structures.

5. TextGrad demonstrates effectiveness and generality across a diverse range of applications, including question answering, molecule optimization, coding, and radiotherapy treatment planning.

6. Without modifying the framework, TextGrad improves the zero-shot accuracy of GPT-4 in Google-Proof Question Answering from 51% to 55%, and yields a 20% relative performance gain in optimizing LeetCode-Hard coding problem solutions.

7. TextGrad optimizes prompts to push the performance of GPT-3.5 close to GPT-4 in several reasoning tasks.

8. TextGrad designs new drug-like small molecules with desirable in silico binding, and optimizes radiation oncology treatment plans with high specificity.

9. TextGrad lays a foundation to accelerate the development of the next-generation of AI systems.

Summary

This paper introduces TEXTGRAD, a powerful new framework that enables automatic "differentiation" via text for optimizing complex AI systems. The key insight is to use natural language feedback from large language models (LLMs) as an analog to gradients in numerical optimization, allowing for the optimization of compound AI systems that combine multiple sophisticated components.

Challenges in AI System Optimization
The paper first highlights the emerging paradigm shift in AI, where breakthroughs are being achieved by systems that orchestrate multiple large language models and other complex components. This new generation of AI systems poses a significant challenge, as developing principled and automated optimization methods for them is a crucial but unsolved problem.

The TEXTGRAD Framework
The authors draw an analogy to the early days of neural networks, where the development of backpropagation and automatic differentiation transformed the field by making optimization turn-key. Inspired by this, they introduce TEXTGRAD, which backpropagates textual feedback provided by LLMs to improve individual components of a compound AI system. In this framework, LLMs provide rich, general, natural language suggestions to optimize variables in computation graphs, ranging from code snippets to molecular structures.

The paper demonstrates the power and generality of TEXTGRAD across a diverse range of applications:
The authors highlight that TEXTGRAD follows PyTorch's syntax and abstraction, making it flexible and easy-to-use. They open-source the framework to accelerate progress in this direction.

Overall, this paper lays a foundation for a new paradigm of automatic "differentiation" via text, unlocking the potential to accelerate the development of the next generation of AI systems. By combining the reasoning power of LLMs with the efficiency of backpropagation, TEXTGRAD represents a significant advance towards principled and automated optimization methods for compound AI systems.

Reference: https://arxiv.org/abs/2406.07496v1