SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2008.02217 · 2020

Hopfield Networks is All You Need

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2008.02217.json · badge: /api/ran/2008.02217.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ppsp-team/pyhkbs community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
HKBextended Ran
ran on a synthesized input
ppsp-team/pyhkbs/basicHKB.py
code served (permissive licence) · get_code("7d6c1bc2b71b84af")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function HKBextended takes a single parameter 'phase'
# Looking at the function body, it uses np.sin() on phase and 2*phase
# This means phase should be a numeric value or numpy array that supports these operations

# Create a small phase value (scalar or array)
phase_value = np.array(0.5)

# Construct the ARGS dictionary with all parameters
ARGS = {
    "phase": phase_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
HKBextended_torch Ran
ran on a synthesized input
ppsp-team/pyhkbs/basicHKB.py
code served (permissive licence) · get_code("d192a8b31ecb58fb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (1,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Examine the function signature and body:
# - t: used nowhere in the function body, but it's a parameter
# - phase: used in torch.sin(phase) operations, so needs to be a tensor

# Create small test tensors
t = torch.tensor(0.0)  # scalar time value
phase = torch.tensor([0.5])  # scalar phase value as a tensor

ARGS = {
    't': t,
    'phase': phase
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (1,) — shape (1,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_KOP Ran
ran on a synthesized input
ppsp-team/pyhkbs/grid_search_evaluation.py
code served (permissive licence) · get_code("30b782ad6c30dce4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a phase_matrix argument
# The function expects a 2D array where:
# - axis 0 is time steps
# - axis 1 is oscillators/phases
# We use distinct dimensions: 5 time steps, 3 phases
np.random.seed(0)
phase_matrix = np.random.uniform(0, 2*np.pi, size=(5, 3))

ARGS = {
    "phase_matrix": phase_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_average_wPLI Ran
ran on a synthesized input
ppsp-team/pyhkbs/grid_search_evaluation.py
code served (permissive licence) · get_code("ce92b635cbc158a0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function to understand what it needs:
# - phase_matrix: a 2D numpy array where:
#   - axis 0 has _n_oscillators elements
#   - axis 1 has simulation_length elements
#   - Must be large enough that window_start + window_length < simulation_length
# - window_length: integer specifying window size
# - window_step: integer specifying step size between windows

# Create small but valid test data
n_oscillators = 4
simulation_length = 20
window_length = 5
window_step = 2

# phase_matrix should contain phase values (can be any float values)
# Using small random phases for testing
phase_matrix = np.random.randn(n_oscillators, simulation_length)

# Verify the condition: window_start + window_length < simulation_length
# Initially window_start = 0, so we need window_length < simulation_length
# This is satisfied: 5 < 20

ARGS = {
    "phase_matrix": phase_matrix,
    "window_length": window_length,
    "window_step": window_step,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_inter_agent_PLV Ran
ran on a synthesized input
ppsp-team/pyhkbs/grid_search_social_evaluation.py
code served (permissive licence) · get_code("d5712474eaf7a180")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create phase matrices for multiple agents
# phase_matrices is a list of 2D arrays where each array represents one agent
# Each array has shape (n_oscillators, time_steps)
n_agents = 2
n_oscillators = 6
time_steps = 500

phase_matrices = []
for agent_idx in range(n_agents):
    # Create phase data as random values between 0 and 2*pi
    phase_data = np.random.rand(n_oscillators, time_steps) * 2 * np.pi
    phase_matrices.append(phase_data)

# Window parameters
window_length = 100  # samples
window_step = 50     # samples
fs = 100            # sampling frequency in Hz

ARGS = {
    "phase_matrices": phase_matrices,
    "window_length": window_length,
    "window_step": window_step,
    "fs": fs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_movement_KOP Ran
ran on a synthesized input
ppsp-team/pyhkbs/grid_search_social_evaluation.py
code served (permissive licence) · get_code("7015688342676943")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function takes orientations as input
# It expects orientations to be a list/array-like of lists/arrays
# Each inner list represents orientations at a time point
# The function converts this to a matrix and performs KOP calculations

# Create sample orientation data
# Shape: (time_steps=2, orientations_per_step=4)
orientations = [
    [0.5, 1.2, 0.3, 2.1],  # First time step
    [0.7, 1.1, 0.4, 2.0]   # Second time step
]

ARGS = {
    "orientations": orientations
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_wPLI Ran
ran on a synthesized input
ppsp-team/pyhkbs/grid_search_evaluation.py
code served (permissive licence) · get_code("64cac94b69ef1b11")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Generate phase data - two arrays of phase values (in radians)
# Using small arrays to keep it simple
phase_1 = np.random.randn(100) * np.pi  # 100 phase values
phase_2 = np.random.randn(100) * np.pi  # 100 phase values

ARGS = {
    "phase_1": phase_1,
    "phase_2": phase_2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
complementary_connection Ran
ran on a synthesized input
ppsp-team/pyhkbs/grid_search_social.py
code served (permissive licence) · get_code("d470117f2f37e57d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function takes two parameters: connection_strength and asymmetry_degree
# Both are used in arithmetic operations, so they should be numeric values or tensors
# Let's use small tensors to match the requirement of keeping things tiny

connection_strength = torch.tensor(0.3, dtype=torch.float32)
asymmetry_degree = torch.tensor(0.7, dtype=torch.float32)

ARGS = {
    "connection_strength": connection_strength,
    "asymmetry_degree": asymmetry_degree,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
single_simulation Not yet run
unverified (harvested, no recorded run)
ppsp-team/pyhkbs/simulations.py
code served (permissive licence) · get_code("ec31ea2fe93a67b9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2008.02217")
get_code_for_paper("2008.02217")
have("2008.02217")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2008.02217.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2008.02217.svg)](https://syntology.ai/paper/2008.02217)

Connect an agent — have() is free.