mlsanityData to 14 Oct 2026

Stronger Enforcement of Instruction Hierarchy via Augmented Intermediate Representations

arXiv 2505.18907 ↗First posted 25 May 2025cs.AI cs.LGcited by 9

On the map: LLM safety and security → Prompt injection and agent security

Abstract (arXiv)

Prompt injection attacks are a critical security vulnerability in large language models (LLMs), allowing attackers to hijack model behavior by injecting malicious instructions within the input context. Recent defense mechanisms have leveraged an Instruction Hierarchy (IH) Signal, often implemented through special delimiter tokens or additive embeddings to denote the privilege level of input tokens. However, these prior works typically inject the IH signal exclusively at the initial input layer, which we hypothesize limits its ability to effectively distinguish the privilege levels of tokens as it propagates through the different layers of the model. To overcome this limitation, we introduce a novel approach that injects the IH signal into the intermediate token representations within the network. Our method augments these representations with layer-specific trainable embeddings that encode the privilege information. Our evaluations across multiple models and training methods reveal that our proposal yields between 1.6× and 9.2× reduction in attack success rate on gradient-based prompt injection attacks compared to state-of-the-art methods, without significantly degrading the model's utility.

Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 21 of its 29 references that are in the map. First posted on arXiv 25 May 2025.

Builds on

21 of 29 references.

Closest ancestors · 8

Same direction, newest first

  1. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attacks15 Apr
  2. 2024Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchy9 Oct
  3. 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct
  4. 2024AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents19 Jun
  5. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions19 Apr
  6. 2024Neural Exec: Learning (and Learning from) Execution Triggers for Prompt Injection Attacks6 Mar
  7. 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
  8. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb

Other references · 13

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  5. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  6. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 832
  7. 2023AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedbackcited by 748
  8. 2023Detecting Language Model Attacks with Perplexitycited by 431
  9. 2025Constitutional Classifiers: Defending against Universal Jailbreaks across Thousands of Hours of Red Teamingcited by 181
  10. 2021Position Information in Transformers: An Overviewcited by 103
  11. 2024Can LLMs Separate Instructions From Data? And What Do We Even Mean By That?cited by 81
  12. 2024Boosting Jailbreak Attack with Momentumcited by 40
1 more
  1. 2023Length Extrapolation of Transformers: A Survey from the Perspective of Positional Encodingcited by 32

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 7.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Defending against Indirect Prompt Injection by Instruction Detection
  2. 2023Evaluating the Instruction-Following Robustness of Large Language Models to Prompt Injection
  3. 2025Backdoor-Powered Prompt Injection Attacks Nullify Defense Methods
  4. 2026Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning
  5. 2026Beyond Over-Refusal: Defending Indirect Prompt Injection via Latent Instruction Manifolds
  6. 2024Defense Against Prompt Injection Attack by Leveraging Attack Techniques
  7. 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuning
  8. 2025Robustness via Referencing: Defending against Prompt Injection Attacks by Referencing the Executed Instruction