SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.13345 · 2022

The Forward-Forward Algorithm: Some Preliminary Investigations

arXiv · PDF · Open in the Atlas

Code that ran

18 of 20 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, 2 violated it and 9 have no contract verdict; 7 failures of our instrument; 2 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/2212.13345.json · badge: /api/ran/2212.13345.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
keras-team/keras-io community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
ads-cmu/forwardforward community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
dah33/explore_forward_forward extension (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
ghadialhajj/FF_unsupervised reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
venkateshtantravahi/ForwardForwardAlgorithm community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
dslisleedh/FF-jax reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
JacksonWuxs/Forward-Forward-Network reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
bytes_to_mib Ran
ran on a synthesized input
keras-team/keras-io/guides/int4_quantization_in_keras.py
code served (permissive licence) · get_code("60054a37a716255b")
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 float, 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

def bytes_to_mib(n):
    return n / 1024 ** 2

ARGS = {
    "n": 2097152  # 2 MiB in bytes
}
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 float, 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
centroid_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dah33/explore_forward_forward/ff_centroids.py
code served (permissive licence) · get_code("a19a77b09f9a85a0")
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 torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for the function
# h: shape [n_examples, feature_dim] - embeddings/hidden states
# y_true: shape [n_examples] - class labels (0-9)

batch_size = 2
feature_dim = 4
n_classes = 10

# Create hidden representations
h = torch.randn(batch_size, feature_dim)

# Create labels (must be in range 0-9 for the function to work)
y_true = torch.tensor([0, 5], dtype=torch.long)

# Parameters for centroid_loss
alpha = 4.0
epsilon = 1e-12
temperature = 1.0

ARGS = {
    "h": h,
    "y_true": y_true,
    "alpha": alpha,
    "epsilon": epsilon,
    "temperature": temperature,
}
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 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
collate_fn Ran
ran on a synthesized input
venkateshtantravahi/ForwardForwardAlgorithm/src/utils.py
code served (permissive licence) · get_code("d342307ef9dbe378")
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 torch
import torch.nn as nn
from torchvision.transforms.v2 import CutMix, MixUp, RandomChoice
from torch.utils.data import default_collate

torch.manual_seed(0)

NUM_CLASSES = 10

cutmix = CutMix(num_classes=NUM_CLASSES)
mixup = MixUp(num_classes=NUM_CLASSES)
cutmix_or_mixup = RandomChoice([cutmix, mixup])

def collate_fn(batch):
    return cutmix_or_mixup(*default_collate(batch))

# Create a small batch of data
# CutMix and MixUp expect (images, labels) tuples
# Images should be tensors of shape (C, H, W)
# Labels should be tensors or ints

batch_data = [
    (torch.randn(3, 4, 4), torch.tensor(i % NUM_CLASSES))
    for i in range(2)
]

ARGS = {
    "batch": batch_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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
create_mask Ran
ran; our contract draft was wrong, not the code
ghadialhajj/FF_unsupervised/utils.py
code served (permissive licence) · get_code("3d9cb0a5f1664e74")
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 2, dtype family int, shape (8, 6) 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 numpy as np
from scipy.signal import convolve2d
from torch import tensor, Tensor
import torch

torch.manual_seed(0)

ARGS = {
    "shape": (8, 6),
    "iterations": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family int, shape (8, 6) — shape (8, 6) 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
create_negative_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ghadialhajj/FF_unsupervised/utils.py
code served (permissive licence) · get_code("58385c5adf85ca32")
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 4, dtype family float, shape (2, 1, 4, 3) 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)

# Create a small batch of random binary images
# Shape: (batch_size, channels, height, width)
# batch_size=2, channels=1, height=4, width=3
images = torch.randint(0, 2, size=(2, 1, 4, 3), dtype=torch.float32)

ARGS = {
    'images': images
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 1, 4, 3) — shape (2, 1, 4, 3) 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
create_negative_image Ran
ran, violated the contract we drafted
ghadialhajj/FF_unsupervised/utils.py
code served (permissive licence) · get_code("6046c45d26e6e0cb")
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 2, dtype family float, shape (4, 5) 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)

# Create two small random binary tensors with the same shape
image_1 = torch.randint(0, 2, size=(4, 5), dtype=torch.float32)
image_2 = torch.randint(0, 2, size=(4, 5), dtype=torch.float32)

ARGS = {
    'image_1': image_1,
    'image_2': image_2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 5) — shape (4, 5) 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
distance_to_centroids Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dah33/explore_forward_forward/ff_centroids.py
code served (permissive licence) · get_code("111d222d62981510")
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 2, dtype family float, shape (2, 10) 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)

# h: tensor of shape [n_examples, feature_dim]
# The function accesses h[y_true == i] and uses unsqueeze(2)
# So we need a 2D tensor where first dimension is examples
h = torch.randn(2, 4)  # 2 examples, 4-dimensional features

# y_true: tensor of class labels with values in range [0, 9]
# The function iterates over range(10) and checks y_true == i
y_true = torch.tensor([0, 5])  # 2 examples with class labels

# epsilon: small float for numerical stability (has default)
epsilon = 1e-12

ARGS = {
    "h": h,
    "y_true": y_true,
    "epsilon": epsilon,
}
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 2, dtype family float, shape (2, 10) — shape (2, 10) 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
forward_layernorm Ran
ran; our contract draft was wrong, not the code
dslisleedh/FF-jax/src/model.py
pointer only (licence: NONE) · get_code("ace2602caf20f685")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dslisleedh/FF-jax when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_image_ids Ran
ran on a synthesized input
keras-team/keras-io/guides/keras_hub/object_detection_retinanet.py
code served (permissive licence) · get_code("84ed89928efc3042")
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 list, ndim 1, 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 os
import tempfile
import logging

# Set up logging to suppress info messages during execution
logging.basicConfig(level=logging.WARNING)

# Create a temporary directory structure that mimics VOC data
temp_dir = tempfile.mkdtemp()
image_sets_dir = os.path.join(temp_dir, 'ImageSets', 'Main')
os.makedirs(image_sets_dir, exist_ok=True)

# Create sample split files with image IDs
splits = {
    'train.txt': 'image_001\nimage_002\nimage_003\n',
    'val.txt': 'image_004\nimage_005\n',
    'trainval.txt': 'image_001\nimage_002\nimage_003\nimage_004\nimage_005\n',
    'test.txt': 'image_006\nimage_007\n'
}

for filename, content in splits.items():
    filepath = os.path.join(image_sets_dir, filename)
    with open(filepath, 'w') as f:
        f.write(content)

ARGS = {
    'data_dir': temp_dir,
    'split': 'train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
get_input_layer_size Ran
ran on a synthesized input
ads-cmu/forwardforward/official_python_implementation/src/utils.py
code served (permissive licence) · get_code("95617e9a91fc12c3")
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 int, ndim 0, dtype family int, 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.

class MockOpt:
    def __init__(self, dataset):
        self.input = MockInput(dataset)

class MockInput:
    def __init__(self, dataset):
        self.dataset = dataset

ARGS = {
    'opt': MockOpt('mnist')
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
get_y_neg Ran
ran on a synthesized input
ads-cmu/forwardforward/previous_implementation/utilities.py
code served (permissive licence) · get_code("f2002874306f8d15")
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 int, shape (4,) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

DEVICE = 'cpu'

y = torch.tensor([3, 7, 2, 5], dtype=torch.long)
num_classes = 10

ARGS = {
    'y': y,
    'num_classes': num_classes
}
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 int, shape (4,) — shape (4,) 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
norm Ran
ran; our contract draft was wrong, not the code
JacksonWuxs/Forward-Forward-Network/forwardforward.py
code served (permissive licence) · get_code("a76b972fcaf75086")
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 2, dtype family float, shape (2, 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
import numpy as np

torch.manual_seed(0)

# Construct a small tensor with batch size 2 and feature dimension 4
x = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    'x': x,
    'p': 2,
    'dim': -1,
    'keepdims': True
}
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 2, dtype family float, shape (2, 1) — shape (2, 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
overlay_y_on_x Ran
ran on a synthesized input
ads-cmu/forwardforward/previous_implementation/utilities.py
code served (permissive licence) · get_code("a0e52ce3feaa9f9e")
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 2, dtype family float, shape (2, 4) 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)

# Analyze the function:
# - x: a tensor that supports .clone(), indexing with range, .max(), and *= operation
# - y: indices for advanced indexing into x
# - classes: int, used to slice x columns

# Create a small tensor for x with shape (batch=2, features=4)
x = torch.randn(2, 4)

# Create target indices y with shape (batch=2)
y = torch.tensor([0, 2])

# classes parameter
classes = 10

ARGS = {
    "x": x,
    "y": y,
    "classes": classes,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
parse_annotation_data Ran
ran on a synthesized input
keras-team/keras-io/guides/keras_hub/object_detection_retinanet.py
code served (permissive licence) · get_code("2482e50dc9cbad0a")
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 dict. 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 xml.etree.ElementTree
import tempfile
import os

# Create a temporary XML annotation file that matches the expected format
xml_content = """<?xml version="1.0"?>
<annotation>
    <filename>test_image.jpg</filename>
    <size>
        <width>640</width>
        <height>480</height>
    </size>
    <object>
        <name>person</name>
        <bndbox>
            <xmin>100</xmin>
            <ymin>50</ymin>
            <xmax>300</xmax>
            <ymax>400</ymax>
        </bndbox>
    </object>
    <object>
        <name>car</name>
        <bndbox>
            <xmin>320</xmin>
            <ymin>150</ymin>
            <xmax>500</xmax>
            <ymax>350</ymax>
        </bndbox>
    </object>
</annotation>
"""

# Create a temporary file with the XML content
temp_dir = tempfile.gettempdir()
temp_file_path = os.path.join(temp_dir, "test_annotation.xml")
with open(temp_file_path, 'w') as f:
    f.write(xml_content)

ARGS = {
    'annotation_file_path': temp_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
parse_args Ran
ran on a synthesized input
ads-cmu/forwardforward/official_python_implementation/src/utils.py
code served (permissive licence) · get_code("27e4d18bafbf444d")
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 DictConfig. 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 random
import numpy as np
import torch
from omegaconf import OmegaConf

torch.manual_seed(0)

# Create a minimal config object that OmegaConf can work with
config_dict = {
    "seed": 42,
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10
}

opt = OmegaConf.create(config_dict)

ARGS = {
    "opt": opt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, omegaconf, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DictConfig — a DictConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DictConfig output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not 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
sigmoid Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from XPixelGroup/SEAL
pointer only; the stored copy get_code serves, from XPixelGroup/SEAL, is pointer only (licence: NONE) · get_code("f35babe3912ec8b1")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

superimpose_label Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dah33/explore_forward_forward/ff_hinton.py
code served (permissive licence) · get_code("4836aa139ad7993d")
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 4, dtype family float, shape (2, 3, 4, 10) 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)

# Analyzing the function:
# - x: a tensor that supports .clone(), indexing with [:, 0, 0, :10], 
#      [range(x.shape[0]), 0, 0, y], and .max()
# - y: a tensor/array of indices used for indexing x at dimension 3
# 
# The function expects:
# - x to be at least 4D (indexed with [batch, 0, 0, indices])
# - x.shape[0] gives batch size
# - y should have length equal to x.shape[0] with values in range [0, x.shape[3])

# Create a small batch of 4D tensors
batch_size = 2
x = torch.randn(batch_size, 3, 4, 10)  # shape: (2, 3, 4, 10)

# Create label indices - must be valid indices for dimension 3 (which has size 10)
# and have length equal to batch_size
y = torch.tensor([3, 7])  # 2 indices, each in range [0, 10)

ARGS = {
    "x": x,
    "y": y
}
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 4, dtype family float, shape (2, 3, 4, 10) — shape (2, 3, 4, 10) 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
transform_value_range Ran
ran on a synthesized input
keras-team/keras-io/guides/keras_cv/custom_image_augmentations.py
code served (permissive licence) · get_code("21f9fa6e83ffc8c3")
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 4, dtype family float, shape (2, 3, 4, 4) 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)

# Create a small tensor of images (batch_size=2, channels=3, height=4, width=4)
images = torch.randn(2, 3, 4, 4)

# Define original range (e.g., images are in range [-1, 1])
original_range = [-1.0, 1.0]

# Define target range (e.g., transform to [0, 255])
target_range = [0.0, 255.0]

ARGS = {
    "images": images,
    "original_range": original_range,
    "target_range": target_range,
}
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 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 4) 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
get_loaders Not yet run
unverified (harvested, no recorded run)
ads-cmu/forwardforward/previous_implementation/utilities.py
code served (permissive licence) · get_code("4613748f89bf60c7")
How it ran

no invocation recorded.

test_step Not yet run
unverified (harvested, no recorded run)
keras-team/keras-io/guides/keras_nnx_guide.py
code served (permissive licence) · get_code("d99d599f73e1e0e6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 19 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.

FunctionAlso present inEarliest-datedOthers named
sigmoid 12 other papers
3 dated earlier, 8 later, 1 same year, order not determinable · 1 only as an assembly brick
1506.02640 (2015-06)
You Only Look Once: Unified, Real-Time Object Detection
1602.01783 (2016-02)
Asynchronous Methods for Deep Reinforcement Learning
2106.12930 (2021-06)
VinDr-SpineXR: A deep learning framework for spinal lesions detection and classification from radiographs
and 9 more not named here

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

The aim of this paper is to introduce a new learning procedure for neural networks and to demonstrate that it works well enough on a few small problems to be worth further investigation. The Forward-Forward algorithm replaces the forward and backward passes of backpropagation by two forward passes, one with positive (i.e. real) data and the other with negative data which could be generated by the network itself. Each layer has its own objective function which is simply to have high goodness for positive data and low goodness for negative data. The sum of the squared activities in a layer can be used as the goodness but there are many other possibilities, including minus the sum of the squared activities. If the positive and negative passes could be separated in time, the negative passes could be done offline, which would make the learning much simpler in the positive pass and allow video to be pipelined through the network without ever storing activities or stopping to propagate derivatives.

For agents

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

get_harvested_code_for_paper("2212.13345")
get_code_for_paper("2212.13345")
have("2212.13345")

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

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

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

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

Connect an agent — have() is free.