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

Chapter 4
Learning preferences

Evolutionary strategies forget most of what the evaluator said: only the latest choices shape the next gallery. This chapter shows how the answers can be accumulated in a statistical model of the evaluator’s utility, and what such a model buys: preferential Bayesian optimization, sequential line search and gallery, which ask the most informative questions; surrogates that spare the evaluator from obviously poor candidates; and rank aggregation for panels. The models are the Bradley–Terry family and Gaussian-process preference learning.

4.1 From comparisons to a utility

All answers reduce to weighted pairwise preferences 𝒞={(a,b,w)} (section 2.3). A preference model postulates a latent utility f and a link between utility differences and choice probabilities. Thurstone’s law of comparative judgement [39] assumes Gaussian perceptual noise, which gives the probit link; the Bradley–Terry–Luce model [40, 41] assumes Gumbel noise, which gives the logistic link:

ℙT(a≻b)=Φ(f(𝐱a)−f(𝐱b) 2σ),ℙBTL(a≻b)=1 1+e−(f(𝐱a)−f(𝐱b)).(4.1)

The package fits three models with a common interface, fit(X, pairs) and predict(X), which returns the posterior mean and standard deviation of the utility.

Figure 4.1 compares the three models on a multimodal landscape after 120 comparisons by a simulated user: the linear model sees only a tilt; the kernel model and the GP recover the peaks. The learning curves of the gallery example show that the GP is the most data-efficient below a hundred comparisons, which is the regime of interactive search.

pairs = comparisons(120, rng) 
models = {"linear BT": LinearBT(), "kernel BT (RFF)": KernelBT(lengthscale=0.2), "GP preference": GPPreference()} 
for m in models.values(): 
    m.fit(X, pairs)
   

Figure 4.1

Figure 4.1. Utilities learned from 120 noisy comparisons of 60 items (white dots) by a simulated user, compared with the hidden utility (left); ρ is the Spearman correlation with the hidden utility on the grid.

Open in ColabExample plot_06_preference_models.py in the gallery

4.2 Preferential Bayesian optimization

Bayesian optimization chooses each evaluation where a statistical model promises the most; preferential Bayesian optimization does so with duels [14, 15]. PreferentialBO keeps the incumbent — the compared item with the highest posterior mean — and duels it against a challenger chosen by an acquisition function over random candidates and perturbations of the incumbent. Three acquisitions are offered: expected improvement over the incumbent’s mean, an upper confidence bound, and, by default, an approximate Thompson sample that draws one independent sample of the posterior marginal at each candidate [45]. In our experiments the latter explored better and was cheaper than expected improvement, whose optimization on a fitted preference GP tends to stay close to the incumbent. Batches of duels are possible; each question remains as simple as possible for the evaluator.

A duel carries at most log⁡23 bits. Koyama and co-workers asked richer questions of the same model. In sequential line search [16] the evaluator moves a slider along the line between the incumbent and the acquisition maximizer and points at the best position; the answer says that the chosen point is better than all other points on the line. In the sequential gallery [17] the evaluator picks the best cell of a 3×3 grid spanned by two directions through the incumbent; the next plane is built from the winner and a new acquisition maximizer. SequentialLineSearch and SequentialGallery implement both on the GP model. Figure 4.2 shows the learned utilities of the three strategies after 15 questions on a two-dimensional landscape; in this run the gallery came close to the optimum after three questions and the duels after eleven, while the slider learned a good local model but explored least.

runs = {} 
for name, strategy in {"PBO (pairs)": PreferentialBO(), "line search (slider)": SequentialLineSearch(n_samples=7), 
                       "gallery (3×3 grid)": SequentialGallery(grid=3)}.items(): 
    user = ei.SimulatedUser(problem, target="random", noise=0.03, seed=8) 
    runs[name] = (strategy, user, ei.run(problem, strategy, user, generations=15, seed=8)) 
    print(f"{name:22s} best utility {runs[name][2].best_true:.3f} after {runs[name][2].summary()[’queries’]} questions")
   
Figure 4.2. The hidden utility of a simulated user (top left) and the GP posterior means of preferential BO, sequential line search and sequential gallery after 15 questions each; white: shown points, circles: chosen points.

Open in ColabExample plot_03_bayesian.py in the gallery

4.4 Surrogates against fatigue

A preference model can also stand between the strategy and the evaluator. Llorà et al. [18] trained a model on the user’s partial orderings and let the GA run on a synthetic fitness between interactions; Loshchilov, Schoenauer and Sebag argued that comparison-based optimizers need comparison-based surrogates [46]; pre-selection of offspring by a metamodel is a standard device of evolution strategies [47]. SurrogateAssisted wraps any strategy in one of two modes. In screening mode the inner strategy’s population is a pool; the model, refitted after every answer, ranks the pool by an upper confidence bound, the evaluator sees only the top candidates, and the unshown ones receive synthetic answers from the model. In pre-selection mode the inner strategy keeps its gallery size, but every new offspring competes with three mutants of itself and only the best-predicted one is shown. Pairwise strategies get a third service: duels whose outcome the model predicts with more than 90 % confidence are decided without asking.

How much a surrogate helps depends on the landscape. On a multimodal landscape both modes found the global peak more often than the plain GA at the same number of images (fig. 4.3); on a unimodal sphere a well-tuned GA already produces good offspring, and a model fitted to a few dozen comparisons adds little. Chapter 10 quantifies this on three landscapes.

Figure 4.3

Figure 4.3. Best ground-truth utility of an interactive GA, the same GA with surrogate screening (6 of 27 offspring shown) and with pre-selection (best of four), on an eight-dimensional multimodal landscape with a tiring simulated user; twelve seeds.

Open in ColabExample plot_06_surrogate.py in the gallery

4.5 Merging rankings

Panels of evaluators (section 5.4) need a consensus. The package implements the classical rules of social choice [48]: Borda counts, Copeland scores (pairwise wins minus losses), the Kemeny ranking that minimizes the total number of pairwise disagreements (exact for up to eight items, otherwise a local search from the Borda order), Bradley–Terry scores fitted by Hunter’s minorization–maximization algorithm [49], and Elo ratings [50]. Intransitivity is measured by Kendall and Babington Smith’s count of cyclic triads and their coefficient of consistency ζ, which equals 1 for a transitive set of comparisons [51]; the same statistic diagnoses inconsistent AI judges in section 6.2.

In a nutshell: Learning preferences

  • Thurstone and Bradley–Terry links turn utility differences into choice probabilities; linear, random-feature and GP models learn the utility from comparisons.
  • Preferential BO asks the most informative duel; sequential line search and gallery ask richer questions of the same GP and need fewer of them.
  • Surrogates screen or pre-select offspring and decide confident duels; their benefit depends on the landscape and is measured, not assumed.
  • Borda, Copeland, Kemeny, Bradley–Terry and Elo merge rankings; cyclic triads reveal intransitive evaluators.