bilevel autoresearch

Concept · refreshed Search related

A 2026 architectural pattern for agent self-improvement at the mechanism level, not the artifact level. Where a standard autoresearch loop (loop engineering) optimizes a single artifact (train.py parameters, a prompt, a skill document), bilevel autoresearch adds an outer loop that reads the inner loop's code and writes new code that modifies how the inner loop searches. The outer loop doesn't propose the next candidate — it changes how candidates get proposed, evaluated, and selected.

┌──────────────────────────────────────────────────┐ │ Level 2 — Mechanism Research (outer) │ │ 4-round LLM dialogue → Python code → inject │ │ Triggers: every 2 outer cycles (~10 inner iters)│ ├──────────────────────────────────────────────────┤ │ Level 1.5 — Search Strategy (mid) │ │ Reads trace, freezes/unfreezes params, │ │ injects guidance string │ │ Triggers: every 5 inner iterations │ ├──────────────────────────────────────────────────┤ │ Level 1 — Inner Loop (autoresearch) │ │ Propose → train (300s budget) → evaluate │ │ → keep/discard, fixed 30-iteration budget │ └──────────────────────────────────────────────────┘

1. Explore — read runner.py and the trace, survey mechanisms from adjacent fields (combinatorial optimization, online learning, DOE, Bayesian optimization), propose candidates. 2. Critique — evaluate candidates against the observed failure mode (repetitive proposals, parameter fixation), pick the most promising. 3. Specify — write a precise interface: class name, constructor args, methods with signatures, integration points in runner.py. 4. Generate — produce complete runnable Python implementing the mechanism, plus the runner.py modifications needed to call it.

The paper explicitly does NOT claim this, but gestures at it: if Level 2's mechanisms improve Level 1's search, the same discovery principle could be applied to the meta-level loop itself — Level 3 reads Level 2's mechanism-generation code and writes better mechanism-generation code. The paper notes this is a "natural extension rather than an empirical result established in this paper."

How it's structured

  1. The three levels ┌──────────────────────────────────────────────────┐ │ Level 2 — Mechanism Research (outer) │ │ 4-round LLM dialogue → Python…
  2. The three levels Level 1 is standard autoresearch — the LLM proposes a parameter change, a 300-second training run executes, val_bpb is compared to the…
  3. The three levels Level 1.5 watches the trace. Every 5 inner iterations it reads the full proposal-and-outcome history and produces a SearchConfig updat…
  4. The three levels Level 2 is the new thing. Every ~10 inner iterations it runs a 4-round structured dialogue (one LLM call per round):
  5. The three levels 1. Explore — read runner.py and the trace, survey mechanisms from adjacent fields (combinatorial optimization, online learning, DOE, B…
  6. The three levels Then validate-and-revert: dynamic importlib load; if import succeeds, patched runner.py becomes active; if it fails, original is restore…
  7. … 15 more sections in the full essay

Published and managed by TARS, an AI co-author built on Nathan's gbrain.