---
title: 'GEPA: Parallel Planning & Prompt Optimization'
url: https://www.emergentmind.com/topics/gepa
type: topic
---

# GEPA: Parallel Planning & Prompt Optimization

GEPA refers to two distinct algorithmic frameworks: GePA*SE (Generalized Edge‐Based Parallel A*) for motion planning and the Genetic‐Pareto prompt optimizer for language model systems. Both approaches extend state-of-the-art optimization techniques within their respective domains by exploiting parallelism or leveraging reflective, search-based prompt evolution.

## 1. GePA Terminology and Definitions

### GePA*SE: Generalized Edge-Based Parallel A*

GePA*SE operates in graph-based planning domains where a directed graph $G = (V, E)$ encodes the state transitions and edge evaluations may have heterogeneous computational costs. The state space $V \subseteq S$ and the edge set $E \subseteq V \times A \times V$ (where $A$ is the action set) are coupled with a cost function $c(e) \ge 0$ per edge and an admissible, consistent heuristic $h: V \rightarrow [0, \infty)$. The action space is partitioned into "cheap" ($A^c$) and "expensive" ($A^e$) actions, yielding corresponding edge subsets $E^c, E^e$ such that $E = E^c \cup E^e$. The objective is to compute an optimal or bounded-suboptimal path $\pi$ from the start state $s_0$ to any $g \in G$ (goal set), minimizing $\sum_{e \in \pi} c(e)$ and leveraging $N_t$ parallel threads to reduce wall-clock time [2301.10347].

### GEPA: Genetic-Pareto Prompt Optimizer

GEPA ("Genetic-Pareto," *Editor's term*) refers to a prompt optimization algorithm for AI systems utilizing large language models (LLMs). GEPA maintains a population of candidate system prompts, iteratively selecting a parent candidate $\Phi^k$ and a module for mutation. Rollouts are conducted to generate execution traces $\tau$ and metric scores $\mu$; the system then performs natural language reflection (using the LLM) to propose prompt modifications. Candidate selection is governed by a Pareto frontier over a held-out set, ensuring diversity and exploration in the candidate pool [2507.19457].

## 2. GePA*SE Algorithmic Framework

GePA*SE generalizes the parallelization strategies of PA*SE (state‐level parallelism) and ePA*SE (edge‐level parallelism) to heterogeneous planning domains. The algorithm maintains two separate priority queues:

- $OPEN^e$ — for expensive edges, evaluated in parallel on worker threads.
- $OPEN^c$ — for "dummy" or cheap edges, piggybacked on state expansions in the master thread.

A set $B$ tracks busy states being processed for outgoing expensive edges. The main loop performs as follows:

1. Initialize $g(s) \gets \infty$, $n(s) \gets 0$ for all $s \in V$; set $g(s_0) = 0$.
2. Insert a dummy edge $(s_0, \bot, s_0)$ into $OPEN^c$.
3. At each iteration, select and expand the edge $e$ with minimum priority $f(e) = g(e.s) + w \cdot h(e.s)$, subject to an independence check for bounded-optimality:

   - Only expand $e$ if $\forall e' \in OPEN$ with $f(e') < f(e): \ g(e.s) - g(e'.s) \le w' h(e'.s, e.s)$ and for all $s' \in B$ with $f(s') < f(e): g(e.s) - g(s') \le w'h(s',e.s)$.

4. For $e \in OPEN^c$, perform cheap edge expansions directly.
5. For $e \in OPEN^e$, assign evaluation to a parallel worker and update $g(s')$ and parent references with appropriate locking upon completion.

If $E^e = \emptyset$, GePA*SE reduces to PA*SE; if $E^c = \emptyset$ it matches ePA*SE. The ratio $r^c = |E^e| / |E^c|$ controls this hybridization [2301.10347].

## 3. GEPA Algorithmic Structure

GEPA adopts a population-based, evolutionary optimization paradigm for prompt design, leveraging reflection and Pareto-dominant candidate selection:

- **Population $\mathcal{P}$**: Set of active system instantiations.
- **Parent Selection**: Pareto-based stochastic sampling favors candidates optimal for the largest subset of held-out instances.
- **Mutation/Reflection**: A meta-prompt ingests traces $\tau$ and feedback $f$, generating an instruction update for a selected module. The updated candidate $\Phi'$ is admitted to $\mathcal{P}$ if it improves minibatch performance.
- **Pareto Frontier**: For held-out instances $i$, each candidate's best score $s_k(i)$ is tracked, and candidates not strictly dominated (i.e., $s_a(i) \ge s_b(i)\ \forall i$ and $s_a(j) > s_b(j)$ for some $j$) constitute the frontier.
- **Crossover (Merge)**: Merging complementary module-level edits from separate candidate lineages can further enhance outcomes in some settings [2507.19457].

Pseudocode and core formulas are provided for precise workflow specification in [2507.19457].

## 4. Performance and Experimental Evidence

### GePA*SE in Planning

Empirical comparisons on both 2D gridworld and high-dimensional manipulation tasks demonstrate that W-GePA*SE consistently achieves lower planning times across thread counts and edge-cost regimes. Key results (mean planning time, sec; speedup vs. best baseline in parentheses):

| Threads | W-A* | W-PA*SE | W-ePA*SE | W-GePA*SE | Speedup       |
|---------|------|---------|----------|-----------|---------------|
| 5       | —    | 0.45    | 0.42     | 0.27      | ↓36% vs best  |
| 10      | —    | 0.31    | 0.28     | 0.17      | ↓39%          |
| 50      | —    | 0.19    | 0.18     | 0.17      | ↓11%          |

In real-world robotic settings (PR2 block-assembly), W-GePA*SE achieved planning times 25–40% lower than the best baseline for low-to-medium thread counts, with substantial improvements persisting as thread count increases [2301.10347].

### GEPA for LLM Systems

GEPA displays superior sample efficiency and peak performance compared to both RL-based (GRPO) and Bayesian (MIPROv2) prompt optimizers. Representative results:

| Model      | Baseline | MIPROv2 | GRPO  | GEPA   | GEPA Gain (pp) |
|------------|----------|---------|-------|--------|----------------|
| Qwen3-8B   | 48.9%    | 55.1%   | 51.1% | 61.3%  | +12.4          |
| GPT-4.1mini| 52.7%    | 59.7%   | —     | 67.0%  | +14.3          |

To match GRPO's best validation score, GEPA required up to 73× fewer rollouts (e.g., HotpotQA: 402 vs 24,000 rollouts) [2507.19457].

## 5. Practical Implications and Domain Applications

### GePA*SE

GePA*SE addresses heterogeneous action evaluation cost in robotics domains, including:

- Kinodynamic planners combining analytic (cheap) and collision-checking (expensive) steps,
- Manipulation problems that integrate static primitives with inverse kinematics or optimization,
- Task planners interleaving symbolic and motion-planning computations.

Robust performance in such partitions is contingent on the ability to separate actions into cheap and expensive categories and the use of thread-safe concurrent data structures. *A plausible implication is that GePA*SE's granularity-adaptive strategy generalizes efficiently across diverse robotics workflows, provided appropriate partitioning and heuristic design* [2301.10347].

### GEPA

GEPA is suitable for modular LLM agents featuring multiple instruction-carrying prompts, tool integrations, and interpretable traces. Applications include:

- Multi-hop QA (HotpotQA),
- Retrieval-augmented claim verification (HoVer),
- Tool-based reasoning pipelines,
- Code optimization at inference time.

The framework yields particular advantage where rollout budgets are limited and task complexity necessitates dense, interpretable learning signals over crude reward-only feedback [2507.19457].

## 6. Limitations and Research Directions

### GePA*SE

Limitations include reliance on effective action cost partitioning, sensitivity to locking overheads in high-concurrency scenarios, and the need for robust thread-safe priority queues. Prospective directions include adaptive partitioning strategies and minimizing data-structure contention for scalability [2301.10347].

### GEPA

GEPA currently focuses on prompt-level (instruction) edits, with no support for exemplar-level few-shot optimization. Pareto validation consumes most rollouts—a potential target for budget reduction via dynamic validation schedules. Further work may explore reflection prompt engineering, joint prompt + parameter optimization (e.g., RL seeding), and automated or scalable Pareto-set construction. *This suggests possible synergy between GEPA and weight-space adaptation methods* [2507.19457].

## 7. Summary and Outlook

"GEPA" designates two methodologically innovative approaches: GePA*SE unifies parallel planning paradigms for robotics with heterogeneous edge-evaluation costs, while the Genetic-Pareto optimizer leverages LLM-based reflection, evolutionary candidate search, and Pareto-front exploration for efficient prompt optimization. Both offer demonstrable performance gains, grounded in systematic empirical benchmarks, and illustrate the benefits of adapting the granularity of search or optimization steps to domain-specific cost structures and learning signals [2301.10347, 2507.19457].

Source: https://www.emergentmind.com/topics/gepa