{"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/hopfield-fenchel-young-networks-a-unified","title":"Hopfield-Fenchel-Young Networks: A Unified Framework for Associative Memory Retrieval","arxiv_id":"2411.08590","date":"2024-11-13","proceeding":null,"authors":["Saul Santos","Vlad Niculae","Daniel McNamee","André F. T. Martins"],"abstract":"Associative memory models, such as Hopfield networks and their modern variants, have garnered renewed interest due to advancements in memory capacity and connections with self-attention in transformers. In this work, we introduce a unified framework-Hopfield-Fenchel-Young networks-which generalizes these models to a broader family of energy functions. Our energies are formulated as the difference between two Fenchel-Young losses: one, parameterized by a generalized entropy, defines the Hopfield scoring mechanism, while the other applies a post-transformation to the Hopfield output. By utilizing Tsallis and norm entropies, we derive end-to-end differentiable update rules that enable sparse transformations, uncovering new connections between loss margins, sparsity, and exact retrieval of single memory patterns. We further extend this framework to structured Hopfield networks using the SparseMAP transformation, allowing the retrieval of pattern associations rather than a single pattern. Our framework unifies and extends traditional and modern Hopfield networks and provides an energy minimization perspective for widely used post-transformations like $\\ell_2$-normalization and layer normalization-all through suitable choices of Fenchel-Young losses and by using convex analysis as a building block. Finally, we validate our Hopfield-Fenchel-Young networks on diverse memory recall tasks, including free and sequential recall. Experiments on simulated data, image retrieval, multiple instance learning, and text rationalization demonstrate the effectiveness of our approach.","url_abs":"https://arxiv.org/abs/2411.08590v1","url_pdf":"https://arxiv.org/pdf/2411.08590v1.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":"hopfield-fenchel-young-networks-a-unified","repo_url":"https://github.com/deep-spin/HFYN","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"multiple-instance-learning","task_name":"Multiple Instance Learning"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2411.08590","atlas_url":"https://app.syntology.ai/?focus=2411.08590","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.08590"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/deep-spin/HFYN","reach":null}],"summary":{"ran_draft_wrong":1,"unverified":7},"by_repo_kind":{"official":{"samples":8,"ran":1,"repositories":1}},"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":0,"samples":[{"code_sha256_prefix":"22ad717c93d97722","entry":"entmax_mapping","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/memory_retrieval_modeling.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/memory_retrieval_modeling.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"22ad717c93d97722"}},{"code_sha256_prefix":"66ff60a02a8c33a8","entry":"eval_iter","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/MNIST_bags.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/MNIST_bags.py","link_basis":"first_harvest_node","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":"66ff60a02a8c33a8"}},{"code_sha256_prefix":"895fe8915d2b891e","entry":"free_recall","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/memory_retrieval_modeling.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/memory_retrieval_modeling.py","link_basis":"first_harvest_node","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":"895fe8915d2b891e"}},{"code_sha256_prefix":"4ac4c93527650dd6","entry":"memory_capacity","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/ME_plotting.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/ME_plotting.py","link_basis":"first_harvest_node","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":"4ac4c93527650dd6"}},{"code_sha256_prefix":"4c6f7067c55c4681","entry":"memory_robustness","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/ME_plotting.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/ME_plotting.py","link_basis":"first_harvest_node","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":"4c6f7067c55c4681"}},{"code_sha256_prefix":"df60557be5712396","entry":"operate","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/MNIST_bags.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/MNIST_bags.py","link_basis":"first_harvest_node","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":"df60557be5712396"}},{"code_sha256_prefix":"4ce07657f370933f","entry":"seq_recall","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/memory_retrieval_modeling.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/memory_retrieval_modeling.py","link_basis":"first_harvest_node","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":"4ce07657f370933f"}},{"code_sha256_prefix":"cbc428014e13e026","entry":"train_epoch","repo":"deep-spin/HFYN","repo_kind":"official","path":"scripts/MNIST_bags.py","file_url":"https://github.com/deep-spin/HFYN/blob/HEAD/scripts/MNIST_bags.py","link_basis":"first_harvest_node","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":"cbc428014e13e026"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}