Allowing for small fraction of errors in retrieved stored binary patterns, Hopfield-Hebbian neural network (NN) associative memory dynamics [14] achieves linearly scaled capacity. The famous proportionality constant αc≈0.14 is obtained in a large dimensional scenario as the ratio of the number of reliably stored patterns m and the patterns' length n under the assumption that uniformly randomly chosen binary patterns are independent among themselves. While such an idealized scenario is now well understood, more practical scenarios with correlated/noisy datasets remaining challenging even for classical statistical mechanics replica approaches. We consider precisely such practical settings where each archetype pattern is replaced with M correlated examples with parameter r governing the quality of correlation. We develop a powerful Random Duality Theory (RDT) based framework to analyze correlated data and already on the first level of RDT lifting obtain capacity characterizations that remarkably well match behavior exhibited through simulated dynamics. Moreover, characterizations explicitly feature correlation parameters M and r, which allows to precisely determine their effects on phase-transitioning behavior of the underlying dynamics. Our results are also a well-fitting complement to the existing literature. Namely, to circumvent challenging statistical mechanics analyses, an alternative combination of spectral and replica methods is considered in [4]. We confirm that [4]'s elegant spectral characterizations are excellent approximations in the low correlated regime. At the same time, we also close the gap in the regimes with higher correlation levels where spectral methods deviate from the practical dynamics performance.
Introduction
The early spin-glass neural networks (NN) forms [29] were superseded by the Hopfield’s auto-associative memories propositions [14]. The main idea centers around the following concept: starting in a vicinity of an already stored/memorized pattern, an iterative dynamics remains trapped by local optima not far away and allows retrieval of the stored pattern. In other words, patterns possess the so-called basins of attraction that simple iterative dynamics can not escape ensuring that a pattern is properly retrieved (and not confused by an unwanted convergence to a different one). The memory capacity – defined as the maximum allowable number of the stored patterns for which the proper retrieval is possible – is the key feature that describes the effectiveness of these types of associative memories. As such, it has been thoroughly studied since the appearance of the Hopfield’s introductory paper [14]. We start by surveying some of the key achieved milestones. That will eventually allow us to properly contextualize our own results.
Prior work and contextualization
Trying to model cognitive type of thinking, Hebb considered an associative type of learning principle [13]. In [14], Hopfield further connected such learning principles to a basic iterative dynamics. Overwhelming numerical evidence suggested that the proposed dynamics might exhibit a remarkable convergence property, where (rather quickly) one ends up either in one of the n-dimensional stored binary patterns or in its a close proximity. In a way, provided that their number is not too high, the stored patterns are observed as stable and surrounded by sizeable basins of attraction, allowing for their efficient retrieval.
Utilizing a simple Gaussian noise argument and considering independent patterns, [14] showed that (with probability approaching 1 as n→∞) the networks associative capacity (maximal number of reliably stored patterns) is approximately m≈2log(n)n. Hopfield observed an even more remarkable property: if a small fraction of errors is allowed in retrieved patterns, then the so-called linear capacity scaling m∼n is possible as well. Moreover, Gaussian noise arguments allowed for a very precise prediction of the underlying linear proportionality α≜limn→∞nm≈0.14 achieved with only 0.4% of errors. Such a set of developments is truly remarkable and to this day remains one of the most fascinating analytical NN results.
As Hopfield’s predictions were basically indistinguishable from the results obtained simulating proposed dynamics, an avalanche of research regarding various related topics followed through the better part of the last four decades. Some of the most relevant analytical results that particularly relate to our own results are discussed below. As almost all of them consider binary patterns statistical context similar or identical to the one from [14], we skip reemphasizing it. Along the same lines, here and later on throughout the paper, we often skip repetitively stating that the known results hold with high probability (i.e., with probability approaching 1 as the patterns’ size/length n→∞).
Exact retrieval: Early Hopfield’s noise considerations, were followed by the memory capacity analysis via the statistical physics replica methods in [6]. Under the replica symmetry (RS) ansatz, the very same m≈2log(n)n estimate for exact retrieval were obtained. The very first set of mathematically rigorous results in this direction arrived with the appearance of [23], where sublinear exact retrieval scaling of [6, 14] was matched. In [11], the RS estimate 2log(n)n from [6] was established as a rigorous lower bound. Results of [23] were then in a way extended in [16] where existence of a nonzero basin of attraction around patterns is shown. Strong numerical evidence suggesting likely impossibility of exact retrieval in regimes with the number of patterns m scaling stronger than ∼log(n)n was presented in [23] as well. This effectively suggested that to achieve a linear scaling, consideration of approximate retrieval (where one allows for a small fraction of errors in retrieved patterns) might be needed. This again was in an excellent agreement with early Hopfield observations [14].
Approximate retrieval: As stated above, Hopfield’s rough analytical arguments coupled with strong numerical algorithmic evidence suggested that the precise value of the underlying linear proportionality in approximate retrieval is likely around α≜limn→∞nm≈0.14. Existence of a basin of attraction around each of the stored patterns emerged as a key concept driving the success of Hopfield propositions.
The so-called AGS (Amit-Gutfreund-Sompolinsky) basin of attraction was analyzed in [6] via replica methods (assuming RS ansatz). It was obtained that Hopfield dynamics converges to a local energy (objective) minima within the basin of attraction (thereby staying trapped in a close vicinity of the stored pattern) provided that α≈0.137906. [6] further predicted that potential additional replica symmetry breaking (RSB) corrections might not necessarily be quantitatively substantial. This prediction was confirmed in [31], where negligibly better estimates α≈0.138186 and α≈0.138187 were obtained with 1RSB and 2RSB ansatz, respectively. The AGS basins were further analyzed in [11] where α≥0.113 estimate was obtained and in [38] where both RS and 1RSB estimates were matched via fully lifted RDT.
As an alternative to the above mentioned AGS basin, the NLT basin was considered in [19, 20, 21, 24]. In addition to the AGS type of energy well around patterns, MLT imposes that the local energy maximum within the well must not be smaller than the one already achieved by the pattern itself. Due to further restrictions, NLT basin capacity estimates are automatically lower bounds for the corresponding AGS ones. Initial NLT basin capacity estimate α≥0.056 obtained in [24] was first improved to α≥0.071 in [19, 20] and then to α≥0.08 in [45]. In [38], the corresponding first and second lifting level RDT estimates, α≈0.1295 and α≈0.1298, were obtained as well.
Different learning rules: If one deviates from the Hebbian learning principle, capacity can grow beyond linear n scaling. The Hebbian rule assumes the quadratic (polynomial of degree 2) objective. Alternatively, utilizing an objective based on a general overlap power (polynomial of degree p), the capacity of exact and approximate retrievals scale as m∼log(n)np−1 and m∼np−1, respectively [1, 12, 17]. On the other hand, relying on the exponential interactions, allows for the exponential capacity growth [10, 22, 30, 46]. One the one hand, these results allow for a substantial increase of the associative capacity. On the other, the connection between the employed learning principles and the neurological behavior might not necessarily as clear as in model with the Hebbian rule.
Correlated/noisy patterns: Majority of the above works consider a common scenario, where the patterns are independent among themselves. Such an idealized context does provide a sufficiently simplified model that allows for analytical tractability. Moreover, results obtained for such models provide an intuition that is presumed to be useful for a better understanding of more complex NNs. In practice the datasets are not as ideal. Instead of being independent the patterns are likely correlated. Such correlations may act as a noise or even portray the presence of some intrinsic features (data redundancy or heterogeneity) that go beyond what can be captured through presumed pattern independence. Along the same lines, if one moves away from the simple pattern retrieval tasks and considers more challenging sequence retrieval, disentanglement, generalization or categorization, then again the idealistic nature of independent patterns might not suffice [2, 5, 8, 15, 18].
Analytical treatments of generic practical correlated scenarios are significantly more challenging. Nonetheless, as understanding of NN’s functioning deepened over the last several years, a lot of effort has been put towards achieving further progress. A particularly successful has been a line of work related to archetype/example patterns. As it is also very closely related to the topics that we study in this paper, we discuss it next in more detail.
Archetype/example patterns: A type of data often used to highlight the correlations effects assumes that to each pattern – called archetype or ground truth – from a set of independent patterns, one associates its M slightly independently perturbed example versions. Perturbations are typically realized by multiplying original pattern elements by independent Bernoulli random variables of mean r∈[0,1] (for r=1, one has the (redundant) standard Hopfield-Hebbian model with each pattern repeated M types). When r<1, the mathematical problems associated with approximate retrieval are then also tightly connected to generalization, inference, and disentanglement as well [3, 4, 5]. However, compared to plain (uncorrelated) scenarios, obtaining underlying statistical mechanics pictures is significantly more complicated.
Recently, spectral methods have emerged as particularly successful analytical alternatives to classical replica methods [3, 4]. The underlying ideas are truly remarkable and rely on spectral fragmentation (in a way resembling the famous BBP phase transition observed in the so-called spiked models [7]). As system parameters that govern correlations change, the spectrum of particularly designed relevant system matrices changes as well. The changes are of quantitative type until parameters’ values reach phase-transition regions, where a qualitative change – fragmenting of the spectrum from a single bulk structure into a two-pieces formation – happens. Onset of such a fragmentation is then predicted as a conceivably accurate approximation of the underlying retrieval phase-transition – in a direct analogy with the appearance of the so-called spectral outliers in BBP transitions considerations [7]. Moreover, not only are these ideas conceptually beautiful, they give excellent practical results as well. In particular, combining spectral and replica theory [4] obtained very elegant single line explicit expression that approximately characterizes impact of correlation parameters M and r on capacity phase-transitions. In case of so-called full rank (αM>1) and low correlated (smaller r) data, the approximations obtained in [4] very closely approach the true performance of the underlying retrieval dynamics. As correlations increase the predictive power decreases and they slowly deviate from the dynamics performance.
Our contributions
In this paper we consider the very same archetypes/examples set of correlated patterns. We develop Random Duality Theory (RDT) based framework for the analysis of the retrieval (or analogously inference/generalization) dynamics. Utilizing the first lifted level of the framework, we obtain retrieval capacity estimates that are explicit functions of both key correlation parameters M and r. For concreteness, we focus on the full rank data (regime where spectral methods tend to show slight deviations from practical dynamics). Our results confirm that spectral predictions from [4] are indeed excellent approximations in the low correlations regimes (precisely as observed in [4]). Moreover, we also manage to close the gap for higher correlations. In particular, after practically running the dynamics, we observe that already for fairly small problem dimensions (on the order of ∼1000), simulation results are in an excellent agreement with our theoretical predictions in the entire r∈[0,1] range and for all M. Implementing the fully lifted RDT machinery (i.e. conducting the analysis and numerical evaluations on higher lifting levels) would keep closing the gap further. However, keeping in mind that in the ideal scenario (with r=1 and M redundant patterns), the capacity estimates obtained on the first (≈0.1379) and second (≈0.1381) lifting level differ by ∼0.01%, no significant corrections on higher lifting levels are expected.
Mathematical preliminaries
We consider standard statistical Hopfield archetype/examples setup. To that end, let gˉ(i)∈SHn, i=1,2,…,m, be m independently and uniformly randomly chosen binary patterns (SHn is the unit n-dimensional Hamming sphere, i.e. SHn≜{−n1,n1}n). We call these patterns archetypes and denote by gˉj(i), j=1,2,…,n, their j-th components. For a fixed correlation parameter r∈[0,1], we associate with each gˉ(i)M correlated patterns (so-called examples), gˉ(i,k), in the following way
ηj(k) are independent among themselves for any choice j and k. For any i, we also set
Gˉ(i)={gˉ(i,k)}k=1,2,…,M,i=1,2,…,m.(2)
Basically, Gˉ(i) is an array of M patterns associated via correlation (1) with gˉ(i). We further set
G≜i=1∑mk=1∑Mgˉ(i,k)(gˉ(i,k))T,(3)
and consider the following Hopfield sequential dynamics
xˉi(t+1)=signj=1j=i∑nGi,jxˉj(t).(4)
Here and throughout the paper, we adopt notational convention that Gi,j stands for the ij-th component of G and Gi,: is the i-th row of G. Defining the energy objective as
H(x)≜−xTGx,(5)
we easily have that the above dynamics converges to its a local minimum. Taking xˉ as the dynamics converging point
xˉ=t→∞limxˉ(t),(6)
we have for the local energy minimum achieved at xˉ
H(xˉ)=−xˉTGxˉ.(7)
Moreover,
H(xˉ)≤∥x−xˉ∥2=2/nx∈SHnmin−xTGx.(8)
Within the standard Hopfield retrieval, the main idea is that (provided “sufficient pattern orthogonality”) the converging point may exactly or approximately match one of the stored patterns. In other words, it may happen that xˉTgˉ(i)=1 or xˉTgˉ(i)=1−2δ, for a small δ>0. The same philosophy applies here as well. The difference though is that this time around the gˉ(i) are not the patterns that one can access (it should be noted that they are not parts of G and do not participate in dynamics (4)). Instead they are the archetypes and one wonders whether these ground truth patterns can be recovered even though they can not be accessed. As we will see, analogously to [6, 11, 14, 23, 38] this will again turn out to be possible even in the linear scaling regime. However, the critical number of patterns for which it will be possible will be a function of underlying correlations parameters M and r that govern to what extent the ground truth archetypes, gˉ(i), are hidden within their associated examples groups Gˉ(i).
Basin of attraction and dynamics capcity
The basin of attraction that we consider is conceptually similar to AGS [6]. However, there are also a few technical differences that we highlight below.
For concreteness and easiness of writing, we take without loss of generality g(1)=n1 as the targeted archetype pattern. Analogously to the AGS considerations from [6], one can define the capacity of the dynamics (4) as the largest α≜limn→∞nm such that for some (small) δ>0
References
[1]E. Agliari, L. Albanese, F. Alemanno, A. Alessandrelli, A. Barra, F. Giannotti, D. Lotito, and D. Pedreschi. Dense hebbian neural networks: A replica symmetric picture of supervised learning. Physica A: Statistical Mechanics and its Applications, 626:129076, 2023.
[2]E. Agliari, A. Alessandrelli, A. Barra, M. Salomone Centonze, and F. Ricci-Tersenghi. Generalized hetero-associative neural networks. Journal of Statistical Mechanics: Theory and Experiment, 2025(1):013302, 2025.DOI
[3]E. Agliari, D. Luongo, and A. Fachechi. A spectral approach to Hebbian-like neural networks. Applied Mathematics and Computation, 474:128689, 2024.DOI
[4]E. Agliari, P. D. Mourao, A. Fachechi, and P. Vivo. Spectral criteria for generalization in unsupervised Hebbian nets. 2026. available online at http://arxiv.org/abs/2606.04651.
[5]F. Alemanno, M. Aquaro, I. Kanter, A. Barra, and E. Agliari. Supervised Hebbian learning. Europhysics Letters, 141(1):11001, jan 2023.DOI
[6]D. J. Amit, H. Gutfreund, and H. Sompolinsky. Storing infinite number of patterns in a spin glass model of neural networks. Phys. Rev. Letters, 55:1530, 1985.
[7]J. Baik, G. Ben Arous, and S. Peche. Phase transition of the largest eigenvalue for non-null complex sample covariance matrices. The Annals of Probability, 33(5):1643–1697, 2005.DOI
[8]M. C. Branchtein and J. J. Arenzon. Categorization and generalization in the Hopfield model. Journal de Physique I, 2(11):2019–2024, November 1992.DOI
[9]S. Chatterjee. A generalization of the Lindenberg principle. The Annals of Probability, 34(6):2061–2076, 2006.
[10]M. Demircigil, J. Heusel, M. Lowe, S. Upgang, and F. Vermet. On a model of associative memory with huge storage capacity. Journal of Statistical Physics, 168(2):288–299, July 2017.DOI
[11]J. Feng, M. Scherbinа, and B. Tirozzi. On the critical capacity of the Hopfield model. Communications in Mathematical Physics, 2000.DOI
[12]E. Gardner. Multiconnected neural network models. Journal of Physics A: Mathematical and General, 20(1):3453–3464, August 1987.DOI
[13]D. O. Hebb. Organization of behavior. New York: Wiley, 1949.
[14]J. J. Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proc. Nat. Acad. Science, 79:2554, 1982.
[15]S. Kalaj, C. Lauditi, G. Perugini, C. Lucibello, E. M. Malatesta, and M. Negri. Random features Hopfield networks generalize retrieval to previously unseen examples. Physica A: Statistical Mechanics and its Applications, 678:130946, 2025.arxiv.org/abs/2407.05658
[16]J. Komlos and R. Paturi. Convergence results in an autoassociative memory model. Neural Networks, 1:239–250, 1988.DOI
[17]D. Krotov and J. J. Hopfield. Dense associative memory for pattern recognition. Advances in Neural Information Processing Systems, 1:1180–1188, 2016.arxiv.org/abs/1606.01164
[18]L. Leuzzi, A. Patti, and F. Ricci-Tersenghi. A quantitative analysis of a generalized Hopfield model that stores and retrieves mismatched memory patterns. Journal of Statistical Mechanics: Theory and Experiment, 2022(8):083301, aug 2022.DOI
[19]D. Loukianova. Capacite de memoire dans le modele de Hopfield. C. R. Acad. Sci. Paris t. 318, Serie I, pages 157–160, 1994.
[20]D. Loukianova. Etude rigoureuse du modele de Hopfield de memoire associative. These de doctorat de l’Universite Paris 7, 1994.
[21]D. Loukianova. Lower bounds on the restitution error in the Hopfield model. Probab. Theory Related Fields, 107:161–176, 1997.DOI
[22]Carlo Lucibello and Marc Mézard. Exponential capacity of dense associative memories. Phys. Rev. Lett., 132:077301, Feb 2024.DOI
[23]R. J. MacEliece, E. C. Posner, E. R. Rodemich, and S.S. Venkatesh. The capacity of the Hopfield associative memory. IEEE Trans. Inform. Theory, 33:461–482, 1987.
[24]Ch. M. Newman. Memory capacity and neural network models: Rigorous lower bounds. Neural Networks, 1:223–238, 1988.DOI
[25]G. Parisi. Infinite number of order parameters for spin-glasses. Phys. Rev. Lett., 43:1754–1756, 1979.
[26]G. Parisi. Breaking the symmetry in SK model. J. Physics, A13:1101, 1980.
[27]G. Parisi. A sequence of approximated solutions to the SK model for spin glasses. Journal of Physics A: Mathematical and General, 13(4):L116, 1980.
[28]G. Parisi. Order parameter for spin glasses. Phys. Rev. Lett., 50:1946, 1983.
[29]L. Pastur and A. Figotin. Exactly soluble model of a spin-glass. Soviet J. of Low Temperature Phys., 3(378-383), 1977.DOI
[30]H. Ramsauer, B. Schafl, J. Lehner, P. Seidl, M. Widrich, L. Gruber, M. Holzleitner, T. Adler, D. Kreil, M. K. Kopp, G. Klambauer, J. Brandstetter, and S. Hochreiter. Hopfield networks is all you need. In International Conference on Learning Representations, 2021.arxiv.org/abs/2008.02217
[31]H. Steffan and R. Kuhn. Replica symmetry breaking in attractor neural network models. Z. Phys. B, 95:249–260, 1994.DOI
[34]M. Stojnic. Bilinearly indexed random processes – stationarization of fully lifted interpolation. 2023. available online at http://arxiv.org/abs/2311.18097.
[35]M. Stojnic. Fully lifted interpolating comparisons of bilinearly indexed random processes. 2023. available online at http://arxiv.org/abs/2311.18092.
[38]M. Stojnic. Capacity of the Hebbian-Hopfield network associative memory. 2024. available online at http://arxiv.org/abs/2403.01907.
[39]M. Stojnic. A CLuP algorithm to practically achieve ∼ 0.76 SK–model ground state free energy. Journal of Statistical Mechanics: Theory and Experiment, (11):123302, 2025.
[40]M. Stojnic. Binary perceptron computational gap – a parametric fl-RDT view. Journal of Statistical Mechanics: Theory and Experiment, (4):043301, 2026.arxiv.org/abs/2511.01037
[41]M. Stojnic. Capacity of the treelike sign perceptrons neural networks with one hidden layer – rdt based upper bounds. IEEE Transactions on Information Theory, 2026. to appear (http://arxiv.org/abs/2312.08244).
[42]M. Stojnic. Lifted RDT based capacity analysis of the 1-hidden layer treelike sign perceptrons neural networks. Information and Inference: A Journal of the IMA, 15(3):iaag034, 09 2026.
[43]M. Stojnic. Parametric RDT approach to computational gap of symmetric binary perceptron. Journal of Statistical Physics, 193(133), 2026.arxiv.org/abs/2601.10628
[44]M. Stojnic. Exact capacity of the wide hidden layer treelike neural networks with generic activations. Neural Networks, 205:109458, January 2027.
[45]M. Talagrand. Rigorous results for the Hopfield models with many patterns. Prob. Theor. Rel. Fields, 110:109–176, 1998.DOI
[46]A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in neural information processing systems, 1:5998–6008, 2017.arxiv.org/abs/1706.03762