mixle.doe.amplify module¶
Capture an amplified teacher with collapse monitoring.
The “amplified teacher” here is optimize_under_oracle()’s search itself: round
1 spends an oracle-call budget searching, and is verified stronger than a single ungrounded guess before
anything else happens. If the search does not beat its best single input, there is nothing to capture,
and this function stops with an explicit reason rather than distilling nothing.
The student captured from round 1 is a low-cost regression surrogate of the oracle’s score landscape, fit
only from round 1’s oracle-verified (x, score) pairs. It never grades a candidate itself; it only
proposes where round 2 should spend its matched oracle-call budget. student(x) is a plain
candidate -> predicted_score callable, the same shape any other teacher/task-model in this codebase
is called with. Every accepted score in round 2
still comes from the oracle. No student or LLM self-grade enters DesignRun.history.
mixle.task.collapse.collapse_monitor() checks the two-round trajectory for
regression or mode collapse; it is reused here rather than reimplemented.
- class StudentTeacher(coef, degree)[source]
Bases:
objectCaptured regression surrogate used to rank follow-up design candidates.
The object is callable as
student(x) -> predicted_scoreso it can be used like other teacher/task-model callables, but its role here is only proposal ranking. Accepted scores still come from the verifiable oracle.
- fit_student(run, *, degree=2)[source]
Fit
StudentTeacherfromrun’s oracle-verified history.- Parameters:
run (DesignRun)
degree (int)
- Return type:
StudentTeacher
- class AmplificationRound(run, best_score, xs)[source]
Bases:
objectOne oracle-verified amplification round and its best observed score.
- class AmplifyReport(round1, round2, baseline_single_input_score, beats_single_input, round2_beats_round1, collapse, student, stopped_early, reason)[source]
Bases:
objectReceipt for a two-round amplify-and-capture run.
round1is the initial oracle-driven search.round2is present only when round 1 beats the single-input baseline and a captured student is used to propose the matched-budget follow-up batch.collapserecords the trajectory-level collapse verdict when both rounds run.
- amplify_and_capture(oracle, bounds, *, n_init=5, n_iter=10, candidate_pool_size=200, degree=2, seed=None)[source]
Round 1: search the oracle for a budget of
n_init + n_itercalls (the amplified teacher). The search must beat a single ungrounded guess, or this returns the explicitstopped_early=Trueresult with nothing distilled. Otherwise: fitStudentTeacherfrom round 1’s history; round 2 uses the student to rank a large candidate pool efficiently and spends the same oracle-call budget verifying only the top-ranked candidates – student-guided, not blind, but every accepted score is still oracle-verified. Runsmixle.task.collapse.collapse_monitor()over the two rounds.