Textual Gradients are a Flawed Metaphor for Automatic Prompt Optimization

Melcer, Daniel, Chen, Qi, Chiang, Wen-Hao, Garg, Shweta, Garg, Pranav, Bock, Christian

–arXiv.org Artificial Intelligence 

AWSAILabs New York, NY, USA and Seattle, WA, USA {qic,cwenhao,shwegarg, prangarg,bocchris}@amazon.com Abstracttrial-and-error. Several model providers have released prompt engineering guides (OpenAI, 2025; One leading class of prompt optimization techniques introduces the analogyengineered prompt (Zhou et al., 2023; Yang et al., of textual gradients. We investigate the behav-2024; Fernando et al., 2023; Guo et al., 2025). A ior of these textual gradient methods through arecent development--textual-gradient based methseries of experiments and case studies. While ods (Pryzant et al., 2023; Cheng et al., 2024; Yuk-such methods often result in a performance improvement, our experiments suggest that thesekgonul et al., 2025)--liken a model's system gradient analogy does not accurately explainprompt to a learnable parameter. Our insights may inform the se-machine learning system, the gradient of a model's lection of prompt optimization strategies, andparameters describes how the parameters should development of new approaches. With the gradient analogy, feedback about how to improve the sys1 Introductiontem prompt is treated as the prompt's "gradient". A prompt engineer could implement a familiar train-Large Language Models (LLMs) have grown significantly in capability and popularity in recent years. In Section 3, we provide an Despite their increase in power and generality, overview of the gradient hypothesis. In Section they are not perfect. While fine-tuning can be a 4, we perform an ablation study where we would useful tool to specialize a model for a specific task, expect a significant decrease in performance unit is generally expensive, and often requires a largeder the gradient hypothesis, but generally do not amount of data (Parthasarathy et al., 2024). Finally, in Section 5, we thermore, many of the best-performing models areintroduce several case studies to further explore the only available behind an API--their weights arebehavior of automatic prompt optimization. In many cases, a well-engineered prompt or se-2 Related Work quence of prompts enables an increase in taskspecific performance, without requiring access to the model weights (Mishra et al., 2022). HowWith access to a model's weights, it is possible to perform backpropagation to a prompt's embedding ever, constructing such a prompt may be a difficult space to learn a task-specific prompt (Shin et al., process, relying on a combination of intuition and 2020).