Bayesian Inference with Shaped Deep Non-linear MLPs

Boris Hanin, Tianze JiangarXiv 2026

TL;DR

This paper provides a mathematically rigorous framework for analyzing Bayesian inference in deep, non-linear neural networks where depth, width, and dataset size all scale up simultaneously. By leveraging Neural Covariance Stochastic Differential Equations (SDEs), the authors prove that the complex predictive posterior simplifies to a data-dependent kernel method to first order. Crucially, they deliver a clear mathematical criterion determining exactly when increasing network depth boosts Bayesian model evidence.

What Problem Does This Paper Address?

Deep learning theory often struggles to explain how networks make predictions when both the model size and the dataset size are massive. Standard approaches simplify this by taking the "infinite width" limit at a fixed depth, leading to well-known regimes like the Neural Network Gaussian Process (NNGP) or Neural Tangent Kernel (NTK).

However, these infinite-width limits often erase the very things that make deep networks powerful: the cumulative effects of depth and the capacity for feature learning. To capture these phenomena, theorists must scale depth ($L$), width ($N$), and dataset size ($P$) together. Because these limits do not commute, finding a rigorous mathematical framework to analyze deep, non-linear networks in this joint scaling regime ($LP \propto N$) has remained an open challenge.

Methods

The authors tackle this challenge from a Bayesian inference perspective using several key mathematical techniques:

  • Shaped Activation Functions: To prevent the network's outputs from degenerating or exploding as depth $L \to \infty$, they scale down the non-linearity at each layer using a shaping factor $s \propto \sqrt{N}$ or $\sqrt{L}$. This ensures that linear and non-linear effects remain balanced.
  • Neural Covariance SDEs (NSDE): They build on recent probability theory that models the layer-by-layer evolution of a network's internal representations as a continuous-time diffusion process (an SDE), where the "depth-time" is controlled by the ratio $\tau = LP/N$.
  • Perturbative Expansion: Since solving the full SDE is generally intractable for arbitrary depths, the authors perform a first-order Taylor expansion around $\tau = 0$ (small effective depth). This allows them to compute closed-form expressions for the Bayesian partition function, model evidence, and predictive posterior.

Datasets

This is a purely theoretical paper, so no real-world empirical datasets (such as ImageNet or MNIST) were used. Instead, the mathematical proofs assume a generic training dataset $\mathcal{D} = \{(x_\mu, y_\mu)\}$ under a few structural assumptions: the number of samples $P$ is less than the input dimension $N_0$, and the initial input Gram matrix is full-rank and well-behaved (resembling Marchenko-Pastur-type random matrices typical of isotropic Gaussian inputs).

Key Insights and Ideas

  • The Simplicity of Deep Posteriors: Despite the highly non-linear and stochastic nature of deep networks, to first order in effective depth ($\tau$), the Bayesian predictive posterior remains remarkably simple—it behaves exactly like a data-dependent kernel method.
  • When Depth Actually Helps: Deeper isn't always better. The paper uncovers a phase transition showing that increasing depth only increases Bayesian model evidence if the network's non-linearity isn't "too strong" relative to the data distribution.
  • Unifying Linear and Non-linear Theory: The framework beautifully splits the first-order change in model evidence into two distinct, additive pieces: a linear network component (governed by diffusion/stochasticity) and an infinite-width non-linear component (governed by drift/deterministic kernel changes).

Key Results

  • Theorem 1 (MLP to SDE Convergence): Proves that the partition function of a finite multi-layer perceptron rigorously converges to the partition function derived from the continuous SDE framework as $L, N \to \infty$.
  • Takeaway 3.1 & 3.2 (Evidence Criteria): Provides explicit algebraic inequalities for both smooth and ReLU activation functions. For instance, under normalized and approximately orthogonal inputs, depth benefits the model if and only if a specific balance between the target labels ($y$), the regularization temperature ($\beta$), and the activation function's derivatives is satisfied.

Limitations and Future Work

  • Small-Depth Assumption: The most explicit, actionable insights rely on a small depth-time perturbation (small $\tau = LP/N$). Fully solving the SDE dynamics for large, deep-time regimes remains an open problem.
  • Sequential Limits: The proofs rely on a sequential limit (width and depth go to infinity first, followed by dataset size and input dimension), though the authors conjecture these limits commute.
  • Loss Function Focus: The detailed perturbative calculations are optimized for squared error loss; extending the explicit formulas to cross-entropy loss is conceptually viable but left for future work.

Summary updated

BibTeX
@misc{hanin2026bayesian,
  author = {Boris Hanin and Tianze Jiang},
  title = {{Bayesian Inference with Shaped Deep Non-linear MLPs}},
  year = {2026},
  eprint = {2605.30860},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.30860},
}
Figure