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

In-Context Examples

In- context examples can be utilized to improve textual gradients and update variables effectively. These examples serve as references to illustrate the characteristics of optimized variables. When in- context examples are applied, TEXTGRAD adopts the following prompt to incorporate them:

In-context examples prompt

You must base on the following examples when modifying the {role_description}: <EXAMPLES>{in_context_examples}</examples>"

By leveraging these examples, TEXTGRAD can better understand and implement the properties of optimized variables, enhancing the overall optimization process