MODX - Inference Time Detection of Anomalous Behavior using Sparse Auto-Encoders
Nipun Katyal, Rahul Tiwari, Sachmeet Singh Bhatia, Bhuvesh Gupta · Team modx
Submitted to Defensive Acceleration Hackathon. Sprint projects are early-stage work by participants, not Apart Research publications.
The fast adoption of open-source language models in building agents and workflows has amplified the risks of backdoor attacks. These backdoors often evade conventional cybersecurity protections and persist through safety training, allowing attackers to exploit them using triggers unknown to the model owner. We present modx, a platform that leverages Sparse Auto-Encoders (SAEs) to perform mechanistic anomaly detection on Llama 3.1 8B. By monitoring a pre-trained "quarantined" feature set, modx triggers real-time alerts when model internals deviate toward harmful patterns. Our empirical evaluation demonstrates that modx successfully differentiates between benign and backdoor-triggered behavior. We observed a statistically significant increase in quarantine flag frequency rising from 20.7% in baseline models to 32.0% in backdoored models. These results validate the viability of mechanistic interpretability as a viable defense layer, capable of providing both real-time detection and interpretable forensic evidence against supply chain attacks.

Reviews
Caveat: I am not a mech interp expert. It would be worth discussing this with people who are, if possible, as I might be missing important considerations.
This project is thoughtful and well-executed, especially given the time constraints of a hackathon. Checking backdoors using mech interp is an exciting and plausible approach, and it's great that you found statistically significant results. Limitations are helpfully acknowledged, e.g. polysemantic quarantined features. This work is a prototype for a potentially very helpful layer of defence-in-depth. Given polysemanticity of features, you'd need other layers for further triage. Documentation and execution quality seem very strong.
Going forward, you could try to resolve the feature polysemanticity issues, use more types of backdoors, and compare against other (non-SAE) detection methods.
Clear motivation and a compelling demonstration of mechanistic anomaly detection applied to backdoor-triggered behaviors. Video and slides are fabulous. Really effective and concise communication of your work, and the real-world example makes the problem feel concrete.
Quantitative results are only found in the written summary. A fuller written report would help reviewers better understand methodology, dataset scale, and evaluation rigor.
Future work should expand testing across more diverse triggers, multiple architectures, and realistic attacker strategies to validate robustness and reduce false positives. I would also like to understand how vulnerable the quarantine feature space itself is to manipulation or evasion.
Cite this project
@misc{katyal2025modx,
title = {{MODX - Inference Time Detection of Anomalous Behavior using Sparse Auto-Encoders}},
author = {Nipun Katyal and Rahul Tiwari and Sachmeet Singh Bhatia and Bhuvesh Gupta},
year = {2025},
month = nov,
note = {Submitted to Defensive Acceleration Hackathon, an Apart Research Sprint},
howpublished = {\url{https://apartresearch.com/sprints/projects/modx-inference-time-detection-of-anomalous-behavior-using-sparse-autoencoders-1nfc}},
url = {https://apartresearch.com/sprints/projects/modx-inference-time-detection-of-anomalous-behavior-using-sparse-autoencoders-1nfc}
}More from Defensive Acceleration Hackathon
- View project: Neops - DevSecOps for the AI era
Neops - DevSecOps for the AI era
Broad Bros
NEOps is a CLI-based tool that embeds AI safety into your product lifecycle from day one. While development teams routinely build cybersecurity checks, AI-safety often comes later—or not at all. NEOps fills that gap by …
- View project: Assisted Audit of Solana Programs
Assisted Audit of Solana Programs
GLAM
Multi-agent solution that assists in auditing Solana programs, allows to consolidate audit findings into a knowledge base, and can integrate into CI/CD pipelines to prevent security regressions.
- View project: Mechanistic Watchdog
Mechanistic Watchdog
SL5
Mechanistic Watchdog is a mechanistic-interpretability-based “cognitive kill switch” for language models. Instead of only filtering final text, we monitor a model’s internal activations in real time and learn linear …