feat: add configurable multi-step Best-of-N evolution - #397
Open
Enoch-H-Kang wants to merge 1 commit into
Open
Enoch-H-Kang wants to merge 1 commit into
Enoch-H-Kang wants to merge 1 commit into
Conversation
Changed Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR lets GEPA try several possible prompt/text improvements at each reflection step, pick the best-looking one, and optionally repeat that process multiple times before evaluating the final candidate.
GEPA generally produce one textual evolution per component per reflection step. With this change, users can configure:
bon: how many candidate textual evolutions to generate per stepitr: how many sequential inner evolution steps to run before evaluationFor example,
bon=3, itr=2means GEPA generates 3 possible updates, asks the reflection LM to choose the best one, then uses that selected update as the starting point for another round of 3 updates.What Changed
bonanditrtogepa.optimize(...).bonanditrtooptimize_anything.ReflectionConfig.StatelessReflectionLMpath.bon/itrvalues.config forwarding, and validation.
Validation
Ran the repository checks from
CONTRIBUTING.md:uv sync --extra dev --python 3.11uv run pre-commit run --files ...uv run pytest tests/564 passed, 4 skippeduv run pyright0 errors, 0 warnings