Hybrid Constitutional Classifiers for Prompt Injection Defense
In this paper, we propose a novel hybrid constitutional classifier system that combines a lightweight input classifier with a fine-tuned generative LLM to enhance security while maintaining efficiency. Our approach integrates a DeBERTa-based classifier for filtering adversarial prompts before they reach the model and a small LLM that performs response monitoring to prevent unsafe completions in real time. Through extensive benchmarking, we demonstrate that our hybrid approach effectively mitigates adversarial inputs while significantly reducing inference latency compared to large-scale models like LLaMA-2 13B. We further explore optimization techniques such as model quantization and knowledge distillation to improve system performance with minimal degradation in classification accuracy. Our results indicate that the hybrid system achieves detection accuracy of 96.97% for inputs and 78.79% for the outputs, maintaining robust safe filtering capabilities while offering 67% lower latency in overall compared to conventional large LLM classifiers. The deployment of a hybrid constitutional classifier system for real-time AI applications enhances LLM security by providing a scalable, high-performance defense against prompt injection attacks, enabling safer AI interactions in critical domains.
Authors
- Anuj Kaul
- Piyush Pattanayak
- Vinothini Pandurangan
- Nishant Kumar Das Pattanaik
- Qianlong Lan
- Shaun Jones
- Stephanie Westrum
Institutions
- eBay (Ireland) (IE)
Publication Details
- Published
- 2025-05-29
- DOI
- https://doi.org/10.1109/eit64391.2025.11103606
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- article
- Field-Weighted Citation Impact
- 0.00