Skip to content

Add budgeted local search for expensive, asynchronous evaluations - #2

Merged
casoon merged 1 commit into
masterfrom
feat/budgeted-local-search
Oct 2, 2026
Merged

casoon merged 1 commit into
masterfrom
feat/budgeted-local-search

Conversation

@casoon

@casoon casoon commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Adds an optimizer for problems whose evaluation is expensive, asynchronous and noisy — e.g. tuning a language-model program against a dataset (used by TypedLM's few-shot optimizer).

  • AsyncOptimizationProblem: evaluate returns a future, the score only needs Clone, and is_improvement decides acceptance, so a noisy score can carry per-sample results for a statistical test.
  • budgeted_local_search: first-improvement local search with a budget of evaluations, a cache of evaluated states and a seeded neighbor order. Runtime-agnostic, no new dependencies; parallelism belongs inside evaluate.
  • LcgRng moved to a crate-internal core::rng and shared with simulated annealing (no behaviour change).
  • Declares rust-version = "1.88": branch_and_bound uses let chains, so builds below 1.88 already failed.

Checked locally: cargo fmt --check, cargo build --all-targets, cargo test --all-targets, cargo clippy --all-targets -- -D warnings, cargo doc --no-deps with -D warnings, and cargo +1.88.0 check --all-targets.

- AsyncOptimizationProblem: evaluate returns a future, scores only need Clone,
  is_improvement decides acceptance (for noisy scores)
- budgeted_local_search: first-improvement local search with a budget of
  evaluations, a cache of evaluated states and a seeded neighbor order
- shared crate-internal LcgRng in core::rng
- declare rust-version 1.88 (let chains in branch_and_bound)
casoon added a commit to casoon/typedlm that referenced this pull request Oct 2, 2026
- optimize_few_shot (feature optimize): chooses k demonstrations from a pool
  by budgeted local search on a validation set; result as CompiledProgram
  with provenance, baseline and best reports, paired comparison and trials
- candidates from complete labels or a teacher program's correct answers
- pathwise as git dependency on casoon/pathwise#2 until it is released
- MSRV checks split: 1.85 without optimize, 1.88 with it (pathwise)
@casoon
casoon merged commit fec5b22 into master Oct 2, 2026
2 checks passed
@casoon casoon mentioned this pull request Oct 2, 2026
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