On the Local Complexity of Linear Regions in Deep ReLU Networks

Niket Patel, Guido Montúfar · DOI

Introduction

Deep neural networks using ReLU activations are continuous piecewise linear (CPWL) functions. This geometric perspective implies that the input space is partitioned into a multitude of linear regions. While the network acts as a simple linear model within each region, its overall complexity arises from the arrangement and density of the boundaries where these regions meet.

Defining Local Complexity

To quantify this geometric structure, we introduce Local Complexity (LC). LC measures the expected density of the boundaries (non-linearities) between linear regions relative to the data distribution. Unlike global region counting, which is computationally prohibitive and often irrelevant to the actual data manifold, LC focuses on the regions the network actually utilizes.

Visualization of linear regions forming the shape of a Stanford Bunny. Each polygon represents a region where the network function is linear.

To make LC mathematically tractable, the framework employs a small amount of noise in the network's biases, "blurring" the boundaries and allowing the use of differential geometry tools like the generalized co-area formula. This allows us to connect the density of these "seams" to the network's internal representations.

A central contribution of this work is relating LC to Local Rank (LR), which measures the average dimensionality of the feature manifold at intermediate layers. We prove that if a network learns low-dimensional representations (low LR), the density of its linear regions (LC) must necessarily decrease. Specifically, we establish a rigorous inequality: $LC \leq \text{Constant} \times \sqrt{LR}$. This provides a formal link between representation learning and the simplification of the network's internal geometry.

Training Dynamics and Grokking

Empirical observations show that during the later stages of training, networks often undergo a "simplification" phase. Our experiments on datasets like MNIST and CIFAR-10 reveal a sudden and simultaneous drop in both Local Complexity and Local Rank late in the training process.

Plots showing the evolution of Local Complexity (left) and Local Rank across four layers (right) over training iterations. Both metrics exhibit a sharp decline after approximately $10^4$ iterations.

This drop provides a geometric signature for "grokking" or the transition from memorization to the learning of structured, robust features. As the network organizes its internal regions into a simpler structure, it becomes significantly more robust to adversarial perturbations. In MNIST experiments, this drop coincided with a spike in adversarial accuracy from near 0% to approximately 40%.

Robustness and Optimization

We further show that LC serves as an upper bound on the Total Variation (TV) of the network function over the data distribution. A lower LC implies a "flatter" function near the data points, which directly correlates with increased adversarial robustness. Furthermore, standard regularization techniques like weight decay are shown to implicitly minimize LC (with a correlation of $R^2 = 0.6972$), suggesting that optimization naturally drives ReLU networks toward geometrically simpler solutions.

Conclusion

By defining Local Complexity, we provide a bridge between the abstract geometric properties of ReLU networks and practical aspects of machine learning such as feature dimensionality, adversarial robustness, and optimization. This framework offers a path toward understanding why deep networks generalize well by quantifying the "simplicity" of the functions they learn.

Summary updated

Abstract

We define the local complexity of a neural network with continuous piecewise linear activations as a measure of the density of linear regions over an input data distribution. We show theoretically that ReLU networks that learn low-dimensional feature representations have a lower local complexity. This allows us to connect recent empirical observations on feature learning at the level of the weight matrices with concrete properties of the learned functions. In particular, we show that the local complexity serves as an upper bound on the total variation of the function over the input data distribution and thus that feature learning can be related to adversarial robustness. Lastly, we consider how optimization drives ReLU networks towards solutions with lower local complexity. Overall, this work contributes a theoretical framework towards relating geometric properties of ReLU networks to different aspects of learning such as feature learning and representation cost.
BibTeX
@inproceedings{patel2025local,
  author = {Niket Patel and Guido Montúfar},
  title = {{On the Local Complexity of Linear Regions in Deep ReLU Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=id2CfAgEAk},
}
Figure