Context-Aware Hierarchical Learning: A Two-Step Paradigm towards Safer LLMs
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
- 2017Attention Is All You Needcited by 59,932
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2024Qwen2.5 Technical Reportcited by 4,713
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2022Emergent Abilities of Large Language Modelscited by 2,483
31 more
- 2022Do As I Can, Not As I Say: Grounding Language in Robotic Affordancescited by 2,302
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2024A Survey on LLM-as-a-Judgecited by 1,384
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,330
- 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedbackcited by 738
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
- 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 702
- 2025SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-trainingcited by 655
- 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
- 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 441
- 20218-bit Optimizers via Block-wise Quantizationcited by 395
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
- 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
- 2024Improving Alignment and Robustness with Circuit Breakerscited by 302
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
- 2021Reframing Instructional Prompts to GPTk's Languagecited by 176
- 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Gamecited by 135
- 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
- 2023Effective Prompt Extraction from Language Modelscited by 83
- 2024Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchycited by 62
- 2024Facilitating Multi-turn Function Calling for LLMs via Compositional Instruction Tuningcited by 40
- 2025ASIDE: Architectural Separation of Instructions and Data in Language Modelscited by 21
- 2025Spotlight Your Instructions: Instruction-following with Dynamic Attention Steeringcited by 18
- 2024LLoCO: Learning Long Contexts Offlinecited by 16
- 2025Defense against Prompt Injection Attacks via Mixture of Encodingscited by 10
- 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
- 2026Hierarchical Alignment: Enforcing Hierarchical Instruction-Following in LLMs through Logical Consistency
- 2024ToolSword: Unveiling Safety Issues of Large Language Models in Tool Learning Across Three Stages
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations
- 2025Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Education
- 2024Defending Large Language Models against Jailbreak Attacks via Semantic Smoothing
- 2026Involuntary In-Context Learning: Exploiting Few-Shot Pattern Completion to Bypass Safety Alignment in GPT-5.4
- 2026Faithful Dual-constrained Erasure for Robust LLM Safety Alignment
- 2026Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning