Know the Enemy and Know Yourself: InstruCoT Defends Against LLM Prompt Injection Through Diversified Data Synthesis and Instruction-Level Chain-of-Thought LearningKnow Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning
AI summary
InstruCoT defends against prompt injection attacks through diversified data synthesis and instruction-level chain-of-thought fine-tuning, enabling large language models to recognize and refuse malicious instructions from any source and at any position in the context. The evaluation covers three dimensions: behavioral deviation, privacy leakage, and harmful output. Experiments on four large language models show that it significantly outperforms baselines on all dimensions, with no degradation in utility.