cs.LGMar 10, 2026

Memorization capacity of deep ReLU neural networks characterized by width and depth

Authors: Xin Yang, Yunfei Yang

Organizations: School of Mathematics (Zhuhai), Sun Yat-sen University, Zhuhai, China. · School of Mathematics (Zhuhai) and Guangdong Province Key Laboratory of Computational Science, Sun Yat-sen University, Zhuhai, China.

Abstract

This paper studies the memorization capacity of deep neural networks with ReLU activation. Specifically, we investigate the minimal size of such networks to memorize any NN data points in the unit ball with pairwise separation distance δδ and discrete labels. Most prior studies characterize the memorization capacity by the number of parameters or neurons. We generalize these results by constructing neural networks, whose width WW and depth LL satisfy W2L2=O(Nlog⁡(δ−1))W^2L^2= \mathcal{O}(N\log(δ^{-1})), that can memorize any NN data samples. We also prove that any such networks should also satisfy the lower bound W2L2=Ω(Nlog⁡(δ−1))W^2L^2=Ω(N \log(δ^{-1})), which implies that our construction is optimal up to logarithmic factors when δ−1δ^{-1} is polynomial in NN. Hence, we explicitly characterize the trade-off between width and depth for the memorization capacity of deep neural networks in this regime.

Explore similar work

Aug 24, 2026

Every Layer Counts: An Exponential L2L_2 Depth Hierarchy for ReLU Networks

We prove a depth hierarchy for ReLU neural networks in which every additional ReLU layer can save exponentially many neurons. For all k≥2k\geq2, we construct a globally [0,1][0,1]-valued, 11-Lipschitz function realized by a depth-(k+1)(k+1) network of width O(d4)\mathcal{O}(d^4), whereas any depth-kk network with unrestricted weights and width at most 2d2d(k−1)\frac{2^d}{2d(k-1)} has squared L2L_2 error at least 1/241/24 under an absolutely continuous distribution supported at exponential distance from the origin. To the best of our knowledge, this is the first exponential hierarchy across all adjacent fixed depths, and the first exponential separation for ReLU networks between two fixed depths whose shallower network has depth at least 33. The lower bound also immediately yields the corresponding hierarchy for exact computation. Moreover, the case k=2k=2 gives a compactly supported separation between depths 33 and 22 with unrestricted shallow-network weights, answering a question raised by Safran, Eldan, and Shamir (2019). The distribution used in our construction nevertheless has all its mass at exponential radius, placing the hierarchy outside the regularity regime in which such a separation would imply major threshold-circuit lower bounds. We also prove an exact separation for a more regular target, which is globally [0,1][0,1]-valued and O(d)\mathcal{O}(\sqrt d)-Lipschitz and maps the unit hypercube onto [0,1][0,1]. It is computed by a polynomial-width depth-44 network, whereas any depth-33 network agreeing with it on the unit hypercube requires exponentially many first-layer neurons, even with unrestricted weights.
Jul 13, 2026

Random Label Prediction Heads for Studying Memorization in Deep Neural Networks

We introduce a straightforward yet effective method to empirically study memorization in deep neural networks for classification tasks. Our approach augments each training sample with auxiliary random labels, which are then predicted by a random label prediction head (RLP-head). RLP-heads can be attached at arbitrary depths of a network, predicting random labels from the corresponding intermediate representation and thereby enabling analysis of how memorization capacity evolves across layers. By interpreting the RLP-head performance as an empirical estimate of Rademacher complexity, we obtain a direct measure of both sample-level memorization and model capacity. We leverage this random label accuracy metric to analyze generalization and overfitting in different models and datasets. Building on this approach, we further propose a novel regularization technique based on the output of the RLP-head, which demonstrably reduces memorization. Interestingly, our experiments reveal that reducing memorization can either improve or impair generalization, depending on the dataset and training setup. These findings challenge the traditional assumption that overfitting is equivalent to memorization and suggest new hypotheses to reconcile these seemingly contradictory results. The source code is available at https://github.com/MarlonBecker/RandomLabelHeads
Oct 12, 2026

Memorization in image classification: test set behavior and scaling laws

Deep neural networks are capable of both learning generalizing solutions on natural tasks and memorizing arbitrary mappings. We argue that understanding the former requires understanding the latter, which is much less studied. In what ways do networks that generalize or memorize differ in their behavior or their training dynamics? Do memorizing networks simply function as a lookup table where input-output mappings are stored independently? We investigate these questions in the context of CNNs trained on image classification tasks with randomized labels or pixels. We first study the behavior of such memorizing networks on unseen images. We find that independently initialized networks trained on the same random labels learn different predictive functions: they make different predictions on test examples, in contrast with generalizing networks. We then examine the effect of dataset size on memorization through the required network capacity and training time to interpolate the training set. Counter-intuitively, we find that the number of presentations of a given example required for complete memorization can decrease with dataset size even when input-output pairs share no common structure. Although memorizing networks do not learn a universal solution, they exhibit interesting behaviors which call for further investigations into the underlying mechanisms.