Prompt Injection Detection: Teacher–Student Distillation

  • Developed a knowledge-distillation pipeline: fine-tuned Qwen2.5-3B with QLoRA (0.91 F1) and transferred soft-label distributions to a DistilBERT classifier (0.89 F1) at 134× lower latency.
  • Designed a cascade architecture routing uncertain inputs to the teacher model, matching teacher F1 at ~9 ms average inference.

Read the write-up on Medium →

updated_at 01-02-2026