Saved in:
Bibliographic Details
Main Authors: Moriai, Ryo, Inoue, Nakamasa, Tanaka, Masayuki, Kawakami, Rei, Ikehata, Satoshi, Sato, Ikuro
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2502.14003
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929720878170112
author Moriai, Ryo
Inoue, Nakamasa
Tanaka, Masayuki
Kawakami, Rei
Ikehata, Satoshi
Sato, Ikuro
author_facet Moriai, Ryo
Inoue, Nakamasa
Tanaka, Masayuki
Kawakami, Rei
Ikehata, Satoshi
Sato, Ikuro
contents Modern Hopfield networks (MHNs) have recently gained significant attention in the field of artificial intelligence because they can store and retrieve a large set of patterns with an exponentially large memory capacity. A MHN is generally a dynamical system defined with Lagrangians of memory and feature neurons, where memories associated with in-distribution (ID) samples are represented by attractors in the feature space. One major problem in existing MHNs lies in managing out-of-distribution (OOD) samples because it was originally assumed that all samples are ID samples. To address this, we propose the rectified Lagrangian (RegLag), a new Lagrangian for memory neurons that explicitly incorporates an attractor for OOD samples in the dynamical system of MHNs. RecLag creates a trivial point attractor for any interaction matrix, enabling OOD detection by identifying samples that fall into this attractor as OOD. The interaction matrix is optimized so that the probability densities can be estimated to identify ID/OOD. We demonstrate the effectiveness of RecLag-based MHNs compared to energy-based OOD detection methods, including those using state-of-the-art Hopfield energies, across nine image datasets.
format Preprint
id arxiv_https___arxiv_org_abs_2502_14003
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Rectified Lagrangian for Out-of-Distribution Detection in Modern Hopfield Networks
Moriai, Ryo
Inoue, Nakamasa
Tanaka, Masayuki
Kawakami, Rei
Ikehata, Satoshi
Sato, Ikuro
Machine Learning
Artificial Intelligence
Modern Hopfield networks (MHNs) have recently gained significant attention in the field of artificial intelligence because they can store and retrieve a large set of patterns with an exponentially large memory capacity. A MHN is generally a dynamical system defined with Lagrangians of memory and feature neurons, where memories associated with in-distribution (ID) samples are represented by attractors in the feature space. One major problem in existing MHNs lies in managing out-of-distribution (OOD) samples because it was originally assumed that all samples are ID samples. To address this, we propose the rectified Lagrangian (RegLag), a new Lagrangian for memory neurons that explicitly incorporates an attractor for OOD samples in the dynamical system of MHNs. RecLag creates a trivial point attractor for any interaction matrix, enabling OOD detection by identifying samples that fall into this attractor as OOD. The interaction matrix is optimized so that the probability densities can be estimated to identify ID/OOD. We demonstrate the effectiveness of RecLag-based MHNs compared to energy-based OOD detection methods, including those using state-of-the-art Hopfield energies, across nine image datasets.
title Rectified Lagrangian for Out-of-Distribution Detection in Modern Hopfield Networks
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2502.14003