Strengthening Large Language Models' Instruction Hierarchy Enforcement by Enhancing Intermediate RepresentationsStronger Enforcement of Instruction Hierarchy via Augmented Intermediate Representations
The researchers propose a defense method against prompt injection that strengthens large language models' instruction hierarchy enforcement by enhancing intermediate representations. Existing defenses usually inject instruction hierarchy (IH) signals only at the initial input layer; the authors conjecture that this limits the signal's ability to distinguish privilege levels as token representations propagate through the model's layers. The new method adds layer-wise trainable embeddings to token representations in the network's intermediate layers to encode privilege information. Evaluations across multiple models and training methods show that this method reduces the success rate of gradient-based prompt injection attacks by 1.6 to 9.2 times compared with state-of-the-art methods, without noticeably harming model utility.