{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/the-forward-forward-algorithm-some-1","title":"The Forward-Forward Algorithm: Some Preliminary Investigations","arxiv_id":"2212.13345","date":"2022-12-27","proceeding":"NA 2022 12","authors":["Geoffrey Hinton"],"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.","url_abs":"https://arxiv.org/abs/2212.13345v1","url_pdf":"https://arxiv.org/pdf/2212.13345v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/ads-cmu/forwardforward","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/ahmed-alllam/Forward-Forward-Algorithm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/dah33/explore_forward_forward","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/dslisleedh/FF-jax","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/keitaroskmt/e2e-info","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/kfkarlsson/ffperceptron","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/loewex/forward-forward","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/tdooms/trifecta","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/2023-MindSpore-4/Code12/tree/main/d2l/chapter_02_preliminaries","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/EscVM/EscVM_YT/blob/master/Notebooks/2%20-%20PT1.X%20DeepAI-Quickie/pt_1_forward_forward_alg.ipynb","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/IsmailKonak/FF-Algorithm-Pytorch-Implementation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/JacksonWuxs/Forward-Forward-Network","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/MindCode-4/code-11/tree/main/FFperceptron","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/alimpk/ffx-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/ghadialhajj/FF_unsupervised","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/keras-team/keras-io/blob/master/examples/vision/forwardforward.py","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/mohammadpz/pytorch_forward_forward","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/pytorch/examples/tree/main/mnist_forward_forward","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"the-forward-forward-algorithm-some-1","repo_url":"https://github.com/venkateshtantravahi/ForwardForwardAlgorithm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2212.13345","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2212.13345"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/keitaroskmt/e2e-info","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/alimpk/ffx-pytorch","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pytorch/examples/tree/main/mnist_forward_forward","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ahmed-alllam/Forward-Forward-Algorithm","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ghadialhajj/FF_unsupervised","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dslisleedh/FF-jax","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mohammadpz/pytorch_forward_forward","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/venkateshtantravahi/ForwardForwardAlgorithm","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dah33/explore_forward_forward","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kfkarlsson/ffperceptron","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/IsmailKonak/FF-Algorithm-Pytorch-Implementation","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/EscVM/EscVM_YT/blob/master/Notebooks/2%20-%20PT1.X%20DeepAI-Quickie/pt_1_forward_forward_alg.ipynb","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tdooms/trifecta","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2023-MindSpore-4/Code12/tree/main/d2l/chapter_02_preliminaries","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-11/tree/main/FFperceptron","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JacksonWuxs/Forward-Forward-Network","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ads-cmu/forwardforward","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/keras-team/keras-io/blob/master/examples/vision/forwardforward.py","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/loewex/forward-forward","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":4,"ran_draft_wrong":3,"ran_violates":2,"unverified":11},"by_repo_kind":{"listed":{"samples":19,"ran":8,"repositories":7}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":2,"samples":[{"code_sha256_prefix":"a19a77b09f9a85a0","entry":"centroid_loss","repo":"dah33/explore_forward_forward","repo_kind":"listed","path":"ff_centroids.py","file_url":"https://github.com/dah33/explore_forward_forward/blob/HEAD/ff_centroids.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a19a77b09f9a85a0"}},{"code_sha256_prefix":"3d9cb0a5f1664e74","entry":"create_mask","repo":"ghadialhajj/FF_unsupervised","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/ghadialhajj/FF_unsupervised/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3d9cb0a5f1664e74"}},{"code_sha256_prefix":"58385c5adf85ca32","entry":"create_negative_batch","repo":"ghadialhajj/FF_unsupervised","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/ghadialhajj/FF_unsupervised/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"58385c5adf85ca32"}},{"code_sha256_prefix":"6046c45d26e6e0cb","entry":"create_negative_image","repo":"ghadialhajj/FF_unsupervised","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/ghadialhajj/FF_unsupervised/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6046c45d26e6e0cb"}},{"code_sha256_prefix":"111d222d62981510","entry":"distance_to_centroids","repo":"dah33/explore_forward_forward","repo_kind":"listed","path":"ff_centroids.py","file_url":"https://github.com/dah33/explore_forward_forward/blob/HEAD/ff_centroids.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"111d222d62981510"}},{"code_sha256_prefix":"ace2602caf20f685","entry":"forward_layernorm","repo":"dslisleedh/FF-jax","repo_kind":"listed","path":"src/model.py","file_url":"https://github.com/dslisleedh/FF-jax/blob/HEAD/src/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ace2602caf20f685"}},{"code_sha256_prefix":"a76b972fcaf75086","entry":"norm","repo":"JacksonWuxs/Forward-Forward-Network","repo_kind":"listed","path":"forwardforward.py","file_url":"https://github.com/JacksonWuxs/Forward-Forward-Network/blob/HEAD/forwardforward.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a76b972fcaf75086"}},{"code_sha256_prefix":"f35babe3912ec8b1","entry":"sigmoid","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"f35babe3912ec8b1"}},{"code_sha256_prefix":"4836aa139ad7993d","entry":"superimpose_label","repo":"dah33/explore_forward_forward","repo_kind":"listed","path":"ff_hinton.py","file_url":"https://github.com/dah33/explore_forward_forward/blob/HEAD/ff_hinton.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4836aa139ad7993d"}},{"code_sha256_prefix":"60054a37a716255b","entry":"bytes_to_mib","repo":"keras-team/keras-io","repo_kind":"listed","path":"guides/int4_quantization_in_keras.py","file_url":"https://github.com/keras-team/keras-io/blob/HEAD/guides/int4_quantization_in_keras.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"60054a37a716255b"}},{"code_sha256_prefix":"d342307ef9dbe378","entry":"collate_fn","repo":"venkateshtantravahi/ForwardForwardAlgorithm","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/venkateshtantravahi/ForwardForwardAlgorithm/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d342307ef9dbe378"}},{"code_sha256_prefix":"84ed89928efc3042","entry":"get_image_ids","repo":"keras-team/keras-io","repo_kind":"listed","path":"guides/keras_hub/object_detection_retinanet.py","file_url":"https://github.com/keras-team/keras-io/blob/HEAD/guides/keras_hub/object_detection_retinanet.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"84ed89928efc3042"}},{"code_sha256_prefix":"95617e9a91fc12c3","entry":"get_input_layer_size","repo":"ads-cmu/forwardforward","repo_kind":"listed","path":"official_python_implementation/src/utils.py","file_url":"https://github.com/ads-cmu/forwardforward/blob/HEAD/official_python_implementation/src/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"95617e9a91fc12c3"}},{"code_sha256_prefix":"4613748f89bf60c7","entry":"get_loaders","repo":"ads-cmu/forwardforward","repo_kind":"listed","path":"previous_implementation/utilities.py","file_url":"https://github.com/ads-cmu/forwardforward/blob/HEAD/previous_implementation/utilities.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4613748f89bf60c7"}},{"code_sha256_prefix":"f2002874306f8d15","entry":"get_y_neg","repo":"ads-cmu/forwardforward","repo_kind":"listed","path":"previous_implementation/utilities.py","file_url":"https://github.com/ads-cmu/forwardforward/blob/HEAD/previous_implementation/utilities.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f2002874306f8d15"}},{"code_sha256_prefix":"a0e52ce3feaa9f9e","entry":"overlay_y_on_x","repo":"ads-cmu/forwardforward","repo_kind":"listed","path":"previous_implementation/utilities.py","file_url":"https://github.com/ads-cmu/forwardforward/blob/HEAD/previous_implementation/utilities.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a0e52ce3feaa9f9e"}},{"code_sha256_prefix":"2482e50dc9cbad0a","entry":"parse_annotation_data","repo":"keras-team/keras-io","repo_kind":"listed","path":"guides/keras_hub/object_detection_retinanet.py","file_url":"https://github.com/keras-team/keras-io/blob/HEAD/guides/keras_hub/object_detection_retinanet.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2482e50dc9cbad0a"}},{"code_sha256_prefix":"27e4d18bafbf444d","entry":"parse_args","repo":"ads-cmu/forwardforward","repo_kind":"listed","path":"official_python_implementation/src/utils.py","file_url":"https://github.com/ads-cmu/forwardforward/blob/HEAD/official_python_implementation/src/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"27e4d18bafbf444d"}},{"code_sha256_prefix":"d99d599f73e1e0e6","entry":"test_step","repo":"keras-team/keras-io","repo_kind":"listed","path":"guides/keras_nnx_guide.py","file_url":"https://github.com/keras-team/keras-io/blob/HEAD/guides/keras_nnx_guide.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d99d599f73e1e0e6"}},{"code_sha256_prefix":"21f9fa6e83ffc8c3","entry":"transform_value_range","repo":"keras-team/keras-io","repo_kind":"listed","path":"guides/keras_cv/custom_image_augmentations.py","file_url":"https://github.com/keras-team/keras-io/blob/HEAD/guides/keras_cv/custom_image_augmentations.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"21f9fa6e83ffc8c3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}