1 of 65

Modern Bayesian Experimental Design

Statistics Seminar, University of Warwick

1

Desi R. Ivanova � @desirivanova� desi.ivanova@stats.ox.ac.uk�

2 of 65

2

Agenda

Mostly based on: Modern Bayesian Experimental Design, Rainforth et al., �Statistical Science 2024

  1. Variational Bayesian experimental design (BED)
  2. Policy-based BED and the Deep Adaptive Design (DAD) framework
  3. Beyond parameter learning: BED for
    1. Contextual optimisation
    2. Active causal discovery
    3. Prediction-oriented Bayesian active learning
  4. Future directions

Goal-oriented BED

3 of 65

3

Experimental design

Designs

Data

Run experiment

Loan agreement��Lorem ipsum dolor sit amet consec tetuer 31.06.2019 adipiscing elit £17,500,000. �

Active learning

Survey

Lorem ipsum dolor sit?

30% complete

Next

Back

Smart surveys

Drug discovery

Next best question for this participant?

Most promising compound to try?

Next document to annotate?

4 of 65

4

Do you prefer £50 now or £100 in 1 year?

Design

£100 later

£50 now

Example: Subjective time value of money

Do you prefer £150 now or £100 in 1 year?

£150 now

£150 now

Outcome

5 of 65

5

Do you prefer £50 now or £100 in 1 year?

Design

£100 later

£50 now

Example: Subjective time value of money

Do you prefer £150 now or £100 in 1 year?

£150 now

£150 now

Outcome

6 of 65

6

Information-theoretic approach to data acquisition

Choose the design so that the data collected is maximally informative about the quantity of interest

7 of 65

7

Bayesian Experimental Design (BED)

Parameters (Latent variables)

Quantity we wish to learn about

Design

Controlled by experimenter

Outcome

Future observation

likelihood

posterior

prior

Formalize by introducing a probabilistic generative model

8 of 65

8

Example: BED for subjective time value of money

Do you prefer £R now or £100 in D days?

What is maximally informative?

9 of 65

9

Optimal maximizes the expected information gain (EIG)

Expected information gain (EIG)

Expectation over the outcome

Lindley, 1956

10 of 65

10

Alternative formulations of the EIG

  • Mutual information between parameters and outcomes under the design:
  • Expected utility with a KL utility function:
  • Bayesian active learning by disagreement (BALD) score:

11 of 65

11

Challenges of vanilla BED

  1. Computational (double) intractability:
    • Estimating and optimizing the EIG is highly demanding
  2. Slow adaptive experimentation:
    • Repeated computations (posterior, EIG) hinder real-time deployment
  3. Ignores downstream task
    • Might not prioritize the parameters most relevant to decision making
  4. Model misspecification
    • Double reliance on the model, making BED more sensitive to misspecification

12 of 65

12

  1. Computational (double) intractability:
    • Estimating and optimizing the EIG is highly demanding
  2. Slow adaptive experimentation:
    • Repeated computations (posterior, EIG) hinder real-time deployment
  3. Ignores downstream task
    • Might not prioritize the parameters most relevant to decision making
  4. Model misspecification
    • Double reliance on the model, making BED more sensitive to misspecification

Challenges of vanilla BED

This presentation

Current/future work

13 of 65

13

  1. Variational BED

14 of 65

14

Double intractability

Key idea: Use optimization to approximate (some of) the unknown densities

Key requirement: Being able to sample from the joint

Posterior: typically intractable

Prior: can be tractable (often is)

Likelihood: can be tractable (often not)

Marginal: typically intractable

15 of 65

15

EIG estimation: Nested Monte Carlo (NMC)

Intractable + �each instance different

Convergence rate in total budget

Biased but asymptotically consistent

Rainforth et al., ICML 2018

16 of 65

16

EIG estimation: Functional and variational approaches

Treat the problem as a stochastic regression and learn a functional approximation

When is a valid normalized density, we have a variational upper bound which is tight iff

Convergence rate , but can be biased

Foster et al., 2019, Rainforth et al., 2023

17 of 65

17

EIG estimation: Variational approaches

We can estimate efficiently for any given

18 of 65

18

EIG estimation: Variational approaches

But we still need

We can estimate efficiently for any given

19 of 65

19

Unified objective: joint EIG estimation and optimisation

Variational lower bounds provide unified objectives!

Estimate MI

Optimize design

Foster et al., 2020, Kleinegesse & Gutmann, 2020,

Rainforth et al., 2023

20 of 65

20

2. Adaptive experimentation

21 of 65

21

Unified objective: joint EIG estimation and optimisation

Would you prefer $49 today, or $100 in 3 months?

$49 today

Computing posterior… Maximizing EIG lower bound, it’s very efficient but you have to wait…

22 of 65

22

Traditional adaptive BED is slow

Infer

Posterior update

Run experiment

Optimize EIG

1

2

1

2

23 of 65

23

The solution: Policy-based BED

Policy

Model

Observe

Foster, Ivanova et al., ICML 2021, Ivanova et al, NeurIPS 2021

24 of 65

24

Next� Design

Past �data

Policy

What is the policy?

Traditional BED ⇔ 2-stage expensive implicit policy

1

2

Posterior estimation

EIG maximisation

25 of 65

25

Deep Adaptive Design (DAD)

Next� Design

Past �data

Explicit policy parametrised by a NN

26 of 65

26

should amortize slow implicit policy

How do we train the DAD network?

The design network

Next� Design

Past �data

27 of 65

27

The design network

should maximize the expected sum of the individual EIGs

How do we train the DAD network?

Next� Design

Past �data

28 of 65

28

Policy-based BED: Theory

Theorem: Total Information

EIG of a T-step experiment is the sum of the EIGs for each experiment iteration.

Total EIG

Informally:

Incremental EIG

Foster et al., ICML, 2021

Shen & Huan, arxiv, 2021 (almost concurrently)

29 of 65

29

Theorem: Total EIG

EIG of a T-step experiment is the sum of the EIGs for each experiment iteration.

  • Generalises traditional BED
  • An end-to-end objective

where

Foster et al., ICML 2021

Policy-based BED: Theory

30 of 65

30

Policy-based BED: Theory

Theorem: Total EIG

EIG of a T-step experiment is the sum of the EIGs for each experiment iteration.

  • Generalises traditional BED
  • An end-to-end objective

where

Sample from the prior, use current policy to create a design, sample the outcome

31 of 65

31

intractable

!

Total EIG Objective

32 of 65

32

DAD: optimize a contrastive lower bound (PCE) – assumes analytic likelihood

intractable

!

Total Information Objective

33 of 65

33

iDAD: optimize a lower bound using samples only

intractable

!

Total Information Objective

DAD: optimize a contrastive lower bound (PCE) – assumes analytic likelihood

Ivanova et al., NeurIPS 2021

34 of 65

34

→ Inspiration from the representation learning literature: InfoNCE (van den Oord et al, 2018) bound on MI and NWJ (Nguyen et al, 2010) bound on KL, to lower bound the total EIG. �

Introduce an auxiliary critic network:

iDAD objective

to approximate the density ratio

35 of 65

35

NWJ

Higher variance

Lower bias

Deep Adaptive Design: Unified variational objectives

Higher bias

Lower variance

InfoNCE

Higher bias

Lower variance

Likelihood-based

PCE

36 of 65

36

Would you prefer $R today, or $100 in D days?

Example: Adaptive Online Surveys

Human participant

$R today

37 of 65

37

Would you prefer $49 today, or $100 in 3 months?

Human participant

$49 today

AI powered by DAD

38 of 65

38

Would you prefer $49 today, or $100 in 3 months?

Human participant

$49 today

Would you prefer $49 today, or $100 in 4 weeks?

Human participant

$49 today

AI powered by DAD

AI powered by DAD

39 of 65

39

Would you prefer $49 today, or $100 in 3 months?

Human participant

$49 today

Would you prefer $49 today, or $100 in 4 weeks?

Human participant

$49 today

Would you prefer $49 today, or $100 in 16 days?

Human participant

$100 in 16 days

AI powered by DAD

AI powered by DAD

AI powered by DAD

40 of 65

40

Would you prefer $49 today, or $100 in 3 months?

Human participant

$49 today

Would you prefer $49 today, or $100 in 4 weeks?

Human participant

$49 today

Would you prefer $49 today, or $100 in 16 days?

Human participant

$100 in 16 days

Would you prefer $49 today, or $100 in 23 days?

Human participant

$49 today

AI powered by DAD

AI powered by DAD

AI powered by DAD

AI powered by DAD

41 of 65

41

Quantitative results: EIG (lower and upper bounds, )

​

​

​

Deployment time (sec.)

Heuristic �(Frye et al. 2006)

3.50

3.51

00.09

Traditional (Vincent & Rainforth 2017)

4.45

4.54

25.27

DAD

5.02

5.12

00.09

42 of 65

42

Quantitative results

→ We actually get better designs! This is due to

​

  1. Avoiding direct Bayesian inference
    • Limits error propagation
    • Learning to map past data to next design is an easier task
  2. Learning non-myopic policies

43 of 65

43

Quantitative results

→ We actually get better designs! This is due to

​

  • Avoiding direct Bayesian inference
    • Limits error propagation
    • Learning to map past data to next design is an easier task
  • Learning non-myopic policies

Myopic

Non-myopic

44 of 65

44

Other experiments: Location Finding

Weak signal

Strong signal

45 of 65

45

​

​

​

Deployment time (sec.)

Variational

08.78

08.91

8963

DAD

10.93

12.38

0.005

>1M times faster

No need for posterior estimation

Non-myopic properties

Other experiments: Location Finding

46 of 65

46

3. Beyond parameter estimation

47 of 65

47

47

Contextual optimisation

Engagement

Revenue

Characteristics

Context

Age

Employment

Income

…

Incentive

We have experimental budget

​

that we use to learn optimal actions

Model

Treatment/action/design

Goal: Maximize reward by choosing optimal actions for a set of customers

48 of 65

48

A stylised example

No testing �(pick best treatment in each context)

RCT �(prior knowledge not utilised)

Experimental contexts

Test context

True (but unknown) m*

Uncertainty about the functional relationship between treatments and outcomes, incorporated in the model via a Bayesian parameter

Note: quantity of interest here are the max-values!

49 of 65

49

No testing �(pick best treatment in each context)

RCT �(prior knowledge ignored)

Exploit

Explore

A stylised example

CO-BED

50 of 65

TL;DR: Better (contextual) A/B testing by formulating and optimising a contextual max-value EIG (CMV-EIG)�

​

  • Formulation inspired by max-value entropy search (Wang & Jegelka, 2017)
  • This is an implicit likelihood BED problem
  • Use any black-box MI estimator, e.g. InfoNCE (Oord et al., 2018)
  • Use Gumbel softmax relaxation to deal with discrete designs

50

CO-BED: Contextual Optimisation via BED

Ivanova et al., ICML 2023

51 of 65

51

Illustrative experiment

52 of 65

  • CO-BED performs on par with the model-specific Sampler-Planner (S-P) algorithm of Zanette et al., 2021.

52

Contextual Linear Bandits

53 of 65

53

BED for Causal Discovery

Structural causal model (SCM)

Goal: Find the most informative interventions to help identify the underlying SCM.

Assumptions:

  • SCM is causally sufficient
  • Parametric + differentiable mechanisms,�

54 of 65

54

Causal Bayesian Experimental Design

55 of 65

55

DiffCBED: Differentiable multi-target causal BED

TL;DR: obtain a batch of designs maximises a standard EIG:

Annadani et al., ICML 2023

  • Problem: the intervention targets involve making a discrete choice
  • Solution: use continuous relaxation – Gumbel-softmax or relaxed Bernoulli

0

0

0

0

0

1.2

0.8

0.7

2.2

0.5

x

2.1

2.1

1

Parameter learning�+

Structure learning

56 of 65

56

Prediction-oriented Bayesian active learning (BAL)

TL;DR: Target information gain in predictions, not parameters

  • Maximise expected predictive information gain (EPIG):

Bickford Smith et al., AISTATS 2023

Reduction in predictive uncertainty

  • Traditional BAL: gain information about underlying model parameters by optimising BALD score – can be suboptimal in prediction-oriented settings
  • EPIG: addresses this limitation and is a drop-in replacement for BALD.

57 of 65

57

3. Limitations and Future Directions

58 of 65

58

Model Misspecification: Catastrophic failures

59 of 65

  • Model misspecification
    • Robust objectives
    • “Fixing” a model?
  • Software and engineering
    • BayesFlow: OS library for SBI
  • Adjacent fields
    • Stochastic optimal control
    • Reinforcement learning
    • Active inference
  • Real-world applications

59

Future directions

Thanks

X: @desirivanova

@: desi.ivanova@stats.ox.ac.uk� www: desirivanova.com

Contact

60 of 65

60

References

  • Annadani, Y., Tigas, P., Ivanova, D. R., Jesson, A., Gal, Y., Foster, A., & Bauer, S. (2023). Differentiable Multi-Target Causal Bayesian Experimental Design. ICML 2023 (to appear).
  • Foster, A., Jankowiak, M., Bingham, E., Horsfall, P., Teh, Y. W., Rainforth, T., & Goodman, N. (2019). Variational Bayesian optimal experimental design. NeurIPS 2019.
  • Foster, A., Jankowiak, M., O’Meara, M., Teh, Y. W., & Rainforth, T. (2020, June). A unified stochastic gradient approach to designing bayesian-optimal experiments. AISTATS 2020.
  • Foster, A., Ivanova, D. R., Malik, I., & Rainforth, T. (2021). Deep adaptive design: Amortizing sequential bayesian experimental design. ICML 2021.
  • Ivanova, D. R., Foster, A., Kleinegesse, S., Gutmann, M. U., & Rainforth, T. (2021). Implicit deep adaptive design: policy-based experimental design without likelihoods. NeurIPS 2021.
  • Ivanova, D. R., Jennings, J., Rainforth, T., Zhang, C., & Foster, A. (2023). CO-BED: Information-Theoretic Contextual Optimization via Bayesian Experimental Design. ICML 2023 (to appear).
  • Kleinegesse, S., & Gutmann, M. U. (2020). Bayesian experimental design for implicit models by mutual information neural estimation. In ICML.
  • Rainforth, T., Foster, A., Ivanova, D. R., & Smith, F. B. (2023). Modern Bayesian Experimental Design. Statistical Science (to appear) – review paper.
  • Smith, F. B., Kirsch, A., Farquhar, S., Gal, Y., Foster, A., & Rainforth, T. (2023, April). Prediction-Oriented Bayesian Active Learning. In AISTATS.
  • Wang, Z., & Jegelka, S. (2017, July). Max-value entropy search for efficient Bayesian optimization. In International Conference on Machine Learning (pp. 3627-3635). PMLR.

​

61 of 65

61

Thanks

Implicit Deep Adaptive Design (iDAD)

Desi R Ivanova, Adam Foster, Steven Kleinegesse, Michael Gutmann, Tom Rainforth, NeurIPS 2021, Paper, Code

Deep Adaptive Design (DAD)�Adam Foster*, Desi R Ivanova*, Ilyas Malik, Tom Rainforth, ICML 2021, Paper, Code

Differentiable Multi-Target Bayesian Experimental Design

Yasha Annadani*, Panagiotis Tigas*, Desi R Ivanova, Andrew Jesson, Yarin Gal, Adam Foster, Stefan Bauer, ICML 2023 Paper

CO-BED: Information-Theoretic Contextual Optimisation via Bayesian Experimental Design

Desi R Ivanova, Joel Jennings, Tom Rainforth, Cheng Zhang, Adam Foster, ICML 2023 Paper

62 of 65

62

Other research interests

63 of 65

  • Better p(x) estimates ⇒ Better compression
  • Rate-distortion-compute trade-off
  • Asymmetric encode-decode: we typically want fast decoding
  • Multi-modal compression – very little work so far
  • Extreme compression: human perception, (RL)HF

​

63

Neural data compression

64 of 65

Current methods are somewhat ad-hoc

  • SOTA subject-driven text-to-image generation like DreamBooth (Ruiz et al., 2022) fine-tune the entire base model are slow and costly (both training and storage)
  • Cheaper methods like Textual Inversion (Gal et al., 2022) learn a new token embedding for each new subject → cheaper overall but do not work as well
  • Model distillation (amortised) methods like SuTI (Chen et al., 2023) do in-context customisation: very quick, but are extremely expensive to train; not suitable for subjects that are far from the implicit prior distribution used to train SuTI

Explore more principled directions:

  • Leverage theoretical advancements in methods that recover true optimal transport maps, e.g. Schrodinger bridge matching (Shi et al., 2023)?

64

Customising diffusion models

65 of 65

Very crowded field, but a lot of research to be done!

  • Uncertainty in LLMs: base models appear calibrated, but fine-tuned ones are not
  • Preference learning without RL (recent paper in this direction – Rafailov et al., 2023)
  • Fine-tuning and mode collapse
  • Steering LLMs: prompt engineering, CoT prompting, activation engineering
  • …

​

65

LLMs: RLHF, reward modelling, alignment, benchmarks