Research map / Large language models / Language, safety and interpretability
Attention Tracker: Detecting Prompt Injection Attacks in LLMs
Kuo-Han Hung, Ching-Yun Ko, Ambrish Rawat, I-Hsin Chung, Winston H. Hsu, Pin-Yu Chen
IBM · National Taiwan University
Read the paperPlace an idea next to itCheck your own paper ↗
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add attention-head selection with k=4 (about 0.3% of heads) instead of all heads (ablation) | Attention Tracker · deepset prompt injection (Llama3-8B) | AUROC: 0.821 -> 0.986 | Improved |
| select too few heads (k=5) instead of k=4 (ablation) | Attention Tracker · deepset prompt injection (Llama3-8B) | AUROC: 0.986 -> 0.869 | Hurt |
| use attention-based focus score instead of Protect AI / Prompt-Guard trained detectors | Attention Tracker · Open-Prompt-Injection | AUROC: 0.97 -> 1.00 (vs Prompt-Guard, Qwen2) | Improved |
| use attention-based focus score instead of best baseline | Attention Tracker · deepset prompt injection | AUROC: up to +10.0% | Improved |
| use attention-based focus score instead of LLM-based / known-answer detection | Attention Tracker · Open-Prompt-Injection and deepset | AUROC: avg +31.3% (OPI), +20.9% (deepset) | Improved |
| use small LLM (Qwen2-1.5B) for detection | Attention Tracker · deepset prompt injection | AUROC: 0.98 (1.5B) vs 0.99 (Llama3-8B) | No clear effect |
| use a trained detector (Protect AI / Prompt-Guard) across datasets | Protect AI detector / Prompt-Guard · both datasets | AUROC: Prompt-Guard 0.97 (OPI) vs 0.75 (deepset) | Mixed |
| longer data portion relative to instruction | Attention Tracker focus score · Llama3 data-length analysis | focus score | No clear effect |
| use important heads found with simple LLM-generated data on other datasets | Attention Tracker · Qwen-2 head analysis | attention difference | Improved |
| vary the test instruction I_test (Say xxxxxx vs others) (ablation) | Attention Tracker · deepset (Qwen-2-1.8B) | AUROC: 0.979 (Say xxxxxx) vs 0.893-0.972 for others | Mixed |
| use stronger attacks with higher attack success rate | Attention Tracker · Open-Prompt-Injection | aggregated attention to instruction | Improved |
Open problems this paper states
- “Requires internal attention scores at inference, which are unavailable to users of closed-source LLMs.” → Methods need white-box access and cannot be used on closed models. (an open problem in safety alignment of LLMs)
Open problems in safety alignment of LLMs
How can LLM safety be shown to hold across languages, multi-turn use and models beyond small open ones?
- Safety is tested in English or a few languages only. · 30 papers state it
- Results come from a few open models, mostly small or mid-sized. · 26 papers state it
- Scores depend on an LLM judge that may be biased. · 23 papers state it
Closest papers by meaning
- Evaluating the Instruction-Following Robustness of Large Language Models to Prompt Injection (EMNLP 2024 · similarity 0.91)
- Defense Against Prompt Injection Attack by Leveraging Attack Techniques (ACL 2025 · similarity 0.90)
- Can Indirect Prompt Injection Attacks Be Detected and Removed? (ACL 2025 · similarity 0.90)
- Robustness via Referencing: Defending against Prompt Injection Attacks by Referencing the Executed Instruction (ACL 2026 · similarity 0.90)
- Defending against Indirect Prompt Injection by Instruction Detection (EMNLP 2025 · similarity 0.89)
- Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchy (ICLR 2025 · similarity 0.88)
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.