Interactive Evolutionary Computation in PythonHuman, simulated and AI evaluators. The easyiec toolbox

Chapter 1
Introduction

This chapter explains what interactive evolutionary computation is good for, why its old bottleneck — the tired human evaluator — is changing with vision–language models, and why that change calls for a science of evaluators rather than a simple replacement. It introduces the easyiec package and a first session with it. The notation and the building blocks follow in chapter 2.

1.1 Optimizing what is judged

An optimization problem needs a search space, a way to generate candidates and a way to tell good candidates from bad ones. In most of engineering the third ingredient is a computable objective. In many problems, however, quality is a matter of judgement. The response of a control loop is “good” when it is fast, well damped, gentle on the actuator and robust, and the weight of each property depends on the plant and on the engineer [2]. A fermentation profile is good when the beer is ready soon, strong and free of off-flavours, and the trade-off is the brewer’s [9]. An image grading, a colour palette, a logo, a melody or a slogan is good when people like it. In all of these cases one can write a weighted sum of criteria, but the weights are unknown, the criteria incomplete, and the optimum of the formula is often a caricature of what was wanted.

Interactive evolutionary computation replaces the objective by an evaluator [1]. An evolutionary algorithm proposes a gallery of candidates; the evaluator looks at them and answers — chooses the good ones, ranks them, compares two, points at the best on a slider; the algorithm learns from the answer and proposes the next gallery. Dawkins’ biomorphs [10], Sims’ evolved images [11] and Picbreeder [12] showed how far the idea carries in art and design; Takagi’s review [1] counted applications from hearing-aid fitting to geophysics; the EASY-IEC toolbox brought it to controller tuning and fermentation design [2]. Figure 1.1 shows the loop as it is implemented in this book.

Figure 1.1

Figure 1.1. The interactive evolutionary loop of easyiec. A strategy asks a query, the evaluator answers in one of seven protocols, the answer is converted into weighted pairwise preferences from which every strategy can learn, and the session log records everything for analysis and validation.

1.2 The tired evaluator and the AI judge

The weak point of IEC has always been the evaluator. A person can make a few hundred careful judgements before attention drops; answers become noisy, the gallery is skimmed rather than examined, and the first images get chosen more often than the last [1]. Three lines of research have fought this limitation. Better algorithms need fewer answers: evolution strategies with self-adaptation [13], preferential Bayesian optimization [14, 15], and protocols that ask more informative questions, such as a slider or a two-dimensional gallery [16, 17]. Surrogate models of the evaluator pre-screen the candidates so that people see only the promising ones [18]. And simulated users with a known taste let algorithms be compared without volunteers [13].

Since 2023 a fourth possibility exists. Large language models judge texts [4], and vision–language models judge images; quality-diversity search guided by AI feedback has produced diverse, high-quality creative texts [19], evolution guided purely by LLM judges has been demonstrated on open-ended tasks [20], and vision–language models have been used to select virtual creatures by subjective terms such as “adorably” [21]. An AI judge does not tire and costs little. It is, however, a measuring instrument of unknown quality. It may prefer the first option shown [4, 5]; it may be inconsistent between repetitions or intransitive across a round robin; its threshold for noticing a difference may be coarse; and its taste may simply not be the taste of the person it replaces. Whether it may replace people is an empirical question with a statistical answer [6].

1.3 What this book adds

The book and its package take the evaluator seriously, in four ways.

Around these, the package implements the strategies of the IEC and preference-learning literature in a common ask–tell form (chapters 3 and 4), visualizations of interactive search (chapter 7), applications from engineering (chapter 8) and the visual and creative domains (chapter 9), a factorial benchmark with simulated users (chapter 10) and a validation study with Claude (chapter 11).

1.4 The toolbox

easyiec is a pure Python package built on NumPy, SciPy, pandas and Matplotlib [23, 24, 25]. The language-model clients use the HTTP APIs of the providers through the standard library. The modules follow the loop of fig. 1.1:

1.5 A first session

A Julia set has ten genes: the complex constant in polar form, zoom, centre, four colour genes and the shade of the interior. In the first example of the gallery a simulated user who secretly prefers one particular Julia set evaluates nine images per generation with an interactive genetic algorithm:

problem = JuliaSet() 
user = ei.SimulatedUser(problem, target="random", noise=0.05, seed=3) 
result = ei.run(problem, InteractiveGA(pop_size=9), user, generations=12, seed=3) 
print(result) 
print(problem.describe(result.best.genome))
   

Because the simulated user’s taste is known, every shown image has a ground-truth utility in [0,1], and the session can be judged by how close it came. Figure 1.2 shows four of the twelve galleries with the chosen images framed, and fig. 1.3 the best utility found against the number of images shown — the classical measure of evaluator effort in IEC. With a person in front of a notebook the same loop is one line, ei.ui.JupyterGallery(JuliaSet(), InteractiveGA()); with Claude as the evaluator it is the judge of section 5.3.

Figure 1.2

Figure 1.2. Four galleries (queries 0, 3, 7 and 11) of an interactive GA on Julia sets with a simulated user. Framed: the images the user chose. The population drifts towards the user’s hidden target within a few generations.

Open in ColabExample plot_01_first_session.py in the gallery

Figure 1.3

Figure 1.3. Best ground-truth utility of the shown images against the number of images shown (line), with the utilities of all shown (grey) and chosen (vermilion) images.

In a nutshell: Interactive evolutionary computation

  • IEC optimizes what is judged: an algorithm proposes, an evaluator chooses, the choices replace the fitness function.
  • The evaluator is the bottleneck: people tire after a few hundred judgements; AI judges do not tire but have biases and thresholds of their own.
  • easyiec runs one loop for every evaluator and converts every answer into weighted pairwise preferences; its validation tools decide whether an AI judge may replace people.