Efficient Distribution Matching of Representations via Noise-Injected Deep InfoMax

## Abstract

Abstract Deep InfoMax (DIM) is a well-established method for self-supervised representation learning (SSRL) based on maximization of the mutual information between the input and the output of a deep neural network encoder.
Despite the DIM and contrastive SSRL in general being well-explored, the task of learning representations conforming to a specific distribution (i.e., distribution matching, DM) is still under-addressed.
Motivated by the importance of DM to several downstream tasks (including generative modeling, disentanglement, outliers detection and other), we enhance DIM to enable automatic matching of learned representations to a selected prior distribution.
To achieve this, we propose injecting an independent noise into the normalized outputs of the encoder, while keeping the same InfoMax training objective.
We show that such modification allows for learning uniformly and normally distributed representations, as well as representations of other absolutely continuous distributions.
Our approach is tested on various downstream tasks.
The results indicate a moderate trade-off between the performance on the downstream tasks and quality of DM.

## 1 Introduction

Learning viable low-dimensional representations of complex data plays an important role in many modern applications of artificial intelligence.
This task arises in various domains, including image (Haralick et al., ; Chen et al., ; Rombach et al., ), audio (van den Oord et al., ), and natural language processing (Mikolov et al., ; Radford et al., ; Devlin et al., ).
High-quality embeddings are particularly useful for multi-modal methods (Vinyals et al., ; Radford et al., ; Ho & Salimans, ),
statistical and topological analysis (Moor et al., ; Duong & Nguyen, ; Butakov et al., ), data visualization (van der Maaten & Hinton, ; McInnes et al., ), and testing fundamental hypotheses (Brown et al., ; Gurnee & Tegmark, ; Huh et al., ).

Existing approaches to representation learning can be divided into three categories (Ericsson et al., ): *supervised* (requires labeled data), *self-supervised* and *unsupervised* (no labeling is required).
In practice, access to labeled data is limited, which hinders the use of supervised approaches.
Therefore, unsupervised and self-supervised methods are of great importance.
Contrastive learning is a well-established paradigm of self-supervised representation learning (SSRL),
which encourages an encoder to learn similar representations for various augmentations of the same data point,
and dissimilar – for different data points.
Deep InfoMax (DIM) (Hjelm et al., ) leverages information-theoretic quantities to construct a decent contrastive objective,
involving a direct maximization of the useful information contained in the embeddings.
DIM is universal, flexible, and deeply connected to the rigorous information theory,
which allows for a good performance on a variety of downstream tasks to be attained (Hjelm et al., ; Bachman et al., ; Veličković et al., ; Tschannen et al., ; Yu, ).

Acquiring embeddings admitting a specific distribution (i.e., distribution matching, DM) is an auxiliary, yet important task in representation learning.
Latent distributions with straightforward sampling procedures or tractable densities are crucial for downstream generative modeling (Kingma & Welling, ; Makhzani et al., ; Larsen et al., ; Papamakarios et al., ).
Additionally, specific distributions (e.g., Gaussian) exhibit properties, which are useful for statistical analysis (Tipping & Bishop, ; Duong & Nguyen, ), disentanglement (Higgins et al., ; Balabin et al., ), and outliers detection.

A classical approach to latent DM is to optimize a cheap and imprecise distribution dissimilarity measure during the training or architecture search (Ng, ; Makhzani & Frey, ; Kingma & Welling, ; Heusel et al., ; Higgins et al., ).
Methods of this family have to rely on several strong assumptions, such as embeddings already admitting a Gaussian distribution,
which eventually leads to suboptimal results.
Another common approach employs adversarial networks to push the learned representations towards a desired distribution (Makhzani et al., ; Hjelm et al., ).
One can also leverage generative models (e.g., normalizing flows or diffusion models) to explicitly perform DM “post hoc” (Böhm & Seljak, ; Rombach et al., ).
These two approaches yield decent results, but require supplementary networks to match the distributions.
Finally, injective likelihood-based models can also be used to acquire low-dimensional representations admitting a desired distribution (Brehmer & Cranmer, ; Sorrenson et al., ).
However, likelihood maximization across dimensions is notoriously problematic due to non-square Jacobi matrices.

In contrast to the mentioned approaches, we propose a simple, cost-effective and non-intrusive modification to DIM,
which allows for an automatic and exact DM of the representations.
In the following text, we show that using specific activation functions and noise injections at the outlet of an encoder, combined with the DIM objective, allows for normally and uniformly distributed representations to be learned.
Our contributions are the following:

- 1.
We prove that applying normalization and adding a small noise at the outlet of an encoder and maximizing the DIM objective minimizes the Kullback-Leibler divergence between a Gaussian (or uniform) distribution and the distribution of embeddings.
- 2.
We conduct experiments on several downstream tasks to explore the trade-off between the downstream performance and the accuracy of DM via our method.
- 3.
We conduct additional experiments to assess the quality of DM via our method in the tasks of generative modelling.

The paper is organized as follows.
In Section 2, the necessary background from information theory and original works on Deep InfoMax is provided.
In Section 3, we describe the general method for DM via modified DIM.
In Section 4, a connection between the proposed approach and other SSRL methods is established.
Section 5 is dedicated to the experimental evaluation of our method.
Finally, we conclude the paper by discussing our results in Section 6.
Complete proofs, additional analysis of infomax-based DM, and technical details are provided in Appendices A, B and C correspondingly.

## 2 Background

In this section, the background necessary to understand our work is provided.
We start with the basic definitions from the information theory.
Then, the maximum entropy theorems are given, which are crucial for understanding our approach. Finally, we outline the general variant of Deep InfoMax representation learning method, which we aim to enhance with an automatic distribution matching.

### 2.1 Preliminaries

Let $(\Omega,\mathcal{F},\operatorname{\mathbb{P}})$ be a probability space with sample space $\Omega$, $\sigma$-algebra $\mathcal{F}$, and probability measure $\operatorname{\mathbb{P}}$ defined on $\mathcal{F}$.
Consider an absolutely continuous random vector $X\colon\Omega\rightarrow\mathbb{R}^{d}$
with the probability density function (PDF) denoted as $p(x)$.
The differential entropy of $X$ is defined as follows:

$$ $h(X)=-\operatorname{\mathbb{E}}\log p(X)=-\int\limits_{\mathclap{\operatorname {\mathrm{supp}}{X}}}p(x)\log p(x)\,dx,$ $$

where $\operatorname{\mathrm{supp}}{X}\subseteq\mathbb{R}^{n}$ represents the *support* of $X$, and $\log(\,\cdot\,)$ denotes the natural logarithm.
Similarly, we define the joint differential entropy as $h(X,Y)=-\operatorname{\mathbb{E}}\log p(x,y)$ and conditional differential entropy as $h(X\mid Y)=-\operatorname{\mathbb{E}}\log p\left(X\middle|Y\right)=-
\operatorname{\mathbb{E}}_{Y}\left(\operatorname{\mathbb{E}}_{X\mid Y}\log p(X
\mid Y)\right)$.
Finally, the mutual information (MI) is given by $I(X;Y)=h(X)-h(X\mid Y)$, and the following equivalences hold

$$ $I(X;Y)=h(X)-h(X\mid Y)=h(Y)-h(Y\mid X),$ $$

$$ $I(X;Y)=h(X)+h(Y)-h(X,Y),$ $$

$$ $I(X;Y)=\operatorname*{D_{\mathrm{KL}}}\left(\operatorname{\mathbb{P}}_{X,Y}\, \|\,\operatorname{\mathbb{P}}_{X}\!\otimes\operatorname{\mathbb{P}}_{Y}\right).$ $$

Mutual information can also be defined as an expectation of the *pointwise mutual information*:

$$ $\operatorname{\mathrm{PMI}}_{X,Y}(x,y)=\log\left[\frac{p(x\mid y)}{p(x)}\right ],\quad I(X;Y)=\operatorname{\mathbb{E}}\operatorname{\mathrm{PMI}}_{X,Y}(X,Y).$ (1) $$

The above definitions can be generalized via Radon-Nikodym derivatives and induced densities in case of distributions supports being manifolds, see (Spivak, ). We use flexible notation, where entropy and divergence may refer to random vectors or their corresponding distributions.

Our work leverages the maximum entropy properties of Gaussian and uniform distributions:

[Theorem 8.6.5 in Cover & Thomas ()]
Let $X$ be a $d$-dimensional absolutely continuous random vector with probability density function $p$, mean $m$ and covariance matrix $\Sigma$.
Then

$$ $h(X)=h\left(\mathcal{N}(m,\Sigma)\right)-\operatorname*{D_{\mathrm{KL}}}\left( p\,\|\,\mathcal{N}(m,\Sigma)\right),\qquad h\left(\mathcal{N}(m,\Sigma)\right) =\frac{1}{2}\log\left((2\pi e)^{d}\det\Sigma\right),$ $$

where $\mathcal{N}(m,\Sigma)$ is a Gaussian distribution of mean $m$ and covariance matrix $\Sigma$.

As for any $m\in\mathbb{R}^{d}$ it holds $h(X-m)=h(X)$,
let us consider a centered random vector $X$.
Denoting the probability density function of $\mathcal{N}(0,\Sigma)$ by $\phi_{\Sigma}$, we have

$$ $\operatorname*{D_{\mathrm{KL}}}\left(p\,\|\,\mathcal{N}(0,\Sigma)\right)=\int_ {\mathbb{R}^{d}}p(x)\log\frac{p(x)}{\phi_{\Sigma}(x)}\,dx=-h(X)-\int_{\mathbb{ R}^{d}}p(x)\log\phi_{\Sigma}(x)\,dx.$ $$

Now, consider the second term:

$$ $\int_{\mathbb{R}^{d}}p(x)\log\phi_{\Sigma}(x)\,dx=\textnormal{const}+\frac{1}{ 2}\operatorname{\mathbb{E}}_{X}X^{T}\Sigma^{-1}X=\\ =\textnormal{const}+\frac{1}{2}\operatorname{Tr}(\Sigma^{-1}\operatorname{ \mathbb{E}}_{X}[XX^{T}])=\textnormal{const}+\frac{1}{2}\operatorname{Tr}( \Sigma^{-1}\Sigma)=\textnormal{const}+\frac{d}{2}=\\ =\textnormal{const}+\frac{1}{2}\operatorname{\mathbb{E}}_{\mathcal{N}(0,\Sigma )}X^{T}\Sigma^{-1}X=\int_{\mathbb{R}^{d}}\phi_{\Sigma}(x)\log\phi_{\Sigma}(x) \,dx.$ $$

Here, in the second line, the cyclic property of the trace is used.

Let $X$ be an absolutely continuous random vector with probability density function $p$
and $\operatorname{\mathrm{supp}}X\subseteq S$, where $S$ has finite and non-zero Lebesgue measure $\mu(S)$.
Then

$$ $h(X)=h\left(\mathrm{U}(S)\right)-\operatorname*{D_{\mathrm{KL}}}\left(p\,\|\, \mathrm{U}(S)\right),\qquad h\left(\mathrm{U}(S)\right)=\log\mu(S),$ $$

where $\mathrm{U}(S)$ is a uniform distribution on $S$.

$$ $\operatorname*{D_{\mathrm{KL}}}\left(p\,\|\,\mathrm{U}(S)\right)=\int_{S}p(x) \log\frac{p(x)}{1/\mu(S)}\,dx=\\ =-h(X)+\int_{S}p(x)\log\mu(S)\,dx=-h(X)+\log\mu(S)=-h(X)+h(\mathrm{U}(S)).$ $$

###### Remark 2.1 .

Note that $h(X)\neq h(X^{\prime})-\operatorname*{D_{\mathrm{KL}}}\left(p_{X}\,\|\,p_{X^{
\prime}}\right)$ in general.

Finally, we also utilize the following lower bound on the conditional entropy of a sum of two conditionally independent random vectors:

Let $X$ and $Z$ be random vectors of the same dimensionality,
independent under the conditioning vector $Y$.
Then

$$ $h(X+Z\mid Y)=h(Z\mid Y)+I(X;X+Z\mid Y)\geq h(Z\mid Y),$ $$

with equality if and only if there exists a measurable function $g$ such that $X=g(Y)$.(^1^11Hereinafter, when comparing random variables, we mean equality or inequality “almost sure”.)

By the definition of mutual information between $Z$ and $X+Z$ conditioned on $Y$, we have

$$ $I(X;X+Z\mid Y)=h(X+Z\mid Y)-h(X+Z\mid X,Y),$ $$

where $h(X+Z\mid X,Y)=h(Z\mid Y)$ due to the independence of $X$ and $Z$ given $Y$.

Now, let us prove that $I(X;X+Z\mid Y)=0$ if and only if $\exists g:X=g(Y)$.
Firstly, if $X=g(Y)$,

$$ $I(X;X+Z\mid Y)=I(g(Y);g(Y)+Z\mid Y)=I(0;Z\mid Y)=I(0;Z)=0$ $$

Next, consider $I(X;X+Z\mid Y)=0$.
Thus, $X$ is conditionally independent both of $X+Z$ and $Z$,
which allows for the multiplicative property of characteristic functions to be used:

$$ $\displaystyle\operatorname{\mathbb{E}}\left(e^{i\left\langle t,Z\right\rangle} \,\middle|\,Y\right)$ $\displaystyle=\operatorname{\mathbb{E}}\left(e^{i\left\langle t,-X+(Z+X)\right \rangle}\,\middle|\,Y\right)=\operatorname{\mathbb{E}}\left(e^{-i\left\langle t ,X\right\rangle}\,\middle|\,Y\right)\operatorname{\mathbb{E}}\left(e^{i\left \langle t,Z\right\rangle}\,\middle|\,Y\right)\operatorname{\mathbb{E}}\left(e^ {i\left\langle t,X\right\rangle}\,\middle|\,Y\right)=$ $\displaystyle=\left[\operatorname{\mathbb{E}}\left(e^{i\left\langle t,X\right \rangle}\right)\right]^{*}\operatorname{\mathbb{E}}\left(e^{i\left\langle t,X \right\rangle}\right)\operatorname{\mathbb{E}}\left(e^{i\left\langle t,Z\right \rangle}\right)=\left|\operatorname{\mathbb{E}}\left(e^{i\left\langle t,X \right\rangle}\,\middle|\,Y\right)\right|^{2}\operatorname{\mathbb{E}}\left(e^ {i\left\langle t,Z\right\rangle}\,\middle|\,Y\right)$ $$

Note that there exists $\varepsilon(Y)>0$ such that $\operatorname{\mathbb{E}}\left(e^{i\left\langle t,Z\right\rangle}\,\middle|\,Y
\right)\neq 0$ for $\|t\|<\varepsilon(Y)$ (non-vanishing property).
Consequently, $\left|\operatorname{\mathbb{E}}\left(e^{i\left\langle t,X\right\rangle}\,
\middle|\,Y\right)\right|=1$ holds for $\|t\|<\varepsilon(Y)$.
This implies that the conditional distribution of $X$ given $Y$ is a $\delta$-distribution (Theorem 6.4.7 in (Chung, )), leading to $X=\operatorname{\mathbb{E}}(X\mid Y)$, where $g(Y)\triangleq\operatorname{\mathbb{E}}(X\mid Y)$ is a $\sigma(Y)$-measurable function.

###### Remark 2.1 .

### 2.2 Deep InfoMax

Mutual information (MI) is widely considered as a fundamental measure of statistical dependence between random variables due to its key properties, such as invariance under diffeomorphisms, subadditivity, non-negativity, and symmetry (Cover & Thomas, ). These attributes make MI particularly useful in information-theoretic approaches to machine learning. The concept of maximizing MI between input and output, known as the infomax principle (Linsker, ; Bell & Sejnowski, ), serves as the foundation for Deep InfoMax (DIM), a family of self-supervised representation learning methods proposed by Hjelm et al. ().

A naïve DIM approach suggests learning the most informative embeddings via a direct maximization of the mutual information between the original data and compressed representations:

$$ $I(X;f(X))\to\max,$ $$

where $X$ is the random vector to be compressed, and $f$ is the encoding mapping (being learned).
However, despite its simplicity and intuitiveness, this setting is rendered useless by the fact that $I(X;f(X))=\infty$ for a wide range of $X$ and $f$ (Bell & Sejnowski, ; Hjelm et al., ).

To avoid this limitation, it is usually suggested to augment (crop randomly, add noise, etc.) original data to inject stochasticity and make information-theoretic objectives non-degenerate. Consider the following Markov chain:

$$ $f(X)\longrightarrow X\longrightarrow X^{\prime},$ $$

where $X^{\prime}$ is augmented data.
Now $I(X^{\prime};f(X))$ can be made non-infinite.
Moreover, according to the data processing inequality (Cover & Thomas, ), $I(X^{\prime};f(X))\leq I(X;f(X))$, which connects this new infomax objective with the naïve one.

The only remaining problem is the high dimensionality of $X^{\prime}$, which makes MI estimation difficult.
To resolve this, one can apply an additional (in general, random) dimensionality-reducing transformation to replace $X^{\prime}$ with $Y^{\prime}$:

$$ $f(X)\longrightarrow X\longrightarrow X^{\prime}\longrightarrow Y^{\prime},$ $$

with $I(Y^{\prime};f(X))\leq I(X^{\prime};f(X))$ being the new infomax objective.
For the sake of computational simplicity, $Y^{\prime}$ can be defined as $f(X^{\prime})$; thus, the same encoder network is used to compress both the original and augmented data.
Moreover, one can view $I(f(X^{\prime});f(X))$ as a contrastive objective: this value is high when $f$ yields similar representations for corresponding augmented and non-augmented samples, and dissimilar for other pairs of samples.

Now, let us consider the task of mutual information maximization.
As MI is notoriously hard to estimate (McAllester & Stratos, ), lower bounds are widely used to reparametrize the infomax objective (Belghazi et al., ; van den Oord et al., ; Hjelm et al., ).
In this work, we only consider the two most popular approaches based on the variational representations of the Kullback-Leibler divergence:

$$ (2) (3) (4) (5) $$

where $\Omega$ is the sampling space,
and $T$ is a measurable critic function.

###### Remark 2.2 .

Assuming $\operatorname{\mathrm{PMI}}_{X,Y}$ exists,
the supremum in (3) and (5) is attained at and only at

$$ $T^{*}=T^{*}(x,y)=\operatorname{\mathrm{PMI}}_{X,Y}(x,y)+\alpha\quad\textnormal {(a.s. w.r.t. $\operatorname{\mathbb{P}}_{X,Y})$},$ (6) $$

where $\alpha=1$ for (5) and can be any real number for (3) (follows from Theorem 1 in Belghazi et al. () and Theorem 2.1 in Keziou ()).

In practice, $f$ and $T$ are approximated via corresponding neural networks,
with the parameters being learned through the maximization of the Monte-Carlo estimate of (3) or (5).
Although (3) usually yields better estimates, the SGD gradients of this expression are biased in a mini-batch setting (Belghazi et al., ).

###### Remark 2.2 .

## 3 Deep InfoMax with automatic distribution matching

In the present section, we modify DIM to enable automatic distribution matching (DM) of representations.
Specifically, we propose adding independent noise $Z$ to normalized representations of $X$,
thus replacing $f(X)$ by $f(X)+Z$ in the infomax objective from Section 2.2.
This corresponds to the following Markov chain:

$$ $f(X)+Z\longrightarrow f(X)\longrightarrow X\longrightarrow X^{\prime} \longrightarrow f(X^{\prime}).$ $$

By the data processing inequality, we know that $I(f(X^{\prime});f(X)+Z)\leq I(f(X^{\prime});f(X))$, which connects our method to the family of conventional DIM approaches discussed previously.

As we will demonstrate, the noise injection at the outlet of an encoder, in conjunction with Sections 2.1 and 2.1 on maximum entropy, allows us to achieve normally or uniformly distributed embeddings.
To prove this, we use the following Section 3,
which decomposes the proposed infomax objective into three components: the entropy of representations with an additive noise $Z$, the entropy of the noise itself, and the mutual information between $f(X)$ and $f(X)+Z$ conditioned on $f(X^{\prime})$ – representations of augmented data.

Consider the following Markov chain of absolutely continuous random vectors:

$$ $f(X)+Z\longrightarrow X\longrightarrow X^{\prime}\longrightarrow f(X^{\prime}),$ $$

with $Z$ being independent of $(X,X^{\prime})$.
Then

$$ $I(f(X^{\prime});f(X)+Z)=h(f(X)+Z)-h(Z)-I(f(X)+Z;f(X)\mid f(X^{\prime})).$ $$

From the definition of mutual information, we have

$$ $I(f(X^{\prime});f(X)+Z)=h(f(X)+Z)-h(f(X)+Z\mid f(X^{\prime})).$ $$

We apply Section 2.1 to rewrite the second term

$$ $\displaystyle h(f(X)+Z\mid f(X^{\prime}))$ $\displaystyle=h(Z\mid f(X^{\prime}))+I(f(X);f(X)+Z\mid f(X^{\prime}))$ $\displaystyle=h(Z)+I(f(X);f(X)+Z\mid f(X^{\prime})),$ $$

where the independence of $Z$ and $f(X^{\prime})$ is used.

Section 3 highlights the importance of both additive noise and input data augmentation.
Specifically, if no augmentation is applied, i.e., $X=X^{\prime}$,
then $I(f(X)+Z;f(X)\mid f(X^{\prime}))=0$.
In this case, maximizing the infomax objective is reduced to maximizing the entropy $h(f(X)+Z)$.
Under the corresponding restrictions on $f(X)$,
this is equivalent to distribution matching, see Sections 2.1 and 2.1.

However, DM alone does not guarantee that the learned representations will be meaningful or useful for downstream tasks.
That is why we also show that using $X\neq X^{\prime}$ allows us to recover meaningful embeddings,
as $I(f(X)+Z;f(X)\mid f(X^{\prime}))$ is set to zero by learning representations that are *weakly invariant* to selected data augmentations:

###### Definition 3.1 .

We call an encoding mapping $f$ *weakly invariant* to data augmentation $X\to X^{\prime}$
if there exists a function $g$ such that $f(X)=g(f(X))=g(f(X^{\prime}))$ almost surely.

Under the conditions of Section 3,
let $\operatorname{\mathbb{P}}(X=X^{\prime}\mid X)\geq\alpha>0$.
Then, $I(f(X)+Z;f(X)\mid f(X^{\prime}))=0$ precisely when $f$ is weakly invariant to $X\to X^{\prime}$.

According to  Section 2.1,
$I(f(X)+Z;f(X)\mid f(X^{\prime}))=0$ if and only if $f(X)=g(f(X^{\prime}))$ for some $g$.
Thus, weak invariance implies $I(f(X)+Z;f(X)\mid f(X^{\prime}))=0$.

On the other hand, if $f(X)=g(f(X^{\prime}))$,

$$ $\operatorname{\mathbb{P}}(f(X)\in(g^{-1}\circ f)(X)\mid X)\geq\operatorname{ \mathbb{P}}(f(X)=f(X^{\prime})\mid X)\geq\operatorname{\mathbb{P}}(X=X^{\prime }\mid X)\geq\alpha>0.$ $$

Note that the predicate $P(X)\triangleq``f(X)\in(g^{-1}\circ f)(X)$” is not random when conditioned on $X$.
Thus, $\operatorname{\mathbb{P}}(P(X)\mid X)=\phi(X)$,
where $\phi$ is a function taking values in $\{0,1\}$.
As $\phi(X)\geq\alpha>0$, $\phi(X)=1$.
This implies $g(f(X))=f(X)$ almost surely.

In what follows, we formalize the provided reasoning by addressing Gaussian and uniform distribution matching separately.
We also briefly discuss how a general DM problem can be reduced to the normal or uniform one.

###### Definition 3.1 .

### 3.1 Gaussian distribution matching

Let us assume $Z$ having finite second-order moments.
According to Section 2.1, if we restrict $f(X)$ by fixing its covariance matrix, $h(f(X)+Z)$ attains its maximal value precisely when $f(X)+Z$ is distributed normally.
Now, as $Z$ is independent of $X$, $f(X)+Z$ is normally distributed if and only if the distribution of $f(X)$ is also Gaussian.

Thus, one can achieve the normality of $f(X)$ via restricting second-order moments of $f(X)$ and maximizing the entropy $h(f(X)+Z)$.
In combination with Section 3,
this forms a basis of the proposed method for Gaussian distribution matching.
Moreover, we show that the imposed restrictions can be partially lifted via only requiring $\operatorname{\mathrm{Var}}(f(X)_{i})=1$ for every $i\in\{1,\ldots,d\}$.
This approach is preferable in practice, as the widely-used batch normalization (Ioffe & Szegedy, ) can be employed to restrict the variances.
We formalize our findings in the following theorem.

[Gaussian distribution matching]
Let the conditions of Section 3 be satisfied. Assume $Z\sim\mathcal{N}(0,\sigma^{2}\mathrm{I})$, $\operatorname{\mathbb{E}}f(X)=0$ and $\operatorname{\mathrm{Var}}\left(f(X)_{i}\right)=1$ for all $i\in\{1,\ldots,d\}$.
Then, the mutual information $I(f(X^{\prime});f(X)+Z)$ can be upper bounded as follows

$$ $I(f(X^{\prime});f(X)+Z)\leq\frac{d}{2}\log\left(1+\frac{1}{\sigma^{2}}\right),$ (7) $$

with the equality holding exactly when $f$ is weakly invariant and $f(X)\sim\mathcal{N}(0,\mathrm{I})$.
Moreover,

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{N}(0,\mathrm{I})\right )\leq I(Z;f(X)+Z)-I(f(X^{\prime});f(X)+Z)-d\log\sigma.$ $$

Applying the result from Lemma B.1 gives us:

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathcal{N}(0,(1+\sigma^{2}) \mathrm{I})\right)\leq\frac{d}{2}\log\left(1+\frac{1}{\sigma^{2}}\right)-I(f(X ^{\prime});f(X)+Z).$ $$

Since KL-divergence is non-negative, we obtain the desired bound. Furthermore, equality holds exactly when $f$ is weakly invariant and $f(X)\sim\mathcal{N}(0,\mathrm{I})$, as discussed in the proof of Lemma B.1.

The second inequality involving $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{N}(0,\mathrm{I})\right)$, follows from Corollary B.3.

While the first inequality in Section 3.1 suggests that exact distribution matching is achieved only asymptotically,
the second expression shows that $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{N}(0,\mathrm{I})\right)$ can be bounded using the value of the proposed infomax objective.
Note that $I(Z;f(X)+Z)$ is typically upper bounded,
except the rare cases where the support of $f(X)$ is degenerate.

### 3.2 Uniform distribution matching

Now consider $Z$ distributed uniformly on $[-\varepsilon;\varepsilon]^{d}$ and $\operatorname{\mathrm{supp}}f(X)\subseteq[0;1]^{d}$.
We can apply reasoning, similar to the Gaussian case, in conjunction with Section 2.1, to perform the uniform distribution matching.
However, unlike the previous case, the desired result can only be achieved asymptotically (with $\varepsilon\to 0$), as the sum of independent uniform random variables is no longer uniform.
These details are outlined in Section 3.2.

[Uniform distribution matching]
Under the conditions of Section 3,
let $Z\sim\mathrm{U}([-\varepsilon;\varepsilon]^{d})$ and $\operatorname{\mathrm{supp}}f(X)\subseteq[0;1]^{d}$.
Then, the mutual information $I(f(X^{\prime});f(X)+Z)$ can be upper bounded as follows

$$ $I(f(X^{\prime});f(X)+Z)\leq d\log\left(1+\frac{1}{2\varepsilon}\right).$ (8) $$

with the equality if and only if $1/\varepsilon\in\mathbb{N}$, $f$ is weakly invariant, and $f(X)\sim\mathrm{U}(A)$, where the set $A=\{0,2\varepsilon,4\varepsilon,\ldots,1\}$ contains $(1/(2\varepsilon)+1)$ elements.

Moreover,

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathrm{U}([0;1]^{d})\right) \leq I(Z;f(X)+Z)-I(f(X^{\prime});f(X)+Z)-d\log(2\varepsilon).$ $$

Proceeding similarly to the Gaussian case, we apply Lemma B.4, yielding

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathrm{U}([-\varepsilon;1+ \varepsilon]^{d})\right)\leq d\log\left(1+\frac{1}{2\varepsilon}\right)-I(f(X^ {\prime});f(X)+Z),$ $$

where the left-hand side is non-negative, so we obtain the claimed inequality. The conditions for equality are also established through Lemma B.4.

To prove the second upper-bound, concerning $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathrm{U}([0;1]^{d})\right)$, it suffices to use the result from Corollary B.6.

In sharp contrast to Section 3.1, the equality in (8) is attained at $f(X)$ conforming to a discrete distribution.
This makes the proposed objective less attractive in comparison to the Gaussian distribution matching.
However, one still can be assured that the standard continuous uniform distribution allows us to approach the equality in (8) with $\varepsilon$ approaching zero:

###### Remark 3.2 ( Butakov et al. 2024a ) .

If $f(X)\sim\mathrm{U}([0;1]^{d})$, $f$ is weakly invariant, and $\varepsilon<1/2$, then

$$ $I(f(X^{\prime});f(X)+Z)=d\left(\varepsilon-\log(2\varepsilon)\right)=d\log \left(1+1/(2\varepsilon)\right)-\smash{\underbrace{\left(\log(1+2\varepsilon)- \varepsilon\right)}_{o(\varepsilon)}}.$ $$

###### Remark 3.2 ( Butakov et al. 2024a ) .

### 3.3 General case

Our approach can be extended to a wide range of desired distributions of embeddings using the probability integral transform (David & Johnson, ; Chen & Gopinath, ).
Normalizing flows (learnable diffeomorphisms) can also be leveraged to transform the distribution “post-hoc” due to their universality property (Huang et al., ; Jaini et al., ; Kobyzev et al., ).

The data processing inequality can be used to estimate the quality of DM after the transformation:

###### Statement 3.3 (Corollary 2.18 in (Polyanskiy & Wu, 2024 ) ) .

Let $g$ be a measurable (w.r.t $\operatorname{\mathbb{P}}$ and $\operatorname{\mathbb{Q}}$) function.
Then
$\operatorname*{D_{\mathrm{KL}}}\left(\operatorname{\mathbb{P}}\circ g^{-1}\,\|
\,\operatorname{\mathbb{Q}}\circ g^{-1}\right)\leq\operatorname*{D_{\mathrm{KL
}}}\left(\operatorname{\mathbb{P}}\,\|\,\operatorname{\mathbb{Q}}\right)$,
where $\operatorname{\mathbb{P}}\circ g^{-1}$ and $\operatorname{\mathbb{P}}\circ g^{-1}$ denote the push-forward measures of $\operatorname{\mathbb{P}}$ and $\operatorname{\mathbb{Q}}$ after applying $g$.

###### Statement 3.3 (Corollary 2.18 in (Polyanskiy & Wu, 2024 ) ) .

## 4 Connection to other methods for SSRL

In this section, we explore the relation of our approach to other methods for unsupervised and self-supervised representation learning.
We argue that the proposed technique for distribution matching can be applied to any other method, given the latter can be formulated in terms of mutual information maximization.

#### Autoencoders

In reconstruction-based generative models (Makhzani et al., ), the reconstruction error is closely tied to the mutual information (Theorem 8.6.6 in (Cover & Thomas, )):

$$ $I(X;Y)=h(X)-h(X\mid Y)\geq h(X)-\frac{d}{2}\log(2\pi e)-\frac{1}{2}\log \operatorname{\mathbb{E}}[\|X-\hat{X}(Y)\|^{2}].$ $$

Here, $X$ denotes the input, $Y$ the latent representation produced by the encoder, and $\hat{X}(Y)$ the reconstructed input.
The last term involving the expected squared error(^2^22Here and throughout, $\|\cdot\|$ denotes the Euclidean norm.)
is essentially the autoencoder’s loss function. By minimizing this reconstruction loss, the mutual information between the input data and its representation is maximized.
However, recall that $I(X;Y)$ can diverge to infinity, as discussed earlier, so it is crucial to introduce augmentations.

#### InfoNCE

Many conventional methods for self-supervised representation learning leverage InfoNCE loss (van den Oord et al., ) in conjunction with a similarity measure $T(\,\cdot\,,\,\cdot\,)$ to formulate the following contrastive objective (Tschannen et al., ; He et al., ; Chen et al., ):

$$ $\mathcal{L}_{\textnormal{InfoNCE}}=-\left[\operatorname{\mathbb{E}}_{ \operatorname{\mathbb{P}}^{+}}T(Q,K)-\log\operatorname{\mathbb{E}}_{ \operatorname{\mathbb{P}}^{-}}\exp(T(Q,K))\right],\qquad\hat{\mathcal{L}}_{ \textnormal{InfoNCE}}=-\log\frac{e^{T(q,k^{+})}}{\frac{1}{K}\sum_{i=1}^{K}e^{T (q,k_{i}^{-})}},$ $$

where $\operatorname{\mathbb{P}}^{+}$ and $\operatorname{\mathbb{P}}^{-}$ denote the distributions of positive and negative pairs of keys $K$ and queries $Q$ correspondingly.
By selecting $\operatorname{\mathbb{P}}^{+}=\operatorname{\mathbb{P}}_{f(X^{\prime}),f(X)+Z}$ and $\operatorname{\mathbb{P}}^{-}=\operatorname{\mathbb{P}}_{f(X^{\prime})}\!
\otimes\operatorname{\mathbb{P}}_{f(X)+Z}$, we recover the Donsker-Varadhan bound (3) for our infomax objective $I(f(X^{\prime});f(X)+Z)$.
However, note that in (3) and (5) the supremum is taken over all measurable functions.
In contrast, non-infomax methods typically employ a *separable critic*: $T(q,k)=\left\langle\phi(q),\psi(k)\right\rangle$, where $\phi$ and $\psi$ are *projection heads* (Tschannen et al., ; Chen et al., ).
In special cases $\phi,\psi=\operatorname{\mathrm{Id}}$,
so similarity of representations is measured via a plain dot product.

Despite this significant difference, our distribution matching paradigm allows us to drop the supremum in (3) and (5) and establish a direct connection between DIM and traditional non-infomax contrastive SSRL methods:

[Dual form of Gaussian distribution matching]
Under the conditions of Section 3.1,

$$ $\displaystyle I(f(X^{\prime});f(X)+Z)\geq\operatorname{\mathbb{E}}_{ \operatorname{\mathbb{P}}^{+}}\left[T_{\mathcal{N}(0,\sigma^{2}\mathrm{I})}^{* }\right]-\log\operatorname{\mathbb{E}}_{\operatorname{\mathbb{P}}^{-}}\left[ \exp\left(T_{\mathcal{N}(0,\sigma^{2}\mathrm{I})}^{*}\right)\right],$ $\displaystyle T_{\mathcal{N}(0,\sigma^{2}\mathrm{I})}^{*}(x,y)=\frac{\|y\|^{2} }{2(1+\sigma^{2})}-\frac{\|y-x\|^{2}}{2\sigma^{2}}=\frac{1}{\sigma^{2}}\left( \left\langle x,y\right\rangle-\frac{\|x\|^{2}+\|y\|^{2}/(1+\sigma^{2})}{2} \right),$ $$

with the equality holding precisely when $f$ is weakly invariant and $f(X)\sim\mathcal{N}(0,\mathrm{I})$.

By Remark 2.2 we know that the equality holds if and only if $T_{\mathcal{N}(0,\sigma^{2}\mathrm{I})}^{*}(x,y)=\operatorname{\mathrm{PMI}}_{
f(X^{\prime}),f(X)+Z}(x,y)+\textnormal{const}$.

Now, for independent $Y\sim\mathcal{N}(0,\mathrm{I})$ and $Z\sim\mathcal{N}(0,\sigma^{2}\mathrm{I})$

$$ $\displaystyle\operatorname{\mathrm{PMI}}_{Y,Y+Z}(x,y)$ $\displaystyle=\log p_{Y+Z\mid Y}(y\mid x)-\log p_{Y+Z}(y)=$ $\displaystyle=\frac{\|y\|^{2}}{2(1+\sigma^{2})}-\frac{\|y-x\|^{2}}{2\sigma^{2} }+\frac{d}{2}\log\left(1+\frac{1}{\sigma^{2}}\right)=$ $\displaystyle=T_{\mathcal{N}(0,\sigma^{2}\mathrm{I})}^{*}(x,y)+I(Y;Y+Z).$ $$

Thus, the equality holds if and only if $I(f(X^{\prime});f(X)+Z)=\frac{d}{2}\log(1+1/\sigma^{2})$,
which, in turn, holds precisely when $f$ is weakly invariant and $f(X)\sim\mathcal{N}(0,\mathrm{I})$ (see Section 3.1).

Note that $\left\langle x,y\right\rangle$ is widely used as a similarity measure, $\sigma^{2}$ can be interpreted as temperature,
and the remaining part of the expression serves as a regularization term.

#### Covariance-based methods

Barlow Twins (Zbontar et al., ) and VICReg (Bardes et al., ) objective functions can be traced to information-theoretic terms either through Information Bottleneck (Tishby et al., ) or multi-view InfoMax (Federici et al., ) principles:

$$ $h(f(X^{\prime})\mid X)-\lambda\,h(f(X^{\prime}))\to\min\quad(\text{BarlowTwins})$ $$

$$ $I(f(X^{\prime});X^{\prime})\geq h(f(X^{\prime}))+\operatorname{\mathbb{E}}[ \log q(f(X^{\prime})\mid X^{\prime\prime})]\to\max\quad(\text{VICReg})$ $$

where $\lambda>0$, $X\to X^{\prime\prime}$ is a separate augmentation path, independent of $X\to X^{\prime}$,
and $q$ is a probability density function of some distribution.
In both cases, the representation entropy $h(f(X^{\prime}))$ comes into play.
Recall that normal distribution is the maximum entropy distribution given first two moments (Section 2.1).
As both methods employ covariance restriction terms in the respective objective functions, one can recover these methods by assuming the normality of $f(X^{\prime})$.

## 5 Experiments

In this section, we evaluate our distribution matching approach on several datasets and downstream tasks.
To assess the quality of the embeddings, we solve downstream classification tasks and calculate clustering scores.
To explore the relation between the magnitude of injected noise and the quality of DM, a set of statistical normality tests is employed.
For the experiments requiring numerous evaluations or visualization, we use MNIST handwritten digits dataset LeCun et al. ().
For other experiments, we use CIFAR10 and CIFAR100 datasets (Krizhevsky, ).

#### Multivariate normality and uniformity tests

The key part of the experimental pipeline is to estimate how much the distribution of embeddings acquired via the proposed method is similar to the multivariate normal or uniform distribution.
To do this, we leverage D’Agostino-Pearson (D’Agostino, ; D’Agostino & Pearson, ), Shapiro-Wilk González-Estrada et al. () univariate tests, and Henze-Zirkler (Henze & Zirkler, ; Trujillo-Ortiz et al., ) multivariate test.
To extend the univariate tests to higher dimensions, we utilize the fundamental property of the Gaussian distribution, which is the normality of any linear projection.

In practice, we sample random projectors from a $d$-dimensional sphere to perform a univariate normality test.
We also employ bootsrapping with small subsampling size to get low-variance averaged $p$-values and to smooth the transition from low to high $p$-values.
Finally, we reduce the uniform distribution case to the Gaussian via the probability integral transform, see Section 3.3.
We report the results of the tests in Figure 1.
We also visualize the two-dimensional embeddings of the MNIST dataset in Figure 2.

#### Classification and clustering

To explore the trade-off between the magnitude of the injected noise and the quality of representations, we evaluate various clustering metrics and perform downstream classification using conventional ML methods, such as Gaussian naïve Bayes, $k$-nearest neighbors and shallow multilayer perceptron.
In order to numerically measure the quality of clustering, we compute Silhouette score (Rousseeuw, ).
The results are reported in Figure 1.

Figure: Figure 1: Results for MNIST dataset in the Gaussian DM setup for $d=2$ with varying capacity $C=\frac{d}{2}\log\left(1+1/\sigma^{2}\right)$. The dotted line denotes the minimal capacity required to preserve the information about the class labels in $f(X)+Z$. The dashed line represents the upper bound on the mutual information (7). We run $5$ experiments for each point and report mean values and $99\%$ asymptotic confidence intervals. InfoNCE loss is used to approximate (3).

We also verify noise injection does not affect typical methods for SSRL such as SimCLR (Chen et al., ) and VICReg  (Bardes et al., ). To this end, we train both methods on CIFAR-10 and CIFAR-100 datasets with varying degree of noise. The linear probing performance does not drop when noise magnitude is increased across $\sigma$ values $(0.0,0.1,0.3,0.5)$ as seen in Table 1.

**Table 1: Noise magnitude influence on linear probing on CIFAR-10 and CIFAR-100. Top-1 and top-5 accuracy (in %) is reported.**
|  | CIFAR-10 | CIFAR-100 |  |  |
| --- | --- | --- | --- | --- |
|  | top-1 | top-5 | top-1 | top-5 |
| SimCLR | 90.83 | 99.76 | 65.64 | 89.91 |
| SimCLR ${\sigma=0.1}$ | 90.96 | 99.72 | 67.03 | 90.49 |
| SimCLR ${\sigma=0.3}$ | 91.56 | 99.77 | 65.72 | 89.76 |
| SimCLR ${\sigma=0.5}$ | 90.51 | 99.74 | 65.58 | 89.56 |
| VICReg | 90.63 | 99.67 | 65.71 | 88.96 |
| VICReg ${\sigma=0.1}$ | 91.09 | 99.68 | 68.92 | 90.50 |
| VICReg ${\sigma=0.3}$ | 90.75 | 99.61 | 67.31 | 89.89 |
| VICReg ${\sigma=0.5}$ | 91.02 | 99.75 | 66.52 | 89.66 |

Figure: (a) Normal distribution, $\sigma=0.1$
Refer to caption: extracted/5913528/figures/MNIST_Gaussian.png

#### Generation

Generative adversarial networks (Goodfellow et al., ) produce samples from the underlying latent distribution, which is usually Gaussian.
A common approach to make the generation not purely random is to introduce a conditioning vector during the generation (Mirza & Osindero, ; Larsen et al., ).
However, the distribution of the conditioning vector is usually unknown except for specific cases, which hinders the unconditional (or partially conditional) generation via the same model.
Thus, a model converting data to the corresponding conditioning vectors with known prior distribution is of great use.
In Appendix D, we plug our encoder into a conditional GAN and perform conditional and unconditional generation.

## 6 Discussion

In this paper, we have proposed and thoroughly investigated a novel and efficient approach to the problem of distribution matching of learned representations.
Our technique falls into a well-established family of Deep InfoMax self-supervised representation learning methods,
and does not require solving min-max optimization problems or employing generative models “post-hoc” to match the distributions.
The proposed approach is grounded in the information theory, which allows for a rigorous theoretical justification of the method.
In our work, we also explore the possibility of applying our technique to other popular methods for unsupervised and self-supervised representation learning.
Consequently, we assert that the proposed approach can be utilized in conjunction with any other method for SSRL, provided that it can be formulated in terms of mutual information or entropy maximization.

To assess the quality of the representations yielded by our method, we (a) visualize the embeddings and run normality tests, and (b) solve a set of downstream tasks in various experimental setups.
The results indicate the following:

- 1.
Increasing the noise magnitude facilitates better distribution matching, but only up to a certain point; beyond that, the entire representation learning process begins to deteriorate due to insufficient information being transmitted through the noisy channel.
- 2.
Experiments with MNIST and low-dimensional embeddings indicate the existence of a moderate trade-off between the magnitude of the injected noise and the quality in downstream classification tasks.
However, experiments with other infomax-related methods for SSRL and higher embedding dimensionality suggest this influence being negligible.
- 3.
Embeddings acquired via the proposed method can be used to condition generative models, allowing both conditional and unconditional generation due to the distribution of the conditioning vector being known.

#### Future work

As for further research, we consider elaborating on the dual formulation of infomax-based distribution matching.
Section 4 suggests that Gaussian DM can be achieved through a specific choice of the critic network $T(x,y)$.
We plan extending this result to other distributions.
Additionally, we consider conducting further experiments with generative models to comprehensively assess the quality of conditional and unconditional generation, utilizing conditioning vectors obtained via the proposed method.

## Appendix A Complete proofs

## Appendix B Supplementary results on distribution matching

In this section, we explore the connection between the proposed infomax objective and the problem of distribution matching, formulated in terms of the Kullback-Leibler divergence.

### Gaussian distribution matching

###### Lemma B.1 .

Assume the conditions of Section 3.1 are satisfied, then for Gaussian distribution matching, we have

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathcal{N}(0,(1+\sigma^{2}) \mathrm{I})\right)\leq\frac{d}{2}\log\left(1+\frac{1}{\sigma^{2}}\right)-I(f(X ^{\prime});f(X)+Z),$ $$

with equality holding exactly when $f$ is weakly invariant and $f(X)\sim\mathcal{N}(0,\mathrm{I})$.

###### Proof.

From Section 3 we obtain

$$ $I(f(X^{\prime});f(X)+Z)=h(f(X)+Z)-h(\mathcal{N}(0,\sigma^{2}\mathrm{I}))-I(f(X )+Z;f(X)\mid f(X^{\prime})).$ $$

Using Section 2.1, we can rewrite the first term, which yields

$$ $I(f(X^{\prime});f(X)+Z)=h(\mathcal{N}(m,\Sigma))-h(\mathcal{N}(0,\sigma^{2} \mathrm{I}))\\ -\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathcal{N}(m,\Sigma)\right) -I(f(X)+Z;f(X)\mid f(X^{\prime})),$ $$

where $m$ and $\Sigma$ are the mean and covariance matrix of $f(X)+Z$.

To bound the KL-divergence, note that the conditional mutual information is non-negative:

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathcal{N}(m,\Sigma)\right) \leq h(\mathcal{N}(m,\Sigma))-h(\mathcal{N}(0,\sigma^{2}\mathrm{I}))-I(f(X^{ \prime});f(X)+Z).$ $$

Equality holds exactly when $I(f(X)+Z;f(X)\mid f(X^{\prime}))=0$, which is equivalent to $f$ being weakly invariant (see Section 3).

Next, we estimate the difference between the entropies by observing that

$$ $h(\mathcal{N}(m,\Sigma))\leq\sum_{i=1}^{d}h(\mathcal{N}(m_{i},\operatorname{ \mathrm{Var}}(f(X)_{i})+\sigma^{2}))=d\cdot h(\mathcal{N}(0,1+\sigma^{2})),$ $$

with the equality holding if and only if $\Sigma$ is diagonal, which implies $\Sigma=\mathrm{I}$ since $\operatorname{\mathrm{Var}}(f(X)_{i})=1$ for all $i\in\{1,\ldots,d\}$.
Finally,

$$ $d\cdot h(\mathcal{N}(0,1+\sigma^{2}))-h(\mathcal{N}(0,\sigma^{2}\mathrm{I}))= \frac{d}{2}\left[\log(1+\sigma^{2})-\log\sigma^{2}\right]=\frac{d}{2}\log\left (1+\frac{1}{\sigma^{2}}\right),$ $$

which proves the claimed inequality.
∎

###### Lemma B.2 .

Under the conditions of Section 3.1,
the following holds:

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathcal{N}(0,(1+\sigma^{2}) \mathrm{I})\right)\leq\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{ N}(0,\mathrm{I})\right)=\\ =\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathcal{N}(0,(1+\sigma^{2}) \mathrm{I})\right)+I(Z;f(X)+Z)-\frac{d}{2}\log\left(1+\sigma^{2}\right).$ $$

###### Proof.

The left-hand inequality follows directly from the data processing inequality for the Kullback-Leibler divergence (Theorem 2.17 in (Polyanskiy & Wu, )).

To establish the right-hand side, we first apply Section 2.1, and then use the independence of $f(X)$ and $Z$, yielding $h(f(X))=h(f(X)+Z\mid Z)$. Thus, we have

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{N}(0,\mathrm{I})\right )=h(\mathcal{N}(0,\mathrm{I}))-h(f(X)+Z\mid Z).$ $$

Next, by using the definition of mutual information and again applying Section 2.1, one can write

$$ $h(f(X)+Z\mid Z)=h(f(X)+Z)-I(f(X)+Z;Z)=\\ =h(\mathcal{N}(0,(1+\sigma^{2})\mathrm{I}))-\operatorname*{D_{\mathrm{KL}}} \left(f(X)+Z\,\|\,\mathcal{N}(0,(1+\sigma^{2})\mathrm{I})\right)-I(f(X)+Z;Z).$ $$

Finally, substituting this into the expansion for $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{N}(0,\mathrm{I})\right)$, and noting that $h(\mathcal{N}(0,\mathrm{I}))-\mathcal{N}(0,(1+\sigma^{2})\mathrm{I}))=-\frac{d
}{2}\log(1+\sigma^{2})$ completes the proof.
∎

###### Corollary B.3 .

In the Gaussian distribution matching setup (Section 3.1), we have

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathcal{N}(0,\mathrm{I})\right )\leq I(Z;f(X)+Z)-I(f(X^{\prime});f(X)+Z)-d\log\sigma.$ $$

###### Proof.

This follows directly from combining Lemma B.1 and Lemma B.2.
∎

###### Lemma B.1 .

###### Proof.

###### Lemma B.2 .

###### Proof.

###### Corollary B.3 .

###### Proof.

### Uniform distribution matching

###### Lemma B.4 .

Let the conditions of Section 3.2 hold, then the following bound applies for uniform distribution matching:

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathrm{U}([-\varepsilon;1+ \varepsilon]^{d})\right)\leq d\log\left(1+\frac{1}{2\varepsilon}\right)-I(f(X^ {\prime});f(X)+Z),$ $$

with the equality if and only if $1/\varepsilon\in\mathbb{N}$, $f$ is weakly invariant, and $f(X)\sim\mathrm{U}(A)$, where the set $A=\{0,2\varepsilon,4\varepsilon,\ldots,1\}$ contains $(1/(2\varepsilon)+1)$ elements.

###### Proof.

Similarly to the proof of Lemma B.1, we use the decomposition of the infomax objective from Section 3.
Afterward, we apply Section 2.1 to the term $h(f(X)+Z)$:

$$ $I(f(X^{\prime});f(X)+Z)=h(\mathrm{U}([-\varepsilon;\varepsilon+1]^{d}))-h( \mathrm{U}([-\varepsilon;\varepsilon]^{d}))\\ -\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathrm{U}([-\varepsilon; \varepsilon+1]^{d})\right)-I(f(X)+Z;f(X)\mid f(X^{\prime})).$ $$

Therefore, the KL-divergence can be bounded as:

$$ $\displaystyle\operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathrm{U}([- \varepsilon;\varepsilon+1]^{d})\right)$ $\displaystyle\leq h(\mathrm{U}([-\varepsilon;\varepsilon+1]^{d}))-h(\mathrm{U} ([-\varepsilon;\varepsilon]^{d}))-I(f(X^{\prime});f(X)+Z)$ $\displaystyle=d\log\left(1+\frac{1}{2\varepsilon}\right)-I(f(X^{\prime});f(X)+ Z),$ $$

with equality achieved if and only if the mutual information between $f(X)+Z$ and $f(X)$ conditioned on $f(X^{\prime})$ is zero, which occurs precisely when $f$ is weakly invariant (see Section 3).

Next, we show when the equality holds.
The probability density function of the sum of independent random vectors $f(X)$ and $Z$ is given by the convolution:

$$ $\int_{\mathbb{R}^{d}}p_{f(X)}(x)p_{Z}(z-x)dx=\prod_{i=1}^{d}\int_{z_{i}- \varepsilon}^{z_{i}+\varepsilon}\left(\frac{1}{1/(2\varepsilon)+1}\sum_{a\in A }\delta(z_{i}-a)\right)\frac{dx_{i}}{2\varepsilon}=\frac{1}{(1+2\varepsilon)^{ d}}\int_{[-\varepsilon;1+\varepsilon]^{d}}dx.$ $$

Here, we used the independence of the components, with $Z_{i}$ uniformly distributed on $[-\varepsilon,\varepsilon]$ and $f(X)_{i}$ uniformly distributed over the discrete set $A=\{0,2\varepsilon,4\varepsilon,\ldots,1\}$.

Therefore, $(f(X)+Z)\sim\mathrm{U}([-\varepsilon;1+\varepsilon]^{d})$. Given this, one can calculate the mutual information explicitly:

$$ $I(f(X);f(X)+Z)=h(f(X)+Z)-h(Z)=d\log\left(1+\frac{1}{2\varepsilon}\right).$ $$

This concludes the proof.
∎

###### Lemma B.5 .

Under the conditions of Section 3.2,
the following holds:

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathrm{U}([0;1]^{d})\right)= \operatorname*{D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathrm{U}([-\varepsilon; \varepsilon+1]^{d})\right)+I(Z;f(X)+Z)-d\log(1+2\varepsilon).$ $$

###### Proof.

One can build on the reasoning from Lemma B.2 by applying Section 2.1 to express the KL-divergence between $f(X)$ and ${\mathrm{U}([0;1]^{d})}$ as follows:

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathrm{U}([0;1]^{d})\right)=h( \mathrm{U}([0;1]^{d}))-h(f(X)+Z\mid Z)=-h(f(X)+Z\mid Z).$ $$

Using Section 2.1 again, the conditional entropy can be expressed as

$$ $h(f(X)+Z\mid Z)=h(\mathrm{U}([-\varepsilon;\varepsilon+1]^{d}))-\operatorname* {D_{\mathrm{KL}}}\left(f(X)+Z\,\|\,\mathrm{U}([-\varepsilon;\varepsilon+1]^{d} )\right)-I(f(X)+Z;Z).$ $$

To conclude it remains to calculate $h(\mathrm{U}([-\varepsilon;\varepsilon+1]^{d}))=d\log(1+2\varepsilon)$.
∎

###### Corollary B.6 .

In the uniform distribution matching setup (Section 3.2), we have

$$ $\operatorname*{D_{\mathrm{KL}}}\left(f(X)\,\|\,\mathrm{U}([0;1]^{d})\right) \leq I(Z;f(X)+Z)-I(f(X^{\prime});f(X)+Z)-d\log(2\varepsilon).$ $$

###### Proof.

Applying Lemma B.4 alongside Lemma B.5 is enough.
∎

###### Lemma B.4 .

###### Proof.

###### Lemma B.5 .

###### Proof.

###### Corollary B.6 .

###### Proof.

## Appendix C Details of implementation

For experiments on MNIST dataset, we use a simple ConvNet with three convolutional and two fully connected layers.
A three-layer fully-connected perceptron serves as a critic network for the InfoNCE loss.
We provide the details in Table 2.
We use additive Gaussian noise with $\sigma=0.6$ as an input augmentation.
Training hyperparameters are as follows: batch size = 1024, 2000 epochs, Adam optimizer (Kingma & Ba, ) with learning rate $10^{-3}$.

**Table 2: The NN architectures used to conduct the tests on MNIST images in Section 5.**
| NN | Architecture |
| --- | --- |
| ConvNet,<br>$24\times 24$<br>images | $\times 1$:<br>Conv2d(1, 32, ks=3), MaxPool2d(2), BatchNorm2d, LeakyReLU(0.01)<br>$\times 1$:<br>Conv2d(32, 64, ks=3), MaxPool2d(2), BatchNorm2d, LeakyReLU(0.01)<br>$\times 1$:<br>Conv2d(64, 128, ks=3), MaxPool2d(2), BatchNorm2d, LeakyReLU(0.01)<br>$\times 1$:<br>Dense(128, 128), LeakyReLU(0.01), Dense(128, dim) |
| Critic NN,<br>pairs of vectors | $\times 1$:<br>Dense(dim + dim, 256), LeakyReLU(0.01)<br>$\times 1$:<br>Dense(256, 256), LeakyReLU(0.01), Dense(256, 1) |

The results on CIFAR datasets (Krizhevsky, ) in Table 1 were obtained with the standard configuration of SSL methods.
Namely, we use ResNet-18 (He et al., ) backbone.
Projection head for SimCLR consists of two linear layers, for VICReg – 3 layers.
Respective configurations are $[2048,256]$ and $[2048,2048,2048]$, meaning embedding dimensions are 256 and 2048, respectively.
We apply a standard set of augmentations:

Training hyperparameters are as follows: batch size $256$, $800$ epochs, LARS optimizer (You et al., ) with clipping, base learning rate $0.3$,
momentum $0.9$, trust coefficient $0.02$, weight decay $10^{-4}$.
For SimCLR, we use temperature $0.2$, for VICReg – standard hyperparameters $(25,25,1)$.

We also provide the source code in the supplementary materials.

## Appendix D Conditioning generative adversarial networks

In this section, we leverage our method to generate conditioning vectors for a conventional cGAN setup (Mirza & Osindero, ).
We use the two-dimensional Gaussian embeddings of the MNIST dataset,
acquired from the noise level $\sigma=0.1$.
For conditioned generation, we get embeddings from a batch of original images.
For unconditioned generation, embeddings are sampled from $\mathcal{N}(0,\mathrm{I})$.
The results are presented in Figures 3 and 4.

Figure: (a) Encoded images
Refer to caption: extracted/5913528/figures/MNIST_cGAN_condition.png

Figure: Figure 4: Results of unconditional generation.
Refer to caption: extracted/5913528/figures/MNIST_cGAN_unconditioned_generation.png

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: - what is the meaning of "nats" in Figure 1 caption "Capacity, nats"? Does it refer to $C = d/2 log(1 + 1 / \sigma^2)$?
soundness: 3
strengths: - The intuition of two noise injection, Gaussian and Uniform, methods are resonable. The reason for the gaussian distribution comes from the fact that the Gussian distribution has the max entropy of all distributions with a fixed covariance. The reason for the uniform distribution comes from uniform distribution U(a, b) has the max entropy of a distribution within range [a,b]. 

- This work provides a theorical proof of the effect of these two noise injections. 

- This paper provides rich background knowledges. 

- The experiments in this paper (cifar, mnist) demenstrate the usefulness of the two noise injection methods.
summary: This work introduces  noise injection to shape a self-supervised learning represenation as Gaussian or Uniformed representation. In short, by injecting a Guassian noise and restricting the convariance of f(x), f(x) tends to be gaussian distirbutioned. By injecting an uniformed distribution within a narrow range $[-\epsilon, \epsilon]$ and restricting the range of f(x) (e.g. within [0,1]), f(x) tends to be uniformly distributioned.

The reason for the gaussian distribution comes from the fact that the Gussian distribution has the max entropy of all distributions with a fixed covariance. The reason for the uniform distribution comes from uniform distribution U(a, b) has the max entropy of a distribution within range [a,b]. 

Apart from the theorical analysis, this work also present interesting plots to demenstrate the two kinds of learned representation, i.e. Gaussian and Uniformed.
weaknesses: - line 236-239 explains why injecting a gaussian noise helps learn a gaussian representation. This sentence is helpful for understanding. It would be good to have a similar short explaination before the proof of uniform noise injection. For example, the reason of small $\epsilon$, discrete support $A$, and the entropy of uniformed distribution. 

- Large experiments beyond cifar and mnist are helpful to convince readers.

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: * Is the linear probe trained on the output of the encoder or on some intermediate layer?
* Are the gains observed in Table 1 transferrable when training on ImageNet?
soundness: 2
strengths: The paper defines the notation and robustly use it throughout the paper making it easy to follow along as a    reader. I appreciate the clarity and reading the method and the experimental section. I was also pleasantly  surprised of the novelty of the idea proposed, while being very simple.
summary: The paper propose to add gaussian or uniform noise to the output of the encoder in contrastive methods.
weaknesses: The main weakness of the paper is that the experiments are conducted on simple and sometimes trivial           benchmarks. The raw input space of MNIST can already be well represented using t-SNE [1] and thus any SSL      representation learning experiments performed on this dataset are dubious. I encourage the authors to          reproduce the visualization obtained on MNIST with CIFAR-10 or CIFAR-100.

One potential issue with adding noise to the output representation is that we limit the bandwith of the        representation. Therefore, while we may see improvement on small datasets such as CIFAR-100, this improvement  may vanish as we scale up the size of the dataset. I encourage the authors to consider running their           experiments on ImageNET to validate the their method scales up to larger and more diverse datasets. 

[Minor] There are some issues with the formatting. E.g. in page 1, the citation overflows to the second page   breaking the reference.

[1] https://www.kaggle.com/code/venkatkrishnan/t-sne-decomposition-on-mnist-dataset

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: If the authors can clarify the significance of the additive noise in the theoretical view, this work will be complete, in my opinion. Then, I will consider changing my rating.
soundness: 3
strengths: 1. The research has been well accomplished since both the theoretical effectiveness and experimental results are provided.

2. The background and fundamental method are well described, so readers can easily follow the idea.
summary: This paper proposes an improved Deep Infomax (DIM) method for self-supervised representation learning. Overall, an independent noise $Z$ is added to the normalized representations of the data. The authors demonstrate that the method is effective since it keeps the same training objective as the DIM. Experimental results also show the effectiveness.
weaknesses: The only improvement in this work is the additive noise in DIM, which may be not very overwhelming. However, if this small improvement can be thoroughly discussed and analyzed, the contribution of this work could still be significant. Therefore, my concerns mainly focus on the discussions and analysis:

1. Since the authors claim in the title that the proposed method is an efficient matching method, it should be clarified why the improved approach is efficient. However, I only see that adding noise will not impact the DIM objective while improving the performance. The efficiency is not discussed.

2. The advantage of adding noise is also not well discussed. It is stated that Lemma 3.1 highlights the importance of both additive noise and input data augmentation. Still, I only see the analysis of the significance of augmentation and do not understand why adding noise is also necessary.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 4
questions: My main questions are about scaling: 

Will the representation learning improve over the baseline InfoMax in more conventional large-scale settings - ImageNet linear-probing/fine-tuning? 

How stable is the training with noise under large-scale settings?

For generation and sampling - can you show interpretable individual directions in the learned representation distribution (again - on more advanced datasets like FFHQ/ImageNet)?
soundness: 3
strengths: 1. The paper is very clear and well-written. It is easy to follow the derivations and the main ideas. 

2. It provides a good theoretical and empirical analysis of the method and the trade-offs between representation learning and distribution matching.  

3. The presented modification is simple, and yet it provides a non-negligible improvement in usefulness (sampling).
summary: The paper modifies the Deep InfoMax approach to learning representations that match specific distributions (uniform and normal). Specifically, it suggests adding noise to the normalized representations encoded from the inputs, before training them to maximize the mutual information with encoded input augmentations. It provides theoretical upper bounds for the mutual information between the noisy representation and the representation of the augmentation. It shows empirical results demonstrating the distribution matching, and the trade-off regarding the amounts of noise - a high noise level facilitates better distribution matching, but might result in worse representation learning.
weaknesses: 1. The quality of conditional and unconditional sampling, the main property that can be achieved from a distribution matching is not tested on larger scale data. The paper can significantly improve with generation results on a larger scale of data (e.g. ImageNet/Cifar100).

2. Even for the representation learning tests, this paper can improve with testing on larger datasets. The results of Figure 1, for example, are mostly saturated on MNIST and it will be useful to verify the same on larger more diverse datasets. 

3. While the paper has a section that argues that the same method can be applied to other SSRLs, it lacks empirical results that can demonstrate the usefulness/fragility of the training regime with noise.

Meta-review: This paper introduces a method for enforcing representations learnt with self-supervised learning (specifically Deep InfoMax) to follow a specific distribution by normalizing and injecting appropriate noise into encoder outputs. The method is simple yet novel, and is theoretically grounded while also being shown to be effective in the experiments. The paper further shows connections to commonly used self-supervised learning techniques and empirically validates its effectiveness on these. The paper is well-written and clear. While reviewers had initial concerns about the lack of experiments on larger scale datasets, these were addressed in the rebuttal (see below). Following the rebuttal, all reviewers were positive about the paper and the AC concurs, recommending acceptance.

Decision: Accept (Poster)