Towards Better Generalization via Distributional Input Projection Network

Yifan Hao, Yanxin Lu, Xinwei Shen, Tong Zhang · DOI

Abstract

Modern overparameterized neural networks often achieve near-zero training loss but struggle with generalization on unseen data due to sharp loss landscapes. We introduce Distributional Input Projection Networks (DIPNet), a novel architectural framework that improves generalization by injecting learnable stochasticity at every layer. By projecting inputs into learnable Gaussian distributions rather than passing deterministic values, DIPNet effectively reduces the network's Lipschitz constant and induces a flatter loss landscape. Our experiments across Vision Transformers, Large Language Models (LLMs), and tabular data demonstrate that DIPNet consistently enhances performance and robustness against distribution shifts and adversarial attacks, while maintaining inference efficiency through model distillation.

Introduction

In contemporary deep learning, the gap between training performance and real-world generalization remains a critical challenge. The "sharpness" or instability of a model’s loss landscape is frequently identified as the primary culprit behind poor generalization. While techniques like Sharpness-Aware Minimization (SAM) or Adversarial Training attempt to find flatter regions, they often suffer from a "robustness-accuracy trade-off," where gains in stability come at the cost of standard accuracy. Furthermore, traditional random smoothing—which injects noise only at the input—often fails to provide sufficient stability deep within a network's non-linear transformations.

The DIPNet Architecture

The core innovation of DIPNet is the replacement of standard deterministic layer transitions with a distributional projection mechanism. Instead of passing a deterministic vector $v$ to the subsequent layer, DIPNet projects $v$ into a Gaussian distribution $\mathcal{N}(v, \Sigma)$, where $\Sigma$ is a learnable variance parameter.

Architecture of the DIPNet framework, illustrating the internal structure of a DIPNet layer and the distillation process for inference.

As shown in the figure above, this process occurs at every layer of the network hierarchy. This fine-grained, layer-wise stochasticity allows the model to learn the optimal level of "blurriness" or regularization required at each stage of feature extraction. Theoretically, this approach reduces the Lipschitz constant of the network, preventing gradient explosion and fostering a more stable mapping from input to output.

Training and Inference via Distillation

Training a DIPNet involves optimizing a loss function derived from the Evidence Lower Bound (ELBO). To ensure the model does not become excessively erratic due to the injected noise, a stability penalty is added to minimize the variance of the final output.

Because running a stochastic model at inference time is computationally expensive—requiring multiple forward passes to average out noise—the authors employ model distillation. A deterministic "student" model is trained to mimic the smoothed "teacher" DIPNet. This allows the final deployed model to retain the generalization benefits of the distributional approach without the computational overhead of sampling.

Experimental Evaluation

The authors validated DIPNet across a diverse set of benchmarks, demonstrating its versatility:

  • Computer Vision: On CIFAR-100 using ViT-Tiny, DIPNet achieved an average accuracy of 55.28% across clean and adversarial (FGSM) settings, outperforming both the standard baseline (50.64%) and SAM (51.04%).
  • LLM Reasoning: DIPNet was applied to fine-tune state-of-the-art open models on the GSM8K benchmark. For instance, Gemma-3-12B saw its reasoning accuracy improve from 72.78% to 74.22%.
  • Out-of-Distribution (OOD) Robustness: Using the Shifts dataset for weather prediction, DIPNet reduced the Mean Squared Error (MSE) on OOD test sets from 0.0662 to 0.0627, highlighting its superior handling of unseen environments.
  • Tabular Data: The framework also showed consistent gains in regression tasks such as air quality and electricity demand forecasting.

Conclusion and Future Work

DIPNet offers a robust alternative to traditional regularization and smoothing techniques. By embedding learnable stochasticity directly into the network architecture, it achieves a flatter loss landscape and better generalization without the typical accuracy trade-offs. While the current implementation requires careful tuning of the stability penalty and involves a more intensive training phase, its success across vision, language, and tabular domains marks it as a significant step toward more reliable deep learning models. Future research may explore scaling DIPNet to frontier models exceeding 100B parameters and applying the framework to reinforcement learning tasks.

Summary updated

BibTeX
@misc{hao2025towards,
  author = {Yifan Hao and Yanxin Lu and Xinwei Shen and Tong Zhang},
  title = {{Towards Better Generalization via Distributional Input Projection Network}},
  year = {2025},
  eprint = {2506.04690},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.04690},
}
Figure