Expected Information Gain, Visually

2026-11-11

A lot of my research has come back to one question: which experiment should I run next? Sometimes the experiment is an intervention on a gene regulatory network (Tigas et al., 2022), sometimes it's a data point to label (Jesson et al., 2021), sometimes it's a pair of LLM answers to show a human annotator (Melo et al., 2024). The setting changes, but the principled answer from Bayesian experimental design stays the same: run the experiment whose outcome you expect to teach you the most. That quantity is the expected information gain (EIG) (Lindley, 1956).

The formula is short, but its meaning is easy to lose behind the notation. This post builds the intuition with a few interactive figures. We'll read EIG as entropy reduction and as mutual information, see why it rewards places where models disagree, and see why it is so hard to compute in practice.

The setup

We have a set of hypotheses θ\theta about how the world works, and a belief p(θ)p(\theta) over them. We can choose a design xx, meaning which experiment to run, and we then observe an outcome y∼p(y∣θ,x)y \sim p(y \mid \theta, x).

t = 1, …, Tθhypothesisunknown · p(θ)xtdesignwe chooseytoutcomeobserved
θ is unknown and shared by every experiment. In each round t we choose xt and observe yt ∼ p(y | θ, xt). Joint: p(θ) ∏t p(yt | θ, xt).

In the graphical model, the design is drawn as a square because it isn't random: it's a decision. It's the only node we control, and it changes which conditional p(y∣θ,x)p(y \mid \theta, x) links the thing we want to know (θ\theta) to the thing we get to see (yy). Experimental design is choosing xx so that this link is as informative as possible. In the sequential setting, each xtx_t can also depend on the outcomes so far, y1,…,yt−1y_1, \dots, y_{t-1}, which is what the loop further down does.

As a running example, imagine we're trying to learn an unknown function. We've already measured it at four points (the black dots below), and we have eight hypotheses that fit those measurements. They're samples from a Gaussian-process posterior, and each one is a curve. Querying at a location xx returns a noisy value y=fθ(x)+εy = f_\theta(x) + \varepsilon, with ε∼N(0,σ2)\varepsilon \sim \mathcal{N}(0, \sigma^2). Where should we query next?

Before any maths, your eye already knows the answer: somewhere the curves disagree. Querying where all eight curves pass through the same value is a wasted experiment, because every hypothesis predicts the same answer and the result can't separate them.

Intuition 1: entropy reduction

Entropy measures how uncertain a belief is:

H[p(θ)]=−∑θp(θ) log⁡2p(θ).H[p(\theta)] = -\sum_\theta p(\theta)\,\log_2 p(\theta).

A uniform belief over eight hypotheses has log⁡28=3\log_2 8 = 3 bits of entropy, the number of yes/no questions you'd need to find the right one. After running experiment xx and seeing outcome yy, Bayes' rule gives the updated belief p(θ∣y,x)∝p(θ) p(y∣θ,x)p(\theta \mid y, x) \propto p(\theta)\, p(y \mid \theta, x). The information gain is how much the entropy dropped:

IG(x,y)=H[p(θ)]−H[p(θ∣y,x)].\mathrm{IG}(x, y) = H[p(\theta)] - H[p(\theta \mid y, x)].

The catch is that we have to choose xx before we see yy. So we average over the outcomes we think are likely, using the predictive distribution p(y∣x)=∑θp(θ) p(y∣θ,x)p(y \mid x) = \sum_\theta p(\theta)\, p(y \mid \theta, x):

EIG(x)=Ep(y∣x)[ H[p(θ)]−H[p(θ∣y,x)] ].\mathrm{EIG}(x) = \mathbb{E}_{p(y \mid x)}\big[\, H[p(\theta)] - H[p(\theta \mid y, x)] \,\big].
00.51x (where we query)yh1 · p(θ) = 0.125h2 · p(θ) = 0.125h3 · p(θ) = 0.125h4 · p(θ) = 0.125h5 · p(θ) = 0.125h6 · p(θ) = 0.125h7 · p(θ) = 0.125h8 · p(θ) = 0.125already observed: (0.10, 0.30)already observed: (0.18, 0.70)already observed: (0.60, -0.15)already observed: (0.67, -0.50)p(y | x)before: p(θ)H = 3.00 bitsh1: 0.1251h2: 0.1252h3: 0.1253h4: 0.1254h5: 0.1255h6: 0.1256h7: 0.1257h8: 0.1258after y: p(θ | y, x)H = 0.84 bitsh1: 0.0001h2: 0.7352h3: 0.0003h4: 0.0004h5: 0.0015h6: 0.0006h7: 0.2647h8: 0.0008
x = 0.42y = -0.20info gain for this y: 2.16 bitsaverage over all y, E[H(θ | y)]: 0.79 bitsEIG(x) = 2.21 bits
Drag on the left to choose where to query (x). Drag on the right to pick an outcome (y). Colours mark the eight hypotheses; hover one to follow it across panels.

Some things to try:

  • Look at the slice. The stacked density on the right is p(y∣x)p(y \mid x), coloured by which hypothesis each bit of probability mass comes from. Take a horizontal slice at your chosen outcome yy: the coloured proportions along that slice are the posterior bars at the bottom. Bayes' rule is just "read off who explains this outcome".
  • Move xx to 0.1 or 0.6, next to the existing data. All the colours pile on top of each other, any outcome leaves the posterior nearly uniform, and EIG drops to almost zero.
  • Move xx to around 0.45, where the curves fan out. Most outcomes now land in a region "owned" by one or two hypotheses, and the expected posterior entropy falls well below 3 bits.

The information gain of a particular outcome can be small, and in general it can even be negative: a surprising result can leave you more confused than before. Its expectation never is. You never expect an experiment to make you more uncertain.

Intuition 2: mutual information

Rearrange the expectation above and something nicer falls out. EIG is exactly the mutual information between the hypothesis and the outcome:

EIG(x)=I(θ;y∣x)=KL(p(θ,y∣x) ∥ p(θ) p(y∣x)).\mathrm{EIG}(x) = I(\theta; y \mid x) = \mathrm{KL}\big(p(\theta, y \mid x)\,\|\,p(\theta)\,p(y \mid x)\big).

Mutual information is symmetric, so we can also write it from the outcome's side:

I(θ;y∣x)=H[p(y∣x)]⏟total uncertainty about y−Ep(θ) H[p(y∣θ,x)]⏟uncertainty left if we knew θ.I(\theta; y \mid x) = \underbrace{H[p(y \mid x)]}_{\text{total uncertainty about } y} - \underbrace{\mathbb{E}_{p(\theta)}\, H[p(y \mid \theta, x)]}_{\text{uncertainty left if we knew } \theta}.

This second form is the useful one. It never mentions the posterior, only predictions. It asks: how uncertain am I about the outcome, minus how uncertain I would still be if I knew the true hypothesis? Whatever is left over is uncertainty that exists only because I don't know θ\theta, and the experiment can resolve exactly that.

The figure below shows the joint distribution p(θ,y∣x)p(\theta, y \mid x) as a table: one row per hypothesis, one column per possible outcome.

(Because yy is continuous, these are differential entropies, and the noise term can be negative. That's fine: their difference is a proper mutual information, always non-negative, and measured in honest bits.)

00.51x (where we query)yh1 · p(θ) = 0.125h2 · p(θ) = 0.125h3 · p(θ) = 0.125h4 · p(θ) = 0.125h5 · p(θ) = 0.125h6 · p(θ) = 0.125h7 · p(θ) = 0.125h8 · p(θ) = 0.125already observed: (0.10, 0.30)already observed: (0.18, 0.70)already observed: (0.60, -0.15)already observed: (0.67, -0.50)joint p(θ, y | x)h1h2h3h4h5h6h7h8p(θ)outcome y →p(y | x)I(θ; y | x) = H[y | x] − H[y | θ, x]1.52 − (-0.69) = 2.21 bitsmax H(θ) = 3
Each row is one hypothesis’ prediction for the outcome at x. Mutual information measures how well an outcome (a column) tells you which row you are in.
  • If the rows look the same (try x=0.6x = 0.6), then θ\theta and yy are independent: knowing the column tells you nothing about the row, and I=0I = 0.
  • If the rows don't overlap (try x≈0.5x \approx 0.5 with small noise), each outcome points to a single row, and the mutual information approaches its ceiling H(θ)=3H(\theta) = 3 bits. You can't learn more about θ\theta than there is to know.
  • Turn up the noise and every row smears out until they overlap, even where the hypotheses disagree. A noisy instrument can't tell nearby predictions apart.

Why disagreement is connected to EIG

The second form splits uncertainty into the two familiar kinds. Total predictive uncertainty is aleatoric (noise, the second term) plus epistemic (disagreement, what's left). EIG is the epistemic part. This is the reading behind BALD (Houlsby et al., 2011): pick inputs where the models disagree with each other about the outcome, while each model on its own is confident.

With Gaussian noise we can make this precise. The noise entropy H[p(y∣θ,x)]=12log⁡2(2πeσ2)H[p(y \mid \theta, x)] = \tfrac12 \log_2(2\pi e\sigma^2) is the same for every hypothesis. The predictive variance splits as Var[y∣x]=σ2+Varp(θ)[fθ(x)]\mathrm{Var}[y \mid x] = \sigma^2 + \mathrm{Var}_{p(\theta)}[f_\theta(x)]. A Gaussian has the largest entropy of any distribution with a given variance, which gives

EIG(x)  ≤  12log⁡2 ⁣(1+Varp(θ)[fθ(x)]σ2),\mathrm{EIG}(x) \;\le\; \frac12 \log_2\!\left(1 + \frac{\mathrm{Var}_{p(\theta)}[f_\theta(x)]}{\sigma^2}\right),

with equality when the predictive is Gaussian, as in Bayesian linear regression or a GP. So EIG is (at most) a monotone function of a signal-to-noise ratio: disagreement between hypotheses, measured in units of noise. For classification the same idea gives BALD's familiar "entropy of the mean prediction minus mean entropy of the predictions", which you can estimate with an ensemble (Lakshminarayanan et al., 2017) or MC dropout (Gal et al., 2017).

The figure below runs the full loop. The hidden truth is one of the eight hypotheses. Each experiment returns a noisy answer, and the belief, the curves' opacity and the EIG curve all update.

00.51yh1 · p(θ) = 0.125h2 · p(θ) = 0.125h3 · p(θ) = 0.125h4 · p(θ) = 0.125h5 · p(θ) = 0.125h6 · p(θ) = 0.125h7 · p(θ) = 0.125h8 · p(θ) = 0.125already observed: (0.10, 0.30)already observed: (0.18, 0.70)already observed: (0.60, -0.15)already observed: (0.67, -0.50)0123bits00.51x (where we query)
x = 0.44EIG 2.43 bitsbound 2.97 bitsexperiments: 0H(θ) left: 3.00 bits
Top: the hypotheses, faded by how much we still believe them. Bottom: the exact EIG (filled) and the disagreement bound ½ log₂(1 + Var/σ²) (dashed). Click anywhere to run an experiment at that x. A hidden hypothesis generates the answers.

Things worth noticing:

  • Greedy works fast. "Query max-EIG x" usually finds the truth in two or three experiments. "Query random x" wastes many queries near the existing data.
  • EIG collapses where hypotheses have been ruled out. Once a hypothesis is discarded its disagreement doesn't count any more, so the EIG landscape reshapes itself after every answer.
  • Disagreement is a bound, not the real thing. The dashed curve can rise above 3 bits, but the solid one can't, because there are only 3 bits to learn. When hypotheses split into a few well-separated clusters, variance keeps growing with the separation while the information on offer is capped. Variance is a good proxy when the predictive is roughly Gaussian and a poor one when it's multimodal.
  • Heteroscedasticity matters. If the noise varied with xx, raw disagreement would happily send you to the noisiest region. EIG divides by the noise, and disagreement heuristics must too.

Why it's hard to compute

Write EIG as one expression and the difficulty is plain to see:

EIG(x)=Ep(θ) p(y∣θ,x)[log⁡p(y∣θ,x)−log⁡Ep(θ′)[p(y∣θ′,x)]⏟p(y∣x)].\mathrm{EIG}(x) = \mathbb{E}_{p(\theta)\,p(y \mid \theta, x)}\Big[\log p(y \mid \theta, x) - \log \underbrace{\mathbb{E}_{p(\theta')}\big[p(y \mid \theta', x)\big]}_{p(y \mid x)}\Big].

There is an expectation inside a log inside an expectation. That causes several problems:

  1. The marginal likelihood is intractable. p(y∣x)p(y \mid x) integrates over all hypotheses. In my toy there are eight. In a deep network θ\theta has millions of dimensions, and in causal discovery it ranges over a super-exponential number of graphs.
  2. Nesting breaks Monte Carlo. You can't plug a Monte Carlo estimate into a log and average: E[log⁡p^]≠log⁡p\mathbb{E}[\log \hat p] \ne \log p. A nested estimator needs NN outer and MM inner samples, and its error falls like T−1/3T^{-1/3} in the total budget T=NMT = NM, not the usual T−1/2T^{-1/2} (Rainforth et al., 2018).
  3. It's an objective, not a number. We need EIG for every candidate design, then we have to optimise it over xx, then do it all again after every observation. Batches are worse still: the EIG of a set isn't the sum of the individual EIGs, because points in a batch can be redundant with each other (Kirsch et al., 2019).
  4. It's only as good as the belief. EIG is computed under your model's p(θ)p(\theta), usually an approximate posterior. If the model is misspecified, it will be confidently curious about the wrong things.

In the figures above I cheated: with eight hypotheses and a one-dimensional outcome I can integrate H[p(y∣x)]H[p(y \mid x)] numerically on a fine grid. That's the "exact" line. Real problems don't allow this.

Approximations

Nested Monte Carlo (NMC) (Ryan, 2003) replaces both expectations with samples:

EIG^NMC=1N∑n=1N[log⁡p(yn∣θn,x)−log⁡1M∑m=1Mp(yn∣θn,m,x)].\hat{\mathrm{EIG}}_{\text{NMC}} = \frac1N \sum_{n=1}^N \left[\log p(y_n \mid \theta_n, x) - \log \frac1M \sum_{m=1}^M p(y_n \mid \theta_{n,m}, x)\right].

By Jensen's inequality the inner log-average is biased low, so NMC overestimates EIG. It's consistent but expensive. With a small MM, an outcome that none of the inner samples can explain blows the estimate up.

Prior contrastive estimation (PCE) (Foster et al., 2020) makes one small change: include the sample that generated yny_n in the inner sum, so the denominator always contains a hypothesis that explains the data. The result is a lower bound on EIG, capped at log⁡2(M+1)\log_2(M+1). It's stable, differentiable in xx, and can be optimised by gradient ascent.

00.51x (where we query)yh1 · p(θ) = 0.125h2 · p(θ) = 0.125h3 · p(θ) = 0.125h4 · p(θ) = 0.125h5 · p(θ) = 0.125h6 · p(θ) = 0.125h7 · p(θ) = 0.125h8 · p(θ) = 0.125already observed: (0.10, 0.30)already observed: (0.18, 0.70)already observed: (0.60, -0.15)already observed: (0.67, -0.50)012345estimated EIG (bits)log₂(M+1)exact 2.21NMC4.302.913.212.694.293.203.732.983.943.654.832.323.167.183.873.362.725.603.162.335.252.678.272.272.993.452.473.463.312.11PCE1.861.532.051.622.031.281.801.801.972.141.971.991.782.151.482.172.132.021.641.501.391.972.021.891.961.852.291.911.641.85
x = 0.42exact 2.21 bitsNMC 3.66 ± 1.38PCE 1.86 ± 0.24Gaussian bound 2.89 bitslikelihood evals / estimate: 220
Thirty independent runs of each estimator at the chosen x. The solid line is the exact EIG; the dotted line is the PCE ceiling log₂(M+1). Points past the right edge are clipped.

Set M=1M = 1 and compare: NMC explodes while PCE sits tightly under its log⁡22=1\log_2 2 = 1 bit ceiling. Increase MM and both close in on the exact value from opposite sides. Upper and lower bounds are worth having together, because they bracket the truth.

Beyond these, the main families are:

  • Variational bounds (Foster et al., 2019). Learn an amortised approximate posterior q(θ∣y,x)q(\theta \mid y, x) and use the Barber–Agakov bound EIG≥H[p(θ)]+E[log⁡q(θ∣y,x)]\mathrm{EIG} \ge H[p(\theta)] + \mathbb{E}[\log q(\theta \mid y, x)], or learn an approximate marginal q(y∣x)q(y \mid x) for an upper bound. You train qq once and reuse it across designs.
  • Moment matching and closed forms. The Gaussian bound above, BALD's closed form for classification, Laplace approximations and linearisation. They're cheap and often good enough, but blind to multimodality.
  • Samples from approximate posteriors. Ensembles and MC dropout give you the θ\theta samples, and an estimator turns them into EIG.
  • Neural mutual-information estimators (MINE, InfoNCE-style critics). Useful when the likelihood can only be simulated, not evaluated (Kleinegesse & Gutmann, 2020).
  • Amortised design policies. Deep Adaptive Design (Foster et al., 2021) trains a policy network to maximise a sequential EIG bound offline, so choosing the next experiment is a single forward pass. We used this idea, and its reinforcement-learning cousins, for causal experimental design (Annadani et al., 2024; Tigas et al., 2023).

For a thorough modern overview, see Rainforth et al. (2024).

Summary

Three readings of the same number:

  • Entropy: how much I expect my uncertainty about θ\theta to shrink.
  • Mutual information: how much the outcome and the hypothesis have in common.
  • Disagreement: how much plausible hypotheses disagree about the outcome, measured relative to noise.

Each reading suggests a different way to estimate it, and most of the work in Bayesian experimental design is choosing the approximation whose failure modes you can live with.

Further reading

Two blogs I'd recommend if you want to go further, both by people I've had the pleasure of working with:

  • Desi Ivanova, Introduction to Bayesian Optimal Experimental Design. A concise introduction to the BOED framework and EIG, covering static and sequential (adaptive) design strategies and the computational challenges of each. A great companion to this post.
  • Adam Foster's blog. Posts that go deeper on the modern machinery: Deep Adaptive Design and its connection to Bayesian reinforcement learning, optimising adaptive designs with RL, stochastic-gradient experimental design with Gaussian processes, and the Pyro framework for optimal experimental design.

References

Annadani, Y., Tigas, P., Bauer, S., & Foster, A. (2024). Amortized Active Causal Induction with Deep Reinforcement Learning. arXiv Preprint arXiv:2405.16718. arxiv.org/abs/2405.16718 ↩
Foster, A., Ivanova, D. R., Malik, I., & Rainforth, T. (2021). Deep Adaptive Design: Amortizing Sequential Bayesian Experimental Design. International Conference on Machine Learning (ICML). arxiv.org/abs/2103.02438 ↩
Foster, A., Jankowiak, M., Bingham, E., Horsfall, P., Teh, Y. W., Rainforth, T., & Goodman, N. (2019). Variational Bayesian Optimal Experimental Design. Advances in Neural Information Processing Systems (NeurIPS). arxiv.org/abs/1903.05480 ↩
Foster, A., Jankowiak, M., O’Meara, M., Teh, Y. W., & Rainforth, T. (2020). A Unified Stochastic Gradient Approach to Designing Bayesian-Optimal Experiments. International Conference on Artificial Intelligence and Statistics (AISTATS). arxiv.org/abs/1911.00294 ↩
Gal, Y., Islam, R., & Ghahramani, Z. (2017). Deep Bayesian Active Learning with Image Data. International Conference on Machine Learning (ICML). arxiv.org/abs/1703.02910 ↩
Houlsby, N., Huszár, F., Ghahramani, Z., & Lengyel, M. (2011). Bayesian Active Learning for Classification and Preference Learning. arXiv Preprint arXiv:1112.5745. arxiv.org/abs/1112.5745 ↩
Jesson, A., Tigas, P., van Amersfoort, J., Kirsch, A., Shalit, U., & Gal, Y. (2021). Causal-BALD: Deep Bayesian Active Learning of Outcomes to Infer Treatment-Effects from Observational Data. Advances in Neural Information Processing Systems (NeurIPS). arxiv.org/abs/2111.02275 ↩
Kirsch, A., van Amersfoort, J., & Gal, Y. (2019). BatchBALD: Efficient and Diverse Batch Acquisition for Deep Bayesian Active Learning. Advances in Neural Information Processing Systems (NeurIPS). arxiv.org/abs/1906.08158 ↩
Kleinegesse, S., & Gutmann, M. U. (2020). Bayesian Experimental Design for Implicit Models by Mutual Information Neural Estimation. International Conference on Machine Learning (ICML). arxiv.org/abs/2002.08129 ↩
Lakshminarayanan, B., Pritzel, A., & Blundell, C. (2017). Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles. Advances in Neural Information Processing Systems (NeurIPS). arxiv.org/abs/1612.01474 ↩
Lindley, D. V. (1956). On a Measure of the Information Provided by an Experiment. The Annals of Mathematical Statistics, 27(4), 986–1005. doi.org/10.1214/aoms/1177728069 ↩
Melo, L. C., Tigas, P., Abate, A., & Gal, Y. (2024). Deep Bayesian Active Learning for Preference Modeling in Large Language Models. Advances in Neural Information Processing Systems (NeurIPS). arxiv.org/abs/2406.10023 ↩
Rainforth, T., Cornish, R., Yang, H., Warrington, A., & Wood, F. (2018). On Nesting Monte Carlo Estimators. International Conference on Machine Learning (ICML). arxiv.org/abs/1709.06181 ↩
Rainforth, T., Foster, A., Ivanova, D. R., & Bickford Smith, F. (2024). Modern Bayesian Experimental Design. Statistical Science, 39(1). arxiv.org/abs/2302.14545 ↩
Ryan, K. J. (2003). Estimating Expected Information Gains for Experimental Designs with Application to the Random Fatigue-Limit Model. Journal of Computational and Graphical Statistics, 12(3), 585–603. doi.org/10.1198/1061860032012 ↩
Tigas, P., Annadani, Y., Ivanova, D. R., Jesson, A., Gal, Y., Foster, A., & Bauer, S. (2023). Differentiable Multi-Target Causal Bayesian Experimental Design. International Conference on Machine Learning (ICML). proceedings.mlr.press/v202/tigas23a.html ↩
Tigas, P., Annadani, Y., Jesson, A., Schölkopf, B., Gal, Y., & Bauer, S. (2022). Interventions, Where and How? Experimental Design for Causal Models at Scale. Advances in Neural Information Processing Systems (NeurIPS). arxiv.org/abs/2203.02016 ↩
□