Optimizers

The parameter fields, defaults, and agent-opt class for every optimizer, in one table.

Six optimizers are available, each suited to a different problem shape. See Choosing an optimizer for how to pick one, or Understanding optimization for how the optimization loop works.

Parameters by optimizer

The parameter set below describes what you pass in the platform’s optimization request when you create a run, not arguments to the class constructor; see Run an optimization for one optimizer’s parameters going into a request end to end. Optimization Objective (task_description) is present on every optimizer’s form, though nothing is prefilled into it.

OptimizerClassUse it whenParameters (label / code key / default)
Random SearchRandomSearchOptimizerFirst look at a prompt’s headroomNumber Variations (num_variations), 3
Bayesian SearchBayesianSearchOptimizerTuning few-shot examples on solid instructionsMin examples (min_examples), 2
Max examples (max_examples), 4
No.of trials (n_trials), 5
ProTeGiProTeGiParallel candidate fixes from failing examplesBeam size (beam_size), 4
Number of gradients (num_gradients), 4
Errors per gradient (errors_per_gradient), 4
Prompts per gradient (prompts_per_gradient), 1
Number of Rounds (num_rounds), 3
Meta-PromptMetaPromptOptimizerOne prompt refined over rounds, not parallel candidatesOptimization Objective (task_description)
Number of Rounds (num_rounds), 4
PromptWizardPromptWizardOptimizerWording itself, not one instruction, is the ceilingMutated Rounds (mutate_rounds), 3
Refined Iterations (refine_iterations), 2
Beam size (beam_size), 2
GEPAGEPAOptimizerWidest search of the six, 40 metric calls prefilledMax Metric Calls (max_metric_calls), 40

Every parameter listed above must be passed on the optimization request. The values shown are what the form prefills when you pick that optimizer, and you can change any of them before you start the run. A request missing any listed parameter, or carrying a parameter that isn’t listed for that optimizer and isn’t task_description, is rejected before the run starts; see Common errors and fixes for the exact error.

task_description is the one parameter allowed outside a row’s own list: it can additionally be passed on any optimizer’s request, even where its row above doesn’t list it for that optimizer, and Meta-Prompt is the one optimizer that requires it as part of its own parameter set.

Keep exploring

Was this page helpful?

Questions & Discussion