When to Use Prompt Learning
- You want rapid improvements to system prompts or candidate instructions with automated scoring.
- You already have a task app (the same environment used for RL) and just need to optimize textual guidance.
- You prefer an online process that streams progress and delivers a Markdown summary when complete.
Requirements
- Config: TOML specifying
prompt_learning.algorithm(gepaormipro), evaluation settings, datasets or candidate pools, and any scoring parameters. - Secrets: Both
SYNTH_API_KEYandENVIRONMENT_API_KEYare required. StoreTASK_APP_URLalongside them so the CLI doesn’t have to prompt. - Task app: Must respond to
check_task_app_health; fix outages before launching a run. - Experimental models: Gate access with
--allow-experimentalor--no-allow-experimental.
Launch a Run
- Config lock-in: Prompt learning ignores
--task-urloverrides; everything comes from the TOML to avoid mismatched environments. - Env resolution: Same
.envpicker used in other flows, but it insists on both Synth and environment keys. - Health check: Uses
check_task_app_healthexactly like RL; failures stop the flow before job creation. - Payload preview & job creation: Calls
POST {backend}/prompt-learning/online/jobsand prints the truncated response for auditing.
Streaming Options
--stream-format clishows summarized events (prompt.learning.progress,prompt.learning.final.results, etc.) while hiding noisy substrings.--stream-format chartdrawsgepa.transformation.mean_scoreover time—helpful for spotting convergence.- Adjust
--poll-timeout/--poll-intervalas needed; jobs typically finish faster than RL/SFT because they don’t retrain weights.
Results You Receive
- Live events describing discovered candidates, GEPA phases, or MIPRO evaluations.
- Final status JSON with success/failure plus backend metadata.
- Local Markdown report saved beside the referenced config. It contains:
- Best prompt and score, plus baseline metrics.
- Attempted vs optimized candidates.
- MIPRO Top-K table (rank, train/test scores, lifts, instruction snippets).
- Extracted text replacements for quick copy/paste into future configs.
Tips & Troubleshooting
- Because prompt learning reads task URLs directly from the config, double-check those values before running; the CLI will not incorporate
--task-url. - If health checks fail, verify
ENVIRONMENT_API_KEYandTASK_APP_URLin your.env; the CLI masks values but prints which keys were found. - Use
--allow-experimentaltemporarily when testing unreleased models; remove it from automation to avoid surprises.