title: TextGrad: Automatic "Differentiation" via Text
summary: 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.
paper_authors._id: 66691326f77c35410da184cb
paper_authors.name: Mert Yuksekgonul
paper_authors.status: extracted_confirmed
paper_authors.statusLastChangedAt: 2024-06-12T03:36:00.974Z
paper_authors._id: 61eb17ac8ae3ccab3b3da97b
paper_authors.avatarUrl: /avatars/9c91c33a0744eae1454e242d51295fbc.svg
paper_authors.fullname: Mert
paper_authors.type: user
paper_authors.user: merty
paper_authors._id: 66691326f77c35410da184cc
paper_authors.name: Federico Bianchi
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2024-06-12T07:29:22.065Z
paper_authors._id: 603f7c7af84ebe399f1c85cf
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/1625214886903-603f7c7af84ebe399f1c85cf.jpeg
paper_authors.fullname: Federico Bianchi
paper_authors.type: user
paper_authors.user: vinid
paper_authors._id: 66691326f77c35410da184cd
paper_authors.name: Joseph Boen
paper_authors.status: extracted_pending
paper_authors.statusLastChangedAt: 2025-02-18T07:28:42.879Z
paper_authors._id: 66846f30f53c83742c117277
paper_authors.avatarUrl: /avatars/31a2434297a6c194d57f2a0234f1ca2c.svg
paper_authors.fullname: Joseph Boen
paper_authors.type: user
paper_authors.user: tboen1
paper_authors._id: 66691326f77c35410da184ce
paper_authors.name: Sheng Liu
paper_authors.status: extracted_confirmed
paper_authors.statusLastChangedAt: 2025-02-19T22:49:08.410Z
paper_authors._id: 653585666141b3927a083b4f
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/653585666141b3927a083b4f/EpMnW_gKz9FV3OvogvUzi.jpeg
paper_authors.fullname: Sheng Liu
paper_authors.type: user
paper_authors.user: shengliu66
paper_authors._id: 66691326f77c35410da184cf
paper_authors.name: Zhi Huang
paper_authors.status: extracted_confirmed
paper_authors.statusLastChangedAt: 2024-06-12T03:17:24.193Z
paper_authors._id: 634b90db3a0cd2d498640479
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/634b90db3a0cd2d498640479/hsM58SlJHK_PnLN2f2esf.jpeg
paper_authors.fullname: Zhi Huang
paper_authors.type: user
paper_authors.user: zhihuang
paper_authors._id: 66691326f77c35410da184d0
paper_authors.name: Carlos Guestrin
paper_authors._id: 66691326f77c35410da184d1
paper_authors.name: James Zou
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-06-12T08:10:54.616Z
paper_authors._id: 648a769003fc4a3938bb7943
paper_authors.avatarUrl: /avatars/7647f99abdcca4251fcac7783b6fcc8d.svg
paper_authors.fullname: zou
paper_authors.type: user
paper_authors.user: jameszou707
paper_title: TextGrad: Automatic "Differentiation" via Text
paper_summary: 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.
paper_ai_keywords: TextGrad large language models (LLMs) compound AI systems backpropagation automatic differentiation computation graphs TextGrad's syntax and abstraction TextGrad's effectiveness Google-Proof Question Answering LeetCode-Hard coding problem solutions in silico binding radiation oncology treatment plans