Cyprian Bohojlo

Author directory

2026

Agentic pipelines assign a separately optimized system prompt to each step, so the cost of automatic prompt optimization (APO) multiplies across the pipeline. In this setting, the strategy for selecting candidate prompts cannot ignore budgetary constraints. We study the selection step of a textual gradient APO framework (Pryzant et al., 2023) in financial question answering with retrieval-augmented generation, a domain that stresses both the prompt and the reward signal. We compare the framework’s stateless Upper Confidence Bound (UCB) selector against two learned alternatives, PPO and DPO, with BEM as the shared reward. Across 135 experiments spanning three benchmarks, three budgets, and five random seeds, the selectors differ little in average accuracy gain (UCB 13.5% vs. DPO 13.4% vs. PPO 11.2%). Averaging over seeds erases these gaps and cost becomes the differentiating factor. PPO runs in under half the time of UCB (76 vs. 182 minutes per experiment) and its cost stays nearly flat as budget grows. For cost-sensitive deployments, selection has to consider efficiency in addition to accuracy, and PPO emerges as a promising low-cost selector within this APO setup. This design was shaped by an in-progress deployment at a consulting firm that assigns one system prompt to each step of an agentic data-cleaning pipeline.