Proceedings

BERM: Low-Overhead Prompt-Injection Detection via In-Situ Benign Representation Modeling

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 599-607.

https://doi.org/10.24963/ijcai.2026/68

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.

Maihao Guo, Chaoyang Zhao, and Jinqiao Wang. 2026. BERM: Low-Overhead Prompt-Injection Detection via In-Situ Benign Representation Modeling. In Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence, IJCAI-26. IJCAI, 599–607. https://doi.org/10.24963/ijcai.2026/68
Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards