Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 36 ยท Crossover and Mutation

Parameter Control and Self-Adaptation

Stop hand-tuning mutation and crossover rates: learn deterministic schedules, the 1/5 success rule, self-adaptive step sizes and feedback control, with Python examples.

Every lesson so far asked you to choose a mutation rate, a step size or a tournament size. But the best setting changes during a run. Early on, big steps explore. Late, when the population sits on a promising peak, the same big steps destroy good solutions and tiny steps polish them. A single fixed value is a compromise that is wrong at both ends.

Parameter control lets the algorithm change its own parameters while it runs. This lesson separates tuning (choose values before a run) from control (change them during the run), and shows three control methods: deterministic schedules, adaptive feedback rules and self-adaptation.

Tuning versus control

  • Parameter tuning: find good fixed values by experiments before the final run (grid search, random search, or a meta-GA; see Applications and Tuning). You pay once, in advance.
  • Parameter control: let values change during the run according to a rule. Three flavors:
    1. Deterministic: a fixed schedule by generation number, ignoring feedback.
    2. Adaptive: a rule that uses feedback from the search (was the last change successful?).
    3. Self-adaptive: the parameter is part of the chromosome and evolves along with the solution.
flowchart TD
    A["Parameter control"] --> B["Deterministic<br/>schedule by generation"]
    A --> C["Adaptive<br/>feedback rule"]
    A --> D["Self-adaptive<br/>parameter inside the genome"]

Three ways a GA can steer its own settings.

Deterministic schedules

Change a parameter as a function of time. Classic examples:

  • Decreasing mutation step: sigma(t) = sigma0 * (1 - t / T), or exponential decay sigma0 * 0.99^t.
  • Increasing selection pressure: tournament size grows from 2 to 5 over the run.
  • Decreasing mutation rate for bit strings from 5/L down to 1/L.

It is simple and needs no feedback, but the schedule is a guess: it does not notice if the population converged early or is still exploring.

Python A decaying mutation step

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A big fixed step cannot refine: its final cost stays relatively high. A tiny fixed step refines but starts slowly. The decaying schedule gets both. (The sphere function has one optimum, so decay is an easy win. On multimodal problems the schedule can shrink before the right peak has been found.)

The 1/5 success rule

The best-known adaptive rule comes from evolution strategies. It looks at the success rate ps: the fraction of recent mutations that produced a child better than its parent.

  • If ps > 1/5, mutations succeed too easily, so steps are too small. Increase sigma.
  • If ps < 1/5, mutations mostly fail, so steps are too large. Decrease sigma.

A common implementation multiplies sigma by 1.22 or divides by about 1.22 every few trials.

Python The 1/5 success rule on a (1+1) strategy

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The adaptive runs end with a much lower cost and, importantly, start from either bad sigma: the rule finds a good step size by itself. Note how it shrinks sigma as the search converges, exactly the schedule you would otherwise have to guess.

Feedback control of GA parameters

The same idea applies to GA rates. Examples of feedback rules:

  • Diversity-driven mutation: if diversity (average distance, unique count) drops below a threshold, raise the mutation rate; if above, lower it.
  • Stagnation-driven: if the best fitness has not improved for k generations, increase mutation or inject new individuals.
  • Operator-probability adaptation: track which crossover or mutation operator produced improvements recently and use those more often (adaptive operator selection, a bandit-style approach).
Python Raise mutation when diversity falls

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

When the diversity falls under the threshold, the adaptive run raises its mutation rate, which keeps variation alive. The mutation rate then relaxes again once diversity returns. Look at the printed rates to see the controller in action.

Self-adaptation

In self-adaptation the parameters live in the chromosome: each individual carries its own mutation step size sigma, which is mutated first and then used to mutate the solution genes. Selection acts on the solution, so step sizes that tend to produce good children are inherited along with them. No external rule decides; evolution finds good values.

A standard update for a step size is log-normal: sigma' = sigma * exp(tau * N(0, 1)), with tau about 1 / sqrt(d), then x' = x + sigma' * N(0, 1).

Python Self-adaptive step sizes

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Whatever the starting step size, the population evolves a suitable one: very small sigmas grow and very large ones shrink, and the mean sigma falls steadily as the search converges on the optimum. This is the core of evolution strategies, which you will see again in the metaheuristics chapter.

Pitfalls

  • Adaptation is not free. The control rule has its own parameters (window size, thresholds, learning rate). They are usually easier to set than the original parameter, but not absent.
  • Feedback can oscillate. Smooth changes (multiplying by 1.1, not 10) keep control stable.
  • Noisy feedback misleads. With a noisy fitness, success rates are unreliable. Use longer windows.
  • Always compare to a tuned fixed baseline over several seeds before claiming adaptation helps.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What distinguishes parameter control from parameter tuning?

    Tuning finds good fixed settings in advance, while control lets the algorithm adjust settings as the run progresses.
  2. 2. In the 1/5 success rule, what should you do when more than a fifth of mutations succeed?

    High success means steps are too timid, so enlarging sigma lets the search progress faster.
  3. 3. What is self-adaptation?

    Each individual carries its own parameters, so values that lead to good children are inherited by selection.
  4. 4. A diversity-driven controller raises mutation when diversity is low. What problem is it attacking?

    Low diversity signals the population has collapsed, and extra mutation reintroduces variation.

Summary

  • Fixed parameters are a compromise; control lets settings change during a run.
  • Deterministic schedules (decaying sigma, growing tournament) are simple but blind to feedback.
  • The 1/5 success rule adjusts step size from the observed success rate.
  • Feedback rules based on diversity or stagnation protect against premature convergence.
  • Self-adaptive genes evolve their own step sizes, the idea at the heart of evolution strategies.

Next: Continue with the rest of the course(/genetic-algorithms)