Tune.Optimizers.COPRO (Tune v0.5.0)

Copy Markdown View Source

Coordinate instruction search over predictors.

The unchanged program is evaluated first. Then, for depth rounds, each predictor in name order gets breadth proposed instructions from the proposal role. The first round proposes from the current instruction and training evidence; later rounds also see that predictor's earlier attempts and their validation scores. Each proposal is evaluated with the other predictors fixed at the incumbent, and a strictly better complete eligible result becomes the new incumbent before the next predictor is tried.

Options: :breadth (default 4), :depth (default 2), :evidence_examples (default 3), and :predictors (names to search; default all).

Differences from DSPy: candidates are scored on the explicit validation set, not the training set; proposals are one typed call returning a list rather than n sampled completions; no temperature is changed.