galapagos
DocsHubLeaderboardPlaygroundNews
galapagos

six blocks · any task ·
better solutions emerge.

Platform

  • Hub
  • Leaderboard
  • Playground

Resources

  • Docs
  • API reference
  • Card spec

Community

  • GitHub
  • Contribute

Updates

  • News
  • Releases

© 2026 Galapagos. Licensed under Apache-2.0.

Build your own scaffold.

Hub/Scaffolds/default/Best-of-N (attempt-counted)

default/best_of_n_attempts

Best-of-N (attempt-counted)

Best-of-N that rotates the parent every N attempts — failed/invalid tries spend the budget too.

Test-time searchApache-2.0
Scaffold cardFiles and versions

About

Best-of-N (attempt-counted) is the strictly-budgeted variant of Best-of-N. Like its sibling, it picks a parent program, reuses that same parent for several consecutive iterations, and then switches to the current global best before repeating the cycle. The only behavioral difference is how the per-parent budget is counted: this variant spends one unit of the N budget on every attempt, whether or not the attempt produces a valid, scorable child.

In the faithful `best_of_n` scaffold (a port of SkyDiscover's BestOfNDatabase), the parent-reuse counter advances only when a valid child is added, so a parse or evaluation failure is a free retry on the same parent. Here, the counter advances at selection time instead, which means a failure still consumes one of the parent's N attempts. The practical effect is that the parent rotates on a fixed cadence of exactly N iterations, regardless of how many of those iterations actually yielded usable children.

Everything else is shared with `best_of_n`: a flat keep-all in-memory population sorted by fitness, the standard multi-section default prompt, a SEARCH/REPLACE diff proposer with full-rewrite fallback, and no memory. Choose `best_of_n` when you want to match SkyDiscover's database semantics where failures are not charged; choose this variant when you want a strictly fixed per-parent compute budget and predictable parent turnover.

Composition

5/6 blocks

The six components this scaffold snaps together. Each block names its concrete implementation.

Population
keep_all
Selection
best_of_n_attempts
Prompt
default
Proposer
diff
Evaluator
task
Memory
none
  • Populationkeep_all

    The set of candidate solutions in play — the gene pool the search evolves over.

  • Selectionbest_of_n_attempts

    Decides which genomes survive and reproduce — tournament, elitism, novelty, or your own policy.

  • Promptdefault

    Assembles the context handed to the model — parents, feedback, instructions, examples.

  • Proposerdiff

    The LLM-driven variation operator — proposes new candidates by mutation and crossover.

  • Evaluatortask

    Scores each candidate against the task — the fitness signal that drives selection.

Tags

baselinesamplingbest-of-nexploitationvariant

Source

Galapagos variant of SkyDiscover's best_of_n search strategy

Quick facts

Downloads0
LicenseApache-2.0
Default model—
ControllerBestOfNAttemptsScaffold

Use this scaffold

example.py
from galapagos import GalapagosScaffold

scaffold = GalapagosScaffold.from_card(name="best_of_n_attempts")
result = scaffold.run(task="<task_name>")