Do Larger Fully Connected Neural Networks Generalize Better?
Authors: Mohammad Jalili Torkamani, Suhib Hamid, Moaz N. Ishag
Organizations: School of Computing, University of Nebraska–Lincoln, Lincoln, NE, USA · Agronomy and Horticulture, University of Nebraska–Lincoln, Lincoln, NE, USA · Biological System Engineering, University of Nebraska–Lincoln, Lincoln, NE, USA
Greater neural-network capacity does not necessarily yield better performance on unseen data. This study investigates whether a deeper, fully connected neural-network architecture generalizes better than a shallower architecture on the Fashion-MNIST dataset. We compare two architectures under two learning rates and two L2-regularization settings, producing eight configurations. The architectures contain 95,410 and 561,470 trainable parameters, respectively, an approximately 5.9-fold difference. Checkpoints and the final configuration are selected by validation loss, and all configurations are evaluated on a held-out test set. The selected larger configuration achieves 89.82% validation accuracy and 88.77% test accuracy. Selecting the lowest-validation-loss configuration within each architecture yields test accuracies of 88.77% and 88.52%, respectively, a difference of 0.25 percentage points. Across matched training settings, the larger architecture achieves higher test accuracy in only one of four comparisons. Class-level errors are concentrated among visually similar garment categories, and qualitative pixel-removal analyses suggest sensitivity to shape and boundaries. Overall, the findings suggest that increasing architectural capacity alone does not guarantee better generalization, highlighting the importance of considering optimization and regularization when selecting neural-network architectures.
Figures & tables
Property
Basic
Extended
Input dimensions
784
784
Hidden layers
1
3
Hidden units
120
500, 300, 60
Hidden activation
ReLU
ReLU
Output units
10
10
Output activation
Softmax
Softmax
TABLE I: Architectural comparison of the Basic and Extended fully connected neural networks.
Model
Epochs
Regularization
Learning Rate
Val. CE loss
Val. acc. (%)
Test CE loss
Test acc. (%)
Error CI (%)
Basic-1
14
0.0
0.001
0.2995
89.35
0.3409
88.22
[11.16, 12.43]
Basic-2
20
0.0001
0.001
0.2975
89.47
0.3323
88.06
[11.32, 12.59]
Basic-3
15
0.0
0.0005
0.3077
88.87
0.3408
87.68
[11.69, 12.98]
Basic-4 †
21
0.0001
0.0005
0.2923
89.42
0.3300
88.52
[10.87, 12.12]
Extended-1
8
0.0
0.001
0.3006
88.65
0.3531
87.56
[11.81, 13.10]
Extended-2
9
0.0001
0.001
0.2992
88.78
0.3435
87.63
[11.74, 13.03]
TABLE II: Performance of the eight evaluated configurations. Losses are cross-entropy without the L2 penalty, measured at restored checkpoints. Epochs denote total training epochs; error intervals are 95% Wilson intervals for test error.
Fig. 1: Training and validation cross-entropy loss and classification accuracy for the selected Extended-3 configuration.
Fig. 2: Row-normalized test confusion matrix for the selected Extended-3 configuration. Rows represent ground-truth classes and columns represent predicted classes.
Fig. 3: Representative test predictions and leave-one-pixel-out influence maps for Extended-3. Top: a Trouser misclassified as a Bag. Bottom: a correctly classified Ankle boot. Positive influence indicates that removing a pixel decreases the probability assigned to the original predicted class.
Classical statistical learning theory predicts that overparameterized models should exhibit severe overfitting, yet modern deep neural networks with far more parameters than training samples consistently generalize well. This contradiction has become a central theoretical question in machine learning. This study investigates the role of optimization dynamics and implicit regularization in enabling generalization in overparameterized neural networks through controlled experiments. We examine stochastic gradient descent (SGD) across batch sizes, the geometry of flat versus sharp minima via Hessian eigenvalue estimation and weight perturbation analysis, the Neural Tangent Kernel (NTK) regime through wide-network experiments, double descent across model scales, and the Lottery Ticket Hypothesis through iterative magnitude pruning. All experiments use PyTorch on CIFAR-10 and MNIST with multiple random seeds. Our findings demonstrate that generalization is strongly influenced by the interaction between network architecture, optimization algorithms, and loss landscape geometry. Smaller batch sizes consistently produced lower test error and flatter minima, with an 11.8x difference in top Hessian eigenvalue between small-batch and large-batch solutions corresponding to 1.61 percentage points higher test accuracy. Sparse subnetworks retaining only 10% of parameters achieved within 1.15 percentage points of full model performance when retrained from their original initialization. These results highlight the need for revised learning-theoretic frameworks capable of explaining generalization in high-dimensional model regimes.
We address the fundamental question of why deep neural networks generalize by establishing a pointwise generalization theory for fully connected networks. This framework resolves long-standing barriers to characterizing the rich nonlinear feature-learning regime and builds a new statistical foundation for representation learning. For each trained model, we characterize the hypothesis via a pointwise Riemannian Dimension, derived from the eigenvalues of the learned feature representations across layers. This establishes a principled framework for deriving hypothesis-dependent, representation-aware generalization bounds. These bounds offer a systematic upgrade over approaches based on model size, products of norms, and infinite-width linearizations, yielding guarantees that are orders of magnitude tighter in both theory and experiment. Analytically, we identify the structural properties and mathematical principles that explain the tractability of deep networks. Empirically, the pointwise Riemannian Dimension exhibits substantial feature compression, decreases with increased over-parameterization, and captures the implicit bias of optimizers. Taken together, our results indicate that deep networks are mathematically tractable in practical regimes and that their generalization is sharply explained by pointwise, feature-spectrum-aware complexity.
Grokking the delayed transition from memorization to generalization in neural networks remains poorly understood, in part because prior empirical studies confound the roles of architecture, optimization, and regularization. We present a controlled study that systematically disentangles these factors on modular addition (mod 97), with matched and carefully tuned training regimes across models. Our central finding is that grokking dynamics are not primarily determined by architecture, but by interactions between optimization stability and regularization. Specifically, we show: (1) depth has a non-monotonic effect, with depth-4 MLPs consistently failing to grok while depth-8 residual networks recover generalization, demonstrating that depth requires architectural stabilization; (2) the apparent gap between Transformers and MLPs largely disappears (1.11× delay) under matched hyperparameters, indicating that previously reported differences are largely due to optimizer and regularization confounds; (3) activation function effects are regime-dependent, with GELU up to 4.3× faster than ReLU only when regularization permits memorization; and (4) weight decay is the dominant control parameter, exhibiting a narrow ``Goldilocks'' regime in which grokking occurs, while too little or too much prevents generalization. Across 3--5 seeds per configuration, these results provide a unified empirical account of grokking as an interaction-driven phenomenon. Our findings challenge architecture-centric interpretations and clarify how optimization and regularization jointly govern delayed generalization.