Imp.Optimizer.SIMBA (Imp v0.5.0)

Copy Markdown View Source

Stochastic Introspective Mini-Batch Ascent over arbitrary Imp programs.

SIMBA repeatedly samples program trajectories, prioritizes examples whose outputs vary most, and creates candidates by appending successful trace demos or predictor-specific reflective rules. It maintains an exploratory program population and performs final selection on the full validation dataset.

Reflection is grounded in the declared predictor names, signatures, instructions, and captured trajectories by default. :reflection_grounding may be set to {:text, context} for explicit consumer-owned context or to :module_source to opt into reading up to 20,000 characters from the program module's compile source. SIMBA never reads ambient source files under the default :structure mode.

Ordinary rollout and reflection failures remain visible in the report. Operational route, cost, budget, transport, and cancellation guards are always fatal across sampling, reflection, candidate scoring, and final selection.

Checkpoints

Pass these to Imp.optimize/4 or Imp.optimize/5. :max_steps limits new completed search steps in one invocation. :checkpoint_fn receives a JSON-safe checkpoint before work, after every completed step, and after every completed final evaluation. Pass any emitted checkpoint back through :resume_state. Step and final-evaluation boundaries are atomic; interrupted in-flight work is retried.

Summary

Functions

new(metric, opts \\ [])