Does Flatness imply Generalization for Logistic Loss in Univariate Two-Layer ReLU Network?

Dan Qiao, Yu-Xiang Wang · DOI

Abstract

In deep learning, "flat" minima in the loss landscape are often associated with superior generalization. While this relationship is well-established for square loss, it remains ambiguous for logistic loss, where gradient descent often drives weights toward infinity. This paper investigates whether flatness guarantees generalization for univariate two-layer ReLU networks under logistic loss. We find that flatness alone is insufficient, as it can allow for pathological overfitting at infinity. However, we prove that flatness ensures near-optimal generalization within the "uncertainty regions" of the model. Our results, supported by theoretical bounds and simulations, highlight the role of large learning rates in finding these flatter, more generalizable solutions.

Introduction

A central mystery in deep learning is why overparameterized models generalize well despite their capacity to overfit. A popular hypothesis is that the optimization process biases models toward "flat" minima—regions of the parameter space where the loss function is relatively insensitive to perturbations. While this has been rigorously proven for regression tasks using square loss, the classification setting with logistic loss presents unique challenges.

For separable data, gradient descent typically maximizes the classification margin by pushing weights toward infinity. This raises a critical question: does this trajectory lead to flat solutions that generalize, or to overconfident solutions that overfit noise? As illustrated in Figure 1, the space of representable functions includes flat solutions that generalize well, but also a significant subset of overconfident, overfitting solutions that are also technically "flat."

Figure 1: Conceptual map of the solution space for two-layer ReLU networks, highlighting the existence of flat but overfitting solutions.

Theoretical Framework: The Uncertainty Filter

To resolve the ambiguity of flatness in classification, we introduce a novel analysis based on uncertainty partitioning. We separate the input space into "certain" and "uncertain" regions based on the magnitude of the model's logit outputs.

Pathological Overfitting

We first establish a negative result (Theorem 3.1): it is possible to theoretically construct solutions that are arbitrarily flat yet heavily overfit the training data. This confirms that flatness is not a universal silver bullet for generalization in the classification context.

Generalization via Smoothness

The core insight of our work is that flatness does imply generalization, provided we look at the right regions. We demonstrate that a flat Hessian (the second derivative of the loss) forces the model to be smooth and simple in its "uncertain" regions (where logit values are small). By applying Weighted Total Variation (TV) bounds and metric entropy tools, we prove that flat solutions achieve an excess risk rate of approximately $O(n^{-2/5})$, matching the minimax optimal rate for this function class.

Empirical Analysis and the Edge of Stability

We validated our theoretical findings using controlled simulations on univariate features $x \sim \text{Uniform}(-2, 2)$ with noisy labels generated by a "tent" function.

Our experiments focused on the impact of the learning rate $\eta$. In line with the "Edge of Stability" phenomenon, we observed that larger learning rates encourage the optimizer to find flatter regions of the loss landscape. As shown in Figure 2, training with a larger step size ($\eta=1$) results in a smoother function that closely tracks the true underlying distribution, whereas a smaller step size ($\eta=0.01$) leads to a highly oscillatory function that interpolates noisy labels.

Figure 2: Comparison of GD-trained ReLU networks with different step sizes. Larger learning rates promote flatter, smoother solutions that generalize better.

Conclusion and Limitations

Our study provides a nuanced answer to whether flatness implies generalization for logistic loss. While flatness can be deceptive at infinity, it serves as a reliable proxy for generalization within a model's uncertain regions.

However, several limitations remain for future research:

  1. Dimensionality: Our proofs are currently restricted to univariate inputs. Extending these concepts to high-dimensional data is a major technical hurdle.
  2. Architecture: The analysis is specific to two-layer ReLU networks; deeper architectures like Transformers or CNNs may exhibit different dynamics.
  3. Optimization Paths: While we characterize the properties of flat solutions, the exact conditions under which gradient descent is guaranteed to avoid pathological flat solutions in favor of generalizing ones require further investigation.

Summary updated

BibTeX
@misc{qiao2025does,
  author = {Dan Qiao and Yu-Xiang Wang},
  title = {{Does Flatness imply Generalization for Logistic Loss in Univariate Two-Layer ReLU Network?}},
  year = {2025},
  eprint = {2512.01473},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.01473},
}
Figure