Skip to main content
COPRO (Collaborative Prompt Optimizer) is a simple but effective optimizer that iteratively refines prompts through generation and evaluation cycles.

How it Works

COPRO uses a straightforward approach:
  1. Generate candidates: Create multiple prompt variations using an LLM
  2. Evaluate: Test each candidate on your training data
  3. Refine: Use the best candidates to generate improved versions
  4. Repeat: Continue for a fixed number of depth iterations

Configuration

Usage Example

Typed Data Loading

Use the shared data ingress guide: DataLoader.

When to Use COPRO

Best for:
  • Quick iteration cycles
  • Simple tasks
  • Limited compute budget
  • When you need results fast
Avoid when:
  • You need best possible quality (use MIPROv2 or GEPA)
  • Task has complex failure modes (use GEPA)
  • You want to leverage prompting best practices (use MIPROv2)

Comparison with Other Optimizers

Configuration Details

Breadth

Number of candidate prompts generated at each iteration. Higher breadth means more exploration but more compute. Recommended: 5-15

Depth

Number of refinement iterations. Each iteration builds on the best candidates from the previous one. Recommended: 2-5

Temperature

Controls randomness in prompt generation. Higher temperature means more diverse candidates. Recommended: 1.0-1.5

Track Stats

When enabled, COPRO tracks detailed statistics about all evaluated candidates and their scores over time.

Implementation Notes

COPRO maintains:
  • All evaluated candidates with their scores
  • Best candidates from each iteration
  • History of improvements over iterations
The algorithm avoids re-evaluating candidates it has already seen by caching results.

Examples

COPRO Examples

See examples 03-evaluate-hotpotqa.rs and 04-optimize-hotpotqa.rs