Choosing the Negatives: Variance-Optimal Reference Distributions for Mutual Information Estimation

Neural estimators of mutual information (MI), the number of nats one variable tells you about another, work by training a classifier to tell real pairs $(x, y)$ apart from shuffled pairs. A shuffled pair takes $x$ and $y$ from different examples, so it is a sample from the product of the marginals. Every major estimator draws its "negatives" from that one distribution: InfoNCE, MINE, the Nguyen-Wainwright-Jordan bound, SMILE, FLO, and the classifier-based estimators. That choice is the root of the two failures the field keeps fighting. Unbiased estimators have variance that grows exponentially in the true MI, and the low-variance ones hit a ceiling of about $\log K$ for $K$ negatives. A separate literature on noise-contrastive estimation (NCE), which fits unnormalized density models by contrasting data with artificial "noise", found years ago that the choice of noise distribution largely decides an estimator's efficiency. It also found that the best noise is generally not the obvious one.

This note proposes to bring that lesson into MI estimation in a form that stays statistically valid. Negatives are drawn from the shuffled pairs but reweighted by a known function. In practice that function is a tempered copy of a pilot critic trained on held-out data. The reweighting is then undone exactly by a correction term that is computed from the in-batch shuffled pairs. The result is a one-parameter family of estimators whose bias-variance trade-off is set by where the negatives come from, not by clipping or interpolation knobs. We develop the asymptotic theory that predicts the variance-optimal temperature, and an effective-sample-size diagnostic that says when an estimate can be trusted. We then test the claim that the optimal reference lies strictly between "shuffled pairs" and "real pairs", in the same way that the optimal NCE noise is neither uniform nor the data.

Core Claim

Let $p(x,y)$ be the joint distribution and $p(x)p(y)$ the product of marginals. For any positive weight function $g(x,y)$ that we can evaluate, define the reweighted reference $q_g(x,y) = g(x,y)\,p(x)p(y)/Z_g$, where $Z_g = \mathbb{E}_{p(x)p(y)}[g]$. Then, exactly,

$$ I(X;Y) = \underbrace{\mathbb{E}_{p(x,y)}\left[\log \frac{p(x,y)}{q_g(x,y)}\right]}_{\text{classifier term}} + \mathbb{E}_{p(x,y)}[\log g(x,y)] - \log \mathbb{E}_{p(x)p(y)}[g(x,y)]. $$

The first term is estimated by a classifier that contrasts real pairs against negatives resampled from the shuffled pairs with probability proportional to $g$. The estimators of DEMI and InfoNCE-anchor are the special case $g \equiv 1$. The second term is an average over real pairs. The third term is a log-mean over the $N(N-1)$ off-diagonal pairs of a batch of size $N$.

With $g = \exp(\beta f_0)$, where $f_0$ is a pilot critic and $\beta \in [0,1]$ is a temperature, the temperature moves variance between the classifier term and the normalizer term. At $\beta = 0$ the classifier faces the full divergence and inherits the exponential variance documented by Understanding the Limitations of Variational Mutual Information Estimators. At $\beta = 1$ with a good pilot, the classifier faces almost no divergence, but the normalizer becomes the exponentially hard Donsker-Varadhan partition term.

Our claim is that the MSE-optimal $\beta^*$ lies strictly inside $(0,1)$. We also claim that it can be predicted, in closed form for Gaussians and by a plug-in rule in general, from the pool size $N$ and an estimate of the MI. Finally, splitting the path into a few stages $0=\beta_0<\beta_1<\dots<\beta_M$ and telescoping the normalizer moves the regime where estimates are accurate to higher MI at fixed batch size.

The proposal does not claim to evade the Song-Ermon lower bound. All samples still come from a finite pool of shuffled pairs, so the reachable MI is limited by that pool's effective sample size. What changes is the constant in front of the exponential, and the estimator gains an explicit warning when it has crossed that limit.

Relation to Prior Work

The motivating evidence comes from NCE. The Optimal Noise in Noise-Contrastive Learning Is Not What You Think derives the noise distribution that minimizes the asymptotic error of NCE parameter estimates. It shows that this noise differs from the data: for example, a Gaussian variance is best estimated with noise of about 3.84 times the data variance. That analysis targets a parameter vector rather than a scalar divergence, and the optimal noise depends on the unknown truth. We borrow the question, "which reference minimizes asymptotic variance?", and ask it for MI. We restrict to references with a computable ratio to the product of marginals, which sidesteps the chicken-and-egg problem: we never need the optimal reference itself, only a member of a tractable family. On the connection between Noise-Contrastive Estimation and Contrastive Divergence supplies the second ingredient. It shows that NCE proposals tracking the current model, implemented by sequential Monte Carlo resampling (SMC-RNCE), improve UCI Gas log-likelihood from 2.60 to 13.01. Our multi-stage path is the MI analogue: resampling of the shuffled-pair pool along a tempered sequence. That work estimates energy functions, not divergences between paired variables, and never studies normalizer variance as MI grows.

The constraints come from the MI literature. On Variational Bounds of Mutual Information proves the $\log K$ ceiling of InfoNCE and introduces the interpolated bound $I_\alpha$. Song & Ermon proves the $\Omega(e^{I})$ variance law and proposes SMILE's ratio clipping. FLO and η-MINE change how the partition function is optimized, with a learned normalizer or a scalar dual variable. All four keep the reference fixed at the product of marginals and modify the objective. We modify the reference and keep a plain logistic classifier.

Multi-label CPC shows that the ceiling is partly an artifact of one-positive framing and adds an annealed $\alpha$ knob. Our temperature plays a similar role, but its effect on variance follows from theory and can be measured, rather than set by a hand-tuned schedule.

Two papers contrast directly with ours. HOBIT reweights negatives toward hardness for retrieval, which is the same mechanism without the correction term, and does not ask whether the resulting score still estimates anything. InfoBridge and MINDE avoid contrastive estimation altogether by learning diffusion drifts or scores. InfoBridge is the strongest current estimator in the file, but it needs finite first moments.

Research Program

The theoretical part derives the asymptotic variance of the decomposed estimator as a function of $\beta$, the pool size $N$, and the negative-to-positive ratio $\nu$. Delta-method arguments for logistic-regression ratio estimators give a classifier-term variance governed roughly by the chi-square divergence $\chi^2(p\,\|\,q_\beta)$. The normalizer variance is governed by $\chi^2(q_\beta\,\|\,p(x)p(y))$ divided by the effective pool size:

$$ \mathrm{Var}(\hat I_\beta) \approx \frac{a_\nu\,\chi^2(p\,\|\,q_\beta)}{n} + \frac{\chi^2(q_\beta\,\|\,p(x)p(y))}{N(N-1)} , $$

where $n$ is the number of real pairs and $a_\nu$ is a constant depending on the noise ratio. For jointly Gaussian $(X,Y)$ with an oracle pilot, $q_\beta$ is again Gaussian and both chi-square terms are closed-form. This yields an explicit $\beta^*(I, N, n)$, a falsifiable prediction in the spirit of the 3.84 result. For $M$ stages the second term becomes a sum of $M$ smaller terms. We will characterize when telescoping pays for its extra bias from the log-of-mean term, which pushes estimates upward by Jensen's inequality.

The algorithmic part has four steps. First, train a pilot critic $f_0$ on a held-out split; cross-fitting avoids reusing data. Second, for each stage, resample negatives from the off-diagonal pairs of each batch with weights $\exp((\beta_{k+1}-\beta_k) f_0)$ under the previous stage's resampled distribution. Third, train one logistic classifier per stage, or a single classifier conditioned on $\beta$. Fourth, sum the three terms.

The diagnostic part reports the effective sample size of the reweighted pool at each stage. When it falls below a threshold, the estimator declares its value a lower-confidence estimate instead of reporting a confident number. No variational MI estimator in the file currently offers this.

We deliberately leave representation learning out of scope. InfoNCE-anchor found that removing estimation bias left CIFAR-100 linear-probe accuracy unchanged (65.98% vs. 65.74%), so there is no reason to expect a better MI measurement to yield better features. This proposal is about measurement.

Baselines

The naive reference point is standard InfoNCE with in-batch negatives. It should saturate near $\log N$ on every high-MI task and fixes the floor any method must clear.

The direct ablation of our key ingredient is the same classifier with $\beta = 0$. That is DEMI or InfoNCE-anchor, using identical architecture, batch size, data and optimizer steps. Beating it means lower MSE at matched compute on tasks where the true MI exceeds about 5 nats. The pilot critic's training cost is counted against our method, so the baseline gets the same total gradient steps.

The tuned-knob baselines are SMILE (Song & Ermon) and $I_\alpha$ (Poole et al.). These are the strongest competitors on the precise question, because they too trade bias for variance with one scalar. We give them the same tuning budget as our $\beta$: a grid of eight values selected on a validation split, not on test ground truth. The file reports that SMILE reaches "nearly two orders of magnitude lower variance than NWJ at similar bias", but the file contains no exact table entry. To beat these baselines, our estimator must have lower MSE at equal or lower variance, across the Song-Ermon MI staircase.

We also include FLO (Guo et al.) as the strongest batch-size-decoupled variational method. No reported MI-estimation number for FLO is found on Lacuna; the file reports only its downstream result of matching SimCLR with 8× smaller batches.

The strongest existing method overall is InfoBridge. On the 160-dimensional Gaussian with 80 nats it reports an estimate of 79.76 nats, and on 1024-dimensional ProtTrans5 embeddings an MAE of 0.04, versus 9.29 for MINDE-C (InfoBridge). On Beyond Normal, MINDE-C is within 0.1 nats on 35 of 40 tasks against MINE's 24 of 40 (MINDE). We run both from released code, including mutinfo-diffusion, at their recommended settings. We will not claim to beat InfoBridge at 80 nats; a pool of 512 shuffled pairs per row cannot support that. Beating the diffusion methods means matching their Beyond Normal count while winning on heavy-tailed tasks they cannot handle, at a fraction of their training cost.

Two further ablations isolate the correction term and the pilot. The first reweights negatives toward hardness, HOBIT-style, without the $\log Z$ and $\mathbb{E}[\log g]$ corrections; it should be badly biased. The second replaces the learned pilot with the oracle pointwise MI on Gaussians, which separates the effect of pilot quality from the reweighting principle.

Why not just…?

Why not just increase the batch size? The pool size enters our variance formula too, so larger batches help every method. The question is the rate. Song & Ermon show that unbiased estimators need batch sizes growing like $e^{I}$. We will plot MSE against $N$ from 64 to 4096 for the $\beta=0$ baseline and for $\beta^*$. If the two curves differ only by a constant shift in $N$ smaller than 2×, the proposal amounts to cheap batch enlargement and we will say so.

Why not just tune SMILE's clipping threshold or $I_\alpha$'s mixing weight? This is the most serious threat, because a well-tuned scalar knob may capture most of the gain. The difference is that clipping biases the estimate by an amount that cannot be computed. Our reweighting is exactly corrected, so its only bias is the finite-sample log-of-mean term, and that term is visible through the effective-sample-size diagnostic. The decisive test is whether SMILE and $I_\alpha$ with an equal tuning budget pass the additivity and data-processing checks on MNIST and CIFAR-10 pairs as often as our estimator does. If they match it on MSE and consistency, the reweighting adds nothing beyond its diagnostic.

Why not just use InfoBridge? Where its assumptions hold, InfoBridge is likely better at very high MI, and the 79.76-of-80-nat result is not something we expect to approach. It requires finite first moments, however, and it trains a bridge-matching drift network. Our estimator is a logistic classifier plus a pilot, and it has no moment condition. The experiment that settles the matter is the heavy-tailed subset of Beyond Normal (Student-t, including Cauchy-like degrees of freedom), together with a wall-clock comparison on the ProtTrans5 task. If InfoBridge with a simple tail transform matches us on those tasks, our method's niche shrinks to cost alone.

Why not just use hard negative mining? Mining warps the reference without accounting for it, so the score stops estimating MI. The uncorrected-reweighting ablation measures exactly this bias.

Proposed Experiments

The first decisive check tests the theory on correlated Gaussians, at 20 dimensions over the Song-Ermon staircase of 2 to 20 nats and at 160 dimensions up to 40 nats, using the oracle pilot. We sweep $\beta$ on a fine grid and compare the empirical MSE-minimizing temperature with the closed-form $\beta^*(I,N,n)$. The proposal's central claim fails if the empirical optimum sits at $\beta=0$ or $\beta=1$, or if the prediction misses by more than the grid spacing across most settings. We repeat the comparison with the cubic transform, under which MI is unchanged but the critic must learn a nonlinearity, and with a learned pilot, to measure how much a pilot misspecified by cross-fitting erodes the gain.

The second check is robustness across distribution families, on the 40 Beyond Normal tasks and the Lee & Rhee image and text suites. The metric is the count of tasks within 0.1 nats, comparable to MINDE-C's 35 of 40. We also record the number of sources at which each estimator fails, comparable to the reported failure after 4 sources on Gaussian data.

The third check covers the consistency tests of Song & Ermon (independence, data processing, additivity) on MNIST and CIFAR-10. It also includes the 1024-dimensional ProtTrans5 embeddings, scored by MAE against InfoBridge's 0.04.

Across all three, we test whether the effective-sample-size diagnostic is calibrated, that is, whether runs it flags are the ones with large error. If the diagnostic is calibrated and $\beta^*$ is predictable, the field gains a principled replacement for hand-tuned clipping even where peak accuracy merely ties the best baselines.