Identify, Classify, Act: Per-Instruction Controlled Compliance for LLMs over External Data
Abstract
LLMs over external data face a per-instruction tension: a single document or tool return often interleaves legitimate directives with adversarial prompt injections, and the model must follow the former while rejecting the latter. Existing defenses suppress or trust all external instructions, collapsing the safety-utility frontier and forcing a choice between over-refusal and over-compliance. We argue the missing capability is per-instruction credit attribution and formalize it as External-Data Instruction Classification, an identify-classify-act decision over each embedded directive. We propose EDIC, a decomposed reward framework for per-instruction compliance. A scene-grounded pipeline injects mixed beneficial and harmful instructions with counterfactual filtering, while a generative judge is initialized by SFT and refined with GRPO to attribute compliance at the instruction level. The judge then produces a reward that separately encourages beneficial compliance and penalizes harmful compliance for RL training. Across two backbones and five benchmarks, EDIC improves both safety and utility over the strongest prior defense, lifting harmful-rejection by up to 7.7\% and Arena-Hard-Auto utility by 12.5\% on Qwen3-4B. The code repository is hosted at https://github.com/yingyingxia666/EDIC.
Create a lesson
Metadata
- Categories
- cs.CL, cs.CR
- Journal
- EMNLP2026
Related papers
Trallie: from Free-Form Text to Structured Data with LLMs
Shared title terminologycs.CLVijayasri Iyer, Cristiano De Nobili, Mubashir Hussain Shah et al.
ESGPT: A Data-Centric ESG Language Model with Unified Instruction and Benchmark Resources
Shared title terminologycs.CLJaeyoung Lee, Misuk Kim
Scaling Synthetic Pre-training Data and Evaluation for Indic LLMs
Shared title terminologycs.CLAbhinav Khattar, Aishwarya Chhabra, Ameya Velingker et al.
Quality-Controlled Reply and Summary Data for Post-Training Small Language Models in AI Call-Screening Agents
Shared title terminologycs.CLJiaqi Gan, Tsang Ng, Ankit Raj et al.
Hidden Cartographer: Hidden State Guided Data Selection for Dual Budgeted Instruction Tuning
Shared title terminologycs.CLZixuan Qin, Qi Qin, Erbo Li et al.
Do LLMs Reproduce the Age Gap in Loneliness? Evaluating Survey Simulation against European Survey Data
Shared title terminologycs.CLYuliya Li, Achim Rettinger, Dominik Beyer