Skip to main content
TextGrad: Automatic "Differentiation" via TextMert Yuksekgonul et al.

5 Discussion

TextGrad is built on three key principles: i) It is a general and performant framework that is not handcrafted for a specific application domain, ii) It is easy- to- use, mirroring PyTorch abstractions thus allowing knowledge transfer, iii) It is fully open- source. Through TEXTGRAD, we obtained state- of- the- art results in code optimization and PhD- level question answering, optimized prompts, and provided proof- of- concept results in scientific applications such as developing molecules and optimizing treatment plans.

While we took a first step, there are various limitations that motivate future work to realize the potential of automatic differentiation frameworks powered by LLMs. First, while we demonstrated the potential of backpropagating text feedback, there are many applications our framework can be extended to. We hope TEXTGRAD can be used to accelerate iterative processes in scientific discovery and increase the productivity of engineering efforts. For instance, to allow for this, we hope to extend the operations in our computation graphs to include more components used in practical LLM applications, such as for tool use [83] or retrieval- augmented generation systems [93]. Second, the automatic differentiation analogy enables a large design space for algorithms. We believe there are many fruitful connections to be drawn between numerical optimization, automatic differentiation, and TEXTGRAD. In particular, increasing the stability of the optimization using variance reduction techniques [94], adaptive gradients [95], or self- verification using LLMs [96] are interesting connections. Meta learning approaches [97- 99] to optimize the TextGrad framework using methods such as TextGrad itself is also an intriguing direction of future work.

Finally, while we conducted proof- of- concept applications of TEXTGRAD to design new molecules and treatment plans with in silico validations, the ultimate test requires experimental and clinical assessments, which are outside of the scope of this paper.

As the paradigm of AI shifts from training individual models to optimizing compound systems involving multiple interacting LLM components and tools, we need a new generation of automated optimizers. TEXTGRAD combines the reasoning power of LLMs with the decomposable efficiency of backpropagation to create a general framework to optimize AI systems.