FAPO: Fully Autonomous Prompt Optimization of Multi-Step LLM Pipelines

Paul Kassianik, Baturay Saglam, Huaibo Zhao, Blaine Nelson, Supriti Vijay, Aman Priyanshu, Amin Karbasi

arXiv:2606.19605 · 2026-06-20 공개 · arXiv · PDF

benchmark-evaluation code-generation foundation-models model-architecture prompt-optimization llm-pipelines autonomous-optimization ctibench-rcm

Abstract

Multi-step LLM pipelines fail through interactions among retrieval, reasoning, and formatting steps, so prompt-only optimization can miss bottlenecks in the chain. We present FAPO (Fully Autonomous Prompt Optimization), a framework that lets Claude Code optimize an LLM pipeline inside a standardized codebase. FAPO evaluates a pipeline, inspects intermediate steps, diagnoses failures, proposes scoped changes, and validates variants repeatedly to optimize against a score function. It first tries prompt edits and, only when prompt optimization appears insufficient, changes chain structure within the permitted scope when attribution identifies a structural bottleneck. Across six benchmarks and three task models, FAPO beats the baseline GEPA in 15 of 18 model-benchmark comparisons. In 11 model-benchmark comparisons, FAPO wins with non-overlapping mean pm trial-standard-deviation ranges, and the mean FAPO-GEPA gain is +14.1 pp. In the six HoVer and IFBench comparisons where prompt-first search escalated to structural changes, FAPO wins all six with a mean gain of +33.8 pp. FAPO also improves performance on security tasks: on CTIBench-RCM, a security CVE-to-CWE task, prompt-only FAPO lifts test accuracy by +4.0 pp on GPT-5, +7.1 pp on Foundation-Sec-8B-Instruct, and +2.0 pp on Foundation-Sec-8B-Reasoning. These results position FAPO as a state-of-the-art pipeline optimization technique for both general-purpose and security-focused tasks.

한국어 요약

한 줄 요약

FAPO는 Claude Code 기반으로 LLM 파이프라인을 자동 최적화하는 프레임워크로, 18개 모델-베이스라인 비교 중 15개에서 GEPA를 능가한다.

핵심 기여도

핵심 아이디어

기존 프롬프트 최적화는 단일 단계에만 집중하여, 검색, 추론, 포맷팅 등 다중 단계 간 상호작용으로 발생하는 실패를 놓칠 수 있다. FAPO는 Claude Code를 활용해 파이프라인 내부를 점검하고, 실패 원인을 분석한 후 범위 내에서 프롬프트 편집 또는 구조 변경을 제안하는 반복적 최적화 프레임워크이다. 특히, LangGraph를 사용해 파이프라인을 상태유지 그래프로 표현함으로써 실패 원인을 추적하고, 최적화를 반복적으로 검증한다. 실패 원인이 프롬프트 편집으로 해결되지 않으면, 구조 변경으로 확장하며, 이는 기존 GEPA와 달리 파이프라인 전체를 고려한 접근법이다.

기술적 접근법

주요 결과

의의 및 한계

FAPO는 다중 단계 LLM 파이프라인 최적화에서 기존 프롬프트 최적화의 한계를 극복하고, 구조적 변경을 포함한 종합적 접근법을 제시한다. 특히, 보안 태스크에서도 성능 향상을 입증하여 실용적 가치가 높다. 그러나 AIME 벤치마크에서는 GEPA가 FAPO를 앞선 경우가 있으며, 이는 작은 샘플 크기로 인한 과적합 가능성으로 설명된다. 또한, Claude Code에 의존하는 점은 다른 모델로의 확장성을 제한할 수 있다.

실용적 활용

FAPO는 보안 분석, 기업 분석, 지식 작업 등에서 사용되는 복잡한 LLM 파이프라인의 신뢰성과 성능을 향상시키는 데 활용 가능하다. 특히, CTIBench-RCM과 같은 보안 태스크에서의 성능 향상은 사이버 보안 분야에서 실용적 적용 가능성을 제시한다.