[Paper Review] Is SGD a Bayesian sampler? Well, almost
This paper investigates whether stochastic gradient descent (SGD) acts as a Bayesian sampler in overparameterized deep neural networks. Using Gaussian processes to estimate Bayesian posteriors, it finds that SGD's convergence probability to a function $f$ given training data $S$ closely correlates with the Bayesian posterior $P_{\textrm{B}}(f|S)$, indicating that the primary inductive bias for generalization arises from the parameter-function map of untrained networks, not SGD itself.
Overparameterised deep neural networks (DNNs) are highly expressive and so can, in principle, generate almost any function that fits a training dataset with zero error. The vast majority of these functions will perform poorly on unseen data, and yet in practice DNNs often generalise remarkably well. This success suggests that a trained DNN must have a strong inductive bias towards functions with low generalisation error. Here we empirically investigate this inductive bias by calculating, for a range of architectures and datasets, the probability $P_{SGD}(f\mid S)$ that an overparameterised DNN, trained with stochastic gradient descent (SGD) or one of its variants, converges on a function $f$ consistent with a training set $S$. We also use Gaussian processes to estimate the Bayesian posterior probability $P_B(f\mid S)$ that the DNN expresses $f$ upon random sampling of its parameters, conditioned on $S$. Our main findings are that $P_{SGD}(f\mid S)$ correlates remarkably well with $P_B(f\mid S)$ and that $P_B(f\mid S)$ is strongly biased towards low-error and low complexity functions. These results imply that strong inductive bias in the parameter-function map (which determines $P_B(f\mid S)$), rather than a special property of SGD, is the primary explanation for why DNNs generalise so well in the overparameterised regime. While our results suggest that the Bayesian posterior $P_B(f\mid S)$ is the first order determinant of $P_{SGD}(f\mid S)$, there remain second order differences that are sensitive to hyperparameter tuning. A function probability picture, based on $P_{SGD}(f\mid S)$ and/or $P_B(f\mid S)$, can shed new light on the way that variations in architecture or hyperparameter settings such as batch size, learning rate, and optimiser choice, affect DNN performance.
Motivation & Objective
- To investigate whether SGD in overparameterized deep neural networks (DNNs) behaves as a Bayesian sampler by comparing its function selection probability to a Bayesian posterior.
- To determine whether the inductive bias enabling generalization in DNNs stems from SGD's optimization dynamics or from the parameter-function map of untrained networks.
- To quantify the extent to which hyperparameter tuning and optimiser choice affect the second-order deviations between SGD's function selection and the Bayesian posterior.
- To develop a function probability framework based on $P_{\textrm{SGD}}(f|S)$ and $P_{\textrm{B}}(f|S)$ for analyzing how architectural and hyperparameter choices impact DNN generalization.
- To assess the implications of this function probability picture for uncertainty quantification and model design, particularly in relation to Deep Ensembles.
Proposed method
- Empirically estimate $P_{\textrm{SGD}}(f|S)$, the probability that SGD converges on a function $f$ consistent with a training set $S$, across various DNN architectures and datasets.
- Use Gaussian processes to non-parametrically estimate the Bayesian posterior $P_{\textrm{B}}(f|S)$, representing the probability that a randomly sampled untrained DNN expresses function $f$ given $S$.
- Compare $P_{\textrm{SGD}}(f|S)$ and $P_{\textrm{B}}(f|S)$ on a log scale to assess their correlation and identify deviations.
- Analyze the role of the parameter-function map by evaluating the prior bias in untrained DNNs, particularly the exponential bias toward low-complexity, low-error functions.
- Systematically vary hyperparameters such as learning rate, batch size, and optimiser choice to measure their impact on second-order differences between $P_{\textrm{SGD}}(f|S)$ and $P_{\textrm{B}}(f|S)$.
- Use the function probability perspective to interpret and compare model performance across different architectures and training configurations.
Experimental results
Research questions
- RQ1To what extent does SGD's function selection probability $P_{\textrm{SGD}}(f|S)$ correlate with the Bayesian posterior $P_{\textrm{B}}(f|S)$ in overparameterized DNNs?
- RQ2Is the inductive bias for generalization in DNNs primarily due to SGD's optimization dynamics or to the inherent parameter-function map of untrained networks?
- RQ3How do hyperparameter choices such as learning rate, batch size, and optimiser type affect the second-order deviations between $P_{\textrm{SGD}}(f|S)$ and $P_{\textrm{B}}(f|S)$?
- RQ4Can the function probability framework $P_{\textrm{SGD}}(f|S)$ and $P_{\textrm{B}}(f|S)$ provide a more nuanced understanding of DNN generalization than average test error alone?
- RQ5Does the observed correspondence between SGD and Bayesian sampling justify the use of Deep Ensembles for uncertainty quantification in DNNs?
Key findings
- The probability $P_{\textrm{SGD}}(f|S)$ that SGD converges on a function $f$ consistent with training data $S$ correlates remarkably well with the Bayesian posterior $P_{\textrm{B}}(f|S)$, especially on a log scale.
- The Bayesian posterior $P_{\textrm{B}}(f|S)$ is strongly biased toward low-generalization-error and low-complexity functions, indicating that the parameter-function map of untrained DNNs is a primary source of inductive bias.
- Second-order deviations between $P_{\textrm{SGD}}(f|S)$ and $P_{\textrm{B}}(f|S)$ are sensitive to hyperparameter tuning, such as learning rate and batch size, suggesting SGD introduces subtle, non-Bayesian effects.
- The primary explanation for generalization in overparameterized DNNs lies in the inductive bias of the parameter-function map, not in special properties of SGD itself.
- The function probability picture based on $P_{\textrm{B}}(f|S)$ and $P_{\textrm{SGD}}(f|S)$ offers a more fine-grained analysis tool than average test error for evaluating hyperparameter and architectural choices.
- The close correspondence between SGD and Bayesian sampling provides theoretical justification for using Deep Ensembles to quantify prediction uncertainty in DNNs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.