search
HomeTechnology peripheralsAINew TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

The AIxiv column is a column where this site publishes academic and technical content. In the past few years, the AIxiv column of this site has received more than 2,000 reports, covering top laboratories from major universities and companies around the world, effectively promoting academic exchanges and dissemination. If you have excellent work that you want to share, please feel free to contribute or contact us for reporting. Submission email: liyazhou@jiqizhixin.com; zhaoyunfeng@jiqizhixin.com

The author team of this article is from Stanford University, and the co-first author teamMert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu, Zhi Huang

Mert Yuksekgonul is a doctoral student at Stanford University, studying under Professors James Zou and Carlos Guestrin. Research directions include AI system self-optimization and its safety and reliability.

Federico Bianchi, Xyla AI engineer, postdoc at Stanford University, studied under Professors Dan Jurafsky and James Zou. His research direction is machine learning and the development of large language models.

Joseph Boen is a doctoral student at Stanford University, studying under James Zou. His research direction is the application of AI in science.

Liu Sheng is a postdoc at Stanford University in the United States. He studied under Professors James Zou and Lei Xing. He graduated with a PhD in data science and artificial intelligence from New York University. Research directions include the safety and reliability of deep learning, multi-modal large language models, and the application of AI in biomedicine.

Huang Zhi, currently a professor at the University of Pennsylvania and a postdoc at Stanford University. PhD from Purdue University. The research direction is biomedical engineering and the application of AI in pathology.

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

                                                                  TextGrad’s team

DO GRADISE DEPRESSION WITH TEXT? ! Recently, researchers from Stanford University have launched a new TextGrad framework to efficiently coordinate and optimize AI systems composed of large language models (LLM) and other components, and automatically optimize end-to-end task performance.

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

Currently, the optimized AI system using TextGrad using GPT-4o as the engine can achieve:

  • LeetCode-Hard best results
  • GPQA SoTA
  • Discover new of The molecule takes into account multiple optimization goals such as drug efficacy and toxicity at the same time
  • Design a cancer radiotherapy plan that exceeds artificial intelligence

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

  • TextGrad website: http://www.textgrad.com/
  • TextGrad paper: https://arxiv.org/abs/2406.07496
  • TextGrad Github: https://github.com/zou-group/textgrad

Generative AI is on the way from a single model In the paradigm shift from training to complex system optimization, developing principled automatic optimization methods for synthetic AI systems has become one of the most important new challenges at the moment. How to efficiently coordinate and optimize AI components such as large language models (LLM) and automatically optimize end-to-end task performance has become one of the most pressing challenges today. To say how many volumes there are in the AI ​​world, you have to look at Stanford University. In the past two days, researchers at Stanford University have made another big move and launched a new TextGrad framework, which provides a new solution to this problem. It draws on DSPy, also released by Stanford, and integrates PyTorch's powerful gradient backpropagation function to automatically optimize complex AI systems. This article will deeply analyze the core concepts and optimization mechanisms of TextGrad, explore its broad application prospects, and look forward to the future of language-driven optimization.

Core idea

TextGrad treats the LLM application as a computation graph (Computation Graph), using natural language as the medium to implement "gradient" transfer between different components. Optimize various variables in various systems by back-propagating textual feedback from the output of the language model to all possible early components. In TextGrad, everything is text, which means we use language models to 1) evaluate the output, 2) critique the output, and 3) update the input. This process is somewhat similar to PyTorch's backpropagation, except that instead of propagating numerical gradients, feedback in the form of text is propagated.

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

This unified language interaction interface gives TextGrad strong universality. It treats prompt, question, output, etc. as variables, without requiring them to be differentiable, and has strong compatibility. TextGrad works seamlessly with any LLM or other API that supports natural language I/O, and does not require other functions in the computational graph to be differentiable. This makes it very suitable for integrating plug-and-play capabilities such as retrieval and tool calling to build a flexible and versatile composite AI pipeline. TextGrad also does not need to manually design prompts, and automatically searches for the most worrying task descriptions and directly participates in optimization. This frees developers from prompt engineering and is expected to automatically find better in-context learning paradigms.

What can TextGrad do?

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

1. Prompt project Through the prompt optimized by TextGrad, the QA accuracy rate of GPT-3.5-turbor can be improved from 78% to 92%, and only a few optimization iterations are required. If you want to replicate this result and explore TextGrad further, the TextGrad team has prepared a simple tutorial for you.

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

                                              TextGrad can be applied to prompt engineer very easily and conveniently.

2. Optimize model output In addition to updating the model's prompt, the model's answer (response) and text representation output can also be optimized by TextGrad. Above, TextGrad optimizes the code for the LeetCode problem generated by LLM.

There are more applications of AI for science!

Drug Discovery

Using TextGrad, we can optimize two key attributes of chemical structures: drug similarity (i.e. how easily the drug is absorbed in the body) and binding affinity ( That is, how tightly the drug binds to the target protein). Drug similarity is measured by the QED score, which ranges from 0 to 1, with 1 indicating the best match to the drug properties; binding affinity is measured by the Vina score, with more negative scores being better.

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

Left: Molecular drug similarity and binding affinity distribution before and after 10 iterations of TextGrad optimization, compared to clinically approved drugs targeting the same target protein. Right: Example trajectory of 10 iterations of TextGrad optimization, comparing properties of clinically approved drugs.

Radiotherapy Treatment Planning

TextGrad can also be used to optimize radiation treatment plans, which determine the dose required for radiation therapy and pinpoint the areas that need treatment. In particular, the goal of treatment planning is to deliver a prescribed dose of radiation to the tumor while protecting critical normal tissue from unsafe doses. Doctors usually adjust and optimize the treatment plan repeatedly through trial and error until the plan meets clinical requirements. This makes the entire process inefficient, time-consuming, and costly. TextGrad automatically provides gradients to AI-led planning systems to optimize radiation treatment plans, automatically weighing the tumor against nearby healthy tissue.

New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks

TextGrad uses language to open up the barriers between different cognitive modules. It allows LLM to participate in its own iterative optimization and achieve continuous evolution through high-level cognitive abilities such as introspection, judgment, and creation. In essence, the significance of TextGrad goes far beyond optimizing the performance of the pipeline. It shows us the possibility of realizing AI self-cognition and self-correction through language. This “Language-Driven Optimization” path may also be a good medicine for many current “illusion problems”. TextGrad has been used to solve many scientific and medical problems! More applications are waiting for you to explore and discover!

The above is the detailed content of New TextGrad framework: using GPT-4o as engine to automatically optimize end-to-end tasks. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The AI Skills Gap Is Slowing Down Supply ChainsThe AI Skills Gap Is Slowing Down Supply ChainsApr 26, 2025 am 11:13 AM

The term "AI-ready workforce" is frequently used, but what does it truly mean in the supply chain industry? According to Abe Eshkenazi, CEO of the Association for Supply Chain Management (ASCM), it signifies professionals capable of critic

How One Company Is Quietly Working To Transform AI ForeverHow One Company Is Quietly Working To Transform AI ForeverApr 26, 2025 am 11:12 AM

The decentralized AI revolution is quietly gaining momentum. This Friday in Austin, Texas, the Bittensor Endgame Summit marks a pivotal moment, transitioning decentralized AI (DeAI) from theory to practical application. Unlike the glitzy commercial

Nvidia Releases NeMo Microservices To Streamline AI Agent DevelopmentNvidia Releases NeMo Microservices To Streamline AI Agent DevelopmentApr 26, 2025 am 11:11 AM

Enterprise AI faces data integration challenges The application of enterprise AI faces a major challenge: building systems that can maintain accuracy and practicality by continuously learning business data. NeMo microservices solve this problem by creating what Nvidia describes as "data flywheel", allowing AI systems to remain relevant through continuous exposure to enterprise information and user interaction. This newly launched toolkit contains five key microservices: NeMo Customizer handles fine-tuning of large language models with higher training throughput. NeMo Evaluator provides simplified evaluation of AI models for custom benchmarks. NeMo Guardrails implements security controls to maintain compliance and appropriateness

AI Paints A New Picture For The Future Of Art And DesignAI Paints A New Picture For The Future Of Art And DesignApr 26, 2025 am 11:10 AM

AI: The Future of Art and Design Artificial intelligence (AI) is changing the field of art and design in unprecedented ways, and its impact is no longer limited to amateurs, but more profoundly affecting professionals. Artwork and design schemes generated by AI are rapidly replacing traditional material images and designers in many transactional design activities such as advertising, social media image generation and web design. However, professional artists and designers also find the practical value of AI. They use AI as an auxiliary tool to explore new aesthetic possibilities, blend different styles, and create novel visual effects. AI helps artists and designers automate repetitive tasks, propose different design elements and provide creative input. AI supports style transfer, which is to apply a style of image

How Zoom Is Revolutionizing Work With Agentic AI: From Meetings To MilestonesHow Zoom Is Revolutionizing Work With Agentic AI: From Meetings To MilestonesApr 26, 2025 am 11:09 AM

Zoom, initially known for its video conferencing platform, is leading a workplace revolution with its innovative use of agentic AI. A recent conversation with Zoom's CTO, XD Huang, revealed the company's ambitious vision. Defining Agentic AI Huang d

The Existential Threat To UniversitiesThe Existential Threat To UniversitiesApr 26, 2025 am 11:08 AM

Will AI revolutionize education? This question is prompting serious reflection among educators and stakeholders. The integration of AI into education presents both opportunities and challenges. As Matthew Lynch of The Tech Edvocate notes, universit

The Prototype: American Scientists Are Looking For Jobs AbroadThe Prototype: American Scientists Are Looking For Jobs AbroadApr 26, 2025 am 11:07 AM

The development of scientific research and technology in the United States may face challenges, perhaps due to budget cuts. According to Nature, the number of American scientists applying for overseas jobs increased by 32% from January to March 2025 compared with the same period in 2024. A previous poll showed that 75% of the researchers surveyed were considering searching for jobs in Europe and Canada. Hundreds of NIH and NSF grants have been terminated in the past few months, with NIH’s new grants down by about $2.3 billion this year, a drop of nearly one-third. The leaked budget proposal shows that the Trump administration is considering sharply cutting budgets for scientific institutions, with a possible reduction of up to 50%. The turmoil in the field of basic research has also affected one of the major advantages of the United States: attracting overseas talents. 35

All About Open AI's Latest GPT 4.1 Family - Analytics VidhyaAll About Open AI's Latest GPT 4.1 Family - Analytics VidhyaApr 26, 2025 am 10:19 AM

OpenAI unveils the powerful GPT-4.1 series: a family of three advanced language models designed for real-world applications. This significant leap forward offers faster response times, enhanced comprehension, and drastically reduced costs compared t

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.