On Variational Bounds of Mutual Information

Ben Poole, Sherjil Ozair, Aaron van den Oord, Alexander A. Alemi, George Tucker

Introduction

Estimating the relationship between pairs of variables is a fundamental problem in science and engineering. Quantifying the degree of the relationship requires a metric that captures a notion of dependency. Here, we focus on mutual information (MI), denoted I(X;Y)I(X;Y), which is a reparameterization-invariant measure of dependency:

Mutual information estimators are used in computational neuroscience (Palmer et al., 2015), Bayesian optimal experimental design (Ryan et al., 2016; Foster et al., 2018), understanding neural networks (Tishby et al., 2000; Tishby & Zaslavsky, 2015; Gabrié et al., 2018), and more. In practice, estimating MI is challenging as we typically have access to samples but not the underlying distributions (Paninski, 2003; McAllester & Stratos, 2018). Existing sample-based estimators are brittle, with the hyperparameters of the estimator impacting the scientific conclusions (Saxe et al., 2018).

Beyond estimation, many methods use upper bounds on MI to limit the capacity or contents of representations. For example in the information bottleneck method (Tishby et al., 2000; Alemi et al., 2016), the representation is optimized to solve a downstream task while being constrained to contain as little information as possible about the input. These techniques have proven useful in a variety of domains, from restricting the capacity of discriminators in GANs (Peng et al., 2018) to preventing representations from containing information about protected attributes (Moyer et al., 2018).

Lastly, there are a growing set of methods in representation learning that maximize the mutual information between a learned representation and an aspect of the data. Specifically, given samples from a data distribution, xp(x)x\sim p(x), the goal is to learn a stochastic representation of the data pθ(yx)p_{\theta}(y|x) that has maximal MI with XX subject to constraints on the mapping (e.g. Bell & Sejnowski, 1995; Krause et al., 2010; Hu et al., 2017; van den Oord et al., 2018; Hjelm et al., 2018; Alemi et al., 2017). To maximize MI, we can compute gradients of a lower bound on MI with respect to the parameters θ\theta of the stochastic encoder pθ(yx)p_{\theta}(y|x), which may not require directly estimating MI.

While many parametric and non-parametric (Nemenman et al., 2004; Kraskov et al., 2004; Reshef et al., 2011; Gao et al., 2015) techniques have been proposed to address MI estimation and optimization problems, few of them scale up to the dataset size and dimensionality encountered in modern machine learning problems.

To overcome these scaling difficulties, recent work combines variational bounds (Blei et al., 2017; Donsker & Varadhan, 1983; Barber & Agakov, 2003; Nguyen et al., 2010; Foster et al., 2018) with deep learning (Alemi et al., 2016, 2017; van den Oord et al., 2018; Hjelm et al., 2018; Belghazi et al., 2018) to enable differentiable and tractable estimation of mutual information. These papers introduce flexible parametric distributions or critics parameterized by neural networks that are used to approximate unkown densities (p(y)p(y), p(yx)p(y|x)) or density ratios (p(xy)p(x)=p(yx)p(y)\frac{p(x|y)}{p(x)}=\frac{p(y|x)}{p(y)}).

In spite of their effectiveness, the properties of existing variational estimators of MI are not well understood. In this paper, we introduce several results that begin to demystify these approaches and present novel bounds with improved properties (see Fig. 1 for a schematic):

We provide a review of existing estimators, discussing their relationships and tradeoffs, including the first proof that the noise contrastive loss in van den Oord et al. (2018) is a lower bound on MI, and that the heuristic “bias corrected gradients” in Belghazi et al. (2018) can be justified as unbiased estimates of the gradients of a different lower bound on MI.

We derive a new continuum of multi-sample lower bounds that can flexibly trade off bias and variance, generalizing the bounds of (Nguyen et al., 2010; van den Oord et al., 2018).

We show how to leverage known conditional structure yielding simple lower and upper bounds that sandwich MI in the representation learning context when pθ(yx)p_{\theta}(y|x) is tractable.

We systematically evaluate the bias and variance of MI estimators and their gradients on controlled high-dimensional problems.

We demonstrate the utility of our variational upper and lower bounds in the context of decoder-free disentangled representation learning on dSprites (Matthey et al., 2017).

Variational bounds of MI

Here, we review existing variational bounds on MI in a unified framework, and present several new bounds that trade off bias and variance and naturally leverage known conditional densities when they are available. A schematic of the bounds we consider is presented in Fig. 1. We begin by reviewing the classic upper and lower bounds of Barber & Agakov (2003) and then show how to derive the lower bounds of Donsker & Varadhan (1983); Nguyen et al. (2010); Belghazi et al. (2018) from an unnormalized variational distribution. Generalizing the unnormalized bounds to the multi-sample setting yields the bound proposed in van den Oord et al. (2018), and provides the basis for our interpolated bound.

Upper bounding MI is challenging, but is possible when the conditional distribution p(yx)p(y|x) is known (e.g. in deep representation learning where yy is the stochastic representation). We can build a tractable variational upper bound by introducing a variational approximation q(y)q(y) to the intractable marginal p(y)=dxp(x)p(yx)p(y)=\int dx\,p(x)p(y|x). By multiplying and dividing the integrand in MI by q(y)q(y) and dropping a negative KL term, we get a tractable variational upper bound (Barber & Agakov, 2003):

which is often referred to as the rate in generative models (Alemi et al., 2017). This bound is tight when q(y)=p(y)q(y)=p(y), and requires that computing logq(y)\log q(y) is tractable. This variational upper bound is often used as a regularizer to limit the capacity of a stochastic representation (e.g. Rezende et al., 2014; Kingma & Welling, 2013; Burgess et al., 2018). In Alemi et al. (2016), this upper bound is used to prevent the representation from carrying information about the input that is irrelevant for the downstream classification task.

Unlike the upper bound, most variational lower bounds on mutual information do not require direct knowledge of any conditional densities. To establish an initial lower bound on mutual information, we factor MI the opposite direction as the upper bound, and replace the intractable conditional distribution p(xy)p(x|y) with a tractable optimization problem over a variational distribution q(xy)q(x|y). As shown in Barber & Agakov (2003), this yields a lower bound on MI due to the non-negativity of the KL divergence:

where h(X)h(X) is the differential entropy of XX. The bound is tight when q(xy)=p(xy)q(x|y)=p(x|y), in which case the first term equals the conditional entropy h(XY)h(X|Y).

Unfortunately, evaluating this objective is generally intractable as the differential entropy of XX is often unknown. If h(X)h(X) is known, this provides a tractable estimate of a lower bound on MI. Otherwise, one can still compare the amount of information different variables (e.g., Y1Y_{1} and Y2Y_{2}) carry about XX.

In the representation learning context where XX is data and YY is a learned stochastic representation, the first term of IBAI_{\text{BA}} can be thought of as negative reconstruction error or distortion, and the gradient of IBAI_{\text{BA}} with respect to the “encoder” p(yx)p(y|x) and variational “decoder” q(xy)q(x|y) is tractable. Thus we can use this objective to learn an encoder p(yx)p(y|x) that maximizes I(X;Y)I(X;Y) as in Alemi et al. (2017). However, this approach to representation learning requires building a tractable decoder q(xy)q(x|y), which is challenging when XX is high-dimensional and h(XY)h(X|Y) is large, for example in video representation learning (van den Oord et al., 2016).

2 Unnormalized lower bounds

To derive tractable lower bounds that do not require a tractable decoder, we turn to unnormalized distributions for the variational family of q(xy)q(x|y), and show how this recovers the estimators of Donsker & Varadhan (1983); Nguyen et al. (2010).

We choose an energy-based variational family that uses a critic f(x,y)f(x,y) and is scaled by the data density p(x)p(x):

Substituting this distribution into IBAI_{\text{BA}} (Eq. 2) gives a lower bound on MI which we refer to as IUBAI_{\text{UBA}} for the Unnormalized version of the Barber and Agakov bound:

To form a tractable bound, we can upper bound the log partition function using the inequality: log(x)xa+log(a)1\log(x)\leq\frac{x}{a}+\log(a)-1 for all x,a>0x,a>0. Applying this inequality to the second term of Eq. 4 gives: logZ(y)Z(y)a(y)+log(a(y))1\log Z(y)\leq\frac{Z(y)}{a(y)}+\log(a(y))-1, which is tight when a(y)=Z(y)a(y)=Z(y). This results in a Tractable Unnormalized version of the Barber and Agakov (TUBA) lower bound on MI that admits unbiased estimates and gradients:

To tighten this lower bound, we maximize with respect to the variational parameters a(y)a(y) and ff. In the InfoMax setting, we can maximize the bound with respect to the stochastic encoder pθ(yx)p_{\theta}(y|x) to increase I(X;Y)I(X;Y). Unlike the min-max objective of GANs, all parameters are optimized towards the same objective.

This bound holds for any choice of a(y)>0a(y)>0, with simplifications recovering existing bounds. Letting a(y)a(y) be the constant ee recovers the bound of Nguyen, Wainwright, and Jordan (Nguyen et al., 2010) also known as ff-GAN KL (Nowozin et al., 2016) and MINE-ff (Belghazi et al., 2018)ITUBAI_{\text{TUBA}} can also be derived the opposite direction by plugging the critic f(x,y)=f(x,y)loga(y)+1f^{\prime}(x,y)=f(x,y)-\log a(y)+1 into INWJI_{\text{NWJ}}.:

This tractable bound no longer requires learning a(y)a(y), but now f(x,y)f(x,y) must learn to self-normalize, yielding a unique optimal critic f(x,y)=1+logp(xy)p(x)f^{*}(x,y)=1+\log\frac{p(x|y)}{p(x)}. This requirement of self-normalization is a common choice when learning log-linear models and empirically has been shown not to negatively impact performance (Mnih & Teh, 2012).

Finally, we can set a(y)a(y) to be the scalar exponential moving average (EMA) of ef(x,y)e^{f(x,y)} across minibatches. This pushes the normalization constant to be independent of yy, but it no longer has to exactly self-normalize. With this choice of a(y)a(y), the gradients of ITUBAI_{\text{TUBA}} exactly yield the “improved MINE gradient estimator” from (Belghazi et al., 2018). This provides sound justification for the heuristic optimization procedure proposed by Belghazi et al. (2018). However, instead of using the critic in the IDVI_{\text{DV}} bound to get an estimate that is not a bound on MI as in Belghazi et al. (2018), one can compute an estimate with ITUBAI_{\text{TUBA}} which results in a valid lower bound.

To summarize, these unnormalized bounds are attractive because they provide tractable estimators which become tight with the optimal critic. However, in practice they exhibit high variance due to their reliance on high variance upper bounds on the log partition function.

3 Multi-sample unnormalized lower bounds

To reduce variance, we extend the unnormalized bounds to depend on multiple samples, and show how to recover the low-variance but high-bias MI estimator proposed by van den Oord et al. (2018).

Our goal is to estimate I(X1,Y)I(X_{1},Y) given samples from p(x1)p(yx1)p(x_{1})p(y|x_{1}) and access to K1K-1 additional samples x2:KrK1(x2:K)x_{2:K}\sim r^{K-1}(x_{2:K}) (potentially from a different distribution than X1X_{1}). For any random variable ZZ independent from XX and YY, I(X,Z;Y)=I(X;Y)I(X,Z;Y)=I(X;Y), therefore:

This multi-sample mutual information can be estimated using any of the previous bounds, and has the same optimal critic as for I(X1;Y)I(X_{1};Y). For INWJI_{\text{NWJ}}, we have that the optimal critic is f(x1:K,y)=1+logp(yx1:K)p(y)=1+logp(yx1)p(y)f^{*}(x_{1:K},y)=1+\log\frac{p(y|x_{1:K})}{p(y)}=1+\log\frac{p(y|x_{1})}{p(y)}. However, the critic can now also depend on the additional samples x2:Kx_{2:K}. In particular, setting the critic to 1+logef(x1,y)a(y;x1:K)1+\log\frac{e^{f(x_{1},y)}}{a(y;x_{1:K})} and rK1(x2:K)=j=2Kp(xj)r^{K-1}(x_{2:K})=\prod_{j=2}^{K}p(x_{j}), INWJI_{\text{NWJ}} becomes:

where we have written the critic using parameters a(y;x1:K)a(y;x_{1:K}) to highlight the close connection to the variational parameters in ITUBAI_{\text{TUBA}}. One way to leverage these additional samples from p(x)p(x) is to build a Monte-Carlo estimate of the partition function Z(y)Z(y):

Intriguingly, with this choice, the high-variance term in INWJI_{\text{NWJ}} that estimates an upper bound on logZ(y)\log Z(y) is now upper bounded by logK\log K as ef(x1,y)e^{f(x_{1},y)} appears in the numerator and also in the denominator (scaled by 1K\frac{1}{K}). If we average the bound over KK replicates, reindexing x1x_{1} as xix_{i} for each term, then the last term in Eq. 8 becomes the constant 1:

and we exactly recover the lower bound on MI proposed by van den Oord et al. (2018):

where the expectation is over KK independent samples from the joint distribution: jp(xj,yj)\prod_{j}p(x_{j},y_{j}). This provides a proofThe derivation by van den Oord et al. (2018) relied on an approximation, which we show is unnecessary. that INCEI_{\text{NCE}} is a lower bound on MI. Unlike INWJI_{\text{NWJ}} where the optimal critic depends on both the conditional and marginal densities, the optimal critic for INCEI_{\text{NCE}} is f(x,y)=logp(yx)+c(y)f(x,y)=\log p(y|x)+c(y) where c(y)c(y) is any function that depends on yy but not xx (Ma & Collins, 2018). Thus the critic only has to learn the conditional density and not the marginal density p(y)p(y).

As pointed out in van den Oord et al. (2018), INCEI_{\text{NCE}} is upper bounded by logK\log K, meaning that this bound will be loose when I(X;Y)>logKI(X;Y)>\log K. Although the optimal critic does not depend on the batch size and can be fit with a smaller mini-batches, accurately estimating mutual information still needs a large batch size at test time if the mutual information is high.

4 Nonlinearly interpolated lower bounds

The multi-sample perspective on INWJI_{\text{NWJ}} allows us to make other choices for the functional form of the critic. Here we propose one simple form for a critic that allows us to nonlinearly interpolate between INWJI_{\text{NWJ}} and INCEI_{\text{NCE}}, effectively bridging the gap between the low-bias, high-variance INWJI_{\text{NWJ}} estimator and the high-bias, low-variance INCEI_{\text{NCE}} estimator. Similarly to Eq. 8, we set the critic to 1+logef(x1,y)αm(y;x1:K)+(1α)q(y)1+\log\frac{e^{f(x_{1},y)}}{\alpha m(y;x_{1:K})+(1-\alpha)q(y)} with α\alpha\in to get a continuum of lower bounds:

By interpolating between q(y)q(y) and m(y;x1:K)m(y;x_{1:K}), we can recover INWJI_{\text{NWJ}} (α=0\alpha=0) or INCEI_{\text{NCE}} (α=1\alpha=1). Unlike INCEI_{\text{NCE}} which is upper bounded by logK\log K, the interpolated bound is upper bounded by logKα\log\frac{K}{\alpha}, allowing us to use α\alpha to tune the tradeoff between bias and variance. We can maximize this lower bound in terms of q(y)q(y) and ff. Note that unlike INCEI_{\text{NCE}}, for α>0\alpha>0 the last term does not vanish and we must sample yp(y)y\sim p(y) independently from x1:Kx_{1:K} to form a Monte Carlo approximation for that term. In practice we use a leave-one-out estimate, holding out an element from the minibatch for the independent yp(y)y\sim p(y) in the second term. We conjecture that the optimal critic for the interpolated bound is achieved when f(x,y)=logp(yx)f(x,y)=\log p(y|x) and q(y)=p(y)q(y)=p(y) and use this choice when evaluating the accuracy of the estimates and gradients of IαI_{\alpha} with optimal critics.

5 Structured bounds with tractable encoders

In the previous sections we presented one variational upper bound and several variational lower bounds. While these bounds are flexible and can make use of any architecture or parameterization for the variational families, we can additionally take into account known problem structure. Here we present several special cases of the previous bounds that can be leveraged when the conditional distribution p(yx)p(y|x) is known. This case is common in representation learning where xx is data and yy is a learned stochastic representation.

InfoNCE with a tractable conditional. An optimal critic for INCEI_{\text{NCE}} is given by f(x,y)=logp(yx)f(x,y)=\log p(y|x), so we can simply use the p(yx)p(y|x) when it is known. This gives us a lower bound on MI without additional variational parameters:

where the expectation is over jp(xj,yj)\prod_{j}p(x_{j},y_{j}).

Leave one out upper bound. Recall that the variational upper bound (Eq. 1) is minimized when our variational q(y)q(y) matches the true marginal distribution p(y)=dxp(x)p(yx)p(y)=\int dx\,p(x)p(y|x). Given a minibatch of KK (xi,yi)(x_{i},y_{i}) pairs, we can approximate p(y)1Kip(yxi)p(y)\approx\frac{1}{K}\sum_{i}p(y|x_{i}) (Chen et al., 2018). For each example xix_{i} in the minibatch, we can approximate p(y)p(y) with the mixture over all other elements: qi(y)=1K1jip(yxj)q_{i}(y)=\frac{1}{K-1}\sum_{j\neq i}p(y|x_{j}). With this choice of variational distribution, the variational upper bound is:

where the expectation is over ip(xi,yi)\prod_{i}p(x_{i},y_{i}). Combining Eq. 12 and Eq. 13, we can sandwich MI without introducing learned variational distributions. Note that the only difference between these bounds is whether p(yixi)p(y_{i}|x_{i}) is included in the denominator. Similar mixture distributions have been used in prior work but they require additional parameters (Tomczak & Welling, 2018; Kolchinsky et al., 2017).

Reparameterizing critics. For INWJI_{\text{NWJ}}, the optimal critic is given by 1+logp(yx)p(y)1+\log\frac{p(y|x)}{p(y)}, so it is possible to use a critic f(x,y)=1+logp(yx)q(y)f(x,y)=1+\log\frac{p(y|x)}{q(y)} and optimize only over q(y)q(y) when p(yx)p(y|x) is known. The resulting bound resembles the variational upper bound (Eq. 1) with a correction term to make it a lower bound:

This bound is valid for any choice of q(y)q(y), including unnormalized qq.

Similarly, for the interpolated bounds we can use f(x,y)=logp(yx)f(x,y)=\log p(y|x) and only optimize over the q(y)q(y) in the denominator. In practice, we find reparameterizing the critic to be beneficial as the critic no longer needs to learn the mapping between xx and yy, and instead only has to learn an approximate marginal q(y)q(y) in the typically lower-dimensional representation space.

Upper bounding total correlation. Minimizing statistical dependency in representations is a common goal in disentangled representation learning. Prior work has focused on two approaches that both minimize lower bounds: (1) using adversarial learning (Kim & Mnih, 2018; Hjelm et al., 2018), or (2) using minibatch approximations where again a lower bound is minimized (Chen et al., 2018). To measure and minimize statistical dependency, we would like an upper bound, not a lower bound. In the case of a mean field encoder p(yx)=ip(yix)p(y|x)=\prod_{i}p(y_{i}|x), we can factor the total correlation into two information terms, and form a tractable upper bound. First, we can write the total correlation as: TC(Y)=iI(X;Yi)I(X;Y)TC(Y)=\sum_{i}I(X;Y_{i})-I(X;Y). We can then use either the standard (Eq. 1) or the leave one out upper bound (Eq. 13) for each term in the summation, and any of the lower bounds for I(X;Y)I(X;Y). If I(X;Y)I(X;Y) is small, we can use the leave one out upper bound (Eq. 13) and INCEI_{\text{NCE}} (Eq. 12) for the lower bound and get a tractable upper bound on total correlation without any variational distributions or critics. Broadly, we can convert lower bounds on mutual information into upper bounds on KL divergences when the conditional distribution is tractable.

6 From density ratio estimators to bounds

Note that the optimal critic for both INWJI_{\text{NWJ}} and INCEI_{\text{NCE}} are functions of the log density ratio logp(yx)p(y)\log\frac{p(y|x)}{p(y)}. So, given a log density ratio estimator, we can estimate the optimal critic and form a lower bound on MI. In practice, we find that training a critic using the Jensen-Shannon divergence (as in Nowozin et al. (2016); Hjelm et al. (2018)), yields an estimate of the log density ratio that is lower variance and as accurate as training with INWJI_{\text{NWJ}}. Empirically we find that training the critic using gradients of INWJI_{\text{NWJ}} can be unstable due to the exp\exp from the upper bound on the log partition function in the INWJI_{\text{NWJ}} objective. Instead, one can train a log density ratio estimator to maximize a lower bound on the Jensen-Shannon (JS) divergence, and use the density ratio estimate in INWJI_{\text{NWJ}} (see Appendix D for details). We call this approach IJSI_{\text{JS}} as we update the critic using the JS as in (Hjelm et al., 2018), but still compute a MI lower bound with INWJI_{\text{NWJ}}. This approach is similar to (Poole et al., 2016; Mescheder et al., 2017) but results in a bound instead of an unbounded estimate based on a Monte-Carlo approximation of the ff-divergence.

Experiments

First, we evaluate the performance of MI bounds on two simple tractable toy problems. Then, we conduct a more thorough analysis of the bias/variance tradeoffs in MI estimates and gradient estimates given the optimal critic. Our goal in these experiments was to verify the theoretical results in Section 2, and show that the interpolated bounds can achieve better estimates of MI when the relationship between the variables is nonlinear. Finally, we highlight the utility of these bounds for disentangled representation learning on the dSprites datasets.

Comparing estimates across different lower bounds. We applied our estimators to two different toy problems, (1) a correlated Gaussian problem taken from Belghazi et al. (2018) where (x,y)(x,y) are drawn from a 20-d Gaussian distribution with correlation ρ\rho (see Appendix B for details), and we vary ρ\rho over time, and (2) the same as in (1) but we apply a random linear transformation followed by a cubic nonlinearity to yy to get samples (x,(Wy)3)(x,(Wy)^{3}). As long as the linear transformation is full rank, I(X;Y)=I(X;(WY)3)I(X;Y)=I(X;(WY)^{3}). We find that the single-sample unnormalized critic estimates of MI exhibit high variance, and are challenging to tune for even these problems. In congtrast, the multi-sample estimates of INCEI_{\text{NCE}} are low variance, but have estimates that saturate at log(batch size)\log(\text{batch size}). The interpolated bounds trade off bias for variance, and achieve the best estimates of MI for the second problem. None of the estimators exhibit low variance and good estimates of MI at high rates, supporting the theoretical findings of McAllester & Stratos (2018).

Efficiency-accuracy tradeoffs for critic architectures. One major difference between the critic architectures used in (van den Oord et al., 2018) and (Belghazi et al., 2018) is the structure of the critic architecture. van den Oord et al. (2018) uses a separable critic f(x,y)=h(x)Tg(y)f(x,y)=h(x)^{T}g(y) which requires only 2N2N forward passes through a neural network for a batch size of NN. However, Belghazi et al. (2018) use a joint critic, where x,yx,y are concatenated and fed as input to one network, thus requiring N2N^{2} forward passes. For both toy problems, we found that separable critics (orange) increased the variance of the estimator and generally performed worse than joint critics (blue) when using INWJI_{\text{NWJ}} or IJSI_{\text{JS}} (Fig. 2). However, joint critics scale poorly with batch size, and it is possible that separable critics require larger neural networks to get similar performance.

Bias-variance tradeoff for optimal critics. To better understand the behavior of different estimators, we analyzed the bias and variance of each estimator as a function of batch size given the optimal critic (Fig. 3). We again evaluated the estimators on the 20-d correlated Gaussian distribution and varied ρ\rho to achieve different values of MI. While INWJI_{\text{NWJ}} is an unbiased estimator of MI, it exhibits high variance when the MI is large and the batch size is small. As noted in van den Oord et al. (2018), the INCEI_{\text{NCE}} estimate is upper bounded by log(batch size)\log(\text{batch size}). This results in high bias but low variance when the batch size is small and the MI is large. In this regime, the absolute value of the bias grows linearly with MI because the objective saturates to a constant while the MI continues to grow linearly. In contrast, the IαI_{\alpha} bounds are less biased than INCEI_{\text{NCE}} and lower variance than INWJI_{\text{NWJ}}, resulting in a mean squared error (MSE) that can be smaller than either INWJI_{\text{NWJ}} or INCEI_{\text{NCE}}. We can also see that the leave one out upper bound (Eq. 13) has large bias and variance when the batch size is too small.

Bias-variance tradeoffs for representation learning. To better understand whether the bias and variance of the estimated MI impact representation learning, we looked at the accuracy of the gradients of the estimates with respect to a stochastic encoder p(yx)p(y|x) versus the true gradient of MI with respect to the encoder. In order to have access to ground truth gradients, we restrict our model to pρ(yixi)=N(ρix,1ρi2)p_{\rho}(y_{i}|x_{i})=\mathcal{N}(\rho_{i}x,\sqrt{1-\rho_{i}^{2}}) where we have a separate correlation parameter for each dimension ii, and look at the gradient of MI with respect to the vector of parameters ρ\rho. We evaluate the accuracy of the gradients by computing the MSE between the true and approximate gradients. For different settings of the parameters ρ\rho, we identify which α\alpha performs best as a function of batch size and mutual information. In Fig. 4, we show that the optimal α\alpha for the interpolated bounds depends strongly on batch size and the true mutual information. For smaller batch sizes and MIs, α\alpha close to 1 (INCE)I_{\text{NCE}}) is preferred, while for larger batch sizes and MIs, α\alpha closer to 0 (INWJI_{\text{NWJ}}) is preferred. The reduced gradient MSE of the IαI_{\alpha} bounds points to their utility as an objective for training encoders in the InfoMax setting.

Many recent papers in representation learning have focused on learning latent representations in a generative model that correspond to human-interpretable or “disentangled” concepts (Higgins et al., 2016; Burgess et al., 2018; Chen et al., 2018; Kumar et al., 2017). While the exact definition of disentangling remains elusive (Locatello et al., 2018; Higgins et al., 2018; Mathieu et al., 2018), many papers have focused on reducing statistical dependency between latent variables as a proxy (Kim & Mnih, 2018; Chen et al., 2018; Kumar et al., 2017). Here we show how a decoder-free information maximization approach subject to smoothness and independence constraints can retain much of the representation learning capabilities of latent-variable generative models on the dSprites dataset (a 2d dataset of white shapes on a black background with varying shape, rotation, scale, and position from Matthey et al. (2017)).

To estimate and maximize the information contained in the representation YY about the input XX, we use the IJSI_{\text{JS}} lower bound, with a structured critic that leverages the known stochastic encoder p(yx)p(y|x) but learns an unnormalized variational approximation q(y)q(y) to the prior. To encourage independence, we form an upper bound on the total correlation of the representation, TC(Y)TC(Y), by leveraging our novel variational bounds. In particular, we reuse the IJSI_{\text{JS}} lower bound of I(X;Y)I(X;Y), and use the leave one out upper bounds (Eq. 13) for each I(X;Yi)I(X;Y_{i}). Unlike prior work in this area with VAEs, (Kim & Mnih, 2018; Chen et al., 2018; Hjelm et al., 2018; Kumar et al., 2017), this approach tractably estimates and removes statistical dependency in the representation without resorting to adversarial techniques, moment matching, or minibatch lower bounds in the wrong direction.

As demonstrated in Krause et al. (2010), information maximization alone is ineffective at learning useful representations from finite data. Furthermore, minimizing statistical dependency is also insufficient, as we can always find an invertible function that maintains the same amount of information and correlation structure, but scrambles the representation (Locatello et al., 2018). We can avoid these issues by introducing additional inductive biases into the representation learning problem. In particular, here we add a simple smoothness regularizer that forces nearby points in xx space to be mapped to similar regions in yy space: R(θ)=KL(pθ(yx)pθ(yx+ϵ))R(\theta)=KL(p_{\theta}(y|x)\|p_{\theta}(y|x+\epsilon)) where ϵN(0,0.5)\epsilon\sim\mathcal{N}(0,0.5).

The resulting regularized InfoMax objective we optimize is:

We use the convolutional encoder architecture from Burgess et al. (2018); Locatello et al. (2018) for p(yx)p(y|x), and a two hidden layer fully-connected neural network to parameterize the unnormalized variational marginal q(y)q(y) used by IJSI_{\text{JS}}.

Empirically, we find that this variational regularized infomax objective is able to learn x and y position, and scale, but not rotation (Fig. 5, see Chen et al. (2018) for more details on the visualization). To the best of our knowledge, the only other decoder-free representation learning result on dSprites is Pfau & Burgess (2018), which recovers shape and rotation but not scale on a simplified version of the dSprites dataset with one shape.

Discussion

In this work, we reviewed and presented several new bounds on mutual information. We showed that our new interpolated bounds are able to trade off bias for variance to yield better estimates of MI. However, none of the approaches we considered here are capable of providing low-variance, low-bias estimates when the MI is large and the batch size is small. Future work should identify whether such estimators are impossible (McAllester & Stratos, 2018), or whether certain distributional assumptions or neural network inductive biases can be leveraged to build tractable estimators. Alternatively, it may be easier to estimate gradients of MI than estimating MI. For example, maximizing IBAI_{\text{BA}} is feasible even though we do not have access to the constant data entropy. There may be better approaches in this setting when we do not care about MI estimation and only care about computing gradients of MI for minimization or maximization.

A limitation of our analysis and experiments is that they focus on the regime where the dataset is infinite and there is no overfitting. In this setting, we do not have to worry about differences in MI on training vs. heldout data, nor do we have to tackle biases of finite samples. Addressing and understanding this regime is an important area for future work.

Another open question is whether mutual information maximization is a more useful objective for representation learning than other unsupervised or self-supervised approaches (Noroozi & Favaro, 2016; Doersch et al., 2015; Dosovitskiy et al., 2014). While deviating from mutual information maximization loses a number of connections to information theory, it may provide other mechanisms for learning features that are useful for downstream tasks. In future work, we hope to evaluate these estimators on larger-scale representation learning tasks to address these questions.

References

Appendix A Summary of mutual information lower bounds

In Table 1, we summarize the characteristics of lower bounds on MI. The parameters and objectives used for each of these bounds is presented in Table 2.

Appendix B Experimental details

Architectures. We experimented with two forms of architecture: separable and joint. Separable architectures independently mapped xx and yy to an embedding space and then took the inner product, i.e. f(x,y)=h(x)Tg(y)f(x,y)=h(x)^{T}g(y) as in (van den Oord et al., 2018). Joint critics concatenate each x,yx,y pair before feeding it into the network, i.e. f(x,y)=h([x,y])f(x,y)=h([x,y]) as in (Belghazi et al., 2018). In practice, separable critics are much more efficient as we only have to perform 2N2N forward passes through neural networks for a batch size of NN vs. N2N^{2} for joint critics. All networks were fully-connected networks with ReLU activations.

Appendix C Additional experiments

To better evaluate the tradeoffs between different bounds, we performed more extensive experiments on the toy problems in Fig. 2. For each bound, we optimized over learning rate, architecture (separable vs. joint critic, number of hidden layers (1-3), hidden units per layer (256, 512, 1024, 2048), nonlinearity (ReLU or Tanh), and batch size (64, 128, 256, 512). In Table 3, we present the estimate of the best-performing hyperparameters for each technique. For both the Gaussian and Cubic problem, IαI_{\alpha} outperforms all approaches at all levels of mutual information between XX and YY. While the absolute estimates are improved after this hyperparameter sweep, the ordering of the approaches is qualitatively the same as in Fig. 2. We also experimented with the bounds that leverage known conditional distribution, and found that Eq. 14 that leverages a known p(yx)p(y|x) is highly accurate as it only has to learn the marginal q(y)q(y).

To better understand the effectiveness of IαI_{\alpha} at trading off bias for variance, we plotted bias vs. variance for 3 levels of mutual information on the toy 20-dimensional Gaussian problem across a range of architecture settings. In Fig. 6, we see that IαI_{\alpha} is able to effectively interpolate between the high-bias low-variance INCEI_{\text{NCE}}, and the low-bias high-variance INWJI_{\text{NWJ}}. We also find that IJSI_{\text{JS}} is competitive at high rates, but exhibits higher bias and variance than IαI_{\alpha} at lower rates.

In addition to IαI_{\alpha}, we compared to two alternative interpolation procedures, neither of which showed the improvements of IαI_{\alpha}:

IαI_{\alpha} interpolation: multisample bound that uses a critic with linear interpolation between the batch mixture m(y;x1:Km(y;x_{1:K} and the learned marginal q(y)q(y) in the denominator (Eqn. 11).

Linear interpolation: αINCE+(1α)INWJ\alpha I_{\text{NCE}}+(1-\alpha)I_{\text{NWJ}}

Product interpolation: same as IαI_{\alpha}, but uses the product m(y;x1:K)αq(y)(1α)m(y;x_{1:K})^{\alpha}q(y)^{(1-\alpha)} in the denominator.

We compared these approaches in the same setting as Fig. 6, evaluating the bias and variance for various hyperparameter settings at three different levels of mutual information. In Fig. 7, we can see that neither the product or linear interpolation approaches reduce the bias or variance as well as IαI_{\alpha}.

Given the high-variance of INWJI_{\text{NWJ}}, optimizing the critic with this objective can be challenging. Instead, we can optimize the critic using the lower bound on Jensen-Shannon (JS) divergence as in GANs and Hjelm et al. (2018), and use the density ratio estimate from the JS critic to construct a critic for the KL lower bound.

The optimal critic for INWJI_{\text{NWJ}}/ff-GAN KL that saturates the lower bound on KL(pq)KL(p\|q) is given by (Nowozin et al., 2016):

If we use the ff-GAN formulation for parameterizing the critic with a softplus activation, then we can read out the density ratio from the real-valued logits V(x)V(x):

In Poole et al. (2016); Mescheder et al. (2017), they plug in this estimate of the density ratio into a Monte-Carlo approximation of the ff-divergence. However, this is no longer a bound on the ff-divergence, it is just an approximation. Instead, we can construct a critic for the KL divergence, TKL(x)=1+V(x)T_{KL}(x)=1+V(x), and use that to get a lower bound using the INWJI_{\text{NWJ}} objective:

For the special case of mutual information estimation, pp is the joint p(x,y)p(x,y) and qq is the product of marginals p(x)p(y)p(x)p(y), yielding:

In the main text, we derive INCEI_{\text{NCE}} (and ITNCEI_{\text{TNCE}}) from a multi-sample variational lower bound. Here we present a simpler and more direct derivation of ITNCEI_{\text{TNCE}}. Let p(x)p(x) be the data distribution, and p(x1:K)p(x_{1:K}) denote KK samples drawn iid from p(x)p(x). Let p(yx)p(y|x) be a stochastic encoder, and p(y)p(y) be the intractable marginal p(y)=dxp(x)p(yx)p(y)=\int dx\,p(x)p(y|x). First, we can write the mutual information as a sum over K terms each of whose expectation is the mutual information:

Let m(y;x1:K)=1Ki=1Kp(yxi)m(y;x_{1:K})=\frac{1}{K}\sum_{i=1}^{K}p(y|x_{i}) be the minibatch estimate of the intractable marginal p(y)p(y). We multiply and divide by mm and then simplify: