MIPRO: Multi-Instruction Prompt Optimization
MIPRO uses Bayesian optimization (TPE) to jointly optimize instructions and few-shot demonstrations for multi-stage LLM programs.When to Use
- Instruction-following tasks with clear structure
- Tasks where few-shot examples improve performance
- When you want faster convergence than genetic methods
- When demo selection matters
Config Reference
Top-Level Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
algorithm | string | - | Must be "mipro" |
task_app_url | string | - | URL of your task app (tunnel URL) |
task_app_api_key | string | - | Environment API key for auth |
task_app_id | string | - | Identifier for your task |
MIPRO Section [prompt_learning.mipro]
| Parameter | Type | Default | Description |
|---|---|---|---|
env_name | string | "banking77" | Environment/task name |
num_iterations | int | 20 | TPE optimization iterations |
num_evaluations_per_iteration | int | 5 | Evaluations per iteration |
batch_size | int | 32 | Batch size for evaluation |
max_concurrent | int | 20 | Max concurrent rollouts |
meta_model | string | "gpt-4o-mini" | Model for instruction generation |
meta_model_provider | string | "openai" | Provider for meta model |
meta_model_inference_url | string | null | Custom inference URL |
few_shot_score_threshold | float | 0.8 | Threshold for demo selection |
proposer_effort | string | "LOW" | Model quality: "LOW_CONTEXT", "LOW", "MEDIUM", "HIGH" |
proposer_output_tokens | string | "FAST" | Token limit: "RAPID", "FAST", "SLOW" |
metaprompt | string | null | Custom metaprompt |
max_wall_clock_seconds | float | null | Max runtime in seconds |
max_total_tokens | int | null | Max tokens across all rollouts |
max_token_limit | int | null | Total token budget |
max_spend_usd | float | null | Maximum spend in USD |
token_counting_model | string | "gpt-4" | Model for token estimation |
enforce_token_limit | bool | true | Halt if limit exceeded |
Seed Pools
| Parameter | Type | Description |
|---|---|---|
bootstrap_train_seeds | list[int] | Seeds for initial instruction generation |
online_pool | list[int] | Seeds for TPE optimization |
test_pool | list[int] | Held-out seeds for final evaluation |
val_seeds | list[int] | Seeds for top-K validation |
reference_pool | list[int] | Seeds for meta-prompt context |
TPE Config [prompt_learning.mipro.tpe]
| Parameter | Type | Default | Description |
|---|---|---|---|
gamma | float | 0.25 | Quantile for good/bad split |
n_candidates | int | 32 | Candidates for Expected Improvement |
n_startup_trials | int | 5 | Random trials before TPE |
epsilon | float | 0.1 | Exploration probability |
alpha | float | 1.0 | KDE smoothing parameter |
Demo Config [prompt_learning.mipro.demo]
| Parameter | Type | Default | Description |
|---|---|---|---|
max_few_shot_examples | int | 3 | Max demos in prompt |
sets_per_size | int | 4 | Demo sets per size |
include_empty | bool | true | Include zero-shot option |
Grounding Config [prompt_learning.mipro.grounding]
| Parameter | Type | Default | Description |
|---|---|---|---|
n | int | 8 | Number of instruction proposals |
temperature | float | 0.7 | LLM temperature for proposals |
max_tokens | int | 600 | Max tokens per proposal |
Meta-Update Config [prompt_learning.mipro.meta_update]
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable periodic regeneration |
every_iterations | int | 3 | Regenerate every N iterations |
topk_success | int | 3 | Top success examples for grounding |
topk_failure | int | 3 | Top failure examples for grounding |
validate_on_batch | int | 16 | Batch size for validation |
keep_k | int | 8 | Max instruction variants to keep |
dedup_token_overlap | float | 0.8 | Deduplication threshold |
regen_temperature_decay | float | 0.95 | Temperature decay per update |
Policy Config [prompt_learning.policy]
| Parameter | Type | Default | Description |
|---|---|---|---|
model | string | - | Model name (e.g., "gpt-4o-mini") |
provider | string | - | Provider: "openai", "groq", "synth" |
temperature | float | 0.0 | Sampling temperature |
max_completion_tokens | int | 128 | Max output tokens |
inference_mode | string | "synth_hosted" | Inference mode |
Returns
Results Structure
Download via CLI
Related
- GEPA — Alternative prompt optimization method
- Artifacts CLI — Download prompts
- Prompt Optimization SDK — Job events reference