BERM: Low-Overhead Prompt-Injection Detection via In-Situ Benign Representation Modeling
Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 599-607.
https://doi.org/10.24963/ijcai.2026/68
Keywords
- Multidisciplinary Topics and Applications: Security and privacy
- Natural Language Processing: Language models
- AI Ethics, Trust, Fairnes: Safety and robustness
- Machine Learning: Representation learning
- Natural Language Processing: Embeddings
Abstract
Real-world deployment of large language models (LLMs) necessitates a robust and low-latency approach to detect prompt injections; existing low-overhead methods fail to simultaneously boost robustness and reduce latency. Current defenses for prompt injection either rely on brittle heuristics or invoke costly auxiliary models, imposing a significant runtime burden. We introduce BERM, a lightweight framework that performs in-situ detection by modeling a host LLM’s internal representations extracted during prefill, adding negligible overhead. Our approach trains a lightweight classifier atop the LLM by learning a compact manifold of benign representations via joint contrastive learning to maximize the separation from malicious representations. At inference, this pre-trained classifier enables in-situ detection without invoking auxiliary guard models. On a diverse landscape of prompt injection attacks, our framework establishes a new state-of-the-art, achieving an F1-score 5.2 percentage points (pp) higher than the best prior work. Critically, BERM achieves this while being over 12x faster, reducing inference overhead to near-zero.
@inproceedings{ijcai2026p68,
title = {BERM: Low-Overhead Prompt-Injection Detection via In-Situ Benign Representation Modeling},
author = {Guo, Maihao and Zhao, Chaoyang and Wang, Jinqiao},
booktitle = {Proceedings of the Thirty-Fifth International Joint Conference on
Artificial Intelligence, {IJCAI-26}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {Diego Calvanese},
pages = {599--607},
year = {2026},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2026/68},
url = {https://doi.org/10.24963/ijcai.2026/68},
}
TY - CPAPER TI - BERM: Low-Overhead Prompt-Injection Detection via In-Situ Benign Representation Modeling AU - Guo, Maihao AU - Zhao, Chaoyang AU - Wang, Jinqiao T2 - Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence, IJCAI-26 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2026 SP - 599 EP - 607 DO - 10.24963/ijcai.2026/68 UR - https://doi.org/10.24963/ijcai.2026/68 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: