Prompt Optimization

AutoPDL

AutoPDL asks a different question from most prompt optimizers: not just how to word a prompt, but which prompting pattern to use in the first place. It treats agent prompt design as an automated-machine-learning search over patterns like zero-shot, chain-of-thought, and ReAct, together with the choice of examples, and uses successive halving to find a strong combination. The result is not a black box but a readable, editable program you can inspect and adjust.

*These are learning tools, not prompts. They teach you to write your own, think of them as training wheels that guide you while you learn, then fall away once you can ride on your own.

The Core Insight

Choose the Pattern, Not Just the Words

Most prompt optimizers assume the shape of the prompt is fixed and only search over its wording or its examples. But for agents, one of the biggest decisions is structural: should this task use a plain zero-shot prompt, a chain-of-thought, a ReAct loop that interleaves reasoning and tools, or a plan-then-work structure? The right pattern depends on the task and the model, and guessing wrong caps how well any wording can do.

AutoPDL frames this as an automated-machine-learning problem. It defines a combinatorial search space that includes several prompting patterns and the choice of demonstrations, then searches that space for the best configuration for a given task and model. Because the space is large, it uses successive halving, a standard AutoML method that gives every configuration a little budget, keeps the top performers, and gives them more, quickly concentrating effort on the best candidates.

What AutoPDL emits is as important as how it searches. Instead of an opaque tuned string, it produces a human-readable program in a prompt declaration language, so the discovered pattern and examples can be read, understood, and edited by a person. Optimization becomes source-to-source: you get a transparent artifact, not a mystery prompt.

A Readable Program, Not a Black Box

AutoPDL's output is a program in a prompt declaration language that spells out the chosen pattern and demonstrations in a form a person can read and change. So the optimization is auditable: you can see exactly which structure won and adjust it, rather than trusting an opaque tuned string.

The AutoPDL Process

Define the space, search with successive halving, and emit a program

1

Define the Search Space

Lay out the choices to search over: which prompting patterns are allowed, such as zero-shot, chain-of-thought, and a reason-and-act loop, and which demonstrations can be included. This turns prompt design into a structured configuration problem.

Example

For a tool-using agent, the space includes a plain prompt, a chain-of-thought variant, and a ReAct loop, each with different example sets.

2

Search With Successive Halving

Give every configuration a small evaluation budget, keep the top fraction, and give the survivors a larger budget, repeating until one remains. This AutoML method finds strong configurations without fully evaluating every option.

Example

Weak pattern-and-example combinations are eliminated after a light test, while promising ones earn deeper evaluation.

3

Select the Best Configuration

The configuration that survives the search, a specific pattern paired with specific demonstrations, is chosen as the best fit for this task and model. The structural decision and the example choice are made together.

Example

The ReAct loop with three well-chosen examples wins for the tool-using agent, beating the plainer patterns.

4

Emit an Editable Program

AutoPDL writes the winning configuration as a readable program in a prompt declaration language. A person can inspect the chosen pattern and examples, understand why the agent is structured that way, and edit it directly.

Example

The output shows the ReAct structure and its examples in plain form, ready to review and tweak before deployment.

See the Difference

Tuning words in a fixed shape versus searching the shape itself

Fixed-Pattern Optimizer

Optimize Wording Only

The prompting pattern is decided by hand up front, and the optimizer only tunes the wording or examples within that fixed structure.

Limit

If the chosen pattern is a poor fit for the task, no amount of wording tuning reaches what a better structure would allow.

Capped by a hand-picked structure
VS

AutoPDL

Search the Structure

AutoPDL searches over prompting patterns and examples together with successive halving, choosing the structure as well as the content.

Result

It finds the pattern that actually fits the task and model, and emits it as a readable, editable program.

Chooses the right pattern, stays transparent

Practice Responsible AI

Always verify AI-generated content before use. AI systems can produce confident but incorrect responses. When using AI professionally, transparent disclosure is both best practice and increasingly a legal requirement.

Most US states are actively legislating AI transparency and accountability. Critical thinking remains your strongest tool against misinformation.

AutoPDL in Action

See how searching the pattern space changes the result

Two Tasks

One task is simple lookup; another needs multi-step tool use.

AutoPDL Search

Lookup task: the search finds that a plain zero-shot prompt wins, since reasoning steps add cost without accuracy.

Tool-use task: the search finds that a reason-and-act loop wins, because interleaving thought and tool calls is what the task needs.

Result: each task gets the structure that fits it, chosen automatically rather than guessed.

Many Configurations

Dozens of pattern-and-example combinations are possible for one agent.

Budget Allocation

Round one: every configuration gets a small test; the bottom half is dropped.

Later rounds: survivors get progressively more budget, concentrating evaluation on the best combinations.

Result: a strong configuration is found without fully evaluating every option.

The Result

AutoPDL emits the winning configuration as a program in a prompt declaration language.

Human Review

A developer opens the program, sees that a chain-of-thought pattern with two examples was chosen, and understands why.

Edit: they swap one example for a clearer one and redeploy, an adjustment an opaque tuned string would not have allowed.

When to Use AutoPDL

Best when the prompting pattern itself is worth optimizing

Perfect For

LLM Agents

Agents can be built with very different structures, so searching over patterns like zero-shot, chain-of-thought, and reason-and-act loops has real payoff.

Uncertain Which Pattern Fits

When it is not obvious whether a task needs reasoning steps or tool use, letting the search decide beats guessing the structure by hand.

Auditable Optimization

When you need to inspect and edit the result, the readable program output keeps the optimized prompt transparent rather than opaque.

Across Tasks and Model Sizes

Because the best pattern varies by task and model, an automatic search adapts the structure to each setting instead of assuming one fits all.

Skip It When

The Pattern Is Obvious

If the right structure is already clear, searching over patterns adds overhead, and a wording-only optimizer is simpler.

No Evaluation Data

Successive halving needs a way to score configurations; without examples or a metric, the search has nothing to rank by.

A Single Simple Prompt

For a basic one-shot task with no agentic structure to choose, the pattern search offers little over direct prompting.

Use Cases

Where AutoPDL delivers the most value

Agent Design

Automatically choose the prompting pattern and examples that make a tool-using agent perform best on its task, rather than fixing the structure by hand.

Transparent Prompt Programs

Produce optimized prompts as readable programs that a team can review, version, and edit, keeping the pattern choice out in the open.

Adapting to a New Model

Re-run the search when switching models, since the best prompting pattern can shift with model size and capability.

Benchmarking Agent Setups

Compare prompting patterns fairly on a task by letting successive halving allocate budget to the most promising configurations.

AutoML for Prompting

Bring established automated-machine-learning search methods to the design of prompts and agent structures, not just model hyperparameters.

Editable Starting Points

Use the emitted program as a strong, transparent baseline that developers can refine by hand rather than starting from scratch.

Where AutoPDL Fits

The pattern-searching, program-emitting optimizer

MIPRO Instructions and Demos Joint program search
ReAct Reason and Act One agent pattern
AutoPDL Search the Pattern AutoML, editable programs
DSPy Program the Pipeline Optimizers in a framework
Chain These

Where MIPRO optimizes instructions and demonstrations within a set structure, AutoPDL also searches which agent pattern to use, and it emits an editable program. Reach for it when the structural choice, zero-shot versus chain-of-thought versus a reason-and-act loop, is itself in question.

Search for the Right Structure

Explore how different prompting patterns suit different tasks in the Prompt Builder, or see how AutoPDL relates to the wider family of prompt optimizers.