atlas

Research map / Large language models / Language, safety and interpretability

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

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces Tool-Completion Attack (TCA), a prompt-injection attack hidden in fake tool-completion contexts, and the Tool-Completion benchmark, and proposes Context-Aware Hierarchical Learning (CAHL), which adds segment summarization and global self-attention on top of ISE to improve instruction hierarchy robustness.

Problem

LLMs process all tokens uniformly and lack role-based instruction hierarchy, making them vulnerable to prompt injections, especially injected instructions hidden in tool-call responses that appear as legitimate task completions.

Approach

Segment query embeddings with a segment-masked cross-attention summarization per instruction role, followed by global self-attention propagation, added to token and instruction-segment embeddings to build a context-aware instruction hierarchy; combined with a new tool-completion attack that creates a false task completion before injecting the instruction.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply CAHL instead of ISELlama-3.1-8B on StruQ clean · StruQ cleanAverage ASR: 33.41 -> 26.32Helped
Apply CAHL instead of ISELlama-3.1-8B on StruQ clean · StruQ cleanCapability: 78.64 -> 83.60Helped
Apply CAHL instead of DelimiterLlama-3.1-8B on Tool-Completion clean · Tool-Completion cleanASR: 56.72 -> 44.89Helped
Apply CAHL instead of DelimiterLlama-3.1-8B on Tool-Completion clean · Tool-Completion cleanIIR: 15.86 -> 28.49Helped
Train CAHL on adversarial rather than clean Tool-Completion dataCAHL · Tool-Completion benchmarkCapability: 77.12 -> 81.35Helped
Remove segment mask M in Segment Summarization (ablation)CAHL on clean StruQ · StruQ cleanCapability: 83.60 -> 80.79Hurt
Remove segment mask M in Segment Summarization (ablation)CAHL on clean StruQ · StruQ cleanAverage ASR: 26.32 -> 30.41Hurt
Add CAHL to DELM + ISE (ablation)Llama-3.1-8B on clean StruQ · StruQ cleanAverage ASR: 33.41 -> 26.32Helped
Add CAHL to DELM + ISE (ablation)Llama-3.1-8B on clean StruQ · StruQ cleanCapability: 78.64 -> 83.60Helped
Add ISE without CAHL or DELM (ablation)Llama-3.1-8B on clean StruQ · StruQ cleanCapability: 84.87 -> 80.05Hurt
Use CAHL without ISE or DELM (ablation)Llama-3.1-8B on clean StruQ · StruQ cleanAverage ASR: 46.51 -> 46.51No clear effect
Use adversarial TCA instead of Naive attackCAHL on Tool-Completion · Tool-Completion benchmarkASR: 12% -> 45%Hurt

Surprising findings

Limitations

Experimental setup

Datasets: Alpaca-Cleaned AlpacaFarm BUTTON Tensor Trust

Benchmarks: StruQ benchmark Tool-Completion benchmark GCG attack evaluation

Metrics: Attack Success Rate (ASR) Capability (AlpacaEval win rate) Injection Ignorance Rate (IIR) manual inspection ASR

Baselines: Text (vanilla delimiter) Delimiter (StruQ) ISE o3-mini GPT-4o DeepSeek-R1 Llama-3.1-8B-Instruct Qwen2.5-7B-Instruct

Builds on: Instructional Segment Embedding (ISE) StruQ BUTTON Circuit Breakers

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy