Why Prompt Optimization Works, and Why It Sometimes Doesn’t — A Causal-Inspired Edit-Level Analysis

Shuzhi Gong, Hechuan Wen · 2026

Read Why Prompt Optimization Works, and Why It Sometimes Doesn’t — A Causal-Inspired Edit-Level Analysis by Shuzhi Gong, Hechuan Wen (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-26655.txt.

Introduction

Shuzhi Gong and Hechuan Wen probe why tuned prompts often shine on one test and flop on another. They study optimized prompts across frameworks, model families, and benchmarks with a causal-style observational design. Complexity-raising and meta-instruction edits drag down math and multi-hop reasoning, while step-by-step and meta-cognitive edits lift logical and sequential tasks. The patterns hold across annotation schemes and transfer across optimizers, pointing to task-edit interplay rather than random luck.

Catalog record

CREATORShuzhi Gong, Hechuan Wen
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE55687
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.26655

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Why Prompt Optimization Works, and Why It Sometimes Doesn’t — A Causal-Inspired Edit-Level Analysis Shuzhi Gong, Hechuan Wen Abstract Automated prompt optimization methods (e.g., DSpy, TextGrad) can substantially improve the performance of large language model (LLM), however, their generalization ability across different tasks remains underperformed. In practice, the superiority of the optimized prompt on one benchmark often fails to transfer to another, and this limitation persists even when switching across different LLM backbones. To investigate the underexplored sources of heterogeneity in prompt performance, we conduct a causal inference-inspired observational analysis of optimized prompts across a diverse set of optimization frameworks, LLM backbones, and NLP benchmarks. To achieve the goal, we build upon the propensity-adjusted associational analysis together with multiple complementary representations of prompt edits, where the consistent task-conditioned edits patterns are identified. We find that complexity-increasing and meta-instructional edits are negatively associated with mathematical and multi-hop reasoning performance, whereas step-by-step and meta-cognitive edits improve logical and sequential reasoning tasks. These effects are robust across cognitive-load annotations, surface-level text features, and edit-motif analyses, and can generalize across optimization frameworks. Overall, these results indicate that prompt optimization failures arise from systematic interactions between edit families and task characteristics rather than random optimization artifacts, providing feature-level characterization of optimizer behavior and motivating future task-conditioned optimizer design. 1 Introduction Prompt optimization has emerged as an increasingly practical alternative to parameter-efficient fine-tuning for large language models (LLMs) Khattab et al. 2024 ; Opsahl-Ong et al. 2024a ; Yuksekgonul et al. 2024 ; Agrawal et al. 2026 . Instead of updating model weights, recent frameworks such as TextGrad Yuksekgonul et al. 2024 , GEPA Agrawal et al. 2026 automatically search the prompt space to improve downstream task performance. These approaches have become particularly attractive for modern LLM systems because they are lightweight, modular, and directly compatible with LLM and agentic applications Opsahl-Ong et al. 2024b ; Mihindukulasooriya et al. ; Susnjak 2026 and retrieval-augmented workflows Câmara et al. 2026 ; Gong et al. 2026 . Despite their empirical success, prompt optimizers often exhibit unstable behavior across tasks and model backbones Zhang et al. 2026 ; Fu et al. 2026 ; Singhal et al. 2026 . In practice, prompt revisions that improve one benchmark frequently fail to transfer to another, and optimizers that perform well on logical or sequential reasoning tasks may substantially degrade performance on mathematical or multi-hop reasoning benchmarks. Importantly, this pattern appears consistently in our experiments across multiple optimization frameworks and across diverse LLM backbones, including GPT-5.2, GPT-4o Achiam et al. 2023 , Qwen3-32B Yang et al. 2025 , and Deepseek Liu et al. 2024 models. Such instability raises a fundamental question: what kinds of prompt edits are modern optimizers actually learning to apply , and why do some edit patterns help certain task types while harming others ? Existing work has largely studied prompt optimization at the aggregate benchmark level Wan et al. 2024 . Prior studies analyze optimizer success rates Pryzant et al. 2023 , optimization dynamics Yuksekgonul et al. 2024 ; Yang et al. 2024 , or embedding-level optimization directions Lester et al. 2021 ; Li and Liang 2021 , but provide limited insight into the edit-level behaviors underlying optimizer failures. As a result, current evaluations often reveal whether optimization succeeds, but not which prompt modifications systematically contribute to improvement or degradation across different task settings. Yet understanding these edit-level behaviors is important for both diagnosis and optimizer design: two optimizers may achieve similar average gains while relying on fundamentally different editing strategies, and seemingly beneficial prompt modifications may interact differently with different reasoning tasks. Figure 1: Overview of our multi-view probing framework for prompt optimizer behavior. In this work, we investigate prompt optimizer behavior through an observational multi-view analysis of optimizer-induced prompt edits, as illustrated in Figure 1 . Rather than treating optimized prompts as indivisible artifacts, we analyze consecutive prompt revisions within real optimization trajectories and examine how different edit families are associated with downstream performance changes across task groups. To reduce dependence on any single representation of prompt edits, we probe optimizer behavior through three complementary views: (1) GPT-4o-annotated cognitive and instructional features, (2) deterministic surface-level text statistics, and (3) literal text-diff motifs extracted from consecutive prompt revisions. These complementary representations are subsequently integrated into a propensity-adjusted associational analysis framework to characterize heterogeneous optimizer behaviors across reasoning tasks. Methodologically, our analysis adopts a causal inference-inspired observational framework. We use propensity-adjusted associational estimation Rosenbaum and Rubin 1983 to reduce measured selection bias arising from differences in prior prompt states, while explicitly avoiding strong causal claims. Because the analysis involves many simultaneous feature-task comparisons, we distinguish between statistically robust findings that survive false-discovery-rate (FDR) correction and exploratory directional patterns that provide corroborative but non-confirmatory evidence. Throughout the paper, we therefore organize results using a unified two-tier evidence hierarchy. Tier 1 refers to associations surviving Benjamini–Hochberg false discovery rate correction. Tier 2 refers to directionally consistent corroborative patterns reproduced across multiple representations or frameworks but not surviving full multiple-testing correction. Across around 20 thousand real world prompt optimization’s ( prompt , question , correctness ) tuples, we observe consistent edit-level heterogeneity across task groups. In particular, complexity-increasing and meta-instructional edits tend to be negatively associated with mathematical and multi-hop reasoning performance, whereas metacognitive and step-structured edits are positively associated with logical and sequential reasoning tasks. Several of these associations remain significant after false-discovery-rate correction, while others appear consistently across multiple independent prompt representations. Our main contributions are summarized as follows: • We present an observational edit-level analysis of prompt optimizer behavior across multiple optimization frameworks, LLM backbones, and reasoning task groups. • We identify statistically robust heterogeneous associations between prompt optimizer-induced edits and downstream task performance. • We provide evidence that prompt optimization failures are not purely random, but are systematically associated with interactions between edits and benchmark-specific characteristics, motivating future task-conditioned optimizer design. 2 Related Work Automated prompt optimization. Automated prompt optimization treats the prompt as a learnable variable to maximize task performance. Early work learns soft prompts or searches discrete prompt tokens/templates for few-shot adaptation and probing ( Li and Liang 2021 ; Lester et al. 2021 ; Shin et al. 2020 ; Gao et al. 2021 ) . Later black-box methods optimize natural-language instructions directly, including instruction generation and ranking ( Zhou et al. 2022 ) , gradient-free edit search ( Prasad et al. 2023 ) , reinforcement-learning-based prompt editing ( Deng et al. 2022 ; Zhang et al. 2022 ) , and textual-gradient revision ( Pryzant et al. 2023 ; Yuksekgonul et al. 2024 ) . More recent systems use LLMs as optimizers or search operators, through natural-language proposal selection ( Yang et al. 2024 ) , evolutionary/self-referential mutation ( Guo et al. 2024 ; Fernando et al. 2023 ; Agrawal et al. 2026 ) , and program-level prompt compilation ( Khattab et al. 2024 ; Opsahl-Ong et al. 2024a ) . Despite their different optimization mechanisms, these methods converge to a common empirical failure mode in our setting: consistent performance degradation on math and multi-hop tasks. This convergence motivates a feature-level diagnosis of prompt changes rather than a method-specific analysis. Prompt sensitivity and format effects. A complementary line of work studies how non-semantic prompt properties affect

Read the complete text