Repository navigation
feat(optim): noise-aware confirmation, islands and MAP-Elites for evolve - #509
Conversation
07c38c6 to
fbc680c
Compare
Aria068
left a comment
There was a problem hiding this comment.
Thank you, what is the main benefit to this update. Could you link a doc
fbc680c to
b27f5e1
Compare
|
Thanks for taking a look! The main benefit is that 1. Noisy evaluators (
2. Diversity (
Docs:
|
ubuntu-latest moved to 26.04, which has no Python 3.9 build, so the 3.9 job failed at setup and fail-fast cancelled the other three. Pin the runner for the test and release workflows (the package supports >=3.9) and stop cancelling sibling jobs when one fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRbbGopnKbeX5NUc35UoPk
…evolve - confirm=n: a candidate whose first score beats the best is re-evaluated with the incumbent to 1+n samples each; only fully sampled candidates can be the best, and a proposal starts only if the budget can finish its comparison. Candidate keeps its samples; evaluation is their mean (types.combine). - islands=k / migrate_every=m: proposals rotate over sub-populations, and each island periodically gets the next island's best as inspiration. - selection="map_elites" with a descriptor: one elite per behavior cell, parents uniform over cells, inspiration from another cell. - benchmarks/evolution: a binpack behavior descriptor, map_elites and islands strategies, and noise_sim.py (no model) for confirm. The README reports the results, which show no clear gain from either diversity method on binpack and that confirm mainly reduces score overstatement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RS4zJj45n2d6zbs4vhsEFx
- docs/source/new_tutorials/evolution.md: the minimal function example, writing evaluators, evolving prompts, choosing a strategy (pareto, best, map_elites, islands, resample), held-out checks, confirm for noisy evaluators, and the result and log fields. Example outputs are from real runs. - use_cases/evolution/evolve_prompt.py: evolves a ticket-routing instruction scored on labeled tickets, with a held-out split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RS4zJj45n2d6zbs4vhsEFx
b27f5e1 to
fcea6f6
Compare
Stacked on #508. This branch contains #508's three commits; the last two commits (
fbe0d70feature,b27f5e1docs) are new here. Rebased ontomainafter #504 and #507 merged; I'll rebase again once #508 merges.Adds noise handling and diversity mechanisms to
adalflow.optim.evolution.evolve, each with tests and a benchmark that reports where it helps and where it does not.Changes
confirm=n(noisy evaluators). When a candidate's first score beats the best so far, it and the incumbent are re-evaluated until each has1 + nsamples, and the means decide. Only fully sampled candidates can be the best. A proposal starts only if the remaining budget can finish its comparison, so the returned best is always fully sampled.Candidatekeeps its samples, andevaluationis their mean (types.combine).islands=k,migrate_every=m. Proposals rotate over sub-populations. Parents and inspirations come from the current island, and everymproposals the next island's best is shown as the inspiration (logged as amigrationevent).selection="map_elites"with adescriptor(candidate -> tuple, which can read evaluator metrics). One elite is kept per behavior cell, parents are drawn uniformly over cells, and the inspiration comes from another cell.benchmarks/evolution:binpackbehavior descriptor: agreement with best fit × code length;map_elitesandislandsstrategies inrun.py;noise_sim.py, a model-free simulation ofconfirm.Results
Diversity (
claude-haiku-5-5,binpack, budget 30, 3 runs each):paretooverfit the most: its highest search score had its lowest held-out score.Noise (
noise_sim.py, no model, greedy, budget 60, 200 runs per cell).confirmalways reduces how much the reported best overstates its true quality (noise sd 0.1: +0.23 → +0.08). The re-evaluations cost budget, though:confirm=2).The docs therefore describe
confirmas a way to get honest scores, not as a way to search better.Tests
confirm=0,islands=1), behavior is unchanged and the earlier tests pass as before.Docs and example (commit 4):
docs/source/new_tutorials/evolution.md, a tutorial covering:confirmfor noisy evaluators;use_cases/evolution/evolve_prompt.pyevolves a ticket-routing instruction against labeled tickets, with a held-out split.claude-haiku-5-5): train went from 0.69 to 1.0 in three rewrites, and held-out from 0.50 to 0.92. One intermediate candidate was worse on average but was kept by Pareto selection, and the eventual winner descends from it.🤖 Generated with Claude Code
https://claude.ai/code/session_01RS4zJj45n2d6zbs4vhsEFx