LLM responses checked for hidden instruction conflicts to improve safety
Combating Instruction Conflict via Energy-Driven Latent Conflict Detection
Computation and Language
Summary
Large language models can sometimes ignore important rules when answering questions, especially when instructions from users clash with system rules. The authors found that current methods only look at the input and miss cases where the final answer breaks these rules. They created a system called ELCD that looks at the model’s full answer after it is generated to detect hidden conflicts. ELCD understands the answer by combining different internal signals and learns to tell apart safe and problematic responses. Tests show ELCD works much better than other methods on popular language models.
Large Language ModelsInstruction ConflictResponse DriftLatent SpaceEmbeddingPost-generation VerificationRanking ObjectiveFalse Positive RatePR-AUC
Authors
Mingyu Ma, Yuxin Wu, Jingbo Wang, Tianxiao Huang, Leixin Sun, Xiaochuan Shi
Abstract
Large Language Models (LLMs) are increasingly deployed with hierarchical instructions, yet they remain vulnerable to conflicts in which user directives override system-level constraints. Existing defense mechanisms predominantly focus on static input inspection and therefore fail to detect Response Drift, a phenomenon in which the model's final response violates system-level constraints despite seemingly compliant inputs. To bridge this gap, we introduce ELCD, a response-level latent conflict detector for post-generation, pre-delivery verification. Given the full generated output, ELCD constructs a composite hidden-state representation by concatenating the final-token embedding with the mean-pooled response embedding. It then optimizes a pairwise margin ranking objective to separate compliant and drifting responses in latent space. Extensive experiments across five mainstream LLMs ranging from 1.5B to 14B parameters demonstrate that ELCD significantly outperforms competitive baselines. Notably, it improves the PR-AUC on Llama-2-7B by approximately 30 percentage points and reduces the False Positive Rate at 95% TPR (FPR95) on Mistral-7B to 2.67%. These results suggest that ELCD provides a promising approach for latent instruction-conflict detection in open-weight or self-hosted LLM deployments.