The Role of Mutual Information in Variational Classifiers

Matías Vera, Leonardo Rey Vega, Pablo Piantanida · OpenReview

Abstract

Overfitting data is a well-known phenomenon related with the generation of a model that mimics too closely (or exactly) a particular instance of data, and may therefore fail to predict future observations reliably. In practice, this behaviour is controlled by various--sometimes heuristics--regularization techniques, which are motivated by developing upper bounds to the generalization error. In this work, we study the generalization error of classifiers relying on stochastic encodings trained on the cross-entropy loss, which is often used in deep learning for classification problems. We derive bounds to the generalization error showing that there exists a regime where the generalization error is bounded by the mutual information between input features and the corresponding representations in the latent space, which are randomly generated according to the encoding distribution. Our bounds provide an information-theoretic understanding of generalization in the so-called class of variational classifiers, which are regularized by a Kullback-Leibler (KL) divergence term. These results give theoretical grounds for the highly popular KL term in variational inference methods that was already recognized to act effectively as a regularization penalty. We further observe connections with well studied notions such as Variational Autoencoders, Information Dropout, Information Bottleneck and Boltzmann Machines. Finally, we perform numerical experiments on MNIST and CIFAR datasets and show that mutual information is indeed highly representative of the behaviour of the generalization error.

Introduction

In the field of deep learning, the ability of a model to generalize from training data to unseen observations is paramount. A common challenge is overfitting, where a model captures noise or specificities of the training set rather than the underlying data distribution. To mitigate this, practitioners employ various regularization techniques. Among the most successful are those that incorporate a Kullback-Leibler (KL) divergence term into the loss function, a staple in Variational Autoencoders (VAEs) and Information Bottleneck (IB) frameworks.

While these methods have demonstrated empirical success, a rigorous theoretical foundation explaining why they enhance generalization in classification tasks using cross-entropy loss has remained partially elusive. This paper addresses this gap by quantifying the relationship between the "compression" of information in a latent space and the resulting generalization gap.

Theoretical Framework: Stochastic Encodings and Information Bounds

The authors formalize the problem through the lens of stochastic encodings. Instead of a deterministic mapping from an input $X$ to a latent representation $U$, the model learns a conditional distribution $q(u|x)$. This stochasticity is central to the variational approach.

The core theoretical contribution is Theorem 1, which establishes a new PAC-learning bound. The derivation involves several key steps:

  1. Input Space Discretization: Borrowing from algorithmic robustness theory, the authors partition the input space into discrete cells. This allows for the application of information-theoretic measures to continuous data regimes.
  2. Decoder Decoupling: The influence of the encoder (representation learning) is separated from the decoder (classification), allowing for a more granular analysis of how each component affects generalization.
  3. Information-Theoretic Bound: The primary result shows that the difference between the true expected cross-entropy and the empirical cross-entropy is upper-bounded by a term proportional to $\sqrt{\frac{I(U;X) \log n}{n}}$. Here, $I(U;X)$ represents the mutual information between the input and its latent representation, and $n$ is the number of training samples.
Table 1: Summary of symbols and notation used in the theoretical derivations.

This bound provides a formal justification for the Information Bottleneck objective: a model should aim to maximize predictive accuracy while simultaneously minimizing the information the latent space retains about the input. In this context, mutual information $I(U;X)$ serves as a proxy for "information complexity." A model that stores excessive detail about the input is more prone to memorization and, consequently, overfitting.

Experimental Validation

The theoretical findings were validated across several standard benchmarks, including MNIST (handwritten digits) and CIFAR-10 (natural images). To ensure the results were not limited to image data, the authors also included experiments on the Forest Cover Type dataset.

Key experimental insights include:

  • Universal Behavior: The predicted relationship between mutual information and generalization error holds across diverse architectures, including standard Variational Classifiers with Normal encoders, Information Dropout (Log-Normal encoders), and Restricted Boltzmann Machines (RBMs).
  • Qualitative Alignment: Although the mathematical constants in the derived bounds may not be perfectly "tight" in an absolute sense, the behavior of the mutual information closely mirrors the behavior of the generalization error. As the regularization strength (the Lagrange multiplier $\lambda$ penalizing mutual information) increases, both the measured mutual information and the actual generalization gap decrease in tandem.
  • Calibration and Cross-Entropy: The authors highlight that cross-entropy is a more informative metric than simple error probability because it accounts for model calibration—the degree of confidence associated with its predictions.

Discussion and Future Directions

This work establishes a solid information-theoretic bridge between latent representations and generalization. It confirms that the popular KL term in variational methods acts as an effective regularization penalty by controlling the information flow.

However, several avenues for future research remain:

  • Tightness of Bounds: Future work could focus on refining the absolute constants in the bounds to make them tighter, although the current work successfully captures the essential scaling behavior ($O(n^{-1/2} \log n)$).
  • Estimation in High Dimensions: Estimating mutual information in high-dimensional spaces is computationally intensive. While variational upper bounds (KL terms) are effective proxies, more direct estimation methods could be explored.
  • Scaling to Modern Architectures: Investigating how these bounds behave in very large-scale models, such as Transformers, would be a valuable extension.
  • Novel Regularizers: The derived bound suggests that new regularization techniques specifically targeting the square root of mutual information might offer further improvements in model generalization.

By providing a theoretical ground for heuristic practices, this research paves the way for more principled designs of variational classifiers and information-constrained neural networks.

Summary updated

Abstract

Overfitting data is a well-known phenomenon related with the generation of a model that mimics too closely (or exactly) a particular instance of data, and may therefore fail to predict future observations reliably. In practice, this behaviour is controlled by various--sometimes heuristics--regularization techniques, which are motivated by developing upper bounds to the generalization error. In this work, we study the generalization error of classifiers relying on stochastic encodings trained on the cross-entropy loss, which is often used in deep learning for classification problems. We derive bounds to the generalization error showing that there exists a regime where the generalization error is bounded by the mutual information between input features and the corresponding representations in the latent space, which are randomly generated according to the encoding distribution. Our bounds provide an information-theoretic understanding of generalization in the so-called class of variational classifiers, which are regularized by a Kullback-Leibler (KL) divergence term. These results give theoretical grounds for the highly popular KL term in variational inference methods that was already recognized to act effectively as a regularization penalty. We further observe connections with well studied notions such as Variational Autoencoders, Information Dropout, Information Bottleneck and Boltzmann Machines. Finally, we perform numerical experiments on MNIST and CIFAR datasets and show that mutual information is indeed highly representative of the behaviour of the generalization error.
BibTeX
@article{vera2023role,
  author = {Matías Vera and Leonardo Rey Vega and Pablo Piantanida},
  title = {{The Role of Mutual Information in Variational Classifiers}},
  journal = {Machine Learning},
  year = {2023},
  doi = {10.1007/s10994-023-06337-6},
}
Figure