Skip to main content
GEPA examples demonstrate evolutionary prompt optimization workflows for different task types: classification, multi-hop QA, instruction following, and claim verification.

Supported Tasks

TaskDescriptionAlgorithmConfig
Banking77Intent classification (77 banking intents)GEPAbanking77_gepa_local.toml
Banking77 PipelineTwo-stage pipeline (classifier → calibrator)GEPAbanking77_pipeline_gepa_local.toml
HotpotQAMulti-hop question answeringGEPAhotpotqa_gepa_local.toml
IFBenchInstruction following benchmarkGEPAifbench_gepa_local.toml
HoVerClaim verification against WikipediaGEPAhover_gepa_local.toml
PUPAPrivacy-aware task delegationGEPApupa_gepa_local.toml

Banking77: Single-Stage vs Multi-Stage

Banking77 has both single-stage and multi-stage (pipeline) variants:
  • Single-Stage: Direct intent classification (banking77_gepa_local.toml)
    • One LLM call per query
    • Simpler configuration
    • Faster optimization
  • Multi-Stage Pipeline: Sequential processing (banking77_pipeline_gepa_local.toml)
    • Two stages: classifier → calibrator OR query_analyzer → classifier
    • Per-stage prompt optimization
    • More complex but allows refinement
See Banking77 Comparison for detailed differences and when to use each.

Quick Start: Banking77

The Banking77 example provides a complete walkthrough:
  1. Deploy task app:
    uvx synth-ai deploy banking77 --runtime uvicorn --port 8102
    
  2. Run optimization:
    uvx synth-ai train \
      --config examples/blog_posts/gepa/configs/banking77_gepa_local.toml \
      --poll
    
  3. Query results:
    from synth_ai.learning import get_prompt_text
    best_prompt = get_prompt_text(job_id="pl_abc123", rank=1)
    
See the Banking77 guide for detailed steps, helper scripts, and troubleshooting.

Example Configurations

All example configs are available in synth-ai/examples/blog_posts/gepa/configs/:
  • banking77_gepa_local.toml – Single-stage intent classification
  • banking77_pipeline_gepa_local.toml – Multi-stage pipeline (classifier → calibrator)
  • banking77_pipeline_gepa_test.toml – Multi-stage pipeline (query_analyzer → classifier)
  • hotpotqa_gepa_local.toml – Multi-hop QA
  • ifbench_gepa_local.toml – Instruction following
  • hover_gepa_local.toml – Claim verification
  • pupa_gepa_local.toml – Privacy-aware delegation
Each config includes:
  • Initial prompt template with {query} placeholder
  • Training and validation seed splits
  • Algorithm parameters (population size, generations, mutation rate)

Integration Tests

Run the integration test to verify the full workflow:
cd synth-ai
uv run pytest tests/integration/cli/test_cli_train_gepa_banking77.py -v
This test:
  • Deploys the Banking77 task app to Modal
  • Runs a GEPA optimization job
  • Validates job completion and result structure

Next Steps