Phase Kernel Lifts Capacity of Dense Associative Memory

Yifei Zhao, Ying TangNeurIPS 2026

TL;DR

Modern Hopfield Networks—the mathematical cousins of Transformer self-attention—promise exponential memory storage in theory, yet stumble in practice because their energy valleys overlap when crowded. By drawing inspiration from coupled oscillators, the authors introduce a class of nonlinear phase kernels (instantiated as S-Hop) that carve out broad, distinct attractor basins without requiring any learned parameters. The result is a training-free associative memory that achieves over a $50\times$ boost in practical retrieval capacity on high-resolution ImageNet images while mathematically guaranteeing stable convergence.

What Problem Does This Paper Address?

Picture an associative memory as a physical landscape where stored memories sit at the bottom of valleys (attractor basins). Drop a noisy query onto the hillside, and gravity pulls it down to the cleanest, closest memory.

Modern Hopfield Networks (MHNs)—which happen to be mathematically equivalent to the self-attention mechanism in Transformers—theoretically boast an exponential number of these valleys relative to input dimension. In reality, however, standard MHNs rely on simple dot-product (linear) similarities. As you pack more high-dimensional patterns into memory, those valleys narrow and blur together, creating "spurious states"—phantom valleys where queries get stuck retrieving a muddled mess instead of a real memory.

You can't just slap an arbitrary nonlinear function onto the features and hope for the best; doing so easily destroys both the guarantee that queries actually settle at the bottom of a valley (Lyapunov stability) and the exponential capacity itself. The challenge is reshaping the geometry of the landscape while keeping the physics intact.

Figure 1: Framework, energy landscape, and capacity gains of S-Hop. (a) Schematic of the energy- shaping motivation for stored patterns. (b) Illustrative 2D energy contours around m1, m2, indepen- dently scaled to [0, 1] for each kernel. (c) Retrieval-load summaries on CIFAR-10 (d = 3072) and ImageNet (224 × 224, d = 150528) for S-Hop, U-Hop [7], MHN [1], and Cosine Hopfield Network (C-Hop). S-Hop achieves passing-load ratios of over 50× than the previous methods.

Methods

Inspired by continuous phase-oscillator networks (like syncing pendulums or fireflies), the authors treat raw inputs and memories as "phase vectors" $\varphi \in \mathbb{R}^d$ and map them into a higher-dimensional feature space via a specialized nonlinear phase kernel $F(\varphi)$.

What makes this new is how the kernel is constrained. In standard MHNs, you update states directly in feature space. Pulling that energy back through a generic nonlinear map normally tangles all the coordinates together via its Jacobian, making updates intractable. The authors design kernels where the quadratic norm $\frac{1}{2}\|F(\varphi)\|_2^2$ is separably strongly convex—meaning its gradient breaks down cleanly into an independent, monotonic 1D function $h(\varphi_k)$ for every single coordinate.

As a concrete flagship model, they introduce the Sigmoidal Phase Hopfield Network (S-Hop), which maps each phase coordinate $\varphi_k$ into two coupled features: $\sqrt{\varphi_k^2 + \tanh\varphi_k + 1}$ and $\sqrt{\varphi_k^2 + 1}$. Because this induces a strict difference-of-convex energy structure, the authors derive a Concave-Convex Procedure (CCCP) update rule. In plain English: every retrieval step simply computes standard softmax attention weights in feature space, projects back via the Jacobian, and applies a fast, component-wise inverse $h^{-1}$—guaranteeing the system slides monotonically downhill in energy with zero training required.

Datasets

The authors evaluate memory retrieval and downstream classification across four standard vision benchmarks—MNIST ($28\times28$), CIFAR-10 ($32\times32$), TinyImageNet ($64\times64$), and ImageNet (at both $64\times64$ and $224\times224$ resolutions)—introducing no new datasets, though they construct specific subset controls on TinyImageNet to probe how image brightness and visual similarity affect retrieval.

Key Insights and Ideas

  • Nonlinear embeddings aren't enough; you need the matching dynamics: In ablations, using S-Hop's nonlinear features with standard similarity-only updates fails almost immediately ($N=10$). The magic happens only when pairing the embedding with its exact energy-derived Jacobian and inverse-field update.
  • Decoupling saves computation: Requiring the kernel's squared norm to decouple coordinate-wise turns what would be a nightmare multidimensional implicit equation into fast, parallel 1D inversions.
  • Training-free beats learned projections: Prior state-of-the-art methods like U-Hop train linear projections specifically to separate a given bank of memories. S-Hop's fixed geometric warping outperforms those learned embeddings out of the box, running $7\text{--}27\times$ faster when amortized over queries.

Key Results

Measuring "critical capacity" ($N_c$) as the maximum number of stored images where $>90\%$ of noisy queries ($\sigma = 0.3$) are recovered within $\text{MSE} < 0.1$ in a single step:

  • ImageNet ($224\times224$ & $64\times64$): S-Hop sustains $>90\%$ success all the way through the maximum tested load of $N=500$ ($98.53\%$ accuracy at $224\times224$), whereas MHN, Cosine-Hopfield, and U-Hop all fail before $N=10$—a $>50\times$ gain in first-failure load.
  • CIFAR-10: At $N=500$, S-Hop hits $92.07\%$ retrieval success versus $48.40\%$ for U-Hop's public objective and $3.33\%$ for standard MHN (an $8.3\times$ load gain, passing $500$ vs. U-Hop's $60$).
  • TinyImageNet: S-Hop achieves a $4\times$ capacity gain over U-Hop on default subsets, jumping past $500$ when visually near-duplicate images are filtered.
  • Speed & Downstream Tasks: On MNIST ($N=300$), S-Hop takes $\approx 1.5\text{ ms}$/query (faster than U-Hop's $10\text{--}40\text{ ms}$, slightly slower than MHN's $0.1\text{ ms}$). Swapping early attention layers for S-Hop in a CIFAR-10 classifier nudges test accuracy to $\approx 90\%$ ($+0.2\%$ over baseline).

Limitations and Future Work

The theoretical proof of exponential capacity assumes memory coordinates are independent and uniformly distributed—a clean mathematical world far removed from natural images, where pixels are heavily correlated and brightness varies wildly. Indeed, on an uncurated TinyImageNet subset full of dim, lookalike goldfish, S-Hop's critical load dropped to $40$ before rebounding past $500$ once better-separated images with comparable norms were selected. Future work points toward extending the theory to correlated data distributions and turning S-Hop's fixed mathematical structure into learnable phase kernels that adapt directly to messy, real-world data.

Summary updated

Abstract

Dense associative memory underlies modern attention mechanisms; however, conventional Modern Hopfield Network (MHN) with linear kernels yields overlapping attractor basins and spurious states under high memory load, limiting their theoretically exponential storage capacity in practice. We construct a class of nonlinear phase kernels that reshape the energy dynamics into deep, well-separated basins, and prove that any kernel in this class preserves exponential storage capacity while guaranteeing convergence to fixed points. As a representative instantiation, we introduce the Sigmoidal Phase Hopfield Network (S-Hop), which guarantees monotone energy descent and mitigates the practical loss of memory capacity. Experiments on MNIST and CIFAR-10 show that S-Hop achieves up to a $50\times$ increase in critical capacity over baseline models. We also provide a systematic capacity measurement of Hopfield networks on TinyImageNet, where S-Hop exhibits improved retrieval robustness and noise resilience. The phase-kernel design provides a principled route toward more robust dense associative memory.
BibTeX
@inproceedings{zhao2026phase,
  author = {Yifei Zhao and Ying Tang},
  title = {{Phase Kernel Lifts Capacity of Dense Associative Memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=iZSMEnlggu},
}
Figure