Nous.Eval.Optimizer.Strategies.OPRO (nous v0.21.1)

Copy Markdown View Source

Optimization by prompting (OPRO, Yang et al. 2023): the cheap mode.

The reflector sees the best earlier versions of every component with their scores (up to 20, shown in ascending order) and a few example inputs, and writes proposals new versions per step (8 by default) at temperature 1.0. Each version is linted, sealed and scored on a fixed subset of the train split; the history keeps the 20 best.

No traces or per-case feedback reach the reflector, so OPRO is blind to why a case failed: GEPA is the better choice when the signal is in the trajectory (wrong tool, wrong arguments), OPRO when only the score moves.

best/1 is the version with the best subset score; like the paper, OPRO selects on train, and the optimizer's held-out test acceptance is what protects against overfitting the subset.

Options (strategy_opts:)

  • :proposals - versions per step (default 8)
  • :subset_size - train cases in the fixed subset (default 20, at most the train split)
  • :history - versions kept and shown (default 20)
  • :examples - example inputs shown per step (default 3)