Prompts are code.
Optimize them like code.

Data in, objective set, optimizer runs, held-out set decides. No hand-tuning, no hoping.

What is prompt learning?

Machine learning applied to prompts. A trained model has a dataset, a loss, an optimizer and a validation set. Prompt learning gives a prompt the same four things: labeled examples, an objective (accuracy, format, latency, tokens, or a combination), a search algorithm that proposes and selects rewrites, and a held-out set that decides. Why the search is hard →

Four things prompt learning delivers

Each one is measurable. Each one is optimizable. None of them survive a model upgrade on their own.

Stability

Prompts drift every time a model changes. A scored dataset turns "it seems fine" into a regression test you can re-run in minutes.

Quality

Accuracy, format compliance, judge scores — pick the metric that matters and let the optimizer climb it instead of guessing.

Efficiency

Shorter prompts, fewer tokens, lower latency. Compression is an objective, not an afterthought.

Performance

Trade accuracy against cost on a Pareto front and choose the operating point your product actually needs.

What the optimizer is

A tree search over prompt rewrites, with two pluggable ideas from two different fields.

Reflective proposals (GEPA)

An LLM reads the prompt, the examples it failed and why, and rewrites. Text feedback carries far more information per rollout than a score does.

Bayesian selection

A surrogate over prompt embeddings predicts where the good children are, so full evaluations go where they are most informative — and it knows a lucky score on a small sample might be luck.

Whole programs, not one prompt

An agent is several prompts wired into a graph, some of them choosing the next step. The optimizer runs the graph, scores the end result and the trace, and rewrites one step at a time.

The two families are not rivals: bpto runs GEPA-style and BO selection as peers on the same tree, and the best configuration we have found uses both. How they compare →

The numbers

From logged experiments, and from the people counting agents.

0.708 → 1.000
accuracy on a two-step ticket-triage program (summarize → route) after ten rounds in Impromptune: 262 model calls, $0.004.
Studio tutorial run, Sept 2026 — see the walkthrough
97 → 6
tokens: an extraction prompt compressed by bpto; held-out F1 0.984 → 0.965. Across 12 seeds: 6–29 tokens.
Compression v2 experiment, Sept 2026 — see findings
0.97 vs 0.86
Bayesian selection vs GEPA's sampler under evaluation noise on synthetic landscapes (8 arms × 40 seeds).
40%
of enterprise applications will include task-specific AI agents by the end of 2026 — up from under 5% in 2025.
62%
of organizations are experimenting with or scaling agentic AI; 23% have a system in production.
3–6
prompts in a typical agent loop (system, planner, tool formatter, summarizer, answer). Each one is a separate optimization target.

Two ways to run it

The same optimizer, as a library and as a studio.

Open source

bpto — the engine

A Python library. Define a task (root prompt or program, dataset, scorer, objective), compose search operators, run with a budget and checkpoints. Everything on this site was measured with it.

github.com/sign-of-fourier/bpto

Studio

Impromptune

Every step of bpto without writing code. Draw the program on a canvas, attach labelled data, validate, run a pilot for the cost, watch the tree grow, and read the optimized prompts off each step.

Open Impromptune

Why prompts belong in your AI strategy

Agents multiply the prompt surface. A single chat assistant has one prompt. A ReAct-style agent has a system prompt, a planning prompt, a tool-call formatter, an observation summarizer and a final-answer prompt — and it runs each of them several times per task. Small inefficiencies compound per call, per step, per user.

Every model upgrade silently re-tunes every prompt. Prompts written for one model are not optimal for the next. Without a scored dataset and an optimizer, "upgrading the model" means re-doing the prompt work by hand, or not at all.

A measurable prompt strategy is the difference between a pilot and a product. Teams that treat prompts as versioned, evaluated, optimized artifacts ship faster and spend less. Teams that treat them as text in a config file discover regressions from customers.

The optimizer is abstract: it takes a starter program, a dataset and an objective, and searches. Accuracy, format compliance, latency, compression — same loop, different objective.

Frequently asked questions

How much data do I need?

Enough to detect the differences you care about. 100 training examples plus a held-out set was enough to separate search strategies in our runs; 30 was not. If you have production traces, you already have the data.

Which models does it work with?

Any: Amazon Bedrock and Anthropic models directly, and anything with an OpenAI-compatible endpoint (OpenAI, vLLM, Ollama, OpenRouter). The optimizer only needs a client that returns completions.

Does it handle multi-step agents?

Yes. A program is a graph of prompt steps; a step with several outgoing edges chooses the next one. The optimizer runs the whole graph per example and rewrites one step at a time, holding the others fixed — coordinate ascent for prompts.

What about prompt compression?

Compression is one objective of this optimizer — minimize tokens subject to an accuracy floor — and it has its own site: promptcompression.ai covers the business case and a worked example.

Can I use it from Claude Code or another coding agent?

Yes — there is a step-by-step page written for agents and an installable skill file.

Is it open source?

The engine, bpto, is open source on GitHub. Impromptune, the studio, is a hosted product built on it.

Who is Quante Carlo?

A small optimization company in Claverack, New York, with a Monte Carlo accelerator at its root. About us →