Why Modern Neural Networks Shouldn't Work (And Why They Do)

The generalization problem in neural networks: why classical theory can't explain it, what research says today, and how I'm approaching it.

· Pietro Abruzzo(Founder of DuckSoft)

Hi! If you have read my recently published blog "A New Direction", you may know that I am studying a problem in Theoretical Machine Learning(TML) which is called the Generalization problem. If you took a traditional statistics class, you were probably taught a fundamental rule: never overfit your data. If your model has way more parameters than training samples, it will simply memorize noise and fail miserably on any new data.

In classical machine learning, we call this the bias-variance tradeoff. But deep learning completely breaks this rule (Belkin et al., 2019) [2]! Modern neural networks have millions (or billions) of parameters, yet they generalize remarkably well to unseen data.

Let's dive into why this happens, how we formulate this mathematically, and where the frontier of research stands today.


1. The Core Intuition: The Overparameterization Paradox

Why is finite-width generalization such a headache for theoretical machine learning?

1. Memorization vs. Generalization

In a famous paper, Zhang et al. (2017) [1] showed that standard finite-width neural networks can easily achieve 100% training accuracy on image datasets where the labels have been completely randomized! The network has enough raw capacity to act like a giant lookup table.

So why, when we feed them real labels, do they learn meaningful features instead of just memorizing the training set?

2. The Problem with Infinite-Width Shortcuts

To explain deep learning, theorists often make neural networks infinitely wide (\(d \to \infty\)). Under infinite width:

  • Neural Tangent Kernel (NTK) (Jacot et al., 2018) [3]: As width goes to infinity, gradient descent behaves like a simple linear model over a fixed kernel.
  • Mean-Field Limit (Mei et al., 2018) [4]: Captures feature dynamics by treating weight layers as continuous probability distributions.

The Catch: Real-world networks are finite-width. Infinite-width models operate in what's called "lazy training"—their weights barely move during training! Finite-width networks, on the other hand, actively reshape their representations and learn features (Fort et al., 2020) [5]. Infinite-width theory misses the exact secret sauce that makes finite-width networks powerful.


2. The Math

Let's ground this intuition with some accessible math. Suppose we have a dataset \(S = \{(x_i, y_i)\}_{i=1}^n\) drawn from an unknown true distribution \(\mathcal{D}\). Our finite-width network \(f_w(x)\) has parameters \(w \in \mathbb{R}^p\).

The Generalization Gap

We care about two quantities:

  1. Training Risk (Empirical Risk): How well we do on our training set. \[ \hat{\mathcal{R}}_S(w) = \frac{1}{n} \sum_{i=1}^n \ell(f_w(x_i), y_i) \]
  2. True Risk (Population Risk): How well we do on the rest of the world. \[ \mathcal{R}(w) = \mathbb{E}_{(x, y) \sim \mathcal{D}} [\ell(f_w(x), y)] \]

The Generalization Gap is simply:

\[ \text{Gap}(w) = \mathcal{R}(w) - \hat{\mathcal{R}}_S(w) \]

Why Standard Theory Fails Here

Classical statistical theory bounds this gap using Rademacher Complexity \(\mathcal{R}_n(\mathcal{F})\), which measures how well a function class \(\mathcal{F}\) can fit random noise:

\[ \mathcal{R}_n(\mathcal{F}) = \mathbb{E}_{\sigma} \left[ \sup_{f \in \mathcal{F}} \frac{1}{n} \sum_{i=1}^n \sigma_i f(x_i) \right], \quad \text{where } \sigma_i \in \{-1, +1\} \]

Because finite-width networks can memorize random labels, their Rademacher complexity is huge! Nagarajan & Kolter (2019) [6] proved that standard uniform convergence bounds become vacuous (meaning the calculated bound on error is greater than 100%) for overparameterized networks.

The Modern Way: PAC-Bayes and Margins

To fix this, researchers use PAC-Bayesian bounds (McAllester, 1999) [7]. Instead of looking at all possible networks, we look at a distribution \(Q\) centered around the specific weights \(w^*\) our optimizer found, relative to a prior \(P\):

\[ \text{Expected Generalization Bound} \le \text{Training Loss} + \mathcal{O}\left(\sqrt{\frac{D_{KL}(Q \parallel P)}{n}}\right) \]

This tells us that if the optimizer lands in a region where small perturbations to \(w^*\) don't destroy performance (\(D_{KL}\) stays small), the network will generalize! (Bartlett et al., 2017) [8].


3. My Approach

My methodological approach differs from conventional methods. Rather than interpreting weight layers as probability distributions, I integrate principles of classical mechanics with theoretical machine learning by conceptualizing each weight as an individual particle. To illustrate, envision a system where each weight functions like a particle within a gas-filled container. Since the precise movement of these particles is uncertain, classical mechanics is employed to predict their trajectories. Similarly, I formulate equations of motion for the entire system of weights, effectively modeling the neural network as a dynamic physical system. Although this research has not yet yielded significant breakthroughs, it continues to progress in a promising direction, fostering a deepening interest in the subject matter.

4. How Science Explains Finite-Width Generalization Today

So, what is actually steering finite-width networks toward good solutions? There are three main theoretical breakthroughs:

1. Implicit Bias of Optimizers (SGD)

Stochastic Gradient Descent (SGD) doesn't just minimize loss—it has an implicit preference for simple solutions (Gunasekar et al., 2018) [9]. For instance, Soudry et al. (2018) [10] proved that on separable data, SGD automatically maximizes the margin, effectively picking the simplest classifier out of infinitely many valid ones.

2. Loss Landscape Geometry & Flat Minima

Not all zero-loss points are created equal. Modern networks land in flat minima—broad valleys in the loss landscape where moving slightly away from \(w^*\) doesn't increase the loss.

  • SGD's batch noise acts like thermal shaking, knocking the optimizer out of narrow, sharp ditches into wide, stable valleys (Chaudhari & Soatto, 2018) [11].
  • Algorithms like Sharpness-Aware Minimization (SAM) explicitly hunt for these flat regions to boost test performance (Foret et al., 2021) [12].

3. Finite-Width Corrections (\(1/d\) Expansions)

The most recent push in theoretical physics and ML uses perturbation theory to fix infinite-width models. By calculating \(1/d\) corrections (where \(d\) is width), researchers like Hanin & Nica (2020) [13] and Yaida (2020) [14] can model how finite-width networks build feature correlations that infinite-width models miss.


5. What Happens When We Solve This? (Consequences & Applications)

Solving the finite-width generalization problem isn't just an academic flex. Unlocking a complete, predictive mathematical theory of finite-width generalization would fundamentally transform how we build, deploy, and trust AI systems:

1. End of Trial-and-Error Architecture Design

Currently, deep learning relies heavily on empirical trial and error—spending millions of compute hours trying different hyperparameter grids, layer widths, and learning rates. A complete theory would provide exact scaling laws from first principles, allowing engineers to calculate the optimal width, depth, learning rate, and batch size before launching training runs.

2. Reliable Performance Guarantees for Safety-Critical AI

In fields like autonomous driving, medical diagnostics, and aviation, empirical success is not enough. Regulatory bodies require safety guarantees. Solving generalization means moving from probabilistic heuristics to non-vacuous, deterministic bounds that guarantee maximum failure rates on unseen distribution shifts.

3. Data-Efficient Deep Learning

Understanding the exact mechanisms behind generalization will reveal what data actually matters. Instead of training on trillions of web tokens or millions of images, precise generalization bounds will allow us to curate minimal, optimal training sets that yield identical generalization performance with a fraction of the data and energy.

4. Principled Model Compression (Pruning & Distillation)

Engineers often struggle to prune networks without destroying generalization capabilities. A precise understanding of finite-width feature dynamics will tell us which parameter dimensions contribute to flat minima and which ones are redundant, paving the way for lossless model distillation and edge deployment.


6. Conclusion

As you may have observed, this represents an ideal balance between theoretical concepts and practical application, which I particularly appreciate. You might wonder how a 14-year-old could address a problem that has remained unsolved by many experienced researchers over several decades. I ask myself the same question; however, my primary goal is not necessarily to solve the problem(although that would be nice) but to gain insight into the research process and deepen my understanding of mathematics along the way. I hope you found this post engaging and stimulating. Thank you for your time.


References

  1. Zhang, C., Bengio, S., Hardt, M., Recht, B., & Vinyals, O. (2017). Understanding deep learning requires rethinking generalization. ICLR.
  2. Belkin, M., Hsu, D., Ma, S., & Mandal, S. (2019). Reconciling modern machine-learning practice and the classical bias–variance trade-off. PNAS, 116(32), 15849-15854.
  3. Jacot, A., Gabriel, F., & Hongler, C. (2018). Neural tangent kernel: Convergence and generalization in neural networks. NeurIPS, 31.
  4. Mei, S., Montanari, A., & Nguyen, P. M. (2018). A mean field view of the landscape of two-layer neural networks. PNAS, 115(33), E7665-E7671.
  5. Fort, S., Dziugaite, G. K., Paul, M., Kharaghani, S., Roy, D. M., & Ganguli, S. (2020). Deep learning versus kernel learning: an empirical study of loss landscape geometry and the time evolution of the Neural Tangent Kernel. NeurIPS, 33.
  6. Nagarajan, V., & Kolter, J. Z. (2019). Uniform convergence may be unable to explain generalization in deep learning. NeurIPS, 32.
  7. McAllester, D. A. (1999). Some PAC-Bayesian theorems. Machine Learning, 37(3), 355-363.
  8. Bartlett, P. L., Foster, D. J., & Telgarsky, M. J. (2017). Spectrally-normalized margin bounds for neural networks. NeurIPS, 30.
  9. Gunasekar, S., Lee, J., Soudry, D., & Srebro, N. (2018). Implicit bias of gradient descent on linear convolutional networks. NeurIPS, 31.
  10. Soudry, D., Hoffer, E., Nacson, M. S., Moran, S., & Srebro, N. (2018). The implicit bias of gradient descent on separable data. JMLR, 19(1), 2822-2878.
  11. Chaudhari, P., & Soatto, S. (2018). Stochastic gradient descent performs variational inference, converges to limit cycles for deep networks. ICLR.
  12. Foret, P., Kleiner, A., Mobahi, H., & Neyshabur, B. (2021). Sharpness-aware minimization for efficiently improving generalization. ICLR.
  13. Hanin, B., & Nica, M. (2020). Products of many large random matrices and gradients in deep neural networks. Communications in Mathematical Physics, 376(1), 287-322.
  14. Yaida, S. (2020). Non-Gaussian processes and neural networks at finite widths. Proceedings of the First Mathematical and Scientific Machine Learning Conference (MSML), PMLR 107, 165-192.

← Back to Engineering