SecInfer: Defending against prompt injection via inference-time scalingSecInfer: Preventing Prompt Injection via Inference-time Scaling
The researchers propose SecInfer, a prompt injection defense method based on inference-time scaling. Existing state-of-the-art defenses typically rely on fine-tuning LLMs to enhance safety, but have limited effectiveness against strong attacks. SecInfer consists of two key steps: system-prompt-guided sampling, which explores different reasoning paths through a set of diverse system prompts to generate multiple responses for a given input; and target-task-guided aggregation, which selects from them the response most likely to accomplish the target task. Extensive experiments show that, with additional inference-time compute, SecInfer can effectively mitigate existing and adaptive prompt injection attacks, outperforming state-of-the-art defenses and existing inference-time scaling methods.