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: object

Captured regression surrogate used to rank follow-up design candidates.

The object is callable as student(x) -> predicted_score so 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.

Parameters:
fit_student(run, *, degree=2)[source]

Fit StudentTeacher from run’s oracle-verified history.

Parameters:
  • run (DesignRun)

  • degree (int)

Return type:

StudentTeacher

class AmplificationRound(run, best_score, xs)[source]

Bases: object

One oracle-verified amplification round and its best observed score.

Parameters:
class AmplifyReport(round1, round2, baseline_single_input_score, beats_single_input, round2_beats_round1, collapse, student, stopped_early, reason)[source]

Bases: object

Receipt for a two-round amplify-and-capture run.

round1 is the initial oracle-driven search. round2 is present only when round 1 beats the single-input baseline and a captured student is used to propose the matched-budget follow-up batch. collapse records the trajectory-level collapse verdict when both rounds run.

Parameters:
  • round1 (AmplificationRound)

  • round2 (AmplificationRound | None)

  • baseline_single_input_score (float)

  • beats_single_input (bool)

  • round2_beats_round1 (bool)

  • collapse (CollapseVerdict | None)

  • student (StudentTeacher | None)

  • stopped_early (bool)

  • reason (str | None)

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_iter calls (the amplified teacher). The search must beat a single ungrounded guess, or this returns the explicit stopped_early=True result with nothing distilled. Otherwise: fit StudentTeacher from 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. Runs mixle.task.collapse.collapse_monitor() over the two rounds.

Parameters:
Return type:

AmplifyReport