---
title: 'MOMEMTO: Patch-based Memory in Anomaly Detection'
url: https://www.emergentmind.com/topics/momemto
type: topic
---

# MOMEMTO: Patch-based Memory in Anomaly Detection

Searching arXiv for the exact topic and closely related work.
MOMEMTO, introduced in “MOMEMTO: Patch-based Memory Gate Model in Time Series Foundation Model,” is a reconstruction-based time-series anomaly detection model that augments a time series foundation model with a patch-based memory mechanism to mitigate over-generalization. The model is designed for anomaly detection in settings where powerful reconstruction models can otherwise reconstruct unseen anomalies accurately, thereby weakening the separation between normal and abnormal inputs. MOMEMTO combines a pre-trained encoder from the MOMENT backbone with an external memory of representative normal patch patterns and supports joint fine-tuning across multiple datasets through a multi-domain training strategy [2509.18751].

## 1. Problem setting and motivation

MOMEMTO is formulated against a specific failure mode of reconstruction-based anomaly detection. In that paradigm, a model is trained to reconstruct “normal” input sequences, and anomalies are detected when reconstruction error is high. As model capacity increases, however, strong encoders and decoders can reconstruct anomalous inputs too well, producing low anomaly scores for true anomalies. The paper identifies this as over-generalization and treats it as the central obstacle to reliable anomaly detection with modern deep architectures [2509.18751].

The proposed remedy is to constrain reconstruction through memory. Rather than reconstructing directly from the input’s own latent representation, MOMEMTO first matches the input to stored prototypes of normal patterns and then reconstructs from a representation refined by those prototypes. This design is explicitly intended to make anomalous inputs “snap” toward normal-like structure, so that mismatch remains visible in the reconstruction error. The paper positions this as an adaptation of memory-based anomaly detection to the setting of time series foundation models, where prior memory architectures had high training cost and had not been effectively integrated with TFMs.

A second motivation concerns scalability. Earlier memory-based approaches are described as sensitive to initialization and tied to a one-model-per-dataset setting. MOMEMTO instead uses a patch-based memory module compatible with the patch-level latent space of a pre-trained foundation model and introduces multi-domain training so that a single model can be jointly fine-tuned across multiple datasets. This suggests a shift from dataset-specific anomaly detectors toward a shared anomaly-detection backbone with reusable normality structure.

## 2. Architectural design

The architecture is an encoder–memory–decoder pipeline built around patch representations. An input time series is segmented into non-overlapping patches of fixed length \(L\), yielding \(x \in \mathbb{R}^{P \times L}\), where \(P\) is the number of observed patches. If fewer than the maximum number of patches \(N\) are available, the sequence is zero-padded to \(\mathbb{R}^{N \times L}\). The pre-trained encoder from MOMENT-large produces patch-level latent representations
\[
q \in \mathbb{R}^{P \times d_{model}},
\]
which are normalized and then used as queries to interact with memory [2509.18751].

The decoder is intentionally lightweight. It consists of two fully connected layers that reconstruct the signal from the concatenation of the original query and the memory-refined query,
\[
[q;\tilde{q}] \in \mathbb{R}^{P \times 2d_{model}}.
\]
This is a deliberate architectural constraint: the paper argues that a lightweight decoder reduces the chance that the decoder itself will over-generalize. In other words, representational strength is concentrated in the pre-trained encoder and the external memory rather than in a highly expressive decoder.

This patch-based organization is closely tied to the MOMENT backbone. Because MOMENT uses patch-level masked representation learning, its latent space already captures local temporal semantics. MOMEMTO exploits that property directly: memory does not store only a global embedding of a time series, but patch-level prototypes aligned with local temporal structure. A plausible implication is that this makes the memory mechanism better suited to heterogeneous local motifs than a single global prototype bank would be.

## 3. Patch-based memory module

The memory module contains \(M\) memory items \(\{m_i\}_{i=1}^M\), each with shape
\[
m_i \in \mathbb{R}^{N \times d_{model}}.
\]
Each memory item therefore stores patch-level prototypes rather than a single vector. Initialization is data-driven. If \(S_i\) encoder outputs \(\{q_s\}_{s=1}^{S_i}\) are sampled from datasets associated with domain \(i\), the corresponding memory item is initialized as
\[
m_i = \frac{1}{S_i}\sum_{s=1}^{S_i} q_s,\quad i=1,\dots,M.
\]
The paper notes that memory items are L2-normalized at the patch level for stability [2509.18751].

Because time series lengths vary, memory and queries are first aligned to the observed patches selected by the input mask. Both the query \(q\) and each memory item \(m_i\) are reduced from \(N\) slots to the observed \(P\) slots so that only corresponding observed patches are compared. Similarities between the aligned query and memory items are computed by dot product and normalized with softmax. The model then selects only the top-\(K\) most similar memory items; in the experiments, \(K=3\). The paper emphasizes that this selective update is more efficient and more discriminative than updating all memory items indiscriminately.

Memory updating is attention-based and gated. For each selected memory item \(m_{i\text{-}th}\), the module computes
\[
v \gets \mathrm{softmax}(m_{i\text{-}th} q^T),
\]
then an update gate
\[
\psi \gets \sigma(m_{i\text{-}th}U_{\psi}+vqW_{\psi}),
\]
with learnable projection matrices \(U_{\psi}, W_{\psi} \in \mathbb{R}^{d_{model}\times d_{model}}\). The updated memory is
\[
\tilde{m}_{i\text{-}th} \gets (1-\psi)\odot m_{i\text{-}th} + \psi \odot vq.
\]
The stored prototype is thus partially retained and partially replaced by query-informed content. The query refinement stage then computes
\[
w \gets \mathrm{softmax}(q(\tilde{m}_{i\text{-}th})^T), \qquad \tilde{q}_{i\text{-}th} \gets w\tilde{m}_{i\text{-}th},
\]
and aggregates the refined queries across the top-\(K\) items into \(\tilde q\), weighted by the retrieval similarities. Conceptually, the original \(q\) preserves the raw contextual encoding, while \(\tilde q\) injects what the paper calls a “normal pattern prior.”

## 4. Multi-domain training and detection workflow

A defining feature of MOMEMTO is its multi-domain training strategy. Instead of training one model per dataset, the paper jointly fine-tunes a single model across all 23 benchmark datasets in the TSB-AD-U benchmark. Memory is initialized with one item per user-defined domain, but the training procedure does not enforce a strict one-to-one mapping between memory items and domains. Because updates are similarity-driven, a memory item may accumulate evidence from multiple domains and become domain-general [2509.18751].

This training strategy is presented as a response to the practical structure of anomaly-detection benchmarks. The TSB-AD-U benchmark contains 870 univariate time series from 23 datasets spanning domains such as UCR, NAB, YAHOO, IOPS, MSL, SMAP, SMD, SWaT, and Stock. The main evaluation uses the Eval split, which contains 350 time series. Input subsequences are created with a non-overlapping window of length 512. The paper argues that multi-domain training enables knowledge sharing across domains, reduces the need for 350 separate models, and improves robustness because the memory sees a broader variety of normal patterns.

At detection time, the workflow is straightforward. The input series is patched and encoded by the pre-trained backbone. The normalized patch embeddings are passed through memory, which retrieves and reinforces the most relevant normal prototypes, producing a refined latent sequence \(\tilde q\). The decoder reconstructs the series from \([q;\tilde q]\). Anomalies are identified by reconstruction error: inputs that cannot be reconstructed well under the constraints of normal-pattern memory receive higher anomaly scores. The core claim is that normal inputs match memory items well and reconstruct with low error, whereas anomalous inputs are forced toward nearby normal prototypes, making the mismatch detectable.

The implementation details reported in the paper make the setup concrete: patch length 8, stride 8, 64 patches, \(d_{model}=1024\), \(K=3\), temperature \(\tau=0.3\), Adam optimization, learning rate \(10^{-4}\), and MSE loss. The paper also notes that multi-domain training plus the patch-based memory module keeps the total model size compact, around 1.3 GB.

## 5. Empirical evaluation

MOMEMTO is evaluated with threshold-independent metrics: AUC-PR, AUC-ROC, VUS-PR, and VUS-ROC. In the standard setting, it improves over the MOMENT backbone, and the multi-domain version performs best overall [2509.18751].

| Model | AUC-PR | AUC-ROC | VUS-PR / VUS-ROC |
|---|---:|---:|---:|
| MOMENT | 29.45 | 69.97 | 29.73 / 76.84 |
| MOMEMTO | 32.83 | 70.00 | 33.23 / 77.49 |
| MOMEMTO\(_{md}\) | 36.35 | 74.83 | 37.62 / 80.95 |

The paper further reports that reconstruction-based TFMs are stronger for anomaly detection than Chronos and TimesFM, and that MOMEMTO is the strongest among them. The gains are not limited to the full-data regime. In few-shot settings, when only 10% to 30% of the training data is used, MOMEMTO consistently outperforms MOMENT by a substantial margin. As more data becomes available, MOMEMTO continues to improve, whereas MOMENT saturates more quickly. The multi-domain version improves few-shot performance further, which the paper interprets as evidence that shared training across domains makes the model more data-efficient.

Transfer performance is also reported. In a zero-shot leave-one-out experiment over 32 domains, MOMEMTO\(_{md}\) reaches 34.51 AUC-PR, 72.17 AUC-ROC, 35.76 VUS-PR, and 78.32 VUS-ROC, again beating MOMENT\(_{md}\). This supports the paper’s claim that the memory module learns reusable normality structure rather than merely memorizing dataset-specific regularities.

The ablation study isolates the roles of pre-training and memory. A scratch encoder without memory achieves 22.44 AUC-PR. Adding memory to the scratch encoder raises this to 33.63. Using a pre-trained encoder without memory gives 29.70, and combining pre-training with memory gives the best result, 36.35. The paper presents this as evidence that the two components are complementary: the encoder provides strong patch representations, while memory constrains reconstruction toward representative normal patterns.

## 6. Scope, interpretation, and nomenclature

MOMEMTO belongs to time-series anomaly detection, not to conversational memory benchmarks, wearable memory augmentation, or symbolic question-answering systems. It is distinct from “Momento,” a benchmark for persistent, multi-session agentic conversations in service environments [2606.00832]; from “Memento,” a multimodal wearable framework for short-term memory augmentation in visual search and wayfinding navigation [2504.19772]; and from “Memento,” a prompting strategy for multi-hop question answering that constructs a Prolog database of intermediate facts [2506.20642].

Within its own domain, MOMEMTO is specifically a reconstruction-based anomaly detector enhanced by a patch-based memory gate model. Its empirical claims are grounded in univariate time series from TSB-AD-U, with evaluation centered on AUC and VUS metrics. The paper does not frame it as an end-to-end generative foundation model for arbitrary time-series reasoning; rather, it targets a narrower but technically important problem: preventing a powerful TFM from reconstructing abnormal inputs so well that anomalies become indistinguishable from normal sequences [2509.18751].

The broader significance of the model lies in how it repurposes foundation-model representations. Instead of treating a pre-trained encoder as sufficient on its own, MOMEMTO uses external memory to impose a normality-aware bottleneck on reconstruction. This suggests that, in anomaly detection, scaling representation quality alone is not enough; the decisive issue is whether the reconstruction path is constrained by representative normal prototypes. That interpretation follows directly from the model’s design and from the reported ablations, where pre-training and memory each improve performance, but their combination performs best.

Source: https://www.emergentmind.com/topics/momemto