Marylou Gabrié
email: marylou.gabrie@ens.fr

Andre Manoel

Clément Luneau

Jean Barbier

Nicolas Macris

Florent Krzakala

Lenka Zdeborová

Entropy and mutual information in models of deep neural networks

The successes of deep learning methods have spurred efforts towards quantitative modeling of the performance of deep neural networks. In particular, an information-theoretic approach linking generalization capabilities to compression has been receiving increasing interest. The intuition behind the study of mutual informations in latent variable models dates back to the information bottleneck (IB) theory of [1]. Although recently reformulated in the context of deep learning [2], verifying its relevance in practice requires the computation of mutual informations for high-dimensional variables, a notoriously hard problem. Thus, pioneering works in this direction focused either on small network models with discrete (continuous, eventually binned) activations [3], or on linear networks [4,5].

In the present paper we follow a different direction, and build on recent results from statistical physics [6,7] and information theory [8,9] to propose, in Section 1, a formula to compute informationtheoretic quantities for a class of deep neural network models. The models we approach, described in Section 2, are non-linear feed-forward neural networks trained on synthetic datasets with constrained weights. Such networks capture some of the key properties of the deep learning setting that are usually difficult to include in tractable frameworks: non-linearities, arbitrary large width and depth, and correlations in the input data. We demonstrate the proposed method in a series of numerical experiments in Section 3. First observations suggest a rather complex picture, where the role of compression in the generalization ability of deep neural networks is yet to be elucidated.

Multi-layer model and main theoretical results

A stochastic multi-layer model-We consider a model of multi-layer stochastic feed-forward neural network where each element x i of the input layer x ∈ R N 0 is distributed independently as P 0 (x i ), while hidden units t ,i at each successive layer t ∈ R N (vectors are column vectors) come from P (t ,i |W ,i t -1 ), with t 0 ≡ x and W ,i denoting the i-th row of the matrix of weights W ∈ R N ×N -1 . In other words

t 0,i ≡ x i ∼ P 0 (•), t 1,i ∼ P 1 (•|W 1,i x), . . . t L,i ∼ P L (•|W L,i t L-1 ), (1)
given a set of weight matrices {W } L =1 and distributions {P } L =1 which encode possible nonlinearities and stochastic noise applied to the hidden layer variables, and P 0 that generates the visible variables. In particular, for a non-linearity t ,i = ϕ (h, ξ ,i ), where ξ ,i ∼ P ξ (•) is the stochastic noise (independent for each i), we have P (t ,i |W ,i t -1 ) = dP ξ (ξ ,i ) δ t ,iϕ (W ,i t -1 , ξ ,i ) . Model (1) thus describes a Markov chain which we denote by

X → T 1 → T 2 → • • • → T L , with T = ϕ (W T -1 , ξ ), ξ = {ξ ,i } N i=1
, and the activation function ϕ applied componentwise. Replica formula-We shall work in the asymptotic high-dimensional statistics regime where all α ≡ N /N 0 are of order one while N 0 → ∞, and make the important assumption that all matrices W are orthogonally-invariant random matrices independent from each other; in other words, each matrix W ∈ R N ×N -1 can be decomposed as a product of three matrices, W = U S V , where U ∈ O(N ) and V ∈ O(N -1 ) are independently sampled from the Haar measure, and S is a diagonal matrix of singular values. The main technical tool we use is a formula for the entropies of the hidden variables, H(T ) = -E T ln P T (t ), and the mutual information between adjacent layers I(T ; T -1 ) = H(T ) + E T ,T -1 ln P T |T -1 (t |t -1 ), based on the heuristic replica method [10,11,6,7,8,9]: Claim 1 (Replica formula). Assume model (1) with L layers in the high-dimensional limit with componentwise activation functions and weight matrices generated from the ensemble described above, and denote by λ W k the eigenvalues of W k W k . Then for any ∈ {1, . . . , L} the normalized entropy of T is given by the minimum among all stationary points of the replica potential:

lim N 0 →∞ 1 N 0 H(T ) = min extr A,V , Ã, Ṽ φ (A, V , Ã, Ṽ ), (2)
which depends on -dimensional vectors A, V , Ã, Ṽ , and is written in terms of mutual information I and conditional entropies H of scalar variables as

φ (A, V , Ã, Ṽ ) = I t 0 ; t 0 + ξ 0 Ã1 - 1 2 k=1 αk-1 Ãk V k + α k A k Ṽk -F W k (A k V k ) + -1 k=1 αk H(t k |ξ k ; Ãk+1 , Ṽk , ρk ) - 1 2 log(2πe Ãk+1 ) + α H(t |ξ ; Ṽ , ρ ), (3)
where

α k = N k /N k-1 , αk = N k /N 0 , ρ k = dP k-1 (t) t 2 , ρk = (E λ W k λ W k )ρ k /α k ,
and ξ k ∼ N (0, 1) for k = 0, . . . , . In the computation of the conditional entropies in (3), the scalar t k -variables are generated from P (t 0 ) = P 0 (t 0 ) and

P (t k |ξ k ; A, V, ρ) = E ξ,z P k (t k + ξ/ √ A| ρ -V ξ k + √ V z), k = 1, . . . , -1, (4)
P (t |ξ ; V, ρ) = E z P (t | ρ -V ξ + √ V z), (5)
where ξ and z are independent N (0, 1) random variables. Finally, the function F W k (x) depends on the distribution of the eigenvalues λ W following

F W k (x) = min θ∈R 2α k θ + (α k -1) ln(1 -θ) + E λ W k ln[xλ W k + (1 -θ)(1 -α k θ)] . (6)
The computation of the entropy in the large dimensional limit, a computationally difficult task, has thus been reduced to an extremization of a function of 4 variables, that requires evaluating single or bidimensional integrals. This extremization can be done efficiently, as detailed in the Supplementary Material; a user-friendly Python package is provided [12], which performs the computation for different choices of prior P 0 , activations ϕ and spectra λ W . Finally, the mutual information between successive layers I(T ; T -1 ) can be obtained from the entropy following the evaluation of an additional bidimensional integral, see Section 1.6.1 of the Supplementary Material.

Our approach in the derivation of (3) builds on recent progresses in statistical estimation and information theory for generalized linear models following the application of methods from statistical physics of disordered systems [10,11] in communication [13], statistics [14] and machine learning problems [15,16]. In particular, we use advanced mean field theory [17] and the heuristic replica method [10,6], along with its recent extension to multi-layer estimation [7,8,9], in order to derive the above formula (3). This derivation is lengthy and thus given in the Supplementary Material.

Rigorous statement-We recall the assumptions under which the replica formula of Claim 1 is conjectured to be exact: (i) weight matrices are drawn from an ensemble of random orthogonallyinvariant matrices, (ii) matrices at different layers are statistically independent and (iii) layers have a large dimension and respective sizes of adjacent layers are such that weight matrices have aspect ratios {α k , αk } k=1 of order one. While we could not prove the replica prediction in full generality, we stress that it comes with multiple credentials: (i) for Gaussian prior P 0 and Gaussian distributions P , it corresponds to the exact analytical solution when weight matrices are independent of each other (see Section 1.6.2 of the Supplementary Material). (ii) In the single-layer case with a Gaussian weight matrix, it reduces to formula (13) in the Supplementary Material, which has been recently rigorously proven for (almost) all activation functions ϕ [18]. (iii) In the case of Gaussian distributions P , it has also been proven for a large ensemble of random matrices [19] and (iv) it is consistent with all the results of the AMP [20,21,22] and VAMP [23] algorithms, known to perform well for these estimation problems. An equivalent formula was proposed by Reeves in [9] using different heuristic arguments.

In order to go beyond results for the single-layer problem and heuristic arguments, we prove Claim 1 for the more involved multi-layer case, assuming Gaussian i.i.d. matrices and two non-linear layers:

Theorem 1 (Two-layer Gaussian replica formula). Suppose (H1) the input units distribution P 0 is separable and has bounded support; (H2) the activations ϕ 1 and ϕ 2 corresponding to P 1 (t 1,i |W 1,i x) and P 2 (t 2,i |W 2,i t 1 ) are bounded C 2 with bounded first and second derivatives w.r.t their first argument; and (H3) the weight matrices W 1 , W 2 have Gaussian i.i.d. entries. Then for model (1) with two layers L = 2 the high-dimensional limit of the entropy verifies Claim 1.

The theorem, that proves the conjecture presented in [7], is proven using the adaptive interpolation method of [24,18] in a multi-layer setting, as first developed in [25]. The lengthy proof, presented in details in the Supplementary Material, is of independent interest and adds further credentials to the replica formula, as well as offers a clear direction to further developments. Note that, following the same approximation arguments as in [18] where the proof is given for the single-layer case, the hypothesis (H1) can be relaxed to the existence of the second moment of the prior, (H2) can be dropped and (H3) extended to matrices with i.i.d. entries of zero mean, O(1/N 0 ) variance and finite third moment.

Tractable models for deep learning

The multi-layer model presented above can be leveraged to simulate two prototypical settings of deep supervised learning on synthetic datasets amenable to the replica tractable computation of entropies and mutual informations. The first scenario is the so-called teacherstudent (see Figure 1, left). Here, we assume that the input x is distributed according to a separable prior distribution P X (x) = i P 0 (x i ), factorized in the components of x, and the corresponding label y is given by applying a mapping x → y, called the teacher. After generating a train and test set in this manner, we perform the training of a deep neural network, the student, on the synthetic dataset. In this case, the data themselves have a simple structure given by P 0 .

In constrast, the second scenario allows generative models (see Figure 1, right) that create more structure, and that are reminiscent of the generative-recognition pair of models of a Variational Autoencoder (VAE). A code vector y is sampled from a separable prior distribution P Y (y) = i P 0 (y i ) and a corresponding data point x is generated by a possibly stochastic neural network, the generative model. This setting allows to create input data x featuring correlations, differently from the teacher-student scenario. The studied supervised learning task then consists in training a deep neural net, the recognition model, to recover the code y from x.

In both cases, the chain going from X to any later layer is a Markov chain in the form of (1). In the first scenario, model (1) directly maps to the student network. In the second scenario however, model (1) actually maps to the feed-forward combination of the generative model followed by the recognition model. This shift is necessary to verify the assumption that the starting point (now given by Y ) has a separable distribution. In particular, it generates correlated input data X while still allowing for the computation of the entropy of any T .

At the start of a neural network training, weight matrices initialized as i.i.d. Gaussian random matrices satisfy the necessary assumptions of the formula of Claim 1. In their singular value decomposition

W = U S V (7)
the matrices U ∈ O(N ) and V ∈ O(N -1 ), are typical independent samples from the Haar measure across all layers. To make sure weight matrices remain close enough to independent during learning, we define a custom weight constraint which consists in keeping U and V fixed while only the matrix S , constrained to be diagonal, is updated. The number of parameters is thus reduced from N × N -1 to min(N , N -1 ). We refer to layers following this weight constraint as USV-layers. For the replica formula of Claim 1 to be correct, the matrices S from different layers should furthermore remain uncorrelated during the learning. In Section 3, we consider the training of linear networks for which information-theoretic quantities can be computed analytically, and confirm numerically that with USV-layers the replica predicted entropy is correct at all times. In the following, we assume that is also the case for non-linear networks. In Section 3.2 of the Supplementary Material we train a neural network with USV-layers on a simple real-world dataset (MNIST), showing that these layers can learn to represent complex functions despite their restriction. We further note that such a product decomposition is reminiscent of a series of works on adaptative structured efficient linear layers (SELLs and ACDC) [26,27] motivated this time by speed gains, where only diagonal matrices are learned (in these works the matrices U and V are chosen instead as permutations of Fourier or Hadamard matrices, so that the matrix multiplication can be replaced by fast transforms). In Section 3, we discuss learning experiments with USV-layers on synthetic datasets.

While we have defined model ( 1) as a stochastic model, traditional feed forward neural networks are deterministic. In the numerical experiments of Section 3, we train and test networks without injecting noise, and only assume a noise model in the computation of information-theoretic quantities. Indeed, for continuous variables the presence of noise is necessary for mutual informations to remain finite (see discussion of Appendix C in [5]). We assume at layer an additive white Gaussian noise of small amplitude just before passing through its activation function to obtain H(T ) and I(T ; T -1 ), while keeping the mapping X → T -1 deterministic. This choice attempts to stay as close as possible to the deterministic neural network, but remains inevitably somewhat arbitrary (see again discussion of Appendix C in [5]).

Other related works-The strategy of studying neural networks models, with random weight matrices and/or random data, using methods originated in statistical physics heuristics, such as the replica and the cavity methods [10] has a long history. Before the deep learning era, this approach led to pioneering results in learning for the Hopfield model [28] and for the random perceptron [29,30,15,16].

Recently, the successes of deep learning along with the disqualifying complexity of studying real world problems have sparked a revived interest in the direction of random weight matrices. Recent results -without exhaustivity-were obtained on the spectrum of the Gram matrix at each layer using random matrix theory [31,32], on expressivity of deep neural networks [33], on the dynamics of propagation and learning [34,35,36,37], on the high-dimensional non-convex landscape where the learning takes place [38], or on the universal random Gaussian neural nets of [39]. The information bottleneck theory [1] applied to neural networks consists in computing the mutual information between the data and the learned hidden representations on the one hand, and between labels and again hidden learned representations on the other hand [2,3]. A successful training should maximize the information with respect to the labels and simultaneously minimize the information with respect to the input data, preventing overfitting and leading to a good generalization. While this intuition suggests new learning algorithms and regularizers [40,[START_REF] Achille | Information Dropout: Learning Optimal Representations Through Noisy Computation[END_REF][START_REF] Alemi | Deep variational information bottleneck[END_REF][START_REF] Achille | Emergence of Invariance and Disentangling in Deep Representations[END_REF][START_REF] Kolchinsky | Nonlinear Information Bottleneck[END_REF][START_REF] Belghazi | MINE: Mutual Information Neural Estimation[END_REF][START_REF] Zhao | InfoVAE: Information Maximizing Variational Autoencoders[END_REF], we can also hypothesize that this mechanism is already at play in a priori unrelated commonly used optimization methods, such as the simple stochastic gradient descent (SGD). It was first tested in practice by [3] on very small neural networks, to allow the entropy to be estimated by binning of the hidden neurons activities. Afterwards, the authors of [5] reproduced the results of [3] on small networks using the continuous entropy estimator of [START_REF] Kolchinsky | Nonlinear Information Bottleneck[END_REF], but found that the overall behavior of mutual information during learning is greatly affected when changing the nature of non-linearities. Additionally, they investigate the training of larger linear networks on i.i.d. normally distributed inputs where entropies at each hidden layer can be computed analytically for an additive Gaussian noise. The strategy proposed in the present paper allows us to evaluate entropies and mutual informations in non-linear networks larger than in [5,3].

Numerical experiments

Estimators and activation comparisons-Two non-parametric estimators have already been considered by [5] to compute entropies and/or mutual informations during learning. The kerneldensity approach of Kolchinsky et. al. [START_REF] Kolchinsky | Nonlinear Information Bottleneck[END_REF] consists in fitting a mixture of Gaussians (MoG) to samples of the variable of interest and subsequently compute an upper bound on the entropy of the MoG [START_REF] Kolchinsky | Estimating mixture entropy with pairwise distances[END_REF]. The method of Kraskov et al. [START_REF] Kraskov | Estimating mutual information[END_REF] uses nearest neighbor distances between samples to directly build an estimate of the entropy. Both methods require the computation of the matrix of distances between samples. Recently, [START_REF] Belghazi | MINE: Mutual Information Neural Estimation[END_REF] proposed a new non-parametric estimator for mutual informations which involves the optimization of a neural network to tighten a bound. It is unfortunately computationally hard to test how these estimators behave in high dimension as even for a known distribution the computation of the entropy is intractable (#P-complete) in most cases. However the replica method proposed here is a valuable point of comparison for cases where it is rigorously exact.

In the first numerical experiment we place ourselves in the setting of Theorem 1: a 2-layer network with i.i.d weight matrices, where the formula of Claim 1 is thus rigorously exact in the limit of large networks, and we compare the replica results with the non-parametric estimators of [START_REF] Kolchinsky | Nonlinear Information Bottleneck[END_REF] and [START_REF] Kraskov | Estimating mutual information[END_REF]. Note that the requirement for smooth activations (H2) of Theorem 1 can be relaxed (see discussion below the Theorem). Additionally, non-smooth functions can be approximated arbitrarily closely by smooth functions with equal information-theoretic quantities, up to numerical precision.

We consider a neural network with layers of equal size N = 1000 that we denote: X → T 1 → T 2 . The input variable components are i.i.d. Gaussian with mean 0 and variance 1. The weight matrices entries are also i.i.d. Gaussian with mean 0. Their standard-deviation is rescaled by a factor 1/ √ N and then multiplied by a coefficient σ varying between 0.1 and 10, i.e. around the recommended value for training initialization. To compute entropies, we consider noisy versions of the latent variables where an additive white Gaussian noise of very small variance (σ 2 noise = 10 -5 ) is added right before the activation function,

T 1 = f (W 1 X + 1 ) and T 2 = f (W 2 f (W 1 X) + 2 ) with 1,2 ∼ N (0, σ 2 noise I N )
, which is also done in the remaining experiments to guarantee the mutual informations to remain finite. The non-parametric estimators [START_REF] Kolchinsky | Nonlinear Information Bottleneck[END_REF][START_REF] Kraskov | Estimating mutual information[END_REF] were evaluated using 1000 samples, as the cost of computing pairwise distances is significant in such high dimension and we checked that the entropy estimate is stable over independent draws of a sample of such a size (error bars smaller than marker size). On Figure 5, we compare the different estimates of H(T 1 ) and H(T 2 ) for different activation functions: linear, hardtanh or ReLU. The hardtanh activation is a piecewise linear approximation of the tanh, hardtanh(x) = -1 for x < -1, x for -1 < x < 1, and 1 for x > 1, for which the integrals in the replica formula can be evaluated faster than for the tanh.

In the linear and hardtanh case, the non-parametric methods are following the tendency of the replica estimate when σ is varied, but appear to systematically over-estimate the entropy. For linear networks with Gaussian inputs and additive Gaussian noise, every layer is also a multivariate Gaussian and therefore entropies can be directly computed in closed form (exact in the plot legend). When using the Kolchinsky estimate in the linear case we also check the consistency of two strategies, either fitting the MoG to the noisy sample or fitting the MoG to the deterministic part of the T and augment the resulting variance with σ 2 noise , as done in [START_REF] Kolchinsky | Nonlinear Information Bottleneck[END_REF] (Kolchinsky et al. parametric in the plot legend). In the network with hardtanh non-linearities, we check that for small weight values, the entropies are the same as in a linear network with same weights (linear approx in the plot legend, computed using the exact analytical result for linear networks and therefore plotted in a similar color to exact). Lastly, in the case of the ReLU-ReLU network, we note that non-parametric methods are predicting an entropy increasing as the one of a linear network with identical weights, whereas the replica computation reflects its knowledge of the cut-off and accurately features a slope equal to half of the linear network entropy (1/2 linear approx in the plot legend). While non-parametric estimators are invaluable tools able to approximate entropies from the mere knowledge of samples,they inevitably introduce estimation errors. The replica method is taking the opposite view. While being restricted to a class of models, it can leverage its knowledge of the neural network structure to provide a reliable estimate. To our knowledge, there is no other entropy estimator able to incorporate such information about the underlying multi-layer model.

Beyond informing about estimators accuracy, this experiment also unveils a simple but possibly important distinction between activation functions. For the hardtanh activation, as the random weights magnitude increases, the entropies decrease after reaching a maximum, whereas they only increase for the unbounded activation functions we consider -even for the single-side saturating ReLU. This loss of information for bounded activations was also observed by [5], where entropies were computed by discretizing the output as a single neuron with bins of equal size. In this setting, as the tanh activation starts to saturate for large inputs, the extreme bins (at -1 and 1) concentrate more and more probability mass, which explains the information loss. Here we confirm that the phenomenon is also observed when computing the entropy of the hardtanh (without binning and with small noise injected before the non-linearity). We check via the replica formula that the same phenomenology arises for the mutual informations I(X; T ) (see Section3.1).

Learning experiments with linear networks-In the following, and in Section 3.3 of the the Supplementary Material, we discuss training experiments of different instances of the deep learning models defined in Section 2. We seek to study the simplest possible training strategies achieving good generalization. Hence for all experiments we use plain stochastic gradient descent (SGD) with Figure 2: Entropy of latent variables in stochastic networks X → T 1 → T 2 , with equally sized layers N = 1000, inputs drawn from N (0, I N ), weights from N (0, σ 2 I N 2 /N ), as a function of the weight scaling parameter σ. An additive white Gaussian noise N (0, 10 -5 I N ) is added inside the non-linearity. Left column: linear network. Center column: hardtanh-hardtanh network. Right column: ReLU-ReLU network. constant learning rates, without momentum and without any explicit form of regularization. The sizes of the training and testing sets are taken equal and scale typically as a few hundreds times the size of the input layer. Unless otherwise stated, plots correspond to single runs, yet we checked over a few repetitions that outcomes of independent runs lead to identical qualitative behaviors. The values of mutual informations I(X; T ) are computed by considering a noisy versions of the latent variables where an additive white Gaussian noise of very small variance (σ 2 noise = 10 -5 ) is added right before the activation function, as in the previous experiment. This noise is neither present at training time, where it could act as a regularizer, nor at testing time. Given the noise is only assumed at the last layer, the second to last layer is a deterministic mapping of the input variable; hence the replica formula yielding mutual informations between adjacent layers gives us directly

I(T ; T -1 ) = H(T ) -H(T |T -1 ) = H(T ) -H(T |X) = I(T ; X).
We provide a second Python package [START_REF]lsd: Learning with Synthetic Data, Python library[END_REF] to implement in Keras learning experiments on synthetic datasets, using USV-layers and interfacing the first Python package [12] for replica computations.

To start with we consider the training of a linear network in the teacher-student scenario. The teacher has also to be linear to be learnable: we consider a simple single-layer network with additive white Gaussian noise, Y = Wteach X + , with input x ∼ N (0, I N ) of size N, teacher matrix Wteach i.i.d. normally distributed as N (0, 1/N ) , noise ∼ N (0, 0.01I N ), and output of size N Y = 4. We train a student network of three USV-layers, plus one fully connected unconstrained layer X → T 1 → T 2 → T 3 → Ŷ on the regression task, using plain SGD for the MSE loss ( Ŷ -Y ) 2 . We recall that in the USV-layers (7) only the diagonal matrix is updated during learning. On the left panel of Figure 3, we report the learning curve and the mutual informations between the hidden Center-left, center-right, right: maximum and squared error of the replica estimation of the mutual information as a function of layers size N , over the course of 5 independent trainings for each value of N for the first, second and third hidden layer.

layers and the input in the case where all layers but outputs have size N = 1500. Again this linear setting is analytically tractable and does not require the replica formula, a similar situation was studied in [5]. In agreement with their observations, we find that the mutual informations I(X; T ) keep on increasing throughout the learning, without compromising the generalization ability of the student. Now, we also use this linear setting to demonstrate (i) that the replica formula remains correct throughout the learning of the USV-layers and (ii) that the replica method gets closer and closer to the exact result in the limit of large networks, as theoretically predicted (2). To this aim, we repeat the experiment for N varying between 100 and 1500, and report the maximum and the mean value of the squared error on the estimation of the I(X; T ) over all epochs of 5 independent training runs. We find that even if errors tend to increase with the number of layers, they remain objectively very small and decrease drastically as the size of the layers increases.

Learning experiments with deep non-linear networks-Finally, we apply the replica formula to estimate mutual informations during the training of non-linear networks on correlated input data.

We consider a simple single layer generative model X = Wgen Y + with normally distributed code Y ∼ N (0, I N Y ) of size N Y = 100, data of size N X = 500 generated with matrix Wgen i.i.d. normally distributed as N (0, 1/N Y ) and noise ∼ N (0, 0.01I N X ). We then train a recognition model to solve the binary classification problem of recovering the label y = sign(Y 1 ), the sign of the first neuron in Y , using plain SGD but this time to minimize the cross-entropy loss. Note that the rest of the initial code (Y 2 , ..Y N Y ) acts as noise/nuisance with respect to the learning task. We compare two 5-layers recognition models with 4 USV-layers plus one unconstrained, of sizes 500-1000-500-250-100-2, and activations either linear-ReLU-linear-ReLU-softmax (top row of Figure 4) or linear-hardtanh-linear-hardtanh-softmax (bottom row). Because USV-layers only feature O(N ) parameters instead of O(N 2 ) we observe that they require more iterations to train in general. In the case of the ReLU network, adding interleaved linear layers was key to successful training with 2 non-linearities, which explains the somewhat unusual architecture proposed. For the recognition model using hardtanh, this was actually not an issue (see Supplementary Material for an experiment using only hardtanh activations), however, we consider a similar architecture for fair comparison. We discuss further the ability of learning of USV-layers in the Supplementary Material. This experiment is reminiscent of the setting of [3], yet now tractable for networks of larger sizes. For both types of non-linearities we observe that the mutual information between the input and all hidden layers decrease during the learning, except for the very beginning of training where we can sometimes observe a short phase of increase (see zoom in insets). For the hardtanh layers this phase is longer and the initial increase of noticeable amplitude.

In this particular experiment, the claim of [3] that compression can occur during training even with non double-saturated activation seems corroborated (a phenomenon that was not observed by [5]). Yet we do not observe that the compression is more pronounced in deeper layers and its link to generalization remains elusive. For instance, we do not see a delay in the generalization w.r.t. training accuracy/loss in the recognition model with hardtanh despite of an initial phase without compression in two layers. Further learning experiments, including a second run of this last experiment, are presented in the Supplementary Material.

Conclusion and perspectives

We have presented a class of deep learning models together with a tractable method to compute entropy and mutual information between layers. This, we believe, offers a promising framework for further investigations, and to this aim we provide Python packages that facilitate both the computation of mutual informations and the training, for an arbitrary implementation of the model.

We observe in our high-dimensional experiments that compression does happen during learning, even when using ReLU activations. While we did not observe a clear link between generalization and compression in our setting, there are many directions to be further explored within the models presented in Section 2. Studying the entropic effect of regularizers is a natural step to formulate an entropic interpretation to generalization. Furthermore, while our experiments focused on the supervised learning, the replica formula derived for multi-layer models is general and can be applied in unsupervised contexts, for instance in the theory of VAEs. On the rigorous side, the greater perspective remains proving the replica formula in the general case of multi-layer models, and further confirm that the replica formula stays true after the learning of the USV-layers. Another question worth of future investigation is whether the replica method can be used to describe not only entropies and mutual informations for learned USV-layers, but also the optimal learning of the weights itself. The replica method [1,2] was first developed in the context of disordered physical systems where the strength of interactions J are randomly distributed, J ∼ P J (J). Given the distribution of microstates x at a fixed temperature β -1 , P (x|β, J) = 1 Z(β,J) e -βH J (x) , one is typically interested in the average free energy

Supplementary Material

F(β) = -lim N →∞ 1 βN E J log Z(β, J), (8)
from which typical macroscopic behavior is obtained. Computing ( 8) is hard in general, but can be done with the use of specific techniques. The replica method in particular employs the following mathematical identity

E J log Z = lim n→0 E J Z n -1 n . (9)
Evaluating the average on the r.h.s. leads, under the replica-symmetry assumption, to an expression of the form E J Z n = e -βN n extrq φ(β,q) , where φ(β, q) is known as the replica-symmetric free energy, and q are order parameters related to macroscopic quantities of the system. We then write F(β) = extr q φ(β, q), so that computing F depends on solving the saddle-point equations ∇ q φ q * = 0. Computing ( 8) is of interest in many problems outside of physics [3,4]. Early applications of the replica method in machine learning include the evaluation of the optimal capacity and generalization error of the perceptron [5,6,7,8,9]. More recently it has also been used in the study of problems in telecommunications and signal processing, such as channel divison multiple access [10] and compressed sensing [11,12,13,14]. For a review of these developments see [15].

These particular examples all share the following common probabilistic structure

y ∼ P Y |Z (y|W x), x ∼ P X (x), (10)
for fixed W and different choices of P Y |Z and P X ; in other words, they are all specific instances of generalized linear models (GLMs). Using Bayes theorem, one writes the posterior distribution of x as P (x|W, y) = 1 P (W,y) P Y |Z (y|W x) P X (x); the replica method is then employed to evaluate the average log-marginal likelihood E W,y log P (W, y), which gives us typical properties of the model. Note this quantity is nothing but the entropy of y given W , H(y|W ).

The distribution P J (or P W in the notation above) is usually assumed to be i.i.d. on the elements of the matrix J. However, one can also use the same techniques to approach J belonging to arbitrary orthogonally-invariant ensembles. This approach was pioneered by [16,17,18,19], and in the context of generalized linear models by [20,21,22,23,24,25,26].

Generalizing the analysis of (10) to multi-layer models has first been considered by [27] in the context of Gaussian i.i.d. matrices, and by [28,29] for orthogonally-invariant ensembles. In particular, [29] has an expression for the replica free energy which should be in principle equivalent to the one we present, although its focus is in the derivation of this expression rather than applications or explicit computations.

Finally, it is worth mentioning that even though the replica method is usually considered to be non-rigorous, its results have been proven to be exact for different classes of models, including GLMs [30,31,32,33,34,35], and are widely conjectured to be exact in general. In fact, in section 2 we show how to proove the formula in the particular case of two-layer with Gaussian matrices.

Entropy in single/multi-layer generalized linear models

Single-layer

For a single-layer generalized linear model

x ∼ P X (x), y ∼ P Y |Z (y|W x). (11)
with P X and P Y |Z separable in the components of x ∈ R N and y ∈ R M , and

W ∈ R M ×N Gaussian i.i.d., W µi ∼ N (0, 1/N ), define α = M/N and ρ = E x x 2 .
Then the entropy of y in the limit N → ∞ is given by [15,35] lim

N →∞ N -1 H(y|W ) = min extr A,V φ(A, V ), (12)
where

φ(A, V ) = - 1 2 AV + I(x; x + ξ 0 √ A ) + αH(y|ξ 1 ; V, ρ), (13)
with ξ 0 , ξ 1 both normally distributed with zero mean and unit variance, and

P (y|ξ; V, ρ) = Dz P Y |Z (y| √ ρ -V ξ + √ V z
) (here Dz denotes integration over a standard Gaussian measure). This can be adapted to orthogonally-invariant ensembles by using the techniques described in [22]. Let W = U SV T , where U is orthogonal, S diagonal and arbitrary and V is Haar distributed. We denote by π W (λ W ) the distribution of eigenvalues of W T W , and the second moment of z = W x by ρ = Eλ W α ρ. The entropy is then written as

N -1 H(y|W ) = min extr A,V, Ã, Ṽ φ(A, V, Ã, Ṽ ), where φ(A, V, Ã, Ṽ ) = - 1 2 ÃV + αA Ṽ -F W (AV ) + I(x; x + ξ 0 Ã ) + αH(y|ξ 1 ; Ṽ , ρ), (14)
and

F W (x) = min θ 2αθ + (α -1) log(1 -θ) + E λ W log[xλ W + (1 -θ)(1 -αθ)] . (15)
If the matrix is Gaussian i.i.d., π W (λ W ) is Marchenko-Pastur and F W (AV ) = αAV . Extremizing over A gives Ṽ = V , so that (13) is recovered. In this precise case, it has been proven rigorously in [35].

Multi-layer

Consider the following multi-layer generalized linear model

                 t 0,i ≡ x i ∼ P 0 (x i ), t 1,i ∼ P 1 (t 1,i |W 1 x), t 2,i ∼ P 2 (t 2,i |W 2 t 1 ), . . . t L,i ≡ y i ∼ P L (y|W L t L-1 ), (16)
where the W ∈ R n ×n -1 are fixed, and the i index runs from 0 to n . Using Bayes' theorem we can write

P (t 0 |t L , W ) = 1 P (t L , W ) L-1 =1 dt L =1 P (t |W t -1 )P (t 0 ). (17)
with W = {W } =1,...,L . Performing posterior inference requires one to evaluate the marginal likelihood

P (t L , W ) = L-1 =0 dt L =1 P (t |W t -1 ) P (t 0 ), (18)
which is in general hard to do. Our analysis employs the framework introduced in [27] to compute the entropy of t L in the limit n 0 → ∞ with α = n /n 0 finite for = 1, . . . , L

lim n 0 →∞ n -1 0 H(t L |W ) = min extr A,V , Ã, Ṽ φ(A, V , Ã, Ṽ ), (19)
with the replica potential φ given by

φ(A, V , Ã, Ṽ ) = - 1 2 L =1 α -1 Ã V + α A Ṽ -F W (A V ) + I(t 0 ; t 0 + ξ 0 Ã1 ) + (20)
+ L-1 =1 α H(t |ξ ; à +1 , Ṽ , ρ ) - 1 2 log(2πe à +1 ) + αL H(t L |ξ L ; ṼL , ρL ).
and the ξ normally distributed with zero mean and unit variance. The t in the expression above are distributed as

P (t |ξ ; A, V, ρ) = D ξDz P (t + 1/A ξ| ρ -V ξ + √ V z), (21)
P (t L |ξ L ; V, ρ) = Dz P L (t L | ρ -V ξ L + √ V z). (22)
where Dz (•) = dz N (z; 0, 1) (•) denotes the integration over the standard Gaussian measure.

A simple heuristic derivation of the multi-layer formula

Formula (20) can be derived using a simple argument. Consider the case L = 2, where the model reads

     t 0 ∼ P 0 (t 0 ), t 1 ∼ P 1 (t 1 |W 1 t 0 ), t 2 ∼ P 2 (t 2 |W 2 t 1 ), (23)
with t ∈ R n and W ∈ R n ×n -1 . For the problem of estimating t 1 given the knowledge of t 2 , we compute lim n 1 →∞ n -1 1 H(t 2 |W 1 ) using the replica free energy ( 14)

φ(A 2 , V 2 , Ã2 , Ṽ2 ) = - 1 2 Ã2 V 2 + α 2 A 2 Ṽ2 -F W 2 (A 2 V 2 ) + (24)
+ I(t 1 ; t 1 + ξ1 Ã2 ) + α 2 H(t 2 |ξ 2 ; Ṽ2 , ρ2 ). (25)
Note that

I(t 1 ; t 1 + ξ1 Ã2 ) = H t 1 + ξ1 Ã2 -H ξ1 Ã2 = H t 1 + ξ1 Ã2 - 1 2 log(2πe Ã2 ). (26)
Moreover, H(t 1 + ξ1 / Ã2 ) can be obtained from the replica free energy of another problem: that of estimating t 0 given the knowledge of (noisy) t 1 , which can again be written using ( 14)

lim n 0 →∞ n -1 0 H(t 1 + ξ1 Ã2 ) = min extr A 1 ,V 1 , Ã1 , Ṽ1 φ 1 (A 1 , V 1 , Ã1 , Ṽ1 ), (27)
with

φ 1 (A 1 , V 1 , Ã1 , Ṽ1 ) = - 1 2 Ã1 V 1 + α 1 A 1 Ṽ1 -F W 1 (A 1 V 1 ) + (28)
+ I(t 0 ; t 0 + ξ 0 Ã1 ) + α 1 H(t 1 |ξ 1 ; Ã1 , Ṽ1 , ρ1 ), (29)
and the noise ξ1 being integrated in the computation of H(t 1 |ξ 1 ), see (22). Replacing ( 26)-( 29) in (25) gives our formula (20) for L = 2; further repeating this procedure allows one to write the equations for arbitrary L.

Formulation in terms of tractable integrals

While expression ( 20) is more easily written in terms of conditional entropies and mutual informations, evaluating it requires us to explicitely state it in terms of integrals, which we do below. We first consider the Gaussian i.i.d. In this case, the multi-layer formula was derived with the cavity and replica method by [27], and we shall use their results here. Assuming that W ∈ R n ×n -1 such that W ,µi ∼ N (0, 1/n -1 ) and using the replica formalism, Claim 1 from the main text becomes, in this case lim

n 0 →∞ n -1 0 H(t L |W ) = min extr A,V φ(A, V ), (30)
with the replica potential φ evaluated from

φ(A, V ) = 1 2 L =1 α -1 A (ρ -V ) -K(A, V , ρ), (31)
and

K(A, V , ρ) = K 0 (A 1 ) + L-1 =1 α K (A +1 , V , ρ ) + αL K L (V L , ρ L ). (32)
The constants α , α and ρ are defined as following

1 : α = n /n -1 , α = n /n 0 , ρ = dt P -1 (t) t 2 . Moreover K (A, V, ρ) = E b,t,z,w|A,V,ρ log Z (A, b, V, w), (33)
for 1 ≤ ≤ L -1, and

K 0 (A) = E b,x|A log Z 0 (A, b), K L (V, ρ) = E y,z,w|V,ρ log Z L (y, V, w). ( 34
)
where

Z 0 (A, B) = dx P 0 (x)e -1 2 Ax 2 +Bx , Z (A, B, V, ω) = dtdz P (t|z)N (z; ω, V )e -1 2 At 2 +Bt , Z L (y, V, ω) = dz P L (y|z)N (z; ω, V ). ( 35
)
and the measures over which expectations are computed are

p 0 (b, x; A) = P 0 (x)N (b; Ax, A), p (b, t, z, w; A, V, ρ) = P (t|z)N (b; At, A)N (z; w, V )N (w, 0, m), ( 36
) p L (y, z, w; V, ρ) = P L (y|z)N (z; w, V )N (w; 0, ρ-V ).
We typically pick the likelihoods P so that Z can be computed in closed-form, which allows for a number of activation functions -linear, probit, ReLU etc. However, our analysis is quite general and can be done for arbitrary likelihoods, as long as evaluating ( 33) and ( 34) is computationally feasible.

Finally, the replica potential above can be generalized to the orthogonally-invariant case using the framework of [22], which we have described in the previous subsection

φ(A, V , Ã, Ṽ ) = - 1 2 L =1 α -1 Ã V + α A Ṽ -F W (A V ) + I(t 0 ; t 0 + ξ 0 √ A 1 ) + (37)
+ L-1 =1 α H(t |ξ ; A +1 , V , ρ ) - 1 2 log(2πeA ) + αL H(t L |ξ L ).
If the matrix W is Gaussian i.i.d., the distribution of eigenvalues of W T W is Marchenko-Pastur and one gets F W (A V ) = α A V , Ã = α A , Ṽ = V , so that (31) is recovered. Moreover, for L = 1, one obtains the replica free energy proposed by [22,23,24].

Recovering the formulation in terms of conditional entropies

One can rewrite the formulas above in a simpler way. By manipulating the measures (36) one obtains

K 0 (A, ρ) = -I(x; b) + 1 2 Aρ, (38)
for x ∼ P 0 (x) and b ∼ N (b; Ax, A). Introducing a standard normal variable ξ 0 and using the invariance of mutual informations, this can be written as

K 0 (A, ρ) = -I(x; x + 1/Aξ 0 ) + 1 2 Aρ. ( 39
) Similarly K L (V, ρ) = -H(y|w; V ), (40)
for P (y|w; V ) = dzP L (y|z)N (z; w, V ) and P (w;

V, ρ) = N (w; 0, ρ -V ). Introducing standard normal ξ L K L (V, ρ) = -H(y|ξ L ; V, ρ). (41)
where

P (y|ξ L ; V, ρ) = Dz P L (y| ρ -V ξ L + √ V z), (42)
and Dz (•) = dz N (z; 0, 1) (•) denotes integration over the standard Gaussian measure. Finally, for the K

K (A, V, ρ) = -H(b|w; A, V, ρ) + 1 2 Aρ + 1 2 log(2πeA), (43)
for P (b|w; A, V ) = dtdz N (b; At, A)P (t|z)N (z; w, V ) and P (w;

V, ρ) = N (w; 0, ρ-V ). Introducing standard normal ξ K (A, V, ρ) = -H(t |ξ ; A, V ) + 1 2 Aρ + 1 2 log(2πeA). ( 44
)
where

P (t |ξ ; A, V, ρ) = D ξDz P (t + 1/A ξ| ρ -V ξ + √ V z). (45)
We can then rewrite (32) as

K(A, V , ρ) = 1 2 L =1 α -1 A ρ -I(t 0 ; t 0 + ξ 0 √ A 1 )- - L-1 =1 α H(t |ξ ; A +1 , V , ρ ) - 1 2 log(2πeA +1 ) -αL H(t L |ξ L ; V L , ρ L ). (46)
Replacing in (31) yields

φ(A, V ) = - 1 2 L =1 α -1 A V + I(t 0 ; t 0 + ξ 0 √ A 1 )+ + L-1 =1 α H(t |ξ ; A +1 , V , ρ ) - 1 2 log(2πeA +1 ) + αL H(t L |ξ L ; V L , ρ L ). (47)

Solving saddle-point equations

In order to deal with the extremization problem in

lim n 0 →∞ n -1 0 H(t L |W ) = min extr A,V , Ã, Ṽ φ(A, V , Ã, Ṽ ), (48)
one needs to solve the saddle-point equations

∇ {A,V , Ã, Ṽ } φ = 0.
In what follows we propose two different methods to do that: a fixed-point iteration, and the state evolution of the ML-VAMP algorithm [28].

Method 1: fixed-point iteration

We first introduce the following function, which is related to the derivatives of

F W ψ (θ, γ) = 1 -γ S -γ -1 (1 -θ)(1 -α θ) -1 , (49)
where S (z) = E λ 1 λ -z is the Stieltjes transform of W T W , see e.g. [36]. In our experiments we have evaluated S approximately by using the empirical distribution of eigenvalues.

The fixed point iteration consist in looping through layers L to 1, first computing the ϑ which minimizes (15), and Ṽ

ϑ (t) = arg min θ θ -ψ (θ, A (t) V (t) ) 2 , Ṽ (t) = ϑ (t) /A (t) , (50)
then A (t+1) , which for layers 1 ≤ ≤ L -1 comes from

A (t+1) = -E b,t,z,w|ρ , Ã +1 , Ṽ ∂ 2 w log Z ( Ã(t) +1 , b, Ṽ (t) , w), (51)
and for the L-th layer, from

A (t+1) L = -E y,z,w|ρ L , ṼL ∂ 2 w log Z L (y, ṼL , w). (52)
Finally, we recompute ϑ using A (t+1) , and Ã

ϑ (t+ 1 2 ) = arg min θ θ -ψ (θ, A (t+1) V (t) ) 2 , Ã(t) = α ϑ (t+ 1
2 ) /V (t) .

(

) 53
and move on to the next layer. After these quantities are computed for all layers, we compute all the V ; for 2 ≤ ≤ L

V (t+1) = E b,t,z,w|ρ -1 , Ã , Ṽ -1 ∂ 2 b log Z ( Ã(t) , b, Ṽ (t) -1 , w), (54)
and for the 1st layer

V (t+1) 1 = E b,x| Ã1 ∂ b log Z 1 ( Ã(t) 1 , b). (55)
This particular order has been chosen so that if W is Gaussian i.i.d., θ

(t) = A (t) V (t)
and one recovers the state evolution equations in [27]. The set of initial conditions is picked so as to cover the basin of attraction of typical fixed points. In our experiments we have chosen (A

(0) i, , V (0) i, ) ∈ {(ρ -1 , ρ ), (δ -1 , δ)}, with δ = 10 -10 .

Method 2: ML-VAMP state evolution

While the fixed-point iteration above works well in most cases, it is not provably convergent. In particular, it relies on a solution for θ = ψ (θ, A (t) V (t) ) being found, which might not happen throughout the iteration.

Algorithm 1 Compute entropy H(y L |W ) Require: {A (1) i , V (1)
i } n init i=1 , , t max for i = 1 → n init do (loop through initial conditions) t ← 0 while D < or t < t max do (at each time step . . . )

for = L → 1 do (. . . loop through layers) compute ϑ (t) , Ṽ (t) using (50) compute A (t+1) using (51) or (52) compute ϑ (t+ 1
2 ) , Ã(t) using (53) end for compute V (t+1) ∀ using (54) or (55)

D ← |V (t+1) -V (t) | t ← t + 1 end while H i ← φ(A (t) , V (t) , Ã(t) , Ṽ (t) ) end for return min i H i
An alternative is to employ the state evolution (SE) of the ML-VAMP algorithm [28], which leads to the same fixed points as the scheme above under certain conditions. Let us first look at the single-layer case; the ML-VAMP SE equations read

A + x = 1 V + x (A - x ) -A - x , A + z = 1 V + z (A + x , 1/A - z ) -A - z , (56)
A - x = 1 V - x (A + x , 1/A - z ) -A + x , A - z = 1 V - z (A + z ) -A + z , (57)
where

V + x (A) = E x,z ∂ 2 B log Z 0 (A, Ax + √ Az), (58)
V + z (A, σ 2 ) = σ 2 lim M →∞ 1 M Tr Φ(Φ T Φ + Aσ 2 ) -1 Φ T = α -1 σ 2 1 -Aσ 2 S(-Aσ 2 ) , (59)
V - x (A, σ 2 ) = σ 2 lim N →∞ 1 N Tr (Φ T Φ + Aσ 2 ) -1 = σ 2 S(-Aσ 2 ), (60)
V - z (A) = 1 A + 1 A 2 E y,w,z ∂ 2 w log Z 1 (y, w, 1/A) -ḡ(A) . (61)
Combining (57) and (61) yields

1/A - z = 1 ḡ(A + z ) - 1 A + z . ( 62
)
At the fixed points

V x ≡ V + x = V - x = 1 A + x + A - x , V z ≡ V + z = V - z = 1 A + z + A - z . ( 63
)
as well as

V z = 1 -A + x V x αA - z = A - x V x αA - z ⇒ α A - z A - z + A + z = A - x A - x + A + x (64)
One can show these conditions also hold for the above scheme, under the following mapping of variables:

V = V x , Ã = A - x , Ṽ = 1/A + z , A = A - z A + z V z = ḡ(A + z ), θ = A - z V z = 1 1 + A + z A - z . ( 65
)
These equations are easily generalizable to the multi-layer case; the equations for A + z and A - x remain the same, while the equations for A + x and A - z become

A + x = 1 V + x (A - x , 1/A + z -1 ) -A - x , (66)
A - z -1 = 1 V - z -1 (A - x , 1/A + z -1 ) -A + z -1 , (67)
where

V + x (A, V ) = E b,t,z,w ∂ 2 B log Z (A, b, V, w), (68)
V - z -1 (A, V ) = 1 A + 1 A 2 E b,t,z,w ∂ 2 w log Z (A, b, V, w). (69)
Note that the quantities in (58), ( 61), ( 68) and (69) were already being evaluated in the scheme described in the previous subsection.

Further considerations

Mutual information from entropy

While in our computations we focus on the entropy H(T ), the mutual information I(T ; T -1 ) can be easily obtained from the chain rule relation

I(T ; T -1 ) = H(T ) + E T ,T -1 log P T |T -1 (t |t -1 ) = H(T ) + dz N (z; 0, ρ ) dh P (h|z) log P (h|z), (70)
where in order to go from the first to the second line we have used the central limit theorem. In particular if the mapping X → T -1 is deterministic, as typically enforced in the models we use in the experiments, then I(T ; T -1 ) = I(T ; X).

Equivalence in linear case

In the linear case,

Y = W L W L-1 • • • W 1 X + N (0, ∆)
, our formula reduces to [22,25,37]

lim N→∞ N -1 I(Y ; X) = min extr A,V - 1 2 AV - 1 2 G(-V /∆) + I(x; x + 1/Aξ) , (71)
where

G(x) = extr Λ {-E λ log |λ -Λ| + Λx} -(log |x| + 1), (72)
is also known as the integrated R-transform, with λ the eigenvalues of

W T W , W ≡ W L W L-1 • • • W 1 . If P 0 is Gaussian, then I(x; x + 1/Aξ) = 1 2 log(1 + A); extremizing over A and V then gives A = 1/V -1, V = ∆S(-∆), (73)
where S(z) is the Stieltjes transform of W T W . The mutual information can then be rewritten as

lim N →∞ N -1 I(Y ; X) = 1 2 E λ log(λ + ∆) - 1 2 log ∆. ( 74
)
This same result can be achieved analytically with much less effort, since in this case P Y (y) = N (y; 0, ∆I M + W W T ).

2 Proof of the replica formula by the adaptive interpolation method ∼ P 0 be the components of a signal vector X 0 . One fixes two functions

ϕ 1 : R × R k 1 → R and ϕ 2 : R × R k 2 → R, k 1 , k 2 ∈ N. They act component-wise, i.e. if x ∈ R m and A ∈ R m×k i then ϕ i (x, A) ∈ R m is a vector with entries [ϕ i (x, A)] µ := ϕ i (x µ , A µ ), A µ being the µ-th row of A. For i ∈ {1, 2}, consider (A i,µ ) n i µ=1 i.i.d. ∼ P A i where P A i is a probability distribution over R k i . One acquires n 2 measurements through Y µ = ϕ 2 1 √ n 1 W 2 ϕ 1 W 1 X 0 √ n 0 , A 1 µ , A 2,µ + √ ∆Z µ , 1 ≤ µ ≤ n 2 . (75)
Here

(Z µ ) n 2 µ=1 i.i.d.
∼ N (0, 1) is an additive Gaussian noise, ∆ > 0, and W 1 ∈ R n 1 ×n 0 , W 2 ∈ R n 2 ×n 1 are measurement matrices whose entries are i.i.d. with respect to (w.r.t.) N (0, 1). Equivalently,

Y µ ∼ P out,2 • 1 √ n 1 W 2 ϕ 1 W 1 X 0 √ n 0 , A 1 µ (76)
where the transition density, w.r.t. Lebesgue's measure, is

P out,2 y x = dP A 2 (a) 1 √ 2π∆ e -1 2∆ (y-ϕ 2 (x,a)) 2 . ( 77
)
Our analysis uses both representations (75) and (76). The estimation problem is to recover

X 0 from the knowledge of Y = (Y µ ) n 2 µ=1 , ϕ 1 , ϕ 2 , W 1 , W 2 , ∆, P 0 .
In the language of statistical mechanics, the random variables Y, W 1 , W 2 , X 0 , A 1 , A 2 , Z are called quenched variables because once the measurements are acquired they have a "fixed realization". An expectation taken w.r.t. all quenched random variables appearing in an expression will simply be denoted by E without subscript. Subscripts are only used when the expectation carries over a subset of random variables appearing in an expression or when some confusion could arise.

After definition of the Hamiltonian

H(x, a 1 ; Y, W 1 , W 2 ) := - n 2 µ=1 ln P out,2 Y µ 1 √ n 1 W 2 ϕ 1 W 1 x √ n 0 , a 1 µ , (78)
the joint posterior distribution of (x, a 1 ) given the quenched variables Y, W 1 , W 2 reads (Bayes formula)

dP (x, a 1 |Y, W 1 , W 2 ) = 1 Z(Y, W 1 , W 2 ) dP 0 (x)dP A 1 (a 1 )e -H(x,a 1 ;Y,W 1 ,W 2 ) ; (79)
dP 0 (x) = n 0 i=1 dP 0 (x i ) being the prior over the signal and dP A 1 (a 1 ) := n 1 i=1 dP A 1 (a 1,i ). The partition function is defined as

Z(Y, W 1 , W 2 ) := dP 0 (x)dP A 1 (a 1 )dP A 2 (a 2 ) n 2 µ=1 1 √ 2π∆ e -1 2∆ Yµ-ϕ 2 1 √ n 1 W 2 ϕ 1 W 1 x √ n 0 ,a 1 µ ,a 2,µ 2 . ( 80
)
One introduces a standard statistical mechanics notation for the expectation w.r.t. the posterior (79), the so called Gibbs bracketdefined for any continuous bounded function g as

g(x, a 1 ) := dP (x, a 1 |Y, W 1 , W 2 )g(x, a 1 ) (81)
One important quantity is the associated averaged free entropy (or minus the averaged free energy)

f n := 1 n 0 E ln Z(Y, W 1 , W 2 ) . (82)
It is perhaps useful to stress that Z(Y, W 1 , W 2 ) is nothing else than the density of Y conditioned on W 1 , W 2 ; so we have the explicit representation (used later on)

f n = 1 n 0 E W 1 ,W 2 dYZ(Y, W 1 , W 2 ) ln Z(Y, W 1 , W 2 ) = 1 n 0 E W 1 ,W 2 dYdP 0 (X 0 )dP A 1 (A 1 )e -H(X 0 ,A 1 ;Y,W 1 ,W 2 ) • ln dP 0 (x)dP A 1 (a 1 )e -H(x,a 1 ;Y,W 1 ,W 2 ) , (83)
where dY =

n 2 µ=1 dY µ .
This appendix presents the derivation, thanks to the adaptive interpolation method, of the thermodynamic limit lim n→∞ f n in the "high-dimensional regime", namely when n 0 , n 1 , n 2 → +∞ such that n 2/n 1 → α 2 > 0, n 1/n 0 → α 1 > 0. In this high-dimensional regime, the "measurement rate" satisfies n 2/n 0 → α := α 1 • α 2 .

Important scalar inference channels

The thermodynamic limit of the free entropy will be expressed in terms of the free entropy of simple scalar inference channels. This "decoupling property" results from the mean-field approach in statistical physics, used through in the replica method to perform a formal calculation of the free entropy of the model [2,4]. This section presents these three scalar denoising models.

The first channel is an additive Gaussian one. Let r ≥ 0 play the role of a signal-to-noise ratio. Consider the inference problem consisting of retrieving X 0 ∼ P 0 from the observation Y 0 = √ r X 0 + Z 0 , where Z 0 ∼ N (0, 1) independently of X 0 . The associated posterior distribution is

dP (x|Y 0 ) = dP 0 (x)e √ r Y 0 x-rx 2 /2 dP 0 (x)e √ r Y 0 x-rx 2 /2 . ( 84
)
The free entropy associated to this channel is just the expectation of the logarithm of the normalization factor

ψ P 0 (r) := E ln dP 0 (x)e √ r Y 0 x-rx 2 /2 . ( 85
)
The second scalar channel appearing naturally in the problem is linked to P out,2 through the following inference model. Suppose that V, U i.i.d.

∼ N (0, 1) where V is known, while the inference problem is to recover the unknown U from the observation

Y 0 ∼ P out,2 • | √ q V + √ ρ -q U , (86)
where ρ > 0, q ∈ [0, ρ]. The free entropy for this model, again related to the normalization factor of the posterior dP (u| Y 0 , V ), is

Ψ P out,2 (q; ρ) := E ln DuP out,2 Y 0 | √ q V + √ ρ -q u , (87)
where Du = du(2π) -1 /2 e -w 2 /2 is the standard Gaussian measure.

The third scalar channel to play a role is linked to the hidden layer

X 1 := ϕ 1 W 1 X 0 / √ n 0 , A 1
of the two-layer GLM. Suppose that V, U i.i.d. ∼ N (0, 1), where V is known. Consider the problem of recovering U from the observation

Y 0 = √ rϕ 1 ( √ q V + √ ρ -q U, A 1 ) + Z where r ≥ 0, ρ > 0, q ∈ [0, ρ], Z ∼ N (0, 1) and A 1 ∼ P A 1 . Equivalently, Y 0 ∼ P (r) out,1 (•| √ q V + √ ρ -q U ) with P (r) out,1 (y|x) := dP A 1 (a) 1 √ 2π e -1 2 (y- √ rϕ 1 (x,a)) 2 . ( 88
)
From this last description, it is easy to see that the free entropy for this model is given by a formula similar to (87). Introducing δ( •ϕ 1 (x, a)), the Dirac measure centred on ϕ 1 (x, a), it reads

Ψ P (r) out,1 (q; ρ) = E ln DuP (r) out,1 Y 0 | √ q V + √ ρ -q u = E ln DudP A 1 (a)dh 1 √ 2π e -1 2 (Y 0 - √ rh) 2 δ h -ϕ 1 ( √ q V + √ ρ -q u, a) = - ln(2π) + E[(Y 0 ) 2 ] 2 + E ln DudP A 1 (a)dhe √ rhY 0 -rh 2 2 δ h -ϕ 1 ( √ q V + √ ρ -q u, a) . The second moment of Y 0 is simply E[(Y 0 ) 2 ] = rE[ϕ 2 1 (T, A 1 )] + 1 with T ∼ N (0, ρ), A 1 ∼ P A 1 . Hence Ψ P (r) out,1 (q; ρ) = - 1 + ln(2π) + rE[ϕ 2 1 (T, A 1 )] 2 + Ψ ϕ 1 (q, r; ρ) (89)
where

Ψ ϕ 1 (q, r; ρ) := E ln DudP A 1 (a)dhe √ rhY 0 -rh 2

Replica-symmetric formula and mutual information

Our goal is to prove Theorem 1 that gives a single-letter replica-symmetric formula for the asymptotic free entropy of model ( 75), (76). The result holds under the following hypotheses:

(H1) The prior distribution P 0 has a bounded support. (H2) ϕ 1 , ϕ 2 are bounded C 2 functions with bounded first and second derivatives w.r.t. their first argument. (H3) W 1 , W 2 have entries i.i.d. with respect to N (0, 1).

Let ρ 0 := E[(X 0 ) 2 ] where X 0 ∼ P 0 and ρ 1 := E[ϕ 2 1 (T, A 1 )] where T ∼ N (0, ρ 0 ), A 1 ∼ P A 1 . The replica-symmetric potential (or just potential) is f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ) := ψ P 0 (r 0 ) + α 1 Ψ ϕ 1 (q 0 , r 1 ; ρ 0 ) + αΨ P out,2 (q 1 ; ρ 1 ) -

r 0 q 0 2 -α 1 r 1 q 1 2 . ( 91
)
Theorem 1 (Replica-symmetric formula). Suppose that hypotheses (H1), (H2), (H3) hold. Then, the thermodynamic limit of the free entropy (82) for the two-layer generalized linear estimation model (75), (76) satisfies

f ∞ := lim n→∞ f n = sup q 1 ∈[0,ρ 1 ] inf r 1 ≥0 sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ) .

The limiting expression of the mutual information between the observations and the signal to recover follows immediately of Theorem 1.

Corollary 1 (Single-letter formula for the mutual information). The thermodynamic limit of the mutual information for model (75), (76) between the observations and the signal to recover verifies

i n := 1 n 0 I(X 0 , A 1 , A 2 ; Y |W 1 , W 2 ) ---→ n→∞ i ∞ := -f ∞ - α 2 (1 + ln(2π∆)) . (93)
Proof. A simple calculation gives

1 n 0 I(X 0 , A 1 , A 2 ; Y|W 1 , W 2 ) = - 1 n 0 E ln P (Y|W 1 , W 2 ) + 1 n 0 E ln P (Y|X 0 , A 1 , A 2 , W 1 , W 2 ) = -f n - 1 2n 0 ∆ E n 2 µ=1 Y µ -ϕ 2 W 2 X 1 √ n 1 µ , A 2,µ 2 - n 2 2n 0 ln(2π∆) = -f n - n 2 2n 0 - n 2 2n 0 ln(2π∆) .

Interpolating estimation problem

The proof of Theorem 1 follows the same steps than the proof of the replica formula for a one-layer GLM in [35].

One introduces an interpolating estimation problem that interpolates between the original problem (76) at t = 0, t ∈ [0, 1] being the interpolation parameter, and two analytically tractable problems at t = 1.

Define ρ 1 (n 0 ) := E 1 n 1 n 1 i=1 (X 1 i ) 2 = E ϕ 2 1 [ W 1 X 0 / √ n 0 ] 1 , A 1,1 . In Appendix A.2

one shows

Proposition 1 (Convergence of ρ 1 (n 0 ) to ρ 1 ). Under the hypotheses (H1), (H2), (H3)

lim n 0 →+∞ ρ 1 (n 0 ) = ρ 1 . (94)
Let q : [0, 1] → [0, ρ 1 (n 0 )] be a continuous interpolation function and r ≥ 0. Define

S t,µ := 1 -t n 1 W 2 ϕ 1 W 1 X 0 √ n 0 , A 1 µ + t 0 q(v)dv V µ + t 0 (ρ 1 (n 0 ) -q(v))dv U µ ( 95
)
where

V µ , U µ i.i.d.
∼ N (0, 1). Assume V = (V µ ) n 2 µ=1 is known and two kinds of observations are given:

   Y t,µ ∼ P out,2 ( • | S t,µ ) , 1 ≤ µ ≤ n 2 , Y t,i = √ r t ϕ 1 W 1 X 0 √ n 0 i , A 1,i + Z i , 1 ≤ i ≤ n 1 , (96)
where

(Z i ) n 1 i=1 i.i.d. ∼ N (0, 1). Y t = (Y t,µ ) n 2 µ=1 , Y t = (Y t,i
) n 1 i=1 are our "time-dependent" observations. Define, with a slight abuse of notations, s t,µ (x, a 1 , u µ ) ≡ s t,µ as

s t,µ = 1 -t n 1 W 2 ϕ 1 W 1 x √ n 0 , a 1 µ + t 0 q(v)dv V µ + t 0 (ρ 1 (n 0 ) -q(v))dv u µ . (97)
One introduces the interpolating Hamiltonian

H t (x, a 1 , u; Y t , Y t , W 1 , W 2 , V) := - n 2 µ=1 ln P out,2 (Y t,µ |s t,µ ) + 1 2 n 1 i=1 Y t,i - √ r t ϕ 1 W 1 x √ n 0 i , a 1,i 2 . ( 98
)
It depends on W 2 and V through the terms (s t,µ ) n 2 µ=1 , and on W 1 through both (s t,µ ) n 2 µ=1 and the sum over i ∈ {1, . . . , n 1 }. The corresponding Gibbs brackett , which is the expectation operator w.r.t. the t-dependent joint posterior distribution of (x, a 1 , u) given

(Y t , Y t , W 1 , W 2 , V) is defined for every continuous bounded function g on R n 0 × R n 2 as: g(x, a 1 , u) t := 1 Z t dP 0 (x)dP A 1 (a 1 )Du g(x, a 1 , u) e -Ht(x,a 1 ,u;Yt,Y t ,W 1 ,W 2 ,V) . (99)
In (99

), Du = (2π) -n 2/2 n 2 µ=1 du µ e -u 2 µ/2 is the n 2 -dimensional standard Gaussian distribution and Z t ≡ Z t (Y t , Y t , W 1 , W 2 , V) is the appropriate normalization, i.e. Z t (Y t , Y t , W 1 , W 2 , V) := dP 0 (x)dP A 1 (a 1 )Du e -Ht(x,a 1 ,u;Yt,Y t ,W 1 ,W 2 ,V) . ( 100
)
Finally, the interpolating free entropy is

f n (t) := 1 n 0 E ln Z t (Y t , Y t , W 1 , W 2 , V) . (101)

Interpolating free entropy at t=0 and t=1

One verifies easily that

f n (0) = f n -1 2 n 1 n 0 , f n (1) = fn 0 ,n 1 + n 2 n 0 Ψ P out,2 1 0 q(t)dt; ρ 1 (n 0 ) + n 1 n 0 ln 2π 2 .
(102)

In the expression of f n (1), fn 0 ,n 1 denotes the free entropy of the one-layer GLM

Y i = √ r ϕ 1 W 1 X 0 √ n 0 i , A 1,i + Z i , 1 ≤ i ≤ n 1 , (103)
with

(X 0 i ) n 0 i=1 i.i.d. ∼ P 0 , (A 1,i ) n 1 i=1 i.i.d. ∼ P A 1 and (Z i ) n 1 i=1 i.i.d.
∼ N (0, 1). Applying Theorem 1 of [35], then (89), the free entropy fn 0 ,n 1 in the thermodynamic limit n 0 , n 1 → +∞ such that n 1/n 0 → α 1 is

lim n 0 ,n 1 →+∞ fn 0 ,n 1 = sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 ψ P 0 (r 0 ) + α 1 Ψ P (r) out,1 (q 0 ; ρ 0 ) - r 0 q 0 2 = -α 1 1 + ln 2π + rρ 1 2 + sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 ψ P 0 (r 0 ) + α 1 Ψ ϕ 1 (q 0 , r; ρ 0 ) - r 0 q 0 2 . (104)
From (102), by making use of (104) and Lemma 1 below, one obtains in the thermodynamic limit:

f n (1) = -α 1 1 + rρ 1 2 + αΨ P out,2 1 0 q(t)dt; ρ 1 (n 0 ) + sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 ψ P 0 (r 0 ) + α 1 Ψ ϕ 1 (q 0 , r; ρ 0 ) - r 0 q 0 2 + O n (1) . (105)
Here O n (1) is a quantity that vanishes uniformly in the limit n 0 , n 1 , n 2 → +∞. Lemma 1 justifies the identity n 2 n 0 Ψ P out,2 1 0 q(t)dt; ρ 1 (n 0 ) = αΨ P out,2 1 0 q(t)dt; ρ 1 (n 0 ) + O n (1).

Lemma 1 (Uniform upperbound on Ψ P out,2 ). Assuming ϕ 2 is bounded, one has for all ρ ≥ 0 and q ∈ [0, ρ]

|Ψ P out,2 (q; ρ)| ≤ 1 + ln(2π∆) 2 + 2 sup |ϕ 2 | 2 ∆ .
Proof. The upperbound P out,2 y x ≤ √ 2π∆ -1 directly implies

Ψ P out,2 (q; ρ) ≤ - 1 2 ln(2π∆) .
By Jensen's inequality, one also has the lowerbound

Ψ P out,2 (q; ρ) ≥ E DudP A 2 (a) ln 1 √ 2π∆ e -1 2∆ ( Y 0 -ϕ 2 ( √ q V + √ ρ-q u,a)) 2 ≥ - 1 2∆ E DudP A 2 (a) ϕ 2 ( √ q V + √ ρ -q U, a) -ϕ 2 ( √ q V + √ ρ -q u, a) 2 - 1 + ln 2π∆ 2 .
Put together, these lower and upper bounds give the lemma.

To conclude on that section, the interpolating model is such that:

• at t=0, it recovers the two-layer GLM;

• at t=1, it reveals one scalar inference channel associated to the term Ψ P out,2 and a one-layer GLM whose formula for the free entropy fn 0 ,n 1 in the thermodynamic limit is already known from [35].

Free entropy variation along the interpolation path

From the Fundamental Theorem of Analysis

f n (1) -f n (0) = 1 0 dfn(t)
dt dt and ( 102), (105), it follows

f n = -α 1 rρ 1 2 + αΨ P out,2 1 0 q(t)dt; ρ 1 (n 0 ) - 1 0 df n (t) dt dt + sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 ψ P 0 (r 0 ) + α 1 Ψ ϕ 1 (q 0 , r; ρ 0 ) - r 0 q 0 2 + O n (1) . ( 106
)
Most of the terms that form the potential (91) can already be identified in the expression (106). For the missing terms to appear, the t-derivative of the free entropy has to be computed first. Define u y (x) := ln P out,2 (y|x). Let u y (x) be the derivative (w.r.t. x). In Appendix B one shows Proposition 2 (Free entropy variation). The derivative of the free entropy (101) verifies, for all t ∈ (0, 1),

df n (t) dt = - 1 2 n 1 n 0 E 1 n 1 n 2 µ=1 u Yt,µ (S t,µ )u Yt,µ (s t,µ ) -r Q -q(t) t + n 1 n 0 rq(t) 2 - rρ 1 (n 0 ) 2 + O n (1) , ( 107
)
where O n (1) is a quantity that goes to 0 in the limit n 0 , n 1 , n 2 → +∞, uniformly in t ∈ [0, 1], and the overlap is

Q := 1 n 1 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i , A 1,i ϕ 1 W 1 x √ n 0 i , a 1,i . (108)

Overlap concentration

We already know from [35] that the overlap Q = 1 n 0 n 0 j=1 x j • X 0 j concentrates. This concentration plays a key role in the proof of the thermodynamic limit of the free entropy fn 0 ,n 1 , still in [35]. The next lemma states that the overlap Q concentrates around its mean.

As in the one-layer case, a "small" perturbation to the interpolating estimation problem is introduced by adding to the Hamiltonian (98) a term

n 1 i=1 2 ϕ 2 1 W 1 x √ n 0 i , a 1,i -ϕ 1 W 1 x √ n 0 i , a 1,i ϕ 1 W 1 X 0 √ n 0 i , A 1,i - √ ϕ 1 W 1 x √ n 0 i , a 1,i Z i (109)
where

( Z i ) n 1 i=1 i.i.d.
∼ N (0, 1). It corresponds to having extra observations coming from a side-channel

Y i = √ ϕ 1 W 1 X 0 √ n 0 i , A 1,i + Z i for i = 1, . . . , n 1 . (110)
It thus preserves the Nishimori identity (see Proposition 8). The new Hamiltonian defines a new Gibbs brackett, and free entropy f n, (t). All the set up of Sec. 2.4 and Proposition 2 trivially extend. This perturbation induces only a small change in the free entropy, namely of the order of :

Lemma 2 (Small free entropy variation under perturbation). Let sup ϕ 2 1 be the supremum of ϕ 2 1 (well-defined under the hypothesis (H2)). For all > 0 and all t ∈ [0, 1],

|f n, (t) -f n (t)| ≤ n 1 n 0 →α 1 sup ϕ 2 1 2 • . (111)
Proof. A simple computation gives ∂fn, (t)

∂ = -n 1 n 0 E L t,
where

L := 1 n 1 n 1 i=1 1 2 ϕ 2 1 W 1 x √ n 0 i , a 1,i -ϕ 1 W 1 x √ n 0 i , a 1,i ϕ 1 W 1 X 0 √ n 0 i , A 1,i - 1 2 √ ϕ 1 W 1 x √ n 0 i , A 1,i Z i .
In Appendix C.2 one proves Lemma 10, i.e.

E L t, = -1 2 E Q t, . The trivial bound | Q| ≤ sup ϕ 2 1
ends the proof.

Besides, this small perturbation forces the overlap to concentrate around its mean:

Lemma 3 (Overlap concentration). For any 0 < a < 1,

lim n 0 →∞ 1 a d 1 0 dt E Q -E Q t, 2 t, = 0 . ( 112
)
The proof of Lemma 3 is mostly the same as the one streamlined in Section V of [38]. One only needs to make slight changes to fit the proof to our problem. For this reason, Appendix C.2 sketches the main steps of the adapted proof and refers to [38] for details. Lemma 3 implies that there exists a sequence ( (n 0 )) n 0 ≥1 ∈ (0, 1) N * that converges to 0 such that

lim n 0 →+∞ 1 0 dt E Q -E Q t, (n 0 ) 2 t, (n 0 ) = 0 . (113)
As ( (n 0 )) n 0 ≥1 converges to 0, f n, (n 0 ) (t) and f n (t) have the same limit (provided it exists) thanks to Lemma 2. In the next section, to lighten the notations, the perturbation subscript (n 0 ) is abusively removed since it makes no difference for computing the limit of the free entropy.

Canceling the remainder

Note from ( 106) and (91) that the second term appearing in (107) is precisely the missing one that is required to obtain the expression of the potential on the r.h.s. of (106) (recall Proposition 1 and make the identifications r ↔ r 1 , 1 0 q(t)dt ↔ q 1 ). Hence, to prove Theorem 1, we would like to "cancel" the Gibbs bracket in (107), which is the so called remainder (once integrated over t). This is made possible thanks to the adaptive interpolating parameter q. One has to choose q(t) = E Q t , which is approximately equal to Q because it concentrates (see Lemma 3). However, E Q t depends on t 0 q(v)dv (and on r too). The equation q(t) = E Q t is therefore a first order differential equation over t → t 0 q(v)dv.

Proposition 3 (Existence of the optimal interpolation function). For all r ≥ 0 the differential equation

q(t) = E Q t ( 114
)
admits a unique solution q (r)

n 0 (t) on [0, ρ 1 (n 0 )] and the mapping

r ≥ 0 → 1 0 q (r) n 0 (v)dv (115)
is continuous.

Proof. Under (H2) one verifies easily that E Q t is a bounded C 1 function of ( t 0 q(v)dv, r). The proposition then follows from an application of the parametric Cauchy-Lipschitz theorem. This optimal choice for the interpolating function allows to relate the free entropy to the potential. Proposition 4. Let r ≥ 0. For n 0 ∈ N * , q (r) n 0 is the solution of (114). Then

f n = sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 f RS q 0 , r 0 , 1 0 q (r) n 0 (v)dv, r; ρ 0 , ρ 1 (n 0 ) + O n (1) . ( 116
)
Proof. By Cauchy-Schwarz inequality

1 0 dt E 1 n 1 n 2 µ=1 u Yt,µ (S t,µ )u Yt,µ (s t,µ ) -r Q -q (r) n 0 (t) t ≤ 1 0 dt E 1 n 1 n 2 µ=1 u Yt,µ (S t,µ )u Yt,µ (s t,µ ) -r 2 t 1 /2 1 0 dt E Q -q (r) n 0 (t) 2 t 1 /2 = O n (1) .
The last equality uses that the first factor is bounded (independently of t) under assumptions (H1), (H2) and (H3) (similar proof to the one in Appendix A.5 of [35]), and that the second factor goes to 0 when n 0 , n 1 , n 2 → +∞ with = (n 0 ) thanks to (113), (114). Making use of the latter result and n 1/n 0 → α 1 , ρ 1 (n 0 ) → ρ 1 , the integral of (107) reads

1 0 df n (t) dt dt = α 1 r 2 1 0 q (r) n 0 (t)dt -α 1 rρ 1 2 + O n (1) , (117)
Replacing this identity in (106) gives the desired result.

Lower and upper matching bounds

To end the proof of Theorem 1 one has to go through the following two steps:

(i) Prove that under assumptions (H1), (H2) and (H3)

lim n→∞ f n = sup r 1 ≥0 inf q 1 ∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ) .

(ii) Invert the order of the optimizations on r 1 and q 1 .

To tackle (i), one proves that lim inf n 0 →∞ f n and lim sup n 0 →∞ f n are -respectively -lowerbounded and upperbounded by the same quantity sup

r 1 ≥0 inf q 1 ∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ).

Proposition 5 (Lower bound). The free entropy (82) verifies lim inf

n 0 →∞ f n ≥ sup r≥0 inf q∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 .

(118)

Proof. By Proposition 4 we have that for any r ≥ 0

f n ≥ inf q∈[0,ρ 1 (n 0 )] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 (n 0 ) + O n (1) . (119)
By a continuity argument

lim n 0 →∞ inf q∈[0,ρ 1 (n 0 )] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 (n 0 ) = inf q∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 .

(120)

This limit, combined with (119), gives lim inf

n 0 →∞ f n ≥ inf q∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 .

This is true for all r ≥ 0, thus we obtain Proposition 5.

Proposition 6 (Upper bound). The free entropy (82) verifies lim sup

n 0 →∞ f n ≤ sup r≥0 inf q∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 .

(122)

Proof. Let K n 0 = 2α 2 Ψ P out,2 (ρ 1 (n 0 ); ρ 1 (n 0 )), Ψ P out,2 being the derivative of Ψ P out,2 w.r.t. its first argument. The latter is continuous and bounded (see Appendix A.2.2. of [35]). Also, (115) is a continuous mapping. It follows that

[0, K n 0 ] → [0, K n 0 ] r → 2α 2 Ψ Pout,2 1 0 q (r) n 0 (t)dt; ρ 1 (n 0 ) (123)
is continuous too. Therefore, it admits a fixed point

r * (n 0 ) = 2α 2 Ψ P out,2 1 0 q (r * (n 0 )) n 0 (t)dt; ρ 1 (n 0 ) .
We now remark that

sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 ,

1 0 q (r * (n 0 )) n 0 (t)dt, r * (n 0 ); ρ 0 , ρ 1 (n 0 ) = inf q∈[0,ρ 1 (n 0 )] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r * (n 0 ); ρ 0 , ρ 1 (n 0 ) .

Indeed, the function

g r * (n 0 ) : q ∈ [0, ρ 1 (n 0 )] → sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r * (n 0 ); ρ 0 , ρ 1 (n 0 ) is convex. To see it, first remember that

g r * (n 0 ) (q) = αΨ P out,2 q; ρ 1 (n 0 ) -α 1 r * (n 0 ) 2 q + C , (125)
where C := sup q 0 inf r 0 ψ P 0 (r 0 ) + α 1 Ψ ϕ 1 (q 0 , r * (n 0 ); ρ 0 )r 0 q 0 /2 does not depend on q. The convexity of g r * (n 0 ) then follows of the convexity of

Ψ P out,2 • ; ρ 1 (n 0 ) (see Proposition 11 in Appendix A.2.2.
of [35]). g r * (n 0 ) derivative is easily obtained from (125):

g r * (n 0 ) (q) = αΨ P out,2 q; ρ 1 (n 0 ) -α 1 r * (n 0 ) 2 . ( 126
)
By definition of r * (n 0 ), g r * (n 0 ) 1 0 q (r * (n 0 )) n 0 (t)dt = 0 and the minimum of g r * (n 0 ) is necessarily achieved at 1 0 q (r * (n 0 )) n 0 (t)dt. Proposition 4, combined with (124), gives

f n = inf q∈[0,ρ 1 (n 0 )] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r * (n 0 ); ρ 0 , ρ 1 (n 0 ) + O n (1)

≤ sup r≥0 inf q∈[0,ρ 1 (n 0 )] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 (n 0 ) + O n (1) .

Finally, by a continuity argument, we have

lim n 0 →∞ sup r≥0 inf q∈[0,ρ 1 (n 0 )] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 (n 0 ) = sup r≥0 inf q∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 , and taking the limit in the inequality (127) ends the proof:

lim sup n 0 →∞ f n ≤ sup r≥0 inf q∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS q 0 , r 0 , q, r; ρ 0 , ρ 1 .

It remains to prove (ii), i.e.

Proposition 7 (Switch the optimization order). Under (H2), for any positive real numbers ρ 0 and ρ 1 one has sup

r 1 ≥0 inf q 1 ∈[0,ρ 1 ] sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ) = sup

q 1 ∈[0,ρ 1 ] inf r 1 ≥0 sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0
f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ) .

Proof. Let f : [0, +∞[→ R and g : [0, ρ 1 ] → R be the two functions f (r 1 ) := sup

q 0 ∈[0,ρ 0 ] inf r 0 ≥0
ψ P 0 (r 0 ) + α 1 Ψ ϕ 1 (q 0 , r 1 ; ρ 0 ) -r 0 q 0 2 , g(q 1 ) := αΨ P out,2 (q 1 ; ρ 1 ) , such that ψ(r 1 , q 1 ) := sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 f RS (q 0 , r 0 , q 1 , r 1 ; ρ 0 , ρ 1 ) = f (r 1 ) + g(q 1 ) -α 1 2 r 1 q 1 . In Appendix A.3 it is shown that, under (H2), f is convex, Lipschitz and non-decreasing on [0, +∞[. Proposition 11 in Appendix A.2.2 of [35] states that, under (H2), g is convex, Lipschitz and non-decreasing on [0, ρ 1 ]. The desired result is then obtained by applying Corollary 5 in Appendix E of [35]: sup

r 1 ≥0 inf q 1 ∈[0,ρ 1 ] ψ(r 1 , q 1 ) = sup q 1 ∈[0,ρ 1 ] inf r 1 ≥0
ψ(r 1 , q 1 ) .

3 Numerical experiments

Activations comparison in terms of mutual informations

Here we assume the exact same setting as the one presented in the main text to compare activation functions on a two-layer random weights network. We compare here the mutual information estimated with the proposed replica formula instead of the entropy behaviors discussed in the main text. As it was the case for entropies, we can see that the saturation of the double-side saturated hardtanh leads to a loss of information for large weights, while the mutual informations are always increasing for linear and ReLU activations.

Learning ability of USV-layers

To ensure weight matrices remain close enough to being independent during learning we instroduce USV-layers, corresponding to a custom type of weight constraint. We recall that in such layers, weight matrices are decomposed in the manner of a singular value decomposition, W = U S V , with by U and V drawn from the corresponding Haar measures (i.e. uniformly among the orthogonal matrices of given size), and S contrained to be diagonal, being the only matrix being learned. In the main text, we demonstrate on a linear network that the USV-layers ensure that the assumptions necessary to our replica formula are met with learned matrices in the case of linear networks. Nevertheless, a USV-layer of size N × N has only N trainable parameters, which implies that they are harder to train than usual fully connected layers. In practice, we notice that they tend to require more parameter updates and that interleaving linear USV-layers to increase the number of parameters between non-linearities can significantly improve the final result of training. To convince ourselves that the training ability of USV-layers is still relevant to study learning dynamics on real data we conduct an experiment on the MNIST dataset. We study the classification problem of the classical MNIST data set (60 000 training images and 10 000 testing images) with a simple fully-connected network featuring one non-linear (ReLU) hidden layer of 500 neurones. On top of the ReLU-layer, we place a softmax output layer where the 500 × 10 parameters of the weight matrix are all being learned in all the versions of the experiments. Conversely, before the ReLU layer, we either (1) do not learn at all the 784 × 500 parameters which then define random projections, (2) learn all of them as a traditional fully connected network, (3) use a combination of 2 (3a), 3 (3b) or 6 (3c) consecutive USV-layers (without any intermediate non-linearity). The best train and test, losses and accuracies, for the different architectures are given in Table 1 and some learning curves are displayed on Figure 6. As expected we observe that USV-layers are acheiving better classification success than the random projections, yet worse than the unconstrained fully connected layer. Interestingly, stacking USV-layers to increase the number of trainable parameters allows to reach very good training accuracies, nevertheless, the testing accuracies do not benefit to the same extent from these additional parameters. On Figure 6, we can actually see that the version of the experiment with 6 USV-layers overfits the training set (green curves with testing losses growing towards the end of learning). Therefore, particularly in this case, adding regularizers might allow to improve the generalization performances of models with USV-layers. For each version of the experiment the outcomes of two independent runs are plotted with the same color, it is not always possible to distinguish the two runs as they overlap.

Additional learning experiments on synthetic data

Similarly to the experiments of the main text, we consider simple training schemes with constant learning rates, no momentum, and no explicit regularization.

We first include a second version of Figure 4 of the main text, corresponding to the exact same experiment with a different random seed and check that results are qualitatively identical.

We consider then a regression task created by a 2-layer teacher network of sizes 500-3-3, activations ReLU-linear, uncorrelated input data distribution N (0, I N X ) and additive white Gaussian noise at the output of variance 0.01. The matrices of the teacher network are i.i.d. normally distributed with a variance equal to the inverse of the layer input dimension. We train a student network with 2 ReLU layers of sizes 2500 and 1000, each featuring 5 stacked USV-layers of same size before the non linear activation, and with one final fully-connected linear layer. We use plain SGD with a constant learning rate of 0.01 and a batchsize of 50. In Figure 8 we plot the mutual informations with the input at the effective 10-hidden layers along the training. Except for the very first layer where we observe a slight initial increase, all mutual informations appear to only decrease during the learning, at least at this resolution (i.e. after the first epoch). We thus observe a compression even in the absence of double-saturated non-linearities. We further note that in this case we observe an accuentuation of the amount of compression with layer depth as observed by [39] (see second plot of first row of Figure 8), but which we did not observe in the binary classification experiment presented in the main text. On Figure 9, we reproduce the figure for a different seed. In a last experiment, we even show that merely changing the weight initialization can drastically change the behavior of mutual informations during training while resulting in identical training and testing final performances. We consider here a setting closely related to the classification on correlated data presented in the main text. The generative model is a a simple single layer generative model X = Wgen Y + with normally distributed code Y ∼ N (0, I N Y ) of size N Y = 100, from which data of size N X = 500 are generated with matrix Wgen i.i.d. normally distributed as N (0, 1/ √ N Y ) and noise ∼ N (0, 0.01I N X ). The recognition model attempts to solve the binary classification problem of recovering the label y = sign(Y 1 ), the sign of the first neuron in Y . Again the training is done with plain SGD to minimize the cross-entropy loss and the rest of the initial code (Y 2 , ..Y N Y ) acts as noise/nuisance with respect to the learning task. On Figure 10 we compare 3 identical 5-layers recognition models with sizes 500-1000-500-250-100-2, and activations hardtanh-hardtanh-hardtanhhartanh-softmax. For the model presented at the top row, initial weights were sampled according to W ,ij ∼ N (0, 4/N -1 ), for the model of the middle row N (0, 1/N -1 ) was used instead, and finally N (0, 1/4N -1 ) for the bottom row. The first column shows that training is delayed for the weight initialized at smaller values, but eventually catches up and reaches accuracies superior to 0.97 both in training and testing. Meanwhile, mutual informations have different initial values for the different weight initializations and follow very different paths. They either decrease during the entire learning, or on the contrary are only increasing, or actually feature an hybrid path. We further note that it is to some extent surprising that the mutual information would increase at all in the first row if we expect the hardtanh saturation to instead induce compression. Figure 11 presents a second run of the same experiment with a different random seed. Findings are identical.

These observed differences and non-trivial observations raise numerous questions, and suggest that within the examined setting, a simple information theory of deep learning remains out-of-reach.

A Proofs of some technical propositions

A.1 The Nishimori identity Proposition 8 (Nishimori identity). Let (X, Y) ∈ R n 1 × R n 2 be a couple of random variables. Let k ≥ 1 and let X (1) , . . . , X (k) be k i.i.d. samples (given Y) from the conditional distribution P (X = • |Y), independently of every other random variables. Let us denotethe expectation operator w.r.t. P (X = • |Y) and E the expectation w.r.t. (X, Y). Then, for all continuous bounded function g we have

E g(Y, X (1) , . . . , X (k) ) = E g(Y, X (1) , . . . , X (k-1) , X) . (128)
Proof. This is a simple consequence of Bayes formula. It is equivalent to sample the couple (X, Y) according to its joint distribution or to sample first Y according to its marginal distribution and then to sample X conditionally to Y from its conditional distribution P (X = • |Y). Thus the (k + 1)-tuple (Y, X (1) , . . . , X (k) ) is equal in law to (Y, X (1) , . . . , X (k-1) , X). A.2 Limit of the sequence (ρ 1 (n 0 )) n 0 ≥1

Here one proves Proposition 1, i.e. that the sequence (ρ 1 (n 0 )) n 0 ≥1 converges to ρ 1 := E[ϕ 2 1 (T, A 1 )] where T ∼ N (0, ρ 0 ), A 1 ∼ P A 1 under the hypotheses (H1), (H2), (H3).

If ρ 0 = 0 then X 0 = 0 almost surely (a.s.) and ρ 1 (n 0 ) = Eϕ 2 1 (0, A 1 ) = ρ 1 for every n 0 ≥ 1, making the result trivial. From now on, assume ρ 0 > 0. Given X 0 , one has

W 1 X 0 √ n 0 1 ∼ N 0, X 0 2 n 0 . Therefore ρ 1 (n 0 ) := E ϕ 2 1 W 1 X 0 √ n 0 1 , A 1 = E dt dP A 1 (a)ϕ 2 1 (t, a) exp -t 2 2 X 0 2 n 0 2π X 0 2 n 0 = E h X 0 2 n 0 , where h : v → dtdP A 1 (a)ϕ 2 1 (t, a) 1 √ 2πv exp( -t 2 /2v
) is a function on ]0, +∞[. It is easily shown to be continuous under (H2) thanks to the dominated convergence theorem. By the Strong Law of Large Numbers, X 02 /n 0 converges a.s. to ρ 0 . Combined with the continuity of h, one has

lim n 0 →+∞ h X 0 2 n 0 a.s. = h(ρ 0 ) = ρ 1 .
Noticing that |h ( X 0 2 /n 0 )| ≤ sup ϕ 2 1 , the dominated convergence theorem gives

ρ 1 (n 0 ) = E h X 0 2 n 0 -----→ n 0 →+∞ E lim n 0 →+∞ h X 0 2 n 0 = ρ 1 .
A.3 Properties of the third scalar channel Proposition 9. Assume ϕ 1 is bounded (as it is the case under (H2)). Let V, U i.i.d. ∼ N (0, 1) and

ρ 0 ≥ 0, q 0 ∈ [0, ρ 0 ]. For any r ≥ 0, Y (r) 0 = √ rϕ 1 ( √ q V + √ ρ -q U, A 1 ) + Z where Z ∼ N (0, 1), A 1 ∼ P A 1 . The function Ψ ϕ 1 (q 0 , • ; ρ 0 ) : r → E ln DuP (r) out,1 Y (r) 0 √ q V + √ ρ -q u .
is twice-differentiable, convex, non-decreasing and ρ 1 2 -Lipschitz on R + . Then the function

f : r → sup q 0 ∈[0,ρ 0 ] inf r 0 ≥0 ψ P 0 (r 0 ) + α 1 Ψ ϕ (q 0 , r; ρ 0 ) - r 0 q 0 2 is convex, non-decreasing and α 1 ρ 1 2 -Lipschitz on R + .
Proof. For fixed ρ 0 and q 0 , let

Ψ ϕ 1 ≡ Ψ ϕ 1 (q 0 , • ; ρ 0 ). Note that Ψ ϕ 1 (r) = E dy 0 1 √ 2π e -1 • ln Du dP A 1 (a)e √ ry 0 ϕ 1 ( √ q 0 V + √ ρ 0 -q 0 u,a)-r 2 ϕ 2 1 ( √ q 0 V + √ ρ 0 -q 0 u,a) .
With the properties imposed on ϕ 1 , all the domination hypotheses to prove the twice-differentiability of ψ ϕ 1 are reunited. Denoter the expectation operator w.r.t. the joint posterior distribution

dP (u, a|Y 0 , V ) = 1 Z(Y 0 , V ) Du dP A 1 (a)e √ ry 0 ϕ 1 ( √ q 0 V + √ ρ 0 -q 0 u,a)-r 2 ϕ 2 1 ( √ q 0 V + √ ρ 0 -q 0 u,a) ,
where Z(Y 0 , V ) is a normalization factor. Using Gaussian integration by parts and the Nishimori property (Proposition 8), one verifies that for all r ≥ 0

Ψ ϕ 1 (r) = 1 2 E ϕ 1 ( √ q 0 V + √ ρ 0 -q 0 u, a) 2 r ≥ 0 , Ψ ϕ 1 (r) = 1 2 E ϕ 2 1 ( √ q 0 V + √ ρ 0 -q 0 u, a) r -ϕ 1 ( √ q 0 V + √ ρ 0 -q 0 u, a) 2 r 2 ≥ 0 .
Hence Ψ ϕ 1 is non-decreasing and convex. The Lipschitzianity follows simply from

Ψ ϕ 1 (r) ≤ 1 2 E ϕ 2 1 ( √ q 0 V + √ ρ 0 -q 0 u, a) r = 1 2 E[ϕ 2 1 ( √ q 0 V + √ ρ 0 -q 0 U, A 1 )] = 1 2 ρ 1 .
The Nishimori identity was used once again to obtain the penultimate equality. Finally, f properties are direct consequences of its definition as the "sup inf" of convex, non-decreasing, ρ 1 2 -lipschitzian functions.

B Proof of Proposition 2

Recall u y (x) is the x-derivative of u y (x) := ln P out,2 (y|x). Denote P out,2 (y|x) and P out,2 (y|x) the first and second x-derivatives of P out,2 (y|x), respectively. First one shows that for all t ∈ (0, 1)

df n (t) dt = - 1 2 n 1 n 0 E 1 n 1 n 2 µ=1 u Yt,µ (S t,µ )u Yt,µ (s t,µ ) -r Q -q(t) t + n 1 n 0 rq(t) 2 - rρ 1 (n 0 ) 2 - A n (t) 2 , (129)
where the overlap is

Q := 1 n 1 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i , A 1,i ϕ 1 W 1 x √ n 0 i
, a 1,i and

A n (t) := E 1 √ n 1 n 2 µ=1 P out,2 (Y t,µ |S t,µ ) P out,2 (Y t,µ |S t,µ ) 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) ln Z t n 0 . ( 130
)
Once this is done, one proves that A n (t) goes to 0 uniformly in t ∈ [0, 1] as n 0 , n 1 , n 2 → +∞ (while

n 1/n 0 → α 1 , n 2/n 1 → α 2 )
, thus proving Proposition 2.

B.1 Proof of (129)

Recall definition (101). Once written as a function of the interpolating Hamiltonian (98), it becomes

f n (t) = 1 n 0 E W 1 ,W 2 ,V dYdY dP 0 (X 0 )dP A 1 (A 1 )DU(2π) -n 1 2 e -Ht(X 0 ,A 1 ,U;Y,Y ,W 1 ,W 2 ,V)
• ln dP 0 (x)dP A 1 (a 1 )Du e -Ht(x,a 1 ,u;Y,Y ,W 1 ,W 2 ,V) . (131)

Here, and from now on, one drops the dependence on t when writing Y and Y as they are now dummy variables on which the integration is performed. We will need the Hamiltonian t-derivative H t given by

H t (X 0 , A 1 , U; Y, Y , W 1 , W 2 , V) = - n 2 µ=1 dS t,µ dt u Yµ (S t,µ ) - 1 2 r t n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i , A 1,i Y i - √ rtϕ 1 W 1 X 0 √ n 0 i , A 1,i . (132)
The derivative of the interpolating free entropy for 0 < t < 1 thus reads

df n (t) dt = - 1 n 0 E H t (X * , A 1 , U; Y, Y , W 1 , W 2 , V) ln Z t T 1 - 1 n 0 E H t (x, a 1 , u; Y, Y , W 1 , W 2 , V) t T 2 , (133)
where

Z t ≡ Z t (Y, Y , W 1 , W 2 , V) is defined in (100).
In the remaining part of this subsection B.1, to lighten notations, one will omit the second argument of the function ϕ 1 except in a few occasions, i.e. one will write for i = 1 . . . n 1

ϕ 1 W 1 X 0 √ n 0 i ≡ ϕ 1 W 1 X 0 √ n 0 i , A 1,i , ϕ 1 W 1 x √ n 0 i ≡ ϕ 1 W 1 x √ n 0 i , a 1,i .
It does not hurt the understanding of the derivation of (129) as the latter relies on integration by parts w.r.t. the Gaussian random variables W 1 , W 2 , V, U, Z . Let first compute T 1 . For 1 ≤ µ ≤ n 2 one has from ( 95)

-E dS t,µ dt u Yµ (S t,µ ) ln Z t = 1 2 E 1 n 1 (1 -t) W 2 ϕ 1 W 1 X 0 √ n 0 µ u Yµ (S t,µ ) ln Z t - 1 2 E q(t) t 0 q(s)ds V µ + ρ 1 (n 0 ) -q(t) t 0 (ρ 1 (n 0 ) -q(s))ds U µ u Yµ (S t,µ ) ln Z t . ( 134
)
By Gaussian integration by parts w.r.t (W 2 ) µi , 1 ≤ i ≤ n 1 , the first expectation becomes

1 n 1 (1 -t) E W 2 ϕ 1 W 1 X 0 √ n 0 µ u Yµ (S t,µ ) ln Z t = 1 n 1 (1 -t) n 1 i=1 E dYdY (2π) -n 1 2 e -Ht(X 0 ,A 1 ,U;Y,Y ,W 1 ,W 2 ,V) (135)
• (W 2 ) µi ϕ 1 W 1 X 0 √ n 0 i u Yµ (S t,µ ) ln Z t = 1 n 1 n 1 i=1 E ϕ 2 1 W 1 X 0 √ n 0 i u Yµ (S t,µ ) + u Yµ (S t,µ ) 2 ln Z t + 1 n 1 n 1 i=1 E ϕ 1 W 1 X 0 √ n 0 i ϕ 1 W 1 x √ n 0 i u Yµ (S t,µ )u Yµ (s t,µ ) t = E 1 n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) ln Z t + E 1 n 1 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i ϕ 1 W 1 x √ n 0 i u Yµ (S t,µ )u Yµ (s t,µ ) t . (136)
In the last equality we used the identity u Yµ (x) + u Yµ (x) 2 = P out,2 (Yµ|x) P out,2 (Yµ|x) . Now one looks to the second expectation in the right hand side of (134). Using again Gaussian integrations by parts, but this time w.r.t V µ , U µ i.i.d.

∼ N (0, 1), one similarly obtains E q(t) t 0 q(s)ds

V µ + ρ 1 (n 0 ) -q(t) t 0 (ρ 1 (n 0 ) -q(s))ds U µ u Yµ (S t,µ ) ln Z t = E dYdY (2π) -n 1 2 e -Ht(X 0 ,U;Y,Y ,W 1 ,W 2 ,V)
• q(t) t 0 q(s)ds

V µ + ρ 1 (n 0 ) -q(t) t 0 (ρ 1 (n 0 ) -q(s))ds U µ u Yµ (S t,µ ) ln Z t = E ρ 1 (n 0 ) P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) ln Z t + E q(t)u Yµ (S t,µ )u Yµ (s t,µ ) t . (137)
Combining equations ( 134), ( 135) and ( 137) together gives us

-E dS t,µ dt u Yµ (S t,µ ) ln Z t = 1 2 E P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 1 n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i -ρ 1 (n 0 ) ln Z t + 1 2 E 1 n 1 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i ϕ 1 W 1 x √ n 0 i -q(t) u Yµ (S t,µ )u Yµ (s t,µ ) t . (138)
As seen from ( 132), ( 133) it remains to compute E ϕ 1

W 1 X 0 √ n 0 i Y i - √ rtϕ 1 W 1 X 0 √ n 0 i ln Z t . Recalling that Y i - √ rtϕ 1 W 1 X 0 √ n 0 i = Z i for 1 ≤ i ≤ n 1
, and then integrating by parts w.r.t.

Z i ∼ N (0, 1), it comes E ϕ 1 W 1 X 0 √ n 0 i Y i - √ rtϕ 1 W 1 X 0 √ n 0 i ln Z t = E ϕ 1 W 1 X 0 √ n 0 i Z i ln Z t = E ϕ 1 W 1 X 0 √ n 0 i Z i ln dP 0 (x)dP A 1 (a 1 )Du e -Ht(x,a 1 ,u;Y,Y ,W 1 ,W 2 ,V) = -E ϕ 1 W 1 X 0 √ n 0 i √ rt ϕ 1 W 1 X 0 √ n 0 i -ϕ 1 W 1 x √ n 0 i + Z i t = - √ rt ρ 1 (n 0 ) -E ϕ 1 W 1 X 0 √ n 0 i ϕ 1 W 1 x √ n 0 i t . (139)
Thus, by taking the sum,

- 1 2 r t E 1 n 0 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i Y i - √ rtϕ 1 W 1 X 0 √ n 0 i ln Z t = n 1 n 0 rρ 1 (n 0 ) 2 - r 2 E 1 n 1 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i ϕ 1 W 1 x √ n 0 i t . (140)
Therefore, for all t ∈ (0, 1),

T 1 = 1 2 E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i -ρ 1 (n 0 ) 1 n 0 ln Z t + 1 2 n 1 n 0 E 1 n 1 n 2 µ=1 u Yµ (S t,µ )u Yµ (s t,µ ) -r 1 n 1 n 1 i=1 ϕ 1 W 1 X 0 √ n 0 i ϕ 1 W 1 x √ n 0 i -q(t) t + n 1 n 0 rρ 1 (n 0 ) 2 - rq(t) 2 . (141)
To obtain (129), it remains to show that T 2 is zero. According to the Nishimori identity (see Proposition 8), one has

T 2 = 1 n 0 E H t (x, u, a 1 ; Y, Y , W 1 , W 2 ) t = 1 n 0 E H t (X 0 , A 1 , U; Y, Y , W 1 , W 2 ) . (142)
From (132) one obtains

E H t (X 0 , A 1 , U; Y, Y , W 1 , W 2 , V) = - n 2 µ=1 E dS t,µ dt u Yµ (S t,µ ) - 1 2 r t n 1 i=1 E ϕ 1 W 1 X 0 √ n 0 i , A 1,i Z i = - n 2 µ=1 E dS t,µ dt u Yµ (S t,µ ) . (143)
Performing the same integration by parts than the ones leading to (138), one gets

- n 2 µ=1 E dS t,µ dt u Yµ (S t,µ ) = 1 2 E n 2 µ P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 1 n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) = 0 . ( 144
)
The last equality follows from a computation in the next section, see (147). Combining (142), ( 143) and (144), one obtains T 2 = 0.

B.2 Proof that A n (t) vanishes uniformly as n 0 → ∞ To get Proposition 2, the last step is to prove that A n (t) -see definition (130) -vanishes uniformly in t ∈ [0, 1] as n 0 → +∞, under conditions (H1)-(H2)-(H3). First we show that

f n (t)E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) = 0 . ( 145
)
Once this is done, we use the fact that 1 n 0 ln Z t concentrates around f n (t) to prove that A n (t) vanishes uniformly.

Start by noticing the simple fact that P out,2 (y|s)dy = 0 for all s ∈ R. Consequently, for µ ∈ {1, . . . , n 2 },

E P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) X 0 , A 1 , W 1 , S t = dY µ P out,2 (Y µ |S t,µ ) = 0 . (146)
The "tower property" of the conditional expectation then gives

E n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) = E n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) E n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) X 0 , A 1 , W 1 , S t = 0 . ( 147
)
This implies (145). Using successively (145) and the Cauchy-Schwarz inequality, we have

|A n (t)| = E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) • ln Z t n 0 -f n (t) ≤ E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 2 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) 2 1 2 • E 1 n 0 ln Z t -f n (t) 2 1 2 . ( 148
)
Making once more use of the "tower property" of conditional expectation, one obtains

E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 2 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) 2 = E 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) 2 • E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 2 X 0 , A 1 W 1 ,
Combining now (151), ( 150) and ( 149) we obtain that

E 1 √ n 1 n 2 µ=1 P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ ) 2 1 √ n 1 n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) 2 ≤ n 2 n 1 C 1 n 1 E n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 ) 2 . (152)
It remains to prove the boundedness of

1 n 1 E n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i -ρ 1 (n 0 ) 2 = 1 n 1 Var(X 1 )
, where

X 1 := n 1 i=1 X 1 i is the sum of the random variables X 1 i := ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i , 1 ≤ i ≤ n 1 .
To achieve that, one uses the identity

1 n 1 Var(X 1 ) = 1 n 1 E Var(X 1 |X 0 ) + 1 n 1 Var E[X 1 |X 0 ] (153)
and show that both terms in the right hand side are bounded. First, the term E Var(X 1 |X 0 ) . Conditionally on X 0 , the random variables (X 1 i ) 1≤i≤n 1 are i.i.d. and

Var(X 1 |X 0 ) = n 1 i=1 Var(X 1 i |X 0 ) = n 1 Var(X 1 1 |X 0 ) . (154)
It follows that

1 n 1 E Var(X 1 |X 0 ) = E Var(X 1 1 |X 0 ) ≤ Var(X 1 1 ) ≤ E ϕ 4 1 W 1 X 0 √ n 0 1 , A 1,1 . (155)
Under (H2), the expectation

E ϕ 4 1 W 1 X 0 √ n 0 1 , A 1,1 is bounded because ϕ 1 is bounded. Second, the term Var E[X 1 |X 0 ] . We have E[X 1 |X 0 ] = n 1 • E ϕ 2 1 W 1 X 0 √ n 0 1 , A 1,1 X 0 = n 1 • g(X 0 1 , . . . , X 0 n 0 ) (156)
where g(x 1 , . . . ,

x n 0 ) = E ϕ 2 1 W 1 x √ n 0 1 , A 1,1 . The partial derivatives of g satisfy for 1 ≤ j ≤ n 0 ∂g ∂x j (x 1 , . . . , x n 0 ) = E 2ϕ 1 W 1 x √ n 0 1 , A 1,1 ϕ 1 W 1 x √ n 0 1 , A 1,1 (W 1 ) 1j √ n 0 = 2x j n 0 E ϕ 2 1 W 1 x √ n 0 1 , A 1,1 + ϕ 1 W 1 x √ n 0 1 , A 1,1 ϕ 1 W 1 x √ n 0 1 , A 1,1 , (157)
where (157) was obtained by integrating by parts w.r.t. (W 1 ) 1j . Under the hypothesis (H1) the prior P 0 has bounded support X ⊆ [-S, S]. Then, for every x ∈ X n 0 , we have

∂g ∂x j (x 1 , . . . , x n ) ≤ 2S n 0 • (sup |ϕ 1 | 2 + sup |ϕ 1 | • sup |ϕ 1 |) ≤ C n 0 , (158)
for some constant C > 0. Here the hypothesis (H2) was used to bound the expectation in (157). Thus, the function g satisfies the bounded difference property, i.e. ∀j ∈ {1, . . . , n 0 } sup x∈X n 0 ,x j ∈X |g(x 1 , . . . , x j , . . . , x n 0 )g(x 1 , . . . , x j , . . . ,

x n )| ≤ C n 0 sup x j ,x j ∈X |x j -x j | ≤ 2S • C n 0 . (159)
Applying Proposition 11 (see Appendix C.1) it comes

Var g(X 0 ) ≤ 1 4 n 0 j=1 2S • C n 0 2 = C n 0 , (160)
and

1 n 1 Var E[X 1 |X 0 ] = n 1 • Var g(X 0 ) ≤ n 1 n 0 C . (161)
It ends the proof of

1 n 1 E n 1 i=1 ϕ 2 1 W 1 X 0 √ n 0 i , A 1,i -ρ 1 (n 0 )
2 boundedness in the limit n 0 → +∞. Combining (148), (152) and the latter, it comes

|A n (t)| ≤ K E 1 n 0 ln Z t -f n (t) 2 1/2 (162)
for some constant K > 0 and n 0 large enough. The uniform convergence of A n (t) then follows from (162) and Theorem 2 in Appendix C.1, that states E

[(n -1 0 ln Z t -f n (t)) 2 ] -----→ n 0 →+∞ 0 uniformly in t ∈ [0, 1].

C Concentration of free entropy and overlaps

C.1 Concentration of the free entropy

In this section, one proves that the free entropy of the interpolation model studied in Sec. 2.4 concentrates around its expectation (uniformly in t), i.e. one proves Theorem 2 stated below. To lighten the notations, one uses C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) to denote a generic positive constant depending only on ϕ 1 , ϕ 2 , α 1 , α 2 , S. Remember that S is a bound on the signal absolute values. It is also understood that the dimensions n 0 , n 1 , n 2 are large enough and

n 1 /n 0 → α 1 , n 2 /n 1 → α 2 .
Theorem 2. Under assumptions (H1), (H2), (H3) one can find a positive constant

C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) such that E 1 n 0 ln Z t -E 1 n 0 ln Z t 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 . (163)
One recalls some setups and notations for the reader's convenience. The interpolating Hamiltonian (97)-(98) is

- n 2 µ=1 ln P out,2 (Y µ |s t,µ (x, a 1 , u µ )) + 1 2 n 1 i=1 Y i - √ r t ϕ 1 W 1 x √ n 0 i , a 1,i 2 , (164)
where

s t,µ (x, a 1 , u µ ) = 1-t n 1 W 2 ϕ 1 W 1 x √ n 0 , a 1 µ + k 1 (t) V µ + k 2 (t) u µ with k 1 (t) := t 0 q(v)dv, k 2 (t) := t 0 (ρ 1 (n 0 ) -q(v))dv .
This Hamiltonian follows from the interpolating model

   Y t,µ = ϕ 2 1-t n 1 W 2 ϕ 1 W 1 X 0 √ n 0 , A 1 µ + k 1 (t) V µ + k 2 (t) U µ , A 2,µ + √ ∆Z µ , 1 ≤ µ ≤ n 2 , Y t,i = √ r t ϕ 1 W 1 X 0 √ n 0 i , A 1,i + Z i , 1 ≤ i ≤ n 1 , where (A 1,i ) n 1 i=1 i.i.d. ∼ P A 1 , (A 2,µ ) n 2 µ=1 i.i.d. ∼ P A 2 , (Z µ ) n 2 µ=1 , (Z i ) n 1 i=1 i.i.d.
∼ N (0, 1). Recall the definition

X 1 := ϕ 1 W 1 X 0 √ n 0 , A 1 .
The channel P out,2 defined in (77) can be written as

P out,2 (Y t,µ |s t,µ (x, a 1 , u)) = dP A 2 (a 2,µ ) 1 √ 2π∆ e -1 2∆ Yt,µ-ϕ 2 (st,µ(x,a 1 ,uµ),a 2,µ 2 = dP A 2 (a 2,µ ) 1 √ 2π∆ e -1 2∆ (Γt,µ(x,a 1 ,a 2,µ ,uµ)+ √ ∆Zµ) 2 (165) with Γ t,µ (x, a 1 , a 2,µ , u µ ) := ϕ 2 1 -t n 1 W 2 X 1 µ + k 1 (t) V µ + k 2 (t) U µ , A 2,µ -ϕ 2 1 -t n 1 W 2 ϕ 1 W 1 x √ n 0 , a 1 µ + k 1 (t) V µ + k 2 (t) u µ , a 2,µ . (166)
From ( 164), (165), (166) the free entropy of the interpolating model reads

1 n 0 ln Z t = 1 n 0 ln Ẑt - 1 2n 0 n 2 µ=1 Z 2 µ - 1 2n 0 n i=1 Z 2 i - n 2 2n 0 ln(2π∆) (167)
where

1 n 0 ln Ẑt = 1 n 0 ln dP 0 (x)dP A 1 (a 1 )dP A 2 (a 2 )Du e -Ĥt(x,a1,a2,u) , (168)
and

Ĥt (x, a 1 , a 2 , u) = 1 2∆ n 2 µ=1 Γ t,µ (x, a 1 , a 2,µ , u µ ) 2 + 2 √ ∆Z µ Γ t,µ (x, a 1 , a 2,µ , u µ ) + 1 2 n 1 i=1 √ rtX 1 i - √ rtϕ 1 W 1 x √ n 0 i , a 1,i 2
+ 2Z i √ rtX 1 i - √ rtϕ 1 W 1 x √ n 0 i , a 1,i . (169)
From (166), (168), (169), note that ln Ẑt /n 0 has been written as a function of Z, Z , V, U, W 2 , W 1 , A 2 , X 1 . Our goal is to show that the free energy (167) concentrates around its expectation. It is enough to show that there exists a positive constant C(ϕ 1 , ϕ . This concentration property together with (167) implies (163), i.e. Theorem 2.

First, the concentration w.r.t. all Gaussian variables Z, Z , V, U, W 2 , W 1 is shown thanks to the classical Gaussian Poincaré inequality, then the concentration w.r.t. A 2 , X 1 using classical bounded difference arguments. The order in which the concentrations are proved matters. These two variance bounds are recalled below. The reader can refer to [40] (Chapter 3) for detailed proofs of these statements.

Proposition 10 (Gaussian Poincaré inequality). Let U = (U 1 , . . . , U N ) be a vector of N independent standard normal random variables. Let g : R N → R be a continuously differentiable function. Then

Var(g(U)) ≤ E ∇g(U) 2 . ( 170
)
Proposition 11. Let U ⊂ R. Let g : U N → R a function that satisfies the bounded difference property, i.e., there exists some constants c 1 , . . . , c N ≥ 0 such that

sup u 1 ,...u N ∈U N u i ∈U |g(u 1 , . . . , u i , . . . , u N ) -g(u 1 , . . . , u i , . . . , u N )| ≤ c i , for all 1 ≤ i ≤ N .
Let U = (U 1 , . . . , U N ) be a vector of N independent random variables that takes values in U. Then

Var(g(U)) ≤ 1 4 N i=1 c 2 i . (171)
Finally, before starting the proof of Theorem

C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) such that E 1 n 0 ln Ẑt -E G 1 n 0 ln Ẑt 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 . (172)
Lemma 4 follows, by Pythagorean theorem, from the Lemmas 5, 6, 7 proven below.

Lemma 5. Let E Z,Z denotes the expectation w.r.t. Z, Z only. There exists a constant

C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) > 0 such that E 1 n 0 ln Ẑt -E Z,Z 1 n 0 ln Ẑt 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 . (173)
Proof. Here g = ln Ẑt /n 0 is seen as a function of Z, Z only and we work conditionally to all other random variables. The norm of the gradient of g reads

∇g 2 = n 2 µ=1 ∂g ∂Z µ 2 + n 1 i=1 ∂g ∂Z i 2 . (174)
Each of these partial derivatives are of the form ∂g = -n -1 0 ∂ Ĥt Ĥt where the Gibbs bracket -Ĥt pertains to the effective Hamiltonian (169). One finds

∂g ∂Z µ = 1 n 0 √ ∆ Γ t,µ Ĥt ≤ 2 n 0 √ ∆ sup |ϕ 2 | , ∂g ∂Z i = 1 n 0 √ rtX 1 i - √ rtϕ 1 W 1 x √ n 0 i Ĥt ≤ 2 √ r n 0 sup |ϕ 1 | ,
and, replacing in (174), one gets ∇g 2 ≤ 4n -1

0 n 2 n 0 ∆ -1 sup |ϕ 2 | 2 + r n 1 n 0 sup |ϕ 1 | 2 . Applying Propo- sition 10, one obtains E Z,Z 1 n 0 ln Ẑt -E Z,Z 1 n 0 ln Ẑt 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 (175)
almost surely. Taking the expectation in (175) gives the lemma. Lemma 6. Let E G denote the expectation w.r.t. Z, Z , V, U, W 2 only. There exists a constant

C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) > 0 such that E E Z,Z 1 n 0 ln Ẑt -E G 1 n 0 ln Ẑt 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 . (176)
Proof. Here g = E Z,Z [ln Ẑt] /n 0 is seen as a function of V, U, W 2 and we work conditionally to all other random variables.

∂g ∂V µ = n -1 0 E Z,Z Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂V µ Ĥt ≤ n -1 0 E Z,Z (2 sup |ϕ 2 | + √ ∆|Z µ |) ρ 1 (n 0 ) ∆ 2 sup |ϕ 2 | = n -1 0 2 sup |ϕ 2 | + 2∆ π ρ 1 (n 0 ) ∆ 2 sup |ϕ 2 |
The same inequality holds for ∂g ∂Uµ . To compute the derivative w.r.t. (W 2 ) µi , first remark that

∂Γ t,µ ∂(W 2 ) µi = 1 -t n 1 X 1 i ϕ 2 1 -t n 1 W 2 X 1 µ + k 1 (t) V µ + k 2 (t) U µ -ϕ 1 W 1 x √ n 0 i ϕ 2 1 -t n 1 W 2 ϕ 1 W 1 x √ n 0 µ + k 1 (t) V µ + k 2 (t) u µ Therefore ∂g ∂(W 2 ) µi = n -1 0 E Z,Z (Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂(W 2 ) µi Ĥt ≤ 1 n 0 √ n 1 E Z,Z (2 sup |ϕ 2 | + √ ∆|Z µ |)∆ -1 (2 sup |ϕ 1 | sup |ϕ 2 |) = 1 n 0 √ n 1 2 sup |ϕ 2 | + 2∆ π ∆ -1 (2 sup |ϕ 1 | sup |ϕ 2 |)
Putting these inequalities together one ends up with

∇g 2 = n 2 µ=1 ∂g ∂V µ 2 + n 2 µ=1 ∂g ∂U µ 2 + n 2 µ=1 n 1 i=1 ∂g ∂(W 2 ) µi 2 ≤ n 2 n 2 0 2 ρ 1 (n 0 ) →ρ 1 + sup |ϕ 1 | 2 2 sup |ϕ 2 | ∆ 2 2 sup |ϕ 2 | + 2∆ π 2 .
Then the lemma follows once again of Proposition 10.

Lemma 7. Let E G denote the expectation w.r.t. Z, Z , V, U, W 2 , W 1 only. There exists a positive constant C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) such that E E G 1 n 0 ln Ẑt -E G 1 n 0 ln Ẑt 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 . (177)
Proof. Here g = E G [ln Ẑt] /n 0 is seen as a function of W 1 only and we work conditionally to the other random variables. The partial derivatives of g w.r.t.

(W 1 ) ij reads ∂g ∂(W 1 ) ij = - 1 n 0 n 2 µ=1 E G (Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂(W 1 ) ij Ĥt + √ rt n 3/2 0 E G √ rtX 1 i - √ rtϕ 1 W 1 x √ n 0 i + Z i x j ϕ 1 W 1 x √ n 0 i

Ĥt

In a similar fashion to what has be done previously, the absolute value of the second term in this partial derivative can be upperbounded by

√ r n 3/2 0 2 √ r sup |ϕ 1 | + 2 π • S sup |ϕ 1 | .
The first term requires more work. First notice that It follows that

E G (Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂(W 1 ) ij Ĥt = ∆ -1 1 -t n 0 n 1 E G (W 2 ) µi (Γ t,µ + √ ∆Z µ ) Γ(ij) t,µ Ĥt , where Γ(ij) t,µ = -x j ϕ 1 W 1 x √ n 0 i ϕ 2 1 -t n 1 W 2 ϕ 1 W 1 x √ n 0 µ + k 1 (t) V µ + k 2 (t) u µ .
Integrating by parts w.r.t. (W 2 ) µi we get

E G (W 2 ) µi (Γ t,µ + √ ∆Z µ ) Γ(ij) t,µ Ĥt = E G ∂Γ t,µ ∂(W 2 ) µi Γ(ij) t,µ Ĥt + E G (Γ t,µ + √ ∆Z µ ) ∂ Γ(ij) t,µ ∂(W 2 ) µi Ĥt -E G (Γ t,µ + √ ∆Z µ ) 2 Γ(ij) t,µ ∆ -1 ∂Γ t,µ ∂(W 2 ) ij Ĥt + E G (Γ t,µ + √ ∆Z µ ) Γ(ij) t,µ Ĥt (Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂(W 2 ) ij Ĥt .
The first two expectations satisfy

E G ∂Γ t,µ ∂(W 2 ) µi Γ(ij) t,µ Ĥt ≤ 2 sup |ϕ 1 | sup |ϕ 2 | √ n 1 • S sup |ϕ 1 | sup |ϕ 2 | , E G (Γ t,µ + √ ∆Z µ ) ∂ Γ(ij) t,µ ∂(W 2 ) µi Ĥt ≤ 2 sup |ϕ 2 | + 2∆ π • S sup |ϕ 1 | sup |ϕ 1 | sup |ϕ 2 | √ n 1 ,
while for the last two we have

E G (Γ t,µ + √ ∆Z µ ) 2 Γ(ij) t,µ ∂Γ t,µ ∂(W 2 ) ij Ĥt ≤ E (2 sup |ϕ 2 | + √ ∆|Z µ |) 2 • S sup |ϕ 1 | sup |ϕ 2 | • 2 sup |ϕ 1 | sup |ϕ 2 | √ n 1 = 4 sup |ϕ 2 | 2 + ∆ + 2 sup |ϕ 2 | 2∆ π • S sup |ϕ 1 | sup |ϕ 2 | • 2 sup |ϕ 1 | sup |ϕ 2 | √ n 1 , E G (Γ t,µ + √ ∆Z µ ) Γ(ij) t,µ Ĥt (Γ t,µ + √ ∆Z µ ) ∂Γ t,µ ∂(W 2 ) ij Ĥt ≤ 4 sup |ϕ 2 | 2 + ∆ + 2 sup |ϕ 2 | 2∆ π • S sup |ϕ 1 | sup |ϕ 2 | • 2 sup |ϕ 1 | sup |ϕ 2 | √ n 1 .
Putting all these inequalities together gives the existence of a positive constant C ). We will show that g satisfies a bounded difference property, then an application of Proposition 11 will end the proof.

1 (ϕ 1 , ϕ 2 , α 1 , α 2 , S) such that n -1 0 n 2 µ=1 E G (Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂(W 1 ) ij Ĥt ≤ 1 n 3/2 0 • n 2 n 1 • C 1 (ϕ 1 , ϕ 2 , α 1 , α 2 , S) Thus, it exists a positive constant C 2 (ϕ 1 , ϕ 2 , α 1 , α 2 , S) satisfying ∂g ∂(W 1 ) ij ≤ C 2 (ϕ 1 ,ϕ 2 ,α 1 ,α
Let i ∈ {1, . . . , n 1 } and x 1 , x (i) ∈ [-sup |ϕ 1 |, sup |ϕ 1 |] n 1 two vectors such that x (i) j = x 1 j for j = i. For s ∈ [0, 1] we define ψ(s) = g(sx 1 + (1s)x (i) ). Hence ψ(1) = g(x 1 ) and ψ(0) = g(x (i)

C.2 Concentration of the overlap

This section presents the main steps towards proving Lemma 3. The interested reader can find more details in Section V of [38] where the proof method has been streamlined. One denotes byt, the Gibbs measure associated to the perturbed Hamiltonian

H t (x, a 1 , u; Y, Y , W 1 , W 2 , V) + n 1 i=1 2 ϕ 2 1 W 1 x √ n 0 i , a 1,i -ϕ 1 W 1 X 0 √ n 0 i , A 1,i ϕ 1 W 1 x √ n 0 i , a 1,i - √ ϕ 1 W 1 x √ n 0 i , a 1,i Z i
i.e., the sum of (98) and (109). As already explained, the addition of the second term can be seen as having an extra Gaussian side-channel, described by (110). Hence the Nishimori identity (Proposition 8) is preserved. The corresponding average free entropy is denoted f n, (t) and we call F n, (t) the free entropy for a realization of the quenched variables, that is F n, (t) = n -1 0 ln Z t (Y, Y , Y, W 1 , W 2 , V). Let

L := 1 n 1 n 1 i=1 1 2 ϕ 2 1 W 1 x √ n 0 i , a 1,i -ϕ 1 W 1 X 0 √ n 0 i , A 1,i ϕ 1 W 1 x √ n 0 i , a 1,i - 1 2 √ ϕ 1 W 1 x √ n 0 i , a 1,i Z i .
Up to the prefactor n -1 1 this quantity is the derivative of the perturbation term in (109). The fluctuations of the overlap

Q = 1 n 1 n 1 i=1 ϕ 1 W 1 x √ n 0 i , a 1,i ϕ 1 W 1 X 0 √ n 0 i
, A 1,i and those of L are related through the identity

E (L -E L t, ) 2 t, = 1 4 E ( Q -E Q n,t, ) 2 t, + 1 2 E[ Q2 t, -Q 2 t, ] + 1 4n 2 1 n 1 i=1 E ϕ 2 1 W 1 x √ n 0 i , a 1,i t, . (183)
To see it, first note that L = 1

n 1 n 1 i=1 1 2 (x 1 i ) 2 -X 1 i x 1 i -1 2 √ x 1 i Z i where x 1 i := ϕ 1 W 1 x √ n 0 i
, a 1,i ,

X i i := ϕ 1 W 1 X 0 √ n 0 i
, A 1,i . Then the full derivation in Appendix IX of [38] can be reproduced exactly by doing the identifications X 1 i ↔ S i , x 1 i ↔ X i , n 1 ↔ n. Indeed, the proof in Appendix IX of [38] only involves some algebra using the Nishimori identity (here x 1 plays the role of a sample obtained from the conditional distribution P (X 1 = •|Y, Y , Y, W 1 , W 2 , V)) and integration by parts w.r.t. the Gaussian Ẑi in the perturbation term. Besides, Appendix F.2 of [35] already remarked that the precise form of the first term H t does not matter as long as it is a Hamiltonian whose Gibbs distribution satisfies Nishimori identity. To illustrate this, we are going to prove the following lemma, that is used to obtain (183) and is also useful to prove Lemma 2.

Lemma 10 (Formula for E L t, ). For any > 0,

E L t, = - 1 2 E Q t, . (184)
Proof. From L definition we directly get

E L t, = 1 n 1 n 1 i=1 1 2 E[ (x 1 i ) 2 t, ] -E[X 1 i x 1 i t, ] - 1 2 √ E[ x 1 i t, Z i ] . (185)
The expectation E[X 1 i x 1 i t, ] in the sum easily simplifies to

E ϕ 1 W 1 X 0 √ n 0 i , A 1,i ϕ 1 W 1 x √ n 0 i , a 1,i t, = E X 1 i E ϕ 1 W 1 X 0 √ n 0 i , A 1,i Y, Y , Y, W 1 , W 2 , V = E E X 1 i E X 1 i Y, Y , Y, W 1 , W 2 , V Y, Y , Y, W 1 , W 2 , V = E E X 1 i Y, Y , Y, W 1 , W 2 , V • E X 1 i Y, Y , Y, W 1 , W 2 , V = E x 1 i 2 t, . (186)
These lines of computation just correspond to the Nishimori identity. We detailed them here to make clear how Nishimory identity still applies to the random variables x 1 , X 1 . The third expectation is dealt with an integration by parts w.r.t. Ẑi :

E[ x 1 i t, Z i ] = E ∂ x 1 i t, ∂ Z i = E √ ( (x 1 i ) 2 t, -x 1 i 2 t, ) . (187)
Combining (185), (186), (187) gives the desired result:

E L t, = 1 n 1 n 1 i=1 - 1 2 E[ x 1 i 2 t, ] = - 1 2 1 n 1 n 1 i=1 E[ x 1 i t, X 1 i ] = - 1 2 E Q t, .
Lemma 3 is then a direct consequence of the following: As for the one-layer case, the proof of this proposition is broken in two parts. Notice that

E (L -E L t, ) 2 t, = E (L -L t, ) 2 t, + E ( L t, -E L t, ) 2 . ( 189
)
Thus it suffices to prove the two following lemmas. The first lemma expresses concentration w.r.t. the posterior distribution (or "thermal fluctuations").

Lemma 11 (Concentration of L on L E L ). Under assumptions (H1), (H2) and (H3), we have for any 0 < a < 1,

lim n 0 →+∞ 1 a d E (L -L t, ) 2 t, = 0 . ( 190
)
Proof. The result is a consequence of the convexity properties of the free energy and the Nishimori identity. The proof is similar to the one of Lemma 5.2 in Sec. V of [38]. Here we go quickly through those steps just to illustrate the minor changes. Let F n,t ( ) = n -1 0 ln Z t (Y, Y , Y, W 1 , W 2 , V) and f n,t ( ) = EF n,t ( ). Note that in [38] the authors work with free energies instead of free entropies, i.e. F n,t is defined with a minus sign in front of the logarithm. Here we have:

dF n,t ( ) d = - n 1 n 0 L , 1 n 0 d 2 F n,t ( ) d 2 = n 1 n 0 2 ( L 2 -L 2 ) - 1 4n 2 0 3/2 n 1 i=1 x 1 i Z i , df n,t ( ) d = - n 1 n 0 E L = 1 2n 0 n 1 i=1 E[ x 1 i 2 ] , 1 n 0 d 2 f n,t ( ) d 2 = n 1 n 0 2 E[ L 2 -L 2 ] - 1 4n 2 0 n 1 i=1 E[ (x 1 i ) 2 -x 1 i 2 ] ,
where we made use of (184), (187) and dropped the indices int, to lighten the notations. From the last equation we get The second lemma expresses the concentration of the average overlap w.r.t. the realizations of quenched disorder variables. The proof is similar to the one of Lemma 5.3 in Sec. V of [38], the main change being in the definition of the functions F ( ), f ( ):

E[ L 2 -L 2 ] = n 0 n 2 1 d 2 f n,t ( ) d 2 + 1 4n 2 1 n 1 i=1 E[ (x 1 i ) 2 -x 1 i 2 ] ≤ n 0 n 2 1 d 2 f n,
F ( ) := F n,t ( ) - √ n 0 n 1 i=1 (sup |ϕ 1 |) • | Z i | , f ( ) := f n,t ( ) - √ n 0 n 1 i=1 (sup |ϕ 1 |) • E| Z i | .
The addition of the second term makes F ( ) convex, while f ( ) is convex too (note that f n,t ( ) was already convex, as it can be shown by the same method than the one in Sec. V of [38]). The proof of Lemma 5.3 in [38] can then be reproduced and choosing δ = n -1/4 0 leads to the bound

1 a d E ( L t, -E[ L t, ]) 2 ≤ C n 1/4 0 • (sup |ϕ 1 |) 2 • 1 + 2 π • a ,
for some positive constant C and n 0 large enough.

Figure 1 :

 1 Figure 1: Two models of synthetic data

Figure 5 :

 5 Figure 5: Replica mutual informations between latent and input variables in stochastic networks X → T 1 → T 2 , with equally sized layers N = 1000, inputs drawn from N (0, I N ), weights from N (0, σ 2 I N 2 /N ), as a function of the weight scaling parameter σ. An additive white Gaussian noise N (0, 10 -5 I N ) is added inside the non-linearity. Left column: linear network. Center column: hardtanh-hardtanh network. Right column: ReLU-ReLU network.

Figure 6 :

 6 Figure 6: Training and testing curves for the training of a two-layer neural net on the classification of MNIST for different constraints on the first layer (further details are given in Section3.2).For each version of the experiment the outcomes of two independent runs are plotted with the same color, it is not always possible to distinguish the two runs as they overlap.

Figure 7 :

 7 Figure 7: Independent run outcome for Figure 4 of the main text. Training of two recognition models on a binary classification task with correlated input data and either ReLU (top) or hardtanh (bottom) non-linearities. Left: training and generalization cross-entropy loss (left axis) and accuracies (right axis) during learning. Best training-testing accuracies are 0.995 -0.992 for ReLU version (top row) and 0.998 -0.997 for hardtanh version (bottom row). Remaining colums: mutual information between the input and successive hidden layers. Insets zoom on the first epochs.

Figure 8 :

 8 Figure 8: Example of regression with a 10 hidden-layer student network: 5 USV-layers -ReLU activation -5 USV-layers -ReLu activation -1 unconstrained final linear layer, on dataset generated by a non-linear teacher network: ReLu-linear. Top row, first plot: training and testing MSE loss along learning. Best train loss is 0.015, best test loss is 0.018. Top row, second plot: mutual informations curves of the 10 hidden layers showing the slight accentuation of compression in deeper layers. Remaining: mutual information from each layer displayed separately.

Figure 9 :

 9 Figure 9: Independent run outcome for Figure 8 of the Supplementary Material. Example of regression with a 10 hidden-layer student network: 5 USV-layers -ReLU activation -5 USV-layers -ReLu activation -1 unconstrained final linear layer, on dataset generated by a non-linear teacher network: ReLu-linear. Top row, first plot: training and testing MSE loss along learning. Best train loss is 0.015, best test loss is 0.019. Top row, second plot: mutual informations curves of the 10 hidden layers showing the slight accentuation of compression in deeper layers. Remaining: mutual information from each layer displayed separately.

Figure 10 :

 10 Figure 10: Learning and hidden-layers mutual information curves for a classification problem with correlated input data, using a 4-USV hardtanh layers and 1 unconstrained softmax layer, from 3 different initializations. Top: Initial weights at layer of variance 4/N -1 , best training accuracy 0.999, best test accuracy 0.994. Middle: Initial weights at layer of variance 1/N -1 , best train accuracy 0.994, best test accuracy 0.9937. Bottom: Initial weights at layer of variance 0.25/N -1 , best train accuracy 0.975, best test accuracy 0.974. The overall direction of evolution of the mutual information can be flipped by a change in weight initialization without changing drastically final performance in the classification task.

Figure 11 :

 11 Figure 11: Independent run outcome for Figure 10 of the Supplementary Material. Learning and hidden-layers mutual information curves for a classification problem with correlated input data, using a 4-USV hardtanh layers and 1 unconstrained softmax layer, from 3 different initializations. Top: Initial weights at layer of variance 4/N -1 , best training accuracy 0.999, best test accuracy 0.998. Middle: Initial weights at layer of variance 1/N -1 , best train accuracy 0.9935, best test accuracy 0.9933. Bottom: Initial weights at layer of variance 0.25/N -1 , best train accuracy 0.974, best test accuracy 0.973. The overall direction of evolution of the mutual information can be flipped by a change in weight initialization without changing drastically final performance in the classification task.

Proposition 12 (0 →+∞ 1 ad

 121 Concentration of L on). Under assumptions (H1), (H2) and (H3) we have for any 0 < a < 1,lim n E (L -E L t, ) 2 t, = 0.(188)

Lemma 12 (

 12 Concentration of L on E L ). Under assumptions (H1), (H2) and (H3), we have for any 0 < a < 1,lim n 0 →+∞ 1 a d E ( L t, -E[ L t, ]) 2 = 0 . (191)Proof. It is a consequence of the concentration of the free energy (see Theorem 2 in Appendix C.1).

  Contents 1 Replica formula for the entropy 1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Entropy in single/multi-layer generalized linear models . . . . . . . . . . . . . . . . . 1.3 A simple heuristic derivation of the multi-layer formula . . . . . . . . . . . . . . . . . 1.4 Formulation in terms of tractable integrals . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Solving saddle-point equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Further considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 Proof of the replica formula by the adaptive interpolation method 2.1 Two-layer generalized linear estimation: Problem statement . . . . . . . . . . . . . . 2.2 Important scalar inference channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Replica-symmetric formula and mutual information . . . . . . . . . . . . . . . . . . . 2.4 Interpolating estimation problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 Interpolating free entropy at t=0 and t=1 . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Free entropy variation along the interpolation path . . . . . . . . . . . . . . . . . . . 2.7 Overlap concentration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.8 Canceling the remainder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.9 Lower and upper matching bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Numerical experiments 3.1 Activations comparison in terms of mutual informations . . . . . . . . . . . . . . . . 3.2 Learning ability of USV-layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Additional learning experiments on synthetic data . . . . . . . . . . . . . . . . . . . A Proofs of some technical propositions A.1 The Nishimori identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2 Limit of the sequence (ρ 1 (n 0 )) n 0 ≥1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.3 Properties of the third scalar channel . . . . . . . . . . . . . . . . . . . . . . . . . . . B Proof of Proposition 2 B.1 Proof of (129) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.2 Proof that A n (t) vanishes uniformly as n 0 → ∞ . . . . . . . . . . . . . . . . . . . . . C Concentration of free entropy and overlaps C.1 Concentration of the free entropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.2 Concentration of the overlap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Replica formula for the entropy 1.1 Background

Table 1 :

 1 Training results for MNIST classification of a fully connected 784-500-10 neural net with a ReLU non linearity. The different rows correspond to different specifications of trainable parameters in the first layer (1, 2, 3a, 3b, 3c) describe in the paragraph. We use plain SGD to minimize the cross-entropy loss. All experiments use the same learning rate 0.01 and batchsize of 100 samples. Results are averaged over 5 independent runs, and standard deviations are reported in parentheses.

	First layer type	#train	Train loss Test loss	Train acc	Test acc
		params
	Random (1)	0	0.1745	0.1860	95.05 (0.09) 94.61 (0.02)
	Unconstrained (2) 784 × 500 2-USV (3a) 2 × 500 3-USV (3b) 3 × 500 6-USV (3c) 6 × 500	0.0012 0.0758 0.0501 0.0092	0.0605 0.1326 0.1238 0.1211	100. (0.00) 97.80 (0.07) 96.10 (0.03) 98.18 (0.06) 98.62 (0.05) 96.35 (0.04) 99.93 (0.01) 96.54 (0.17)

  S t . (149) Conditionally on S t , the random variables Under condition (H2), it is not difficult to show that there exists a constant C > 0 such that E P out,2 (Y 1 |S t,1 ) P out,2 (Y 1 |S t,1 )

					P out,2 (Yµ|St,µ) P out,2 (Yµ|St,µ)	1≤µ≤n 2	are i.i.d. and centered. Therefore
	E	n 2 µ=1	P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ )	2	X 0 , A 1 , W 1 , S t = E	n 2 µ=1	P out,2 (Y µ |S t,µ ) P out,2 (Y µ |S t,µ )	2	S t
					= n 2 E	P out,2 (Y 1 |S t,1 ) P out,2 (Y 1 |S t,1 )	2	S t .	(150)

2

S t ≤ C .

  2, we point out that under the hypothesis (H2) all the suprema sup |ϕ k |, sup |ϕ k |, sup |ϕ k | for k ∈ {1, 2} are well-defined, and for all i ∈ {1, . . . , n 1 } |X 1

i | ≤ sup |ϕ 1 | almost surely. C.1.1 Concentration with respect to Gaussian random variables Z, Z , V, U, W 2 , W 1

In this subsection, as in B.1 and to lighten the notations, one will systemically omit the second argument in the functions ϕ 1 , ϕ 2 and their first and second derivatives w.r.t. to their first argument. Here one proves ln Ẑt /n 0 is close to its expectation w.r.t. the Gaussian random variables Z, Z , V, U, W 2 , W 1 , i.e. Lemma 4. Let E G denotes the expectation w.r.t. Z, Z , V, U, W 2 , W 1 only. There exists a positive constant

  2 ,S) /n 3/2 0 for any (i, j) ∈ {1, . . . , n 1 } × {1, . . . , n 0 }, and∇g 2 = (ϕ 1 , ϕ 2 , α 1 , α 2 , S) . Applying Proposition 10 ends the proof. C.1.2 Bounded difference with respect to A 2,µ Next one applies the variance bound of Lemma 11 to show n -1 0 E G [ln Ẑt ] concentrates w.r.t. A 2 , while keeping X 1 fixed for the moment. Lemma 8. Let E G ,A 2 denotes the expectation w.r.t. Z, Z , V, U, W 2 , W 1 , A 2 only. There exists a positive constant C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) such that Proof. Consider g = E G [ln Ẑt] /n 0 as a function of A 2 only. Let ν ∈ {1, . . . , n 2 }. One wants to estimate the variation g(A 2 )g(A = A 2,µ for µ = ν. The notations Ĥ(ν) Ĥt and Γ t,µ where A 2 is replaced by A -Γ t,ν ) ≤ 8 sup |ϕ 2 | 2 + 4|Z ν | sup |ϕ 2 |. From (179) we conclude that g satisfies the bounded difference property: |g(A 2 )g(A One now proves the last lemma needed to get Theorem 2, i.e. Lemma 9. There exists a positive constant C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) such that E E G ,A 2 Proof. One sees that n -1 0 E G ,A 2 [ln Ẑt ] is a function of X 1 only. Consider g(x 1 ) = n -1 0 E[ln Ẑt |X 1 = x 1 ]. Note that n -1 0 E G ,A 2 [ln Ẑt ] = g(X 1

				n 1 i=1 n 0 1 ln Ẑt -E G ,A 2 n 0 j=1 ∂g ∂(W 1 ) ij 2 E E G 2 ≤ 1 n 0 • n 1 n 0 1 n 0 ln Ẑt 2 ≤ • C 2 1 n 0 ln Ẑt -E 1 n 0 ln Ẑt 2 ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 n 0 .	.	(178) (181)
	and A	(ν) 2 with A	(ν) 2 ) for two configurations A 2 2 , respectively. By an application of Jensen's inequality one finds 2,µ (ν) (ν)
					1 n 0	E G	Ĥ(ν)		1 n 0	E G	Ĥ(ν) t -Ĥt Ĥt	(179)
	where the Gibbs brackets pertain to the effective Hamiltonians (169). From (169) we obtain
	Ĥ(ν) t -Ĥt = 1 2∆	n 2 µ=1	Γ (ν)2 t,µ -Γ 2 t,µ + 2Z µ (Γ	(ν) t,µ -Γ t,µ ) =	1 2∆	Γ (ν)2 t,ν -Γ 2 t,ν + 2Z ν (Γ	(ν)
	Notice that Γ	(ν)2 t,ν -Γ 2 t,ν + 2Z ν (Γ	(ν) t,ν (ν) 2 )| ≤	2 sup |ϕ 2 | ∆n 0	2 sup |ϕ 2 | +	2 π	.	(180)
	Lemma 8 follows then by an application of Proposition 11.
	C.1.3 Bounded difference with respect to X 1 i

t and Γ (ν) t,µ will denote the quantities t -Ĥt Ĥ(ν) t ≤ g(A)g(A (ν) ) ≤ t,ν -Γ t,ν ) .

  ). If we can prove that|ψ (s)| ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 ∀s ∈ [0, 1] ,(182)then the bounded difference property follows, namelysup x 1 ,x (i) |g(x 1 )g(x (i) )| ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 0 . Let Ẽ[ • ] := E[ • |X 1 = sx 1 + (1s)x (i)]. The derivative of ψ satisfies while for every µ ∈ {1, . . . , n 2 } integration by parts w.r.t. (W 2 ) µi givesẼ (Γ t,µ + √ ∆Z µ )∆ -1 ∂Γ t,µ ∂X 1 (t) V µ + k 2 (t) U µ , A 2,µ Ĥt ≤ C(ϕ 1 , ϕ 2 , α 1 , α 2 , S) n 1for some positive constant C(ϕ 1 , ϕ 2 , α 1 , α 2 , S). Hence the condition (182) is satisfied, ending the proof of the lemma.C.1.4 Proof of Theorem 2From Lemmas 4, 8, 9 above, one obtains the bound , ϕ 2 , α 1 , α 2 , S) n 0 ,where the equality of the first line follows simply of the Pythagorean theorem. As mentioned before, this implies Theorem 2 thanks to (167).

	|ψ (s)| = One has Ẽ |x 1 i -x n 0 √ rt √ (i) i | rtX 1 Ẽ ∂ Ĥt ∂X 1 i ≤ 2 sup |ϕ 1 | Ĥt n 0 i -√ rtϕ 1 i Ĥt = Ẽ (Γ t,µ + √ ∆Z µ ) 1 -t n 1 (W 2 ) µi ϕ 2 n 2 µ=1 + W 1 x Ẽ (Γ t,µ + 2 sup |ϕ 1 | n 0 Ẽ √ n 0 i + Z i 1 -t n 1 W 2 X 1 √ ∆Z µ )∆ -1 ∂Γ t,µ ∂X 1 i √ rt √ rtX 1 i -√ Ĥt ≤ Ẽ √ rt( √ rt 2 sup |ϕ 1 | + |Z i |) Ĥt rtϕ 1 W 1 x √ n 0 i + Z i ≤ rt 2 sup |ϕ 1 | + 2rt π , µ ln Ẑt n 0 = E   ln Ẑt n 0 -E G ln Ẑt n 0 2   + E   E G ln Ẑt n 0 2 ln Ẑt -E G ,A 2 n 0 + E   E G ,A 2 ln Ẑt n 0 -E ln Ẑt n 0 2   + k 1 Var ≤ C(ϕ 1	Ĥt  

Note that due to the central limit theorem, ρ can be evaluated from ρ -1 using ρ = dtdz P (t|z)N (z; 0, ρ -1 ) t

.

δ hϕ 1 ( √ q V + √ ρq u, a) .(90)

(y 0 -√ rϕ 1 ( √ q 0 V + √ ρ 0 -q 0 U,A 1 )) 2

Acknowledgments

The authors would like to thank Léon Bottou, Antoine Maillard, Marc Mézard and Galen Reeves for insightful discussions. This work has been supported by the ERC under the European Union's FP7 Grant Agreement 307087-SPARCS and the European Union's Horizon 2020 Research and Innovation Program 714608-SMiLe, as well as by the French Agence Nationale de la Recherche under grant ANR-17-CE23-0023-01 PAIL. Additional funding is acknowledged by MG from "Chaire de recherche sur les modèles et sciences des données", Fondation CFM pour la Recherche-ENS; by AM from Labex DigiCosme; and by CL from the Swiss National Science Foundation under grant 200021E-175541. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan Xp GPU used for this research.