Abstract
The Hopfield recurrent neural network is a classical auto-associative model of memory, in which collections of symmetrically coupled McCulloch–Pitts binary neurons interact to perform emergent computation. Although previous researchers have explored the potential of this network to solve combinatorial optimization problems or store reoccurring activity patterns as attractors of its deterministic dynamics, a basic open problem is to design a family of Hopfield networks with a number of noise-tolerant memories that grows exponentially with neural population size. Here, we discover such networks by minimizing probability flow, a recently proposed objective for estimating parameters in discrete maximum entropy models. By descending the gradient of the convex probability flow, our networks adapt synaptic weights to achieve robust exponential storage, even when presented with vanishingly small numbers of training patterns. In addition to providing a new set of low-density error-correcting codes that achieve Shannon’s noisy channel bound, these networks also efficiently solve a variant of the hidden clique problem in computer science, opening new avenues for real-world applications of computational models originating from biology.
Keywords: Hopfield network, Recurrent dynamics, Exponential codes, Error-correcting, Shannon optimal, Minimum probability flow, Hidden clique
Introduction
Discovered first by Pastur and Figotin [1] as a simplified spin glass [2] in statistical physics, the Hopfield model [3] is a recurrent network of n linear threshold McCulloch–Pitts [4] neurons that can store binary patterns [5] as distributed “memories” in the form of auto-associative fixed-point attractors. While several aspects of these networks appeared earlier (see, e.g., [6] for dynamics and learning), the approach nonetheless introduced ideas from physics into the theoretical study of neural computation. The Hopfield model and its variants have been studied intensely in theoretical neuroscience and statistical physics [7], but investigations into its utility for memory and coding have mainly focused on storing collections of patterns X using a “one-shot” outer-product rule (OPR) for learning, which essentially assigns abstract synaptic weights between neurons to be their correlation, an early idea in neuroscience [8, 9]. Independent of learning, at most 2n randomly generated dense patterns can be simultaneously stored in networks with n neurons [10].
Despite this restriction, super-linear capacity in Hopfield networks is possible for special pattern classes and connectivity structures. For instance, if patterns to memorize contain many zeros, it is possible to store nearly a quadratic number [11]. Other examples are random networks, which have attractors asymptotically [12], and networks storing all permutations [13]. In both examples of exponential storage, however, memories have vanishingly small basins of attraction, making them ill-suited for noise-tolerant pattern storage. Interestingly, the situation is even worse for networks storing permutations: any Hopfield network storing permutations will not recover the derangements (more than a third of all permutations) from asymptotically vanishing noise (see Theorem 4, proved in Sect. 5).
In this note, we design a family of sparsely connected n-node Hopfield networks with (asymptotically, as )
| 1 |
robustly stored fixed-point attractors by minimizing “probability flow” [14, 15]. To our knowledge, this is the first rigorous demonstration of super-polynomial noise-tolerant storage in recurrent networks of simple linear threshold elements. The approach also provides a normative, convex, biologically plausible learning mechanism for discovering these networks from small amounts of data and reveals new connections between binary McCulloch–Pitts neural networks, efficient error-correcting codes, and computational graph theory.
Background
The underlying probabilistic model of data in the Hopfield network is the non-ferromagnetic Lenz–Ising model [16] from statistical physics, more generally called a Markov random field in the literature, and the model distribution in a fully observable Boltzmann machine [17] from artificial intelligence. The states of this discrete distribution are length n binary column vectors each having probability , in which is the energy of a state, W is an n-by-n real symmetric matrix with zero diagonal (the weight matrix), the vector is a threshold term, and is the partition function, the normalizing factor ensuring that represents a probability distribution. In theoretical neuroscience, rows of the matrix W are interpreted as abstract “synaptic” weights connecting neuron e to other neurons f.
The pair determines an asynchronous deterministic (“zero-temperature”) dynamics on states x by replacing each in x with the value:
| 2 |
in a (usually initialized randomly) fixed order through all neurons . The quantity in (2) is often called the feedforward input to neuron e and may be computed by linearly combining input signals from neurons with connections to e. Let (resp. ) be the energy (resp. bit) change when applying (2) at neuron e. The relationship
| 3 |
guarantees that network dynamics does not increase energy. Thus, each initial state x will converge in a finite number of steps to its attractor (also called in the literature fixed-point, memory, or metastable state); e.g., see Fig. 1. The biological plausibility and potential computational power [18] of the dynamics update (2) inspired both early computer [19] and neural network architectures [4, 20].
Fig. 1.

Energy landscape and discrete dynamics in a Hopfield network having robust storage of all 4-cliques in graphs on 8 vertices. The deterministic network dynamics sends three corrupted cliques to graphs with smaller energy, converging on the underlying 4-clique attractors
We next formalize the notion of robust fixed-point attractor storage for families of Hopfield networks. For , the p-corruption of x is the random pattern obtained by replacing each by with probability p, independently. The p-corruption of a state differs from the original by pn bit flips on average so that for larger p it is more difficult to recover the original binary pattern; in particular, is the uniform distribution on (and thus independent of x). Given a Hopfield network, the attractor has -tolerance for a p-corruption if the dynamics can recover from with probability at least . The α-robustness for a set of states X is the most p-corruption every state -tolerates.
At last, we say that a sequence of Hopfield networks robustly stores states with robustness index if the following limit exists and equals the number α:
| 4 |
If α is the robustness index of a family of networks, then the chance that dynamics does not recover an α-corrupted memory can be made as small as desired by devoting more neurons. (Note that by definition, we always have .)
To determine parameters in our networks from a set of training patterns , we minimize the following probability flow objective function [14, 15]:
| 5 |
in which are those neighboring states differing from x by a single flipped bit. It is elementary that a Hopfield network has attractors X if and only if the probability flow (5) can be arbitrarily close to zero, motivating the application of minimizing (5) to find such networks [15]. Importantly, the probability flow is a convex function of the parameters, consists of a number of terms linear in n and the size of X, and avoids the exponentially large partition function Z. We remark that the factor of inside of the exponential in (5) will turn out to be unimportant for our analysis; however, we keep it to be consistent with the previous literature on interpreting (5) as a probability density estimation objective.
Let v be a positive integer and set . A state x in a Hopfield network on n nodes represents a simple undirected graph G on v vertices by interpreting a binary entry in x as indicating whether edge e is in G () or not (). A k-clique x is one of the graphs consisting of k fully connected nodes and other isolated nodes. Below, in Sect. 3, we will design Hopfield networks that have all k-cliques on 2k (or ) vertices as robustly stored memories. For large n, the count approaches (1) by Stirling’s approximation. Figure 1 depicts a network with neurons storing 4-cliques in graphs on vertices.
Results
Our first result is that numerical minimization of probability flow over a vanishingly small critical number of training cliques determines linear threshold networks with exponential attractor memory. We fit all-to-all connected networks on neurons (; ) with increasing numbers of randomly generated k-cliques as training data X by minimizing (5) with the limited-memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) algorithm [21] (implemented in the programming language Python’s package SciPy). In Fig. 2, we plot the percentage of 1000 random new k-cliques that are fixed-points in these networks after training as a function of the ratio of training set size to total number of k-cliques. Each triangle in the figure represents the average of this fraction over 50 networks, each given the same number of randomly generated (but different) training data. The finding is that a critical number of training samples allows for storage of all k-cliques. Moreover, this count is significantly smaller than the total number of patterns to be learned.
Fig. 2.

Learning critical networks with exponential memory by minimizing probability flow on few training patterns. For numbers of vertices () with 50 trials each, the average percent of 1000 randomly drawn cliques that are memories vs. the fraction of training samples to total number of k-cliques. Inset displays enlarged version of the region demarcated by black square; filled regions indicate standard deviation errors over these 50 trials. Dotted lines are average percentage of correct bits after converging dynamics
In Fig. 3(a), we display a portion of the weight matrix with minimum probability flow representing a network (4,994,380 weight and threshold parameters) given 100 ( of all 40-cliques), 1000 (), or () randomly generated 40-cliques as training data; these are the three special starred points in Fig. 2. In Fig. 3(b), we also plot histograms of learned parameters from networks trained on data with these three sample sizes. The finding is that weights and thresholds become highly peaked and symmetric about three limiting quantities as sample size increases.
Fig. 3.

Distribution of network parameters learned by minimizing probability flow (MPF) sharpens around three critical values. (a) Portion of network weights W after minimizing (5) given 100 (bottom), 1000 (middle), or 10,000 (top) random 40-cliques X (of about 1023 in total) on vertices. These networks represent the marked points in Fig. 2. (b) Histograms of weight and threshold parameters for networks in (a) (histogram of thresholds θ in inset). Network parameters are scaled so that thresholds have mean 1 (this does not affect the dynamics). Groups of similar network weights and thresholds are labeled with corresponding parameter x, y, z
We next analytically minimize probability flow to determine explicit networks achieving robust exponential storage. To simplify matters, we first observe by a symmetrizing argument (see Sect. 5) that there is a network storing all k-cliques if and only if there is one with constant threshold and satisfying for each pair , ether (whenever e and f share one vertex) or (when e and f are disjoint). Weight matrices approximating this symmetry can be seen in Fig. 3(a). (Note that this symmetry structure on the weights is independent of clique size k.) In this case, the energy of a graph G with edges is the following linear function of :
| 6 |
in which and are the number of edge pairs in the graph G with exactly one or zero shared vertices, respectively.
Consider the minimization of (5) over a training set X consisting of all k-cliques on vertices (this simplifies the mathematics), restricting networks to our 3-parameter family . When , these networks are sparsely connected, having a vanishing number of connections between neurons relative to total population size. Using single variable calculus and Eq. (6), one can check that, for any fixed positive threshold z, the minimum value of (5) is achieved uniquely at the parameter setting , where
| 7 |
This elementary calculation gives our first main theoretical contribution.
Theorem 1
McCulloch–Pitts attractor networks minimizing probability flow can achieve robust exponential pattern storage.
We prove Theorem 1 using the following large deviation theory argument; this approach also allows us to design networks achieving optimal robustness index (Theorem 2). Fix (or ) and consider a p-corrupted clique. Using Bernstein’s concentration inequality for sums of Bernoulli binary random variables [22] (“coin flips”), it can be shown that with high probability (i.e., approaching 1 as ) an edge in the clique has 2k neighboring edges at least, on average (see Corollary 1).
This gives the fixed-point requirement from (2):
On the other hand, a non-clique edge sharing a vertex with the clique has neighbors at most, on average. Therefore, for a k-clique to be a robust fixed-point, this forces again from (2):
and any other edges will disappear when this holds. ( is “little-o” notation.)
It follows that the optimal setting (7) for x minimizing probability flow gives robust storage (with a single parallel dynamics update) of all k-cliques for . This proves Theorem 1 (see Sect. 5 for the full mathematical details).
It is possible to do better than robustness index by setting , which satisfies the above fixed-point requirements with probability approaching 1 for any fixed and increasing k. We have thus also demonstrated:
Theorem 2
There is a family of Hopfield networks on nodes that robustly store binary patterns with maximal robustness index .
In Fig. 4, we show robust storage of the (≈1037) 64-cliques in graphs on 128 vertices using three parameter specializations designed here.
Fig. 4.

Robust exponential storage in networks of McCulloch–Pitts neurons. Error-correction performance of Hopfield networks storing all 64-cliques in vertex graphs using a fully connected 8128-bit network minimizing probability flow (5) on random 64-cliques (light gray line), a sparsely connected network with large deviation setting and (gray), or a sparsely connected MPF theoretical optimum (7) (black). Over 10 trials, 100 64-cliques chosen uniformly at random were p-corrupted for different p and then dynamics were converged initialized at noisy cliques. The plot shows the fraction of cliques completely recovered vs. pattern corruption p (standard deviation error bars). Dotted lines are average number of bits in a pattern retrieved correctly after converging network dynamics
A natural question is whether we can store a range of cliques using the same architecture. In fact, we show here that there is a network storing nearly all cliques.
Theorem 3
For large v, there is a Hopfield network on nodes that stores all cliques of size k as fixed-points, where k is in the range:
for constants , . Moreover, this is the largest possible range of k for any such Hopfield network.
Our next result demonstrates that even robustness to vanishingly small amounts of noise is nontrivial (see Sect. 5.5 for the proof).
Theorem 4
Hopfield–Platt networks storing all permutations will not robustly store derangements (permutations without fixed-points).
As a final application to biologically plausible learning theory, we derive a synaptic update rule for adapting weights and thresholds in these networks. Given a training pattern x, the minimum probability flow (MPF) learning rule moves weights and thresholds in the direction of steepest descent of the probability flow objective function (5) evaluated at . Specifically, for the rule takes the form:
| 8 |
After learning, the weights between neurons e and f are symmetrized to , which preserves the energy function and guarantees that dynamics terminates in fixed-point attractors. As update directions (8) descend the gradient of an infinitely differentiable convex function, learning rules based on them have good convergence rates [23].
Let us examine the (symmetrized) learning rule (8) more closely. Suppose first that so that or 1 (depending on the sign of ). When , weight does not change; on the other hand, when , the weight decreases if (and stays the same, otherwise). If instead , then changes only if or , in which case the update is positive when at least one of , is 1 (and zero, otherwise). In particular, either (i) weights do not change (when the pattern is memorized or there is no neural activity) or (ii) when neurons e and f are both active in (8), weights increase, while when they are different, they decrease, consistent with Hebb’s postulate [9], a basic hypothesis about neural synaptic plasticity. In fact, approximating the exponential function with unity in (8) gives a variant of classical outer-product rule (OPR) learning. Note also that adaptation (8) is local in that updating weights between 2 neurons only requires their current state/threshold and feedforward input from nearby active neurons.
Discussion
The biologically inspired networks introduced in this work constitute a new nonlinear error-correcting scheme that is simple to implement, parallelizable, and achieves the most asymptotic error tolerance possible [24] for low-density codes over a binary symmetric channel ( in definition (4)). There have been several other approaches to optimal error-correcting codes derived from a statistical physics perspective; for a comprehensive account, we refer the reader to [25]. See also [26–29] for related work on neural architectures with large memory. Additionally, for a recent review of memory principles in computational neuroscience theory more broadly, we refer the reader to the extensive high level summary [30].
Although we have focused on minimizing probability flow to learn parameters in our discrete neural networks, several other strategies exist. For instance, one could maximize the (Bayesian) likelihood of cliques given network parameters, though any strategy involving a partition function over graphs might run into challenging algorithmic complexity issues [31]. Contrastive divergence [17] is another popular method to estimate parameters in discrete maximum entropy models. While this approach avoids the partition function, it requires a nontrivial sampling procedure that precludes exact determination of optimal parameters.
Early work in the theory of neural computation put forward a framework for neurally plausible computation of (combinatorial) optimization tasks [32]. Here, we add another task to this list by interpreting error-correction by a recurrent neural network in the language of computational graph theory. A basic challenge in this field is to design efficient algorithms that recover structures imperfectly hidden inside of others; in the case of finding fully connected subgraphs, this is called the “Hidden clique problem” [33]. The essential goal of this task is to find a single clique that has been planted in a graph by adding (or removing) edges at random.
Phrased in this language, we have discovered discrete recurrent neural networks that learn to use their cooperative McCulloch–Pitts dynamics to solve hidden clique problems efficiently. For example, in Fig. 5 we show the adjacency matrices of three corrupted 64-cliques on vertices returning to their original configuration by one iteration of the network dynamics through all neurons. As a practical matter, it is possible to use networks robustly storing k-cliques for detecting highly connected subgraphs with about k neighbors in large graphs. In this case, error-correction serves as a synchrony finder with free parameter k, similar to how “K-means” is a standard unsupervised approach to decompose data into K clusters.
Fig. 5.

Learning to solve ≈1037 “Hidden clique” problems. (Bottom) Adjacency matrices of three 64-cliques on vertices. (Top) Adjacency matrices of noisy versions of the cliques having, on average, 1219 bits corrupted out of from the original. Converging dynamics of a symmetric 3-parameter network with minimum probability flow initialized at these noisy cliques uncovers the originals
In the direction of applications to basic neuroscience, we comment that it has been proposed that co-activation of groups of neurons—that is, synchronizing them—is a design principle in the brain (see, e.g., [34–36]). If this were true, then perhaps the networks designed here can help discover this phenomenon from spike data. Moreover, our networks also then provide an abstract model for how such coordination might be implemented, sustained, and error-corrected in nervous tissue.
As a final technical remark about our networks, note that our synapses are actually discrete since the probability flow is minimized at a synaptic ratio equaling a rational number. Thus, our work adds to the literature on the capacity of neural networks with discrete synapses (see, e.g., [26, 37–40]), all of which build upon early classical work with associative memory systems (see, e.g., [20, 41]).
Mathematical Details
We provide the remaining details for the proofs of mathematical statements appearing earlier in the text.
Symmetric 3-Parameter Networks
The first step of our construction is to exploit symmetry in the following set of linear inequalities:
| 9 |
where c runs over k-cliques and over vectors differing from c by a single bit flip. The space of solutions to (9) is the convex polyhedral cone of networks having each clique as a strict local minimum of the energy function, and thus a fixed-point of the dynamics.
The permutations of the vertices V act on a network by permuting the rows/columns of the weight matrix () and thresholds (), and this action on a network satisfying property (9) preserves that property. Consider the average of a network over the group : , , and note that if satisfies (9) then so does the highly symmetric object . To characterize , observe that and for all .
These strong symmetries imply there are x, y, z such that and for each pair of all possible edges:
where is the number of vertices that e and f share.
Our next demonstration is an exact setting for weights in these Hopfield networks.
Exponential Storage
For an integer , we say that state is r-stable if it is an attractor for all states with Hamming distance at most r from . Thus, if a state is r-stably stored, the network is guaranteed to converge to when exposed to any corrupted version not more than r bit flips away.
For positive integers k and r, is there a Hopfield network on nodes storing all k-cliques r-stably? We necessarily have , since is greater than or equal to the Hamming distance between two k-cliques that share a -subclique. In fact, for any , this upper bound is achievable by a sparsely connected three-parameter network.
Lemma 1
There exists a family of three-parameter Hopfield networks with , storing all k-cliques as -stable states.
The proof relies on the following lemma, which gives the precise condition for the three-parameter Hopfield network to store k-cliques as r-stable states for fixed r.
Lemma 2
Fix and . The Hopfield network stores all k-cliques as r-stable states if and only if the parameters satisfy
where
Furthermore, a pattern within Hamming distance r of a k-clique converges after one iteration of the dynamics.
Proof
For fixed r and k-clique x, there are possible patterns within Hamming distance r of x. Each of these patterns defines a pair of linear inequalities on the parameters . However, only the inequalities from the following two extreme cases are active constraints. All the other inequalities are convex combinations of these.
r edges in the clique with a common node i are removed.
r edges are added to a node i not in the clique.
In the first case, there are two types of edges at risk of being mislabeled. The first are those of the form ij for all nodes j in the clique. Such an edge has neighbors and non-neighbors. Thus, each such edge will correctly be labeled 1 after one network update if and only if x, y, and z satisfy
| 10 |
The other type are those of the form īj for all nodes in the clique, and j not in the clique. Assuming , such an edge has at most neighbors and non-neighbors. Thus, each such edge will be correctly labeled 0 if and only if
| 11 |
Rearranging Eqs. (10) and (11) yield the first two rows of the matrix in the lemma. A similar argument applies for the second case, giving the last two inequalities.
From the derivation, it follows that if a pattern is within Hamming distance r of a k-clique, then all spurious edges are immediately deleted by case 1, all missing edges are immediately added by case 2, and thus the clique is recovered in precisely one iteration of the network dynamics. □
Proof of Lemma 1
The matrix inequalities in Lemma 2 define a cone in , and the cases or correspond to two separate components of this cone. For the proof of Theorem 1 in the main article, we use the cone with . We further assume to achieve a sparsely connected matrix W. In this case, the second and fourth constraints are dominated by the first and third. Thus, we need x that solves
There exists such a solution if and only if
| 12 |
The above equation is feasible if and only if . □
Proofs of Theorems 1, 2
Fix and . We now tune x such that asymptotically the α-robustness of our set of Hopfield networks storing k-cliques tends to as . By symmetry, it is sufficient to prove robustness for one fixed k-clique x; for instance, the one with vertices . For , let be the p-corruption of x. For each node , let denote the number of edges from i to other clique and non-clique nodes, respectively. With an abuse of notation, we write to mean a vertex i in the clique; that is, . We need the following inequality originally due to Bernstein from 1924.
Proposition 1
(Bernstein’s inequality [22])
Let be independent Bernoulli random variables taking values +1 and −1, each with probability . For any , the following holds:
The following fact is a fairly direct consequence of Proposition 1.
Lemma 3
Let Y be an symmetric matrix with zero diagonal, . For each , let be the ith row sum. Let , and . Then, for any constant , as , we have
and
In particular, .
Proof
Fix . As a direct corollary of Bernstein’s inequality, for each i and for any , we have
It follows that
and thus from a union bound with , we have
Since this last bound converges to 0 with , we have proved the claim for . Since is symmetric about np, a similar inequality holds for . □
Corollary 1
Let , , , , and . Then , , , , and are all of order as almost surely.
Proofs of Theorems 1, 2 (robustness)
Let be the number of neighbors of edge e. For each e in the clique:
To guarantee that all edges e in the clique are labeled 1 after one dynamics update, we need ; that is,
| 13 |
If f is an edge with exactly one clique vertex, then we have
To guarantee that for all such edges f after one iteration of the dynamics, we need ; that is,
| 14 |
In particular, if for some small , then taking would guarantee that for large k the two inequalities (13) and (14) are simultaneous satisfied. In this case, , and thus the family of two-parameter Hopfield networks with , , has robustness index . □
Clique Range Storage
In this section, we give precise conditions for the existence of a Hopfield network on nodes that stores all k-cliques for k in an interval , . We do not address the issue of robustness as the qualitative trade-off is clear: the more memories the network is required to store, the less robust it is. This trade-off can be analyzed by large deviation principles as in Theorem 2.
Lemma 4
Fix m such that . For , there exists a Hopfield network on nodes that stores all k-cliques in the range if and only if M solves the implicit equation , where
Proof
Fix and in Lemma 1. (We do not impose the constraint .) Then the cone defined by the inequalities in Lemma 1 is in bijection with the polyhedron cut out by inequalities:
Let be the line , and be the line . By symmetry, there exists a Hopfield network that stores all k-cliques in the range if and only if . For a point , write for its x-coordinate. Note that, for , the points lie on the following curve Q implicitly parametrized by k:
When the polytope is nonempty, its vertices are the following points: , , for , and the points . This defines a nonempty convex polytope if and only if
Direct computation gives the formulas for , in the lemma statement. See Fig. 6 for a visualization of the constraints of the feasible region. □
Fig. 6.

Feasible exponential storage. (a) The shaded region is the feasible polytope for network parameters giving clique storage for . Black points are its vertices, the red and blue lines are linear constraints. (b) Lines (red) and (blue) for . Note the appearance of the smooth curve Q enveloping the family in the figure
Fixing the number of nodes and optimizing the range in Lemma 4, we obtain Theorem 3 from Sect. 3.
Proof of Theorem 3
From Lemma 4, for large m, M, and v, we have the approximations , . Hence when . Asymptotically for large v, the most cliques are stored when and contains . Consider so that , and thus . Next, set and so that storing the most cliques becomes the problem of maximizing over admissible β the quantity:
One can now check that gives the best value, producing the range in the statement of the theorem.
Next, note that is the fraction of k-cliques in all cliques on v vertices, which is also the probability of a variable equaling k. For large v, approximating this variable with a normal distribution and then using Mill’s ratio to bound its tail c.d.f. Φ, we see that the proportion of cliques storable tends to
for some constant . □
Hopfield–Platt Networks
We prove the claim in the main text that Hopfield–Platt networks [13] storing all permutations on will not robustly store derangements (permutations without fixed-points). For large k, the fraction of permutations that are derangements is known to be .
Proof of Theorem 4
Fix a derangement σ on , represented as a binary vector x in for . For each ordered pair , , , we construct a pattern that differs from x by exactly two bit flips:
Add the edge ij.
Remove the edge .
There are such pairs , and thus different patterns . For each such pattern, we flip two more bits to obtain a new permutation as follows:
Remove the edge .
Add the edge .
It is easy to see that is a permutation on k letters with exactly two cycles determined by . Call the set of edges modified the critical edges of the pair . Note that are all distinct and have disjoint critical edges.
Each is exactly two bit flips away from x and , both permutations on k letters. Starting from , there is no binary Hopfield network storing all permutations that always correctly recovers the original state. In other words, for a binary Hopfield network, is an indistinguishable realization of a corrupted version of x and .
We now prove that, for each derangement x, with probability at least , its p-corruption is indistinguishable from the p-corruption of some other permutation. This implies the statement in the theorem.
For each pair as above, recall that and are two random variables in obtained by flipping each edge of x (resp. ) independently with probability p. We construct a coupling between them as follows. Define the random variable via:
For each non-critical edge, flip this edge on and with the same .
For each critical edge, flip them on and with independent .
Then have the same distribution, and and only differ in distribution on the four critical edges. Their marginal distributions on these four edges are two discrete variables on 24 states, with total variation distance . Thus, there exists a random variable such that , and
In other words, given a realization of , with probability , this is equal to a realization from the distribution of , and therefore no binary Hopfield network storing both and x can correctly recover the original state from such an input. An indistinguishable realization occurs when two of the four critical edges are flipped in a certain combination. For fixed x, there are such where the critical edges are disjoint. Thus, the probability of being an indistinguishable realization from a realization of one of the is at least
completing the proof of Theorem 4. □
Examples of Clique Storage
To illustrate the effect of two different noise levels on hidden clique finding performance of the networks from Fig. 4, we present examples in Fig. 7 of multiple networks acting with their dynamics on the same two noisy inputs. Notice that non-clique fixed-points appear, and it is natural to ask whether a complete characterization of the fixed-point landscape is possible. Intuitively, our network performs a local, weighted degree count at each edge of the underlying graph and attempts to remove edges with too few neighbors, while adding in edges that connect nodes with high degrees. Thus, resulting fixed-points (of the dynamics) end up being graphs such as cliques and stars. Beyond this intuition, however, we do not have a way to characterize all fixed-points of our network in general.
Fig. 7.

Examples of robustness for networks in Fig. 4 of main text with , , . Adjacency matrices of noisy cliques (in red) have 1219 (top) or 1625 (bottom) bits corrupted out of 8128 () from the original 64-clique (in green). Images show the result of dynamics applied to these noisy patterns using networks with all-to-all MPF parameters after L-BFGS training on 64-cliques ( of all 64-cliques), Large deviation parameters , or MPF Theory parameters from Eq. (7) in the main text
In fact, this is a very difficult problem in discrete geometry, and except for toy networks, we believe that this has never been done. Geometrically, the set of all states of a binary Hopfield network with n neurons is the n-hypercube . Being a fixed-point can be characterized by the energy function becoming larger when one bit is flipped. As the energy function is quadratic, for each of the n bits flipped, this creates a quadratic inequality. Thus, the set of all fixed-point attractors in a binary Hopfield network is the n-hypercube intersected with n quadratic inequalities in n variables. In theory, one could enumerate such sets for small n; however, characterizing them all is challenging, even for the highly symmetric family of weight matrices that we propose here.
Acknowledgments
Acknowledgements
We thank Kilian Koepsell and Sarah Marzen for helpful comments that enhanced the quality of this work.
Availability of data and materials
Data sharing not applicable to this article as no datasets were generated or analyzed during the current study.
Abbreviations
- OPR
outer-product rule
- MPF
minimum probability flow
Authors’ contributions
CJH and NMT contributed equally. All authors read and approved the final manuscript.
Funding
Support was provided, in part, by NSF grant IIS-0917342 (CH), an NSF All-Institutes Postdoctoral Fellowship administered by the Mathematical Sciences Research Institute through its core grant DMS-0441170 (CH), and DARPA Deep Learning Program FA8650-10-C-7020 (NT).
Ethics approval and consent to participate
Not applicable.
Competing interests
The authors declare that they have no competing interests.
Consent for publication
Not applicable.
Footnotes
Christopher J. Hillar and Ngoc M. Tran contributed equally to this work.
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Contributor Information
Christopher J. Hillar, Email: chillar@msri.org
Ngoc M. Tran, Email: ntran@math.utexas.edu
References
- 1.Pastur L, Figotin A. Exactly soluble model of a spin glass. Sov J Low Temp Phys. 1977;3:378–383. [Google Scholar]
- 2.Edwards S, Anderson P. Theory of spin glasses. J Phys F, Met Phys. 1975;5(5):965. doi: 10.1088/0305-4608/5/5/017. [DOI] [Google Scholar]
- 3.Hopfield J. Neural networks and physical systems with emergent collective computational abilities. Proc Natl Acad Sci USA. 1982;79(8):2554. doi: 10.1073/pnas.79.8.2554. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.McCulloch W, Pitts W. A logical calculus of the ideas immanent in nervous activity. Bull Math Biol. 1943;5(4):115–133. [PubMed] [Google Scholar]
- 5.McEliece R, Posner E, Rodemich E, Venkatesh S. The capacity of the Hopfield associative memory. IEEE Trans Inf Theory. 1987;33(4):461–482. doi: 10.1109/TIT.1987.1057328. [DOI] [Google Scholar]
- 6.Amari S-I. Learning patterns and pattern sequences by self-organizing nets of threshold elements. IEEE Trans Comput. 1972;100(11):1197–1206. doi: 10.1109/T-C.1972.223477. [DOI] [Google Scholar]
- 7.Talagrand M. Spin glasses: a challenge for mathematicians. Berlin: Springer; 2003. [Google Scholar]
- 8.Lorente de Nó R. Vestibulo-ocular reflex arc. Arch Neurol Psychiatry. 1933;30(2):245–291. doi: 10.1001/archneurpsyc.1933.02240140009001. [DOI] [Google Scholar]
- 9.Hebb D. The organization of behavior. New York: Wiley; 1949. [Google Scholar]
- 10.Cover T. Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition. IEEE Trans Comput. 1965;3:326–334. doi: 10.1109/PGEC.1965.264137. [DOI] [Google Scholar]
- 11.Amari S-I. Characteristics of sparsely encoded associative memory. Neural Netw. 1989;2(6):451–457. doi: 10.1016/0893-6080(89)90043-9. [DOI] [Google Scholar]
- 12.Tanaka F, Edwards S. Analytic theory of the ground state properties of a spin glass. I. Ising spin glass. J Phys F, Met Phys. 1980;10:2769. doi: 10.1088/0305-4608/10/12/017. [DOI] [Google Scholar]
- 13.Platt J, Hopfield J. Neural networks for computing. Melville: AIP Publishing; 1986. Analog decoding using neural networks; pp. 364–369. [Google Scholar]
- 14.Sohl-Dickstein J, Battaglino P, DeWeese M. New method for parameter estimation in probabilistic models: minimum probability flow. Phys Rev Lett. 2011;107(22):220601. doi: 10.1103/PhysRevLett.107.220601. [DOI] [PubMed] [Google Scholar]
- 15.Hillar C, Sohl-Dickstein J, Koepsell K. 4th neural information processing systems (NIPS) workshop on discrete optimization in machine learning (DISCML): structure and scalability. 2012. Efficient and optimal binary Hopfield associative memory storage using minimum probability flow; pp. 1–6. [Google Scholar]
- 16.Ising E. Beitrag zur theorie des ferromagnetismus. Z Phys. 1925;31:253–258. doi: 10.1007/BF02980577. [DOI] [Google Scholar]
- 17.Ackley D, Hinton G, Sejnowski T. A learning algorithm for Boltzmann machines. Cogn Sci. 1985;9(1):147–169. doi: 10.1207/s15516709cog0901_7. [DOI] [Google Scholar]
- 18.Turing A. On computable numbers, with an application to the Entscheidungsproblem. Proc Lond Math Soc. 1937;2(1):230–265. doi: 10.1112/plms/s2-42.1.230. [DOI] [Google Scholar]
- 19.Von Neumann J. First draft of a report on the EDVAC. IEEE Ann Hist Comput. 1993;15(4):27–75. doi: 10.1109/85.238389. [DOI] [Google Scholar]
- 20.Rosenblatt F. Principles of neurodynamics: perceptrons and the theory of brain mechanisms. Washington, DC: Spartan Books; 1961. [Google Scholar]
- 21.Nocedal J. Updating quasi-Newton matrices with limited storage. Math Comput. 1980;35(151):773–782. doi: 10.1090/S0025-5718-1980-0572855-7. [DOI] [Google Scholar]
- 22.Bernstein S. On a modification of Chebyshev’s inequality and of the error formula of Laplace. Ann Sci Inst Sav Ukr, Sect Math. 1924;1(4):38–49. [Google Scholar]
- 23.Hazan E, Agarwal A, Kale S. Logarithmic regret algorithms for online convex optimization. Mach Learn. 2007;69(2–3):169–192. doi: 10.1007/s10994-007-5016-8. [DOI] [Google Scholar]
- 24.Shannon C. A mathematical theory of communication. Bell Syst Tech J. 1948;27:379–423. doi: 10.1002/j.1538-7305.1948.tb01338.x. [DOI] [Google Scholar]
- 25.Vicente R, Saad D, Kabashima Y. Low-density parity-check codes—a statistical physics perspective. Adv Imaging Electron Phys. 2002;125:232–355. [Google Scholar]
- 26.Gripon V, Berrou C. Sparse neural networks with large learning diversity. IEEE Trans Neural Netw. 2011;22(7):1087–1096. doi: 10.1109/TNN.2011.2146789. [DOI] [PubMed] [Google Scholar]
- 27.Kumar K, Salavati A, Shokrollahi A. Information theory workshop (ITW) New York: IEEE Press; 2011. Exponential pattern retrieval capacity with non-binary associative memory; pp. 80–84. [Google Scholar]
- 28.Curto C, Itskov V, Morrison K, Roth Z, Walker J. Combinatorial neural codes from a mathematical coding theory perspective. Neural Comput. 2013;25(7):1891–1925. doi: 10.1162/NECO_a_00459. [DOI] [PubMed] [Google Scholar]
- 29.Karbasi A, Salavati A, Shokrollahi A, Varshney L. Noise facilitation in associative memories of exponential capacity. Neural Comput. 2014;16(11):2493–2526. doi: 10.1162/NECO_a_00655. [DOI] [PubMed] [Google Scholar]
- 30.Chaudhuri R, Fiete I. Computational principles of memory. Nat Neurosci. 2016;19(3):394–403. doi: 10.1038/nn.4237. [DOI] [PubMed] [Google Scholar]
- 31.Jerrum M, Sinclair A. Polynomial-time approximation algorithms for the Ising model. SIAM J Comput. 1993;22(5):1087–1116. doi: 10.1137/0222066. [DOI] [Google Scholar]
- 32.Hopfield J, Tank D. Computing with neural circuits: a model. Science. 1986;233(4764):625–633. doi: 10.1126/science.3755256. [DOI] [PubMed] [Google Scholar]
- 33.Alon N, Krivelevich M, Sudakov B. Finding a large hidden clique in a random graph. Random Struct Algorithms. 1998;13(3–4):457–466. doi: 10.1002/(SICI)1098-2418(199810/12)13:3/4<457::AID-RSA14>3.0.CO;2-W. [DOI] [Google Scholar]
- 34.Singer W. Synchronization of cortical activity and its putative role in information processing and learning. Annu Rev Physiol. 1993;55(1):349–374. doi: 10.1146/annurev.ph.55.030193.002025. [DOI] [PubMed] [Google Scholar]
- 35.Singer W. Neuronal synchrony: a versatile code for the definition of relations? Neuron. 1999;24(1):49–65. doi: 10.1016/S0896-6273(00)80821-1. [DOI] [PubMed] [Google Scholar]
- 36.Womelsdorf T, Schoffelen J-M, Oostenveld R, Singer W, Desimone R, Engel A, Fries P. Modulation of neuronal interactions through neuronal synchronization. Science. 2007;316(5831):1609–1612. doi: 10.1126/science.1139597. [DOI] [PubMed] [Google Scholar]
- 37.Gutfreund H, Stein Y. Capacity of neural networks with discrete synaptic couplings. J Phys A. 1990;23(12):2613–2630. doi: 10.1088/0305-4470/23/12/036. [DOI] [Google Scholar]
- 38.Kocher I, Monasson R. On the capacity of neural networks with binary weights. J Phys A. 1992;25(2):367–380. doi: 10.1088/0305-4470/25/2/017. [DOI] [Google Scholar]
- 39.Knoblauch A. Efficient associative computation with discrete synapses. Neural Comput. 2015;28(1):118–186. doi: 10.1162/NECO_a_00795. [DOI] [PubMed] [Google Scholar]
- 40.Alemi A, Baldassi C, Brunel N, Zecchina R. A three-threshold learning rule approaches the maximal capacity of recurrent neural networks. PLoS Comput Biol. 2015;11(8):1004439. doi: 10.1371/journal.pcbi.1004439. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 41.Willshaw D, Buneman O, Longuet-Higgins H. Non-holographic associative memory. Nature. 1969;222(5197):960–962. doi: 10.1038/222960a0. [DOI] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
Data sharing not applicable to this article as no datasets were generated or analyzed during the current study.
