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/Top-K

default/topk

Top-K

Always expand the single best program, with the next K as context. Pure greedy elitism.

Test-time searchApache-2.0
Scaffold cardFiles and versions

About

Top-K is the simplest SkyDiscover search strategy: at every step it selects the single best program as the parent and the next K programs (ranks 2 through K+1) as inspirations, drawn from an uncapped keep-all archive sorted by combined score. There is no topology, no migration, and no adaptive selection — just deterministic greedy elitism applied to the full history of everything ever generated.

The method is a faithful port of SkyDiscover's `TopKDatabase` (UC Berkeley Sky Computing Lab). In Galapagos it decomposes into an `InMemoryPopulation` acting as the flat fitness-sorted leaderboard plus a fixed-rule `TopKPolicy` that does the rank-1-parent / rank-2-to-K+1-context selection. The reference store enforces no population cap, so Top-K effectively keeps all candidates and re-ranks them on every selection.

Because the selection rule is fixed and stateless, Top-K is a reliable, reproducible baseline. It is the natural first thing to run when you want to sanity-check a new task or evaluator before committing budget to an adaptive search strategy, and it makes a clean reference point for measuring whether more elaborate selection actually helps.

Composition

5/6 blocks

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

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

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

  • Selectiontopk_greedy

    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

baselineelitismtop-kgreedyskydiscover

Source

SkyDiscover (UC Berkeley Sky Computing Lab) — topk search strategy

Quick facts

Downloads0
LicenseApache-2.0
Default model—
ControllerTopKScaffold

Use this scaffold

example.py
from galapagos import GalapagosScaffold

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