Table of Contents
Fetching ...

Adaptive Dependency-aware Prompt Optimization Framework for Multi-Step LLM Pipeline

Minjun Zhao, Xinyu Zhang, Shuai Zhang, Deyang Li, Ruifeng Shi

TL;DR

The paper tackles prompt optimization in multi-step LLM pipelines where only end-to-end supervision is available and intermediate labels are unavailable. It introduces ADOPT, a dependency-aware framework that (i) derives step-level textual adjustment directions from execution traces without LLM-based backward reasoning, (ii) decouples gradient estimation from optimization to allow flexible single-prompt optimizers, and (iii) uses a Shapley-based mechanism to allocate optimization resources to the most impactful steps. Empirical results on HotPotQA and HoVer pipelines with Qwen2.5-72B-Instruct show ADOPT achieving consistent end-to-end gains and faster convergence than CoT, MIPRO, and GEPA, demonstrating robust handling of inter-step dependencies. The approach is modular and adaptable, enabling practitioners to plug in different prompt optimizers while maintaining coordinated, end-to-end improvements in complex multi-step LLM systems.

Abstract

Multi-step LLM pipelines invoke large language models multiple times in a structured sequence and can effectively solve complex tasks, but their performance heavily depends on the prompts used at each step. Jointly optimizing these prompts is difficult due to missing step-level supervision and inter-step dependencies. Existing end-to-end prompt optimization methods struggle under these conditions and often yield suboptimal or unstable updates. We propose ADOPT, an Adaptive Dependency-aware Prompt Optimization framework for multi-step LLM pipelines. ADOPT explicitly models the dependency between each LLM step and the final task outcome, enabling precise text-gradient estimation analogous to computing analytical derivatives. It decouples textual gradient estimation from gradient updates, reducing multi-prompt optimization to flexible single-prompt optimization steps, and employs a Shapley-based mechanism to adaptively allocate optimization resources. Experiments on real-world datasets and diverse pipeline structures show that ADOPT is effective and robust, consistently outperforming state-of-the-art prompt optimization baselines.

Adaptive Dependency-aware Prompt Optimization Framework for Multi-Step LLM Pipeline

TL;DR

The paper tackles prompt optimization in multi-step LLM pipelines where only end-to-end supervision is available and intermediate labels are unavailable. It introduces ADOPT, a dependency-aware framework that (i) derives step-level textual adjustment directions from execution traces without LLM-based backward reasoning, (ii) decouples gradient estimation from optimization to allow flexible single-prompt optimizers, and (iii) uses a Shapley-based mechanism to allocate optimization resources to the most impactful steps. Empirical results on HotPotQA and HoVer pipelines with Qwen2.5-72B-Instruct show ADOPT achieving consistent end-to-end gains and faster convergence than CoT, MIPRO, and GEPA, demonstrating robust handling of inter-step dependencies. The approach is modular and adaptable, enabling practitioners to plug in different prompt optimizers while maintaining coordinated, end-to-end improvements in complex multi-step LLM systems.

Abstract

Multi-step LLM pipelines invoke large language models multiple times in a structured sequence and can effectively solve complex tasks, but their performance heavily depends on the prompts used at each step. Jointly optimizing these prompts is difficult due to missing step-level supervision and inter-step dependencies. Existing end-to-end prompt optimization methods struggle under these conditions and often yield suboptimal or unstable updates. We propose ADOPT, an Adaptive Dependency-aware Prompt Optimization framework for multi-step LLM pipelines. ADOPT explicitly models the dependency between each LLM step and the final task outcome, enabling precise text-gradient estimation analogous to computing analytical derivatives. It decouples textual gradient estimation from gradient updates, reducing multi-prompt optimization to flexible single-prompt optimization steps, and employs a Shapley-based mechanism to adaptively allocate optimization resources. Experiments on real-world datasets and diverse pipeline structures show that ADOPT is effective and robust, consistently outperforming state-of-the-art prompt optimization baselines.
Paper Structure (15 sections, 5 equations, 3 figures, 2 tables)

This paper contains 15 sections, 5 equations, 3 figures, 2 tables.

Figures (3)

  • Figure 1: An example of the optimization problem we explore for a multi-step pipeline.
  • Figure 2: Dependency-aware Textual Gradient Estimation.
  • Figure 3: Convergence of ADOPT