Skip to content

Batch evaluation: crown the best challenger, not the fastest#2

Open
angosr wants to merge 1 commit into
unarbos:mainfrom
angosr:feat/batch-evaluation
Open

Batch evaluation: crown the best challenger, not the fastest#2
angosr wants to merge 1 commit into
unarbos:mainfrom
angosr:feat/batch-evaluation

Conversation

@angosr

@angosr angosr commented Apr 16, 2026

Copy link
Copy Markdown

Background

The current validator crowns the first challenger that passes the bootstrap threshold (LCB > delta). This rewards submission speed rather than model quality — miners race to submit first instead of training better models.

What this PR does

Adds a batch evaluation mode: instead of accepting the first passing challenger, the validator collects pending submissions into a batch, evaluates all of them on the same shard and sequences, then selects the one with the highest μ̂.

Key design choices:

  • Shared king baseline: King losses are computed once per batch and reused across all challengers. This cuts ~50% of GPU time per additional challenger.
  • Same evaluation data: All challengers in a batch are compared on identical sequences, eliminating data-induced variance from the comparison.
  • Backward compatible: Controlled by TEUTONIC_BATCH_MAX env var (default 5). Set to 1 to restore the original first-to-pass behavior.

Changes

  • eval_torch.py: Two new functions (compute_king_baseline, eval_challenger_against_baseline) that decompose run_bootstrap_test into reusable phases. Original function untouched.
  • eval_server.py: Two new endpoints (POST /eval/king-baseline, POST /eval/challenger). Original POST /eval untouched.
  • validator.py: New process_batch() function and main loop branching on BATCH_MAX.

Instead of crowning the first challenger that passes delta, collect up to
BATCH_MAX challengers, evaluate all on the same shard with shared king
baseline, and select the one with highest mu_hat. King losses are computed
once per batch for efficiency.

New env var TEUTONIC_BATCH_MAX (default 5) controls batch size.
Set to 1 to restore legacy first-to-pass behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant