Latent detection improves instruction conflict handling in large language models

Combating Instruction Conflict via Energy-Driven Latent Conflict Detection

Computation and Language

Summary

Large language models sometimes give answers that go against important system rules when following user instructions. The authors found that current checks focus only on the input and miss when the final answer breaks these rules, a problem they call Response Drift. They created ELCD, a method that looks at the model's full answer to spot hidden conflicts before sending it out. ELCD uses patterns in the hidden data of the model's output to better tell when answers are going off track. Tests on several popular models showed ELCD works much better than existing methods at catching these conflicts.

What this means in practice

  • For ai platform engineers: Verify generated outputs from deployed language models for hidden conflicts to prevent policy violations before responses reach users.
  • For enterprise chatbot developers: Improve chatbot reliability by detecting subtle breaks in system rules within generated responses, reducing mismatches between user instructions and compliance.

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.