# TextGrad

> TextGrad is a framework that optimizes systems built from LLM calls by propagating natural-language feedback backward through the computation, so that each component, such as a prompt or a piece of code, is revised according to criticism of the final output.

- Identifier: PTL-0152
- Category: Prompt Optimization
- Canonical URL: https://protologue.com/t/textgrad/
- Also known as: textual backpropagation
- Introduced: 2024

## Description

It applies the idea of backpropagation to text, with an API modeled on PyTorch. Its authors used it to optimize prompts, code solutions, and answers to scientific questions. Like other feedback-driven optimizers, it is only as good as the evaluation signal it receives.

## Broader terms

- [Prompt Optimization](https://protologue.com/t/prompt-optimization/)

## Related terms

- [ProTeGi](https://protologue.com/t/protegi/)
- [DSPy](https://protologue.com/t/dspy/)
- [Self-Refine](https://protologue.com/t/self-refine/)

## Sources

- Yuksekgonul et al. (2024). TextGrad: Automatic "Differentiation" via Text. https://arxiv.org/abs/2406.07496

## Cite this entry

Protologue. (2026). TextGrad. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0, PTL-0152). https://protologue.com/t/textgrad/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
