Hopfield-Netzwerke (Attraktornetzwerke)

Hopfield-Netzwerke sind rekurrente neuronale Netze, die assoziatives Gedächtnis modellieren: Sie speichern Muster als stabile Zustände (Attraktoren) und können unvollständige oder verrauschte Eingaben zum gespeicherten Muster vervollständigen.

Details

Grundprinzip

  • Vollständig verbundenes rekurrentes Netz mit symmetrischen Gewichten (w_ij = w_ji)
  • Zustand jedes Neurons: ±1 (klassisch) oder kontinuierlich
  • Energiefunktion: E = −½ Σ_ij w_ij s_i s_j — das Netz minimiert diese Energie
  • Stabiler Zustand (Attraktor): lokales Minimum der Energiefunktion = gespeichertes Muster

Lernregel (Hebb’sches Lernen)

  • w_ij = Σ_μ x_i^μ · x_j^μ (Summe über alle gespeicherten Muster)
  • Muster, die oft co-aktiv sind, erhalten starke Verbindungen — direkte Umsetzung der Hebb’schen Regel
  • Kapazitätsgrenze: ca. 0.14 × N Muster (N = Anzahl Neuronen) → bei Überschreitung: falsche Attraktoren

Anwendung: Mustervervollständigung

Teilmuster ("halbe Erinnerung") → Dynamik → nächster Attraktor = vollständiges Muster

→ Modell für Gedächtnisabruf beim Menschen: Hippocampus als Attraktor-Netzwerk (CA3-Region)

Modern Hopfield Networks (Ramsauer et al., 2020)

  • Kontinuierliche Version mit exponentieller Interaktion
  • Exponentiell mehr Kapazität: kann ~2^(N/2) Muster speichern
  • Äquivalenz zu Transformer Self-Attention: der Update-Schritt eines modernen Hopfield-Netzwerks ist mathematisch identisch mit dem Softmax-Attention-Mechanismus
  • Interpretiert Transformers als implementierende assoziative Gedächtnissysteme

Neurowissenschaftliche Relevanz

  • CA3 des Hippocampus: Kollateralverbindungen ermöglichen Mustervervollständigung (Pattern Completion)
  • CA3 ↔ CA1: Hippocampus unterscheidet Mustervervollständigung (CA3) von Musterdiskriminierung (DG/CA1 → Mustertrennungspair mit Körnerzellen)
  • A³-Bench (A3-Bench – Memory-Driven Scientific Reasoning via Anchor and Attractor Activation): Benchmark für LLMs, das Attraktor-Mechanismen für wissenschaftliches Schlussfolgern evaluiert

Simulation: Mustervervollständigung und Energieabstieg

What this shows. Three 5×5 binary glyphs (X, T, O) are stored as attractors via a single Hebbian outer-product sum W = Σ_μ x^μ(x^μ)ᵀ with the diagonal zeroed — no iterative training, just one matrix operation. Pattern X is then corrupted by flipping 8 of its 25 bits, and the network runs asynchronous sign(Wy) updates (one neuron at a time, random order) until no neuron flips. The recalled image is bit-for-bit identical to the original X: this is content-addressable memory / pattern completion, exactly the CA3-hippocampus analogy. The right panel tracks the energy E = −½ yᵀWy after every neuron flip — it descends monotonically to a local minimum and never increases, which is the lecture’s guarantee E(y^(t+1)) ≤ E(y^(t)) and the reason convergence to a stored attractor is assured. The same retrieval-by-energy-minimisation, in its continuous form, is mathematically equivalent to Transformer Self-Attention (Modern Hopfield Networks, Ramsauer et al. 2020).

Mini-Demo: Speichern und Abrufen eines Musters

Hebb’sches Lernen ist eine einzige Zeile (W = Σ x·xᵀ), Retrieval ist eine sign-Iteration bis zur Konvergenz. Das Netz wird hier mit einem halben Muster gefüttert und konvergiert zum gespeicherten Original:

Was der Code sichtbar macht:

  • Speicherung = eine Matrixoperation, kein Training-Loop. Das ist die Stärke (one-shot learning) und Schwäche (kein Lernen aus Statistik).
  • Retrieval ist Energieminimierung: jeder Update-Schritt senkt E garantiert → Konvergenz in einen Attraktor (ein gespeichertes Muster oder ein “Geister”-Minimum bei Überlast).
  • Bei > 0.14·N Mustern beginnen die Attraktoren zu interferieren und die Retrievals werden falsch — die berühmte Hopfield-Kapazitätsgrenze.

Where Hopfield Networks are still used today

Classical Hopfield Networks (Hopfield 1982) are mostly historical, but the idea of energy-based associative memory has had a major revival.

  • Modern Hopfield Networks (Ramsauer et al., 2020) — continuous version with exponential capacity. Mathematically equivalent to Transformer self-attention — every attention layer can be read as one step of Hopfield retrieval over a continuous memory.
  • Biologically inspired memory models — used in computational neuroscience to model hippocampal CA3 pattern completion (the “remember a face from a glimpse” mechanism).
  • A³-Bench (2024) — benchmark that explicitly tests LLMs for Hopfield-style attractor reasoning.
  • Content-addressable memory in robotics & sensor fusion — small-scale systems that need to retrieve patterns from noisy partial cues.
  • Energy-based models (EBMs) revival — LeCun’s recent work on Joint-Embedding Predictive Architectures (JEPA) uses Hopfield-style energy landscapes.

Where Hopfield Networks were replaced — and by what

DomainWas Hopfield, now …Why
General associative memory in MLTransformer self-attentionModern Hopfield Networks are literally the same math — Transformers won because they integrate cleanly with backprop and scale to billions of parameters
Pattern recognition (early 1980s use)CNNs, MLPs trained with backpropHopfield’s storage capacity is ~0.14·N (catastrophic interference past that); deep nets have effectively unlimited capacity per parameter
Optimization (Hopfield-Tank TSP, 1985)Simulated Annealing, Branch-and-Cut (Concorde), neural combinatorial methodsHopfield-Tank optimization was unreliable; SA and ILP solvers dominate combinatorial optimization

Where Hopfield ideas still stand: when you need a retrieval mechanism that can be analyzed in terms of energy minimization and attractor dynamics — particularly in neuroscience-inspired AI and EBM research. Pure classical Hopfield Networks are rarely deployed.

See also

Tags: neuroscience ai memory
Superlink: 050 🧠Neuroscience

Verbindungen

Created: 06/05/26