Skip to main content
QUICK REVIEW

[论文解读] Hopfield Networks is All You Need

Hubert Ramsauer, Bernhard Schäfl|arXiv (Cornell University)|Jul 16, 2020
Cognitive Science and Education Research参考文献 106被引用 72
一句话总结

本文介绍了将现代连续状态的 Hopfield 网络作为可微分内存层,相当于 transformer 的注意力机制,使存储呈指数级增长并实现一次性检索,并展示其在 MIL、免疫受体、较小数据集和药物设计中的有效性。

ABSTRACT

We introduce a modern Hopfield network with continuous states and a corresponding update rule. The new Hopfield network can store exponentially (with the dimension of the associative space) many patterns, retrieves the pattern with one update, and has exponentially small retrieval errors. It has three types of energy minima (fixed points of the update): (1) global fixed point averaging over all patterns, (2) metastable states averaging over a subset of patterns, and (3) fixed points which store a single pattern. The new update rule is equivalent to the attention mechanism used in transformers. This equivalence enables a characterization of the heads of transformer models. These heads perform in the first layers preferably global averaging and in higher layers partial averaging via metastable states. The new modern Hopfield network can be integrated into deep learning architectures as layers to allow the storage of and access to raw input data, intermediate results, or learned prototypes. These Hopfield layers enable new ways of deep learning, beyond fully-connected, convolutional, or recurrent networks, and provide pooling, memory, association, and attention mechanisms. We demonstrate the broad applicability of the Hopfield layers across various domains. Hopfield layers improved state-of-the-art on three out of four considered multiple instance learning problems as well as on immune repertoire classification with several hundreds of thousands of instances. On the UCI benchmark collections of small classification tasks, where deep learning methods typically struggle, Hopfield layers yielded a new state-of-the-art when compared to different machine learning methods. Finally, Hopfield layers achieved state-of-the-art on two drug design datasets. The implementation is available at: https://github.com/ml-jku/hopfield-layers

研究动机与目标

  • 将记忆增强架构作为 RNN 的替代方案的动机,并提升深度网络中的存储与检索能力。
  • 提出一种可微分的、连续状态的 Hopfield 网络,具有新的能量函数和一次更新检索。
  • 展示 Hopfield 层可以被整合到深度架构中,作为池化、内存或注意力机制。
  • 展示在 MIL、小型分类任务、免疫受体分类和药物设计等领域的广泛适用性。

提出的方法

  • 为连续状态的 Hopfield 网络定义一个新的能量函数 E,将 -lse 与二次状态项结合以约束范数。
  • 引入一个一次更新规则 xi_new = X softmax(beta X^T xi),使其全局收敛到 E 的驻点。
  • 证明收敛性质以及在模式分离和网络参数方面的指数级检索精度。
  • 展示该更新规则与变换器中使用的键-值注意力机制(自注意力)的等价性。
  • 描述三种 Hopfield 层类型(Hopfield、HopfieldPooling、HopfieldLayer),用于集成到深度网络中。

实验结果

研究问题

  • RQ1现代 Hopfield 网络在连续状态下是否能够在 d 维空间中以指数级存储模式并在一次更新中以高精度检索它们?
  • RQ2如何将 Hopfield 网络整合为可微分层,在深度架构中提供记忆、池化和注意力?
  • RQ3基于 Hopfield 的层是否在 MIL、免疫学受体分类、小型 UCI 任务和药物设计数据集上提升性能?

主要发现

方法TigerFoxElephantUCSB
Hopfield (ours) | HopfieldPooling?91.3±0.564.05±0.494.9±0.389.5±0.8
Path encoding (Küçükaşcı & Baydoğan 2018)91.0±1.071.2±1.494.4±0.788.0±2.2
MInD (Cheplygina et al., 2016)85.3±1.170.4±1.693.6±0.983.1±2.7
MILES (Chen et al., 2006)87.2±1.773.8±1.692.7±0.783.3±2.6
APR (Dietterich et al., 1997)77.8±0.754.1±0.955.0±1.0
Citation-kNN (Wang, 2000)85.5±0.963.5±1.589.6±0.970.6±3.2
  • 维度上的存储容量呈指数级增长,在某些条件下有可证的下界 N ≥ sqrt(p) c^{(d-1)/4}。
  • 一次更新检索在模式分离良好的情况下一般ε-接近固定点(在分离度 Δi 上呈指数增长)。
  • Hopfield 层在若干 MIL 基准测试(免疫受体和基于图像的 MIL 数据集)上实现了最先进的结果。
  • 在 MIL 基准测试中,HopfieldPooling 在 Tiger、Fox、Elephant、UCSB Breast Cancer 数据集上显示出有竞争力或更优的 AUC。
  • HopfieldLayer 可以在单层中模拟 SVM、k-NN 和 LVQ,提供灵活的分类能力。
  • 变换器中的注意力机制对应 Hopfield 更新,将现代内存网络与自注意力联系起来。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。