Parent Selection Strategies

Installation
SKILL.md

Parent Selection Strategies

Parent selection is how HyperAgents balances exploration (trying new directions) with exploitation (refining what works). The choice of selection method significantly affects evolution dynamics.

Available Methods

random — Maximum Exploration

P(parent_i) = 1 / N  for all valid parents
  • Every valid parent has equal probability
  • Maximum diversity in the search
  • Good for early exploration when you don't know what works
  • Risk: wastes compute on low-fitness branches

latest — Linear Chain

Always select the most recent valid generation
  • Creates a simple chain: each generation builds on the last
  • No branching, no backtracking
  • Good for incremental refinement of a known approach
  • Risk: can't escape local optima

best — Maximum Exploitation

Always select the highest-fitness generation
  • Aggressively refines the best-known solution
  • Fast convergence when near a good solution
  • Risk: premature convergence, no exploration of alternatives

score_prop — Balanced (Recommended)

P(parent_i) = fitness_i / sum(all_fitness)
  • Higher-scoring parents are more likely to be selected
  • But any valid parent has a chance proportional to its score
  • Natural balance of exploitation and exploration
  • This is the default in HyperAgents

score_child_prop — Novelty-Aware

P(parent_i) = (fitness_i / (1 + children_i)) / Z

Where Z is the normalizing constant and children_i is the number of offspring already created from parent i.

  • Favors high-fitness parents that haven't been explored much
  • Encourages branching — explores different evolutionary paths
  • Best for open-ended search where diversity matters

Selection Algorithm

def select_parent(archive, output_dir, domains, method):
    # 1. Get candidates (valid parents only)
    candidates = {}
    for genid in archive:
        if not is_valid_parent(output_dir, genid):
            continue
        # Average fitness across all domains
        scores = [get_score(domain, output_dir, genid) for domain in domains]
        if all(s is not None for s in scores):
            candidates[genid] = mean(scores)

    # 2. Apply selection method
    if method == "random":
        return random.choice(list(candidates.keys()))
    elif method == "latest":
        return max(candidates.keys())
    elif method == "best":
        return max(candidates, key=candidates.get)
    elif method == "score_prop":
        weights = list(candidates.values())
        return random.choices(list(candidates.keys()), weights=weights, k=1)[0]
    elif method == "score_child_prop":
        child_counts = count_children(archive, output_dir)
        weights = [
            score / (1 + child_counts.get(gid, 0))
            for gid, score in candidates.items()
        ]
        return random.choices(list(candidates.keys()), weights=weights, k=1)[0]

Validity Check

A generation is a valid parent if:

  1. valid_parent: true in its metadata
  2. It has non-null fitness scores for all active domains
  3. It was not marked as failed by the meta-agent

When to Use Each Method

Scenario Recommended Method
Starting evolution, unknown domain random
Refining a known-good approach best
General purpose, most cases score_prop
Open-ended exploration, diversity matters score_child_prop
Ablation study, control condition latest
Many generations complete, seeking novelty score_child_prop

Examples

These scenarios illustrate when this skill activates and what it does.

Scenario 1: Evolve loop needs a parent for the next generation

Trigger: The evolve command reaches the "Select Parent" phase of the generate loop and calls /hyperagents:select-parent --method score_prop. Action: The skill loads archive.jsonl, filters to valid parents, computes fitness-weighted probabilities, and returns the selected parent genid. For example, with 4 valid parents scoring [0.60, 0.75, 0.82, 0.91], parent gen_4 (0.91) has a ~30% chance of selection while gen_1 (0.60) has a ~19% chance.

Scenario 2: User asks about exploration vs exploitation tradeoffs

Trigger: User asks "My evolution seems stuck, all offspring come from the same parent. How do I increase diversity?" Action: The skill diagnoses the issue as over-exploitation and recommends switching from best to score_child_prop, which down-weights parents that already have many children. It explains the formula and shows how the adjusted probabilities would look for the current archive.

Scenario 3: Dry-run to inspect selection probabilities

Trigger: User runs /hyperagents:select-parent --method score_child_prop --dry-run. Action: The skill computes and displays a table of all valid parents with their fitness scores, child counts, adjusted weights, and selection probabilities -- without actually selecting a parent. This lets the user verify the selection dynamics before committing to a strategy.

Diagnostics

Signs of poor parent selection:

  • All offspring from one parent: Switch to score_child_prop
  • No improvement for 5+ generations: Switch to random temporarily
  • Fitness oscillating: Switch to best to stabilize
  • Archive diversity too low: Switch to random or score_child_prop
Related skills
Installs
First Seen