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 (section 2.3). A preference model postulates a latent utility 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:
| (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.
- LinearBT: , logistic regression on feature differences with a Gaussian prior; the Laplace approximation gives a predictive variance. Fast and robust, but it cannot represent a peak.
- KernelBT: the same model on random Fourier features , which approximate an RBF kernel [42]; nonlinear at the cost of a linear model.
- GPPreference: Gaussian-process preference learning [43]. The utilities of the compared items have a GP prior with an RBF kernel, the likelihood is the probit of eq. (4.1), and the posterior is approximated by Laplace’s method: Newton iterations find the MAP utilities , and the predictive distribution at new points is Gaussian with mean and variance , where is the negative Hessian of the log-likelihood [44]. The length-scale is chosen from a small grid by the Laplace approximation of the evidence; warm starts from the previous solution keep refitting cheap during a session.
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)
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.
4.3 Sequential line search and gallery
A duel carries at most 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 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 (33 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")
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.
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.