mlsanityData to 7 Oct 2026

Context-Aware Hierarchical Learning: A Two-Step Paradigm towards Safer LLMs

arXiv 2512.03720 ↗First posted 3 Dec 2025cs.CR cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) have emerged as powerful tools for diverse applications. However, their uniform token processing paradigm introduces critical vulnerabilities in instruction handling, particularly when exposed to adversarial scenarios. In this work, we identify and propose a novel class of vulnerabilities, termed Tool-Completion Attack (TCA), which exploits function-calling mechanisms to subvert model behavior. To evaluate LLM robustness against such threats, we introduce the Tool-Completion benchmark, a comprehensive security assessment framework, which reveals that even state-of-the-art models remain susceptible to TCA, with surprisingly high attack success rates. To address these vulnerabilities, we introduce Context-Aware Hierarchical Learning (CAHL), a sophisticated mechanism that dynamically balances semantic comprehension with role-specific instruction constraints. CAHL leverages the contextual correlations between different instruction segments to establish a robust, context-aware instruction hierarchy. Extensive experiments demonstrate that CAHL significantly enhances LLM robustness against both conventional attacks and the proposed TCA, exhibiting strong generalization capabilities in zero-shot evaluations while still preserving model performance on generic tasks. Our code is available at https://github.com/S2AILab/CAHL.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 43 of its 54 references that are in the map. First posted on arXiv 3 Dec 2025.

Builds on

43 of 54 references.

References · 43

  1. 2017Attention Is All You Needcited by 59,932
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  6. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  7. 2024Qwen2.5 Technical Reportcited by 4,713
  8. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  9. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
  10. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  11. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  12. 2022Emergent Abilities of Large Language Modelscited by 2,483
31 more
  1. 2022Do As I Can, Not As I Say: Grounding Language in Robotic Affordancescited by 2,302
  2. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  3. 2020Extracting Training Data from Large Language Modelscited by 2,144
  4. 2024A Survey on LLM-as-a-Judgecited by 1,384
  5. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
  6. 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,330
  7. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
  8. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
  9. 2023AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedbackcited by 738
  10. 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
  11. 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 702
  12. 2025SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-trainingcited by 655
  13. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
  14. 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
  15. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 441
  16. 20218-bit Optimizers via Block-wise Quantizationcited by 395
  17. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
  18. 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
  19. 2024Improving Alignment and Robustness with Circuit Breakerscited by 302
  20. 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
  21. 2021Reframing Instructional Prompts to GPTk's Languagecited by 176
  22. 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Gamecited by 135
  23. 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
  24. 2023Effective Prompt Extraction from Language Modelscited by 83
  25. 2024Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchycited by 62
  26. 2024Facilitating Multi-turn Function Calling for LLMs via Compositional Instruction Tuningcited by 40
  27. 2025ASIDE: Architectural Separation of Instructions and Data in Language Modelscited by 21
  28. 2025Spotlight Your Instructions: Instruction-following with Dynamic Attention Steeringcited by 18
  29. 2024LLoCO: Learning Long Contexts Offlinecited by 16
  30. 2025Defense against Prompt Injection Attacks via Mixture of Encodingscited by 10
  31. 2025The Illusion of Role Separation: Hidden Shortcuts in LLM Role Learning (and How to Fix Them)cited by 6

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Hierarchical Alignment: Enforcing Hierarchical Instruction-Following in LLMs through Logical Consistency
  2. 2024ToolSword: Unveiling Safety Issues of Large Language Models in Tool Learning Across Three Stages
  3. 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations
  4. 2025Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Education
  5. 2024Defending Large Language Models against Jailbreak Attacks via Semantic Smoothing
  6. 2026Involuntary In-Context Learning: Exploiting Few-Shot Pattern Completion to Bypass Safety Alignment in GPT-5.4
  7. 2026Faithful Dual-constrained Erasure for Robust LLM Safety Alignment
  8. 2026Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning