SimGuard: Context-Aware Anomaly Filtering via Similarity-Guided Error Detection

Amir Raza, Mayank Jauhari, Vikash Sharma, Vipul Joshi, Boris N. Oreshkin, Anurag TripathiFMSD @ ICML 2026

TL;DR

SimGuard is a post-hoc filtering framework designed to help human investigators distinguish between genuine financial errors and "benign anomalies" in massive invoice datasets. By using a novel asymmetric contrastive loss and a few-shot retrieval mechanism, it reduces the volume of flagged anomalies by 15% while maintaining nearly 99% recall, all without requiring model retraining to learn new error patterns.

What Problem Does This Paper Address?

In large-scale enterprise operations, anomaly detectors flag millions of invoices daily. However, most of these flags are "benign anomalies"—transactions that look strange statistically but are actually legitimate (e.g., a one-time seasonal spike for a specific vendor).

The challenge is two-fold:

  1. The Precision Gap: Modern foundation models for tabular data, like TabPFN, have excellent recall (they catch almost all errors) but very low precision (they flag way too much junk). This "floods" human investigators with false positives.
  2. Context & Evolution: An anomaly for a steady-service utility provider might be perfectly normal for a retail vendor during the holidays. Furthermore, error patterns change faster than models can be retrained.

The authors aim to create a "context-aware" filter that sits downstream of an initial anomaly detector to suppress the noise without missing the "million-dollar" errors.

Methods

SimGuard introduces several clever tweaks to self-supervised contrastive learning:

  • Asymmetric InfoNCE Loss: This is the core technical innovation. Standard contrastive loss (InfoNCE) uses a single temperature parameter ($\tau$) to balance "alignment" (making sure similar things stay together) and "dispersion" (pushing different things apart). SimGuard decouples these into $\tau_{num}$ and $\tau_{denom}$. This prevents feature suppression, where a model ignores subtle but critical features because it found an easier "shortcut" to minimize the loss.
  • Curriculum-based Scheduling: The model doesn't start training at full intensity. It follows a 50-epoch alternating schedule that gradually lowers the denominator temperature and the feature corruption rate. This guides the model from learning broad semantic clusters to fine-grained discrimination.
  • Categorical Anchoring: When generating "corrupted" versions of data for training, SimGuard never corrupts categorical features (like Vendor ID). These act as anchors, forcing the model to learn representations that are deeply rooted in the specific context of that vendor.
  • Few-Shot Retrieval (Inference): Instead of a standard classifier head, SimGuard uses the learned embeddings to perform a $k$-nearest-neighbor search within a specific vendor's history. It then uses a similarity-weighted vote of previously verified labels to decide if a new flag is a true error or a known benign pattern.

Datasets

The authors evaluated SimGuard on a mix of real-world and public data:

  • Enterprise Invoice Datasets: Two massive, proprietary datasets containing 450k and 800k invoices respectively.
  • Public Fraud Benchmarks:
    • Santander Customer Transaction Prediction (10% anomalies)
    • Credit Card Fraud (0.17% anomalies)
    • IEEE Fraud (3.59% anomalies)

Key Insights and Ideas

  • Decoupling is the "Aha!" Moment: The authors prove mathematically that tying the numerator and denominator temperatures together forces a trade-off that often leads to the model ignoring rare but important features. By operating in the asymmetric regime ($\tau_{denom} \ll \tau_{num}$), SimGuard remains sensitive to subtle error patterns.
  • Explainability via Neighbors: Because the system is retrieval-based, every "suppression" of a flag comes with a built-in explanation: "We think this is benign because it looks exactly like these three other invoices that an investigator already cleared last month."
  • Zero-Retraining Adaptivity: To "teach" SimGuard a new error pattern, you don't retrain the neural network. You simply add the newly labeled case to the historical repository. The retrieval mechanism picks it up instantly.

Key Results

  • Enterprise Performance: On real-world data, SimGuard achieved a 15% reduction in flagged volume while keeping the loss in recall below 1%.
  • Public Benchmarks:
    • On the Santander dataset, it improved the F1 score to 0.53 (compared to TabPFN's 0.51).
  • On Credit Card Fraud, it boosted F1 from 0.73 to 0.78 while maintaining a high recall of 0.87.
  • Efficiency: The curriculum learning strategy alone reduced missed errors by 12% to 18% compared to fixed-parameter baselines.

Limitations and Future Work

  • The "Cold Start" Problem: SimGuard relies on a populated historical repository. It cannot effectively filter anomalies for a brand-new vendor or a completely novel fraud pattern that has never been seen before.
  • Sparse Data: In regions of the feature space where data is extremely sparse, $k$-NN retrieval becomes less reliable.
  • Future Directions: The authors suggest exploring hybrid approaches that combine SimGuard with traditional anomaly detectors to handle "cold starts," and incorporating temporal patterns (time-series analysis) to better capture seasonal shifts in vendor behavior.

Summary updated

BibTeX
@inproceedings{raza2026simguard,
  author = {Amir Raza and Mayank Jauhari and Vikash Sharma and Vipul Joshi and Boris N. Oreshkin and Anurag Tripathi},
  title = {{SimGuard: Context-Aware Anomaly Filtering via Similarity-Guided Error Detection}},
  booktitle = {FMSD @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=nYshRurz2i},
}
Figure