Tight Generalization Bounds for Large-Margin Halfspaces

Kasper Green Larsen, Natascha Schalburg

Introduction

Halfspaces, or linear classifiers, represent one of the most fundamental building blocks in machine learning theory and practice. They form the core of classical algorithms such as the Perceptron and Support Vector Machines (SVM). A central tenet of these models is the concept of the "margin" ($\gamma$)—the distance between the decision boundary and the nearest training examples. Intuitively, a larger margin suggests a more robust classifier that is likely to generalize better to unseen data.

Despite decades of research since the late 1990s, a precise mathematical characterization of this generalization has remained elusive. Specifically, a persistent gap existed between the theoretical upper bounds and lower bounds of the error rate. While known upper bounds suggested the error depended on a logarithmic factor of the sample size ($\ln n$), lower bounds did not. This paper finally closes this gap, providing an asymptotically tight generalization bound for large-margin halfspaces.

The Challenge of the Logarithmic Gap

In statistical learning theory, we seek to bound the true error $L_{\mathcal{D}}(w)$ of a classifier $w$ based on its performance on a training set $S$ of size $n$. For large-margin halfspaces, the standard approach involves the empirical margin loss $L_S^\gamma(w)$, which measures the fraction of training points that either fall on the wrong side of the boundary or within the margin $\gamma$.

Previous proofs relied on techniques that introduced a $\ln n$ term in the upper bound. This suggested that as the number of samples increased, the complexity of the hypothesis space grew in a way that required more data than lower bounds predicted. This discrepancy implied that either our understanding of linear classifiers was overly pessimistic or our mathematical tools were insufficiently sharp to capture the true nature of the problem.

Methodology: Refining Random Discretization

The authors resolve this by advancing the framework of Random Discretization. Since there are infinitely many possible hyperplanes in $d$-dimensional space, one cannot apply a simple union bound. Instead, the infinite set of hyperplanes must be mapped to a finite "grid" of representative classifiers. The paper introduces three primary innovations to sharpen this mapping:

  1. Refined Error Decomposition: The authors identified that previous proofs used loose inequalities when comparing true error to discretized error. By precisely accounting for "near misses"—points where the margin is shifted by discretization but the classification threshold is not crossed—they demonstrated that these superfluous terms actually cancel out, eliminating the $\ln n$ gap.
  2. Infinite Grid Sequence: To avoid the "error floor" typically introduced by a fixed-resolution grid, the researchers employed an infinite sequence of increasingly fine grids ($G_0, G_1, \dots$). They proved that the training set remains representative across all these grids simultaneously.
  3. Rademacher Complexity and Lipschitz Continuity: The proof utilizes a continuous "proxy" function (similar to a ramp loss) and establishes its Lipschitz continuity. This allows the application of the contraction principle of Rademacher complexity to bound error fluctuations more tightly than previous methods.

Key Results

The centerpiece of the research is Theorem 2, which establishes a new upper bound for the true error. This bound is proven to be asymptotically tight, matching the lower bound in its dependence on the margin $\gamma$, the empirical margin loss $L_S^\gamma(w)$, the sample size $n$, and the failure probability $\delta$.

Simplified, the bound shows that the generalization error scales as: $$\text{Error} \approx L_S^\gamma(w) + \sqrt{L_S^\gamma(w) \cdot \frac{\ln(1/L_S^\gamma(w))}{\gamma^2 n}} + \frac{\ln(1/\gamma^2 n)}{\gamma^2 n}$$

This result confirms that the complexity of the halfspace learning problem is governed by the "effective dimension" $1/\gamma^2$, scaled by the logarithm of the error rate rather than the sample size. Notably, the paper replaces the generic $\ln n$ term with $\ln(e/L_S^\gamma(w))$, meaning that for classifiers with high training accuracy, the generalization guarantee is significantly stronger than previously believed.

Discussion and Limitations

While this work provides the "final word" on the statistical limits of large-margin halfspaces, it also highlights several areas for future exploration:

  • Model Linearity: The results are specific to linear models. While the techniques of refined discretization and infinite grids may be adaptable to more complex architectures like deep neural networks, the specific bounds do not translate directly.
  • Computational Complexity: The paper focuses on the statistical limit (data requirements) rather than the computational limit. Finding the optimal hyperplane that minimizes this new bound remains a separate challenge, particularly in non-separable (soft-margin) scenarios.
  • High-Dimensional Constants: As an asymptotic result, the bound contains hidden constants. In specific high-dimensional edge cases, these constants may still play a role in practical performance.

Conclusion

By refining the mathematical machinery used to analyze linear classifiers, this research successfully bridges a decades-old gap in learning theory. The proof that generalization bounds for halfspaces are independent of $\ln n$ provides a more optimistic and accurate picture of how these fundamental models perform, cementing our theoretical understanding of the relationship between margin, sample size, and error.

Summary updated

BibTeX
@inproceedings{larsen2025tight,
  author = {Kasper Green Larsen and Natascha Schalburg},
  title = {{Tight Generalization Bounds for Large-Margin Halfspaces}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=wAq0ZLxrGq},
}
Figure