feat: Weighted majority voting for classification domain ensemble#11
feat: Weighted majority voting for classification domain ensemble#11Ryuketsukami wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
The ensemble mechanism currently selects the single best-scoring agent from the archive (argmax). This is not true ensembling — it cannot combine predictions from different agents that may each be strong on different question types. For classification domains (search_arena, paper_review, imo_grading), implements weighted majority voting across the top-3 agents by score. Each agent's vote is weighted by its evaluation score. Falls back to single-best when fewer than 3 agents exist or for non-classification domains. The meta-agent can still evolve this file — this change improves the starting point, not the ceiling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hi @Ryuketsukami! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Problem
ensemble.pycurrently selects the single best-scoring agent from the archive and returns its prediction for each question. This is argmax selection, not ensembling — it cannot benefit from diversity across agents.For classification domains (search_arena: Accept/Reject, paper_review: Accept/Reject, imo_grading: 4-class), a globally best agent may be wrong on specific question types where a lower-scoring agent would answer correctly. Majority voting is a well-established baseline that exploits archive diversity.
The ensemble score feeds into parent selection (
type="max"inget_saved_score), so a better ensemble would also improve the evolutionary search dynamics.Solution
For classification domains (
search_arena,paper_review,imo_grading), implements weighted majority voting:Falls back to single-best when:
can_domain_ensembled()returns FalseThe meta-agent can still evolve
ensemble.py— this improves the initialization, not the ceiling.Tests
Added
tests/test_ensemble.py(12 tests):can_ensembleflag blocks votingQuestion for maintainers
Was the argmax ensemble chosen as a deliberately minimal baseline for the self-improvement to iterate on? If so, this change still preserves that property — the meta-agent can still modify
ensemble.pyfreely. The improvement is just a stronger starting point. If there's a reason to keep the baseline minimal (e.g., to measure the delta of self-improvement from a weaker start), let us know and we can revert.