mlsanityData to 14 Oct 2026

Exposing the Ghost in the Transformer: Abnormal Detection for Large Language Models via Hidden State Forensics

arXiv 2504.00446 ↗First posted 1 Apr 2025cs.CRcited by 6

On the map: LLM safety and security → Backdoor and data poisoning attacks

Abstract (arXiv)

The widespread adoption of Large Language Models (LLMs) in critical applications has introduced severe reliability and security risks, as LLMs remain vulnerable to notorious threats such as hallucinations, jailbreak attacks, and backdoor exploits. These vulnerabilities have been weaponized by malicious actors, leading to unauthorized access, widespread misinformation, and compromised LLM-embedded system integrity. In this work, we introduce a novel approach to detecting abnormal behaviors in LLMs via hidden state forensics. By systematically inspecting layer-specific activation patterns, we develop a general framework that can efficiently identify a range of security threats in real-time without imposing prohibitive computational costs. Extensive experiments indicate detection accuracies exceeding 95% and consistently robust performance across multiple models in most scenarios, while preserving the ability to detect novel attacks effectively. Furthermore, the computational overhead remains minimal, with detector inference taking merely fractions of a second. The significance of this work lies in proposing a promising strategy to reinforce the security of LLM-integrated systems, paving the way for safer and more reliable deployment in high-stakes domains. By enabling real-time detection that can also support the mitigation of abnormal behaviors, it represents a meaningful step toward ensuring the trustworthiness of AI systems amid rising security challenges.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 45 of its 59 references that are in the map. First posted on arXiv 1 Apr 2025.

Builds on

45 of 59 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models23 Aug
  2. 2024CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Models18 Jun
  3. 2024Chain-of-Scrutiny: Detecting Backdoor Attacks for Large Language Models10 Jun
  4. 2023Backdooring Instruction-Tuned Large Language Models with Virtual Prompt Injection31 Jul
  5. 2023BDMMT: Backdoor Sample Detection for Language Models through Model Mutation Testing25 Jan
  6. 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct

Other references · 39

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  4. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  5. 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,975
  6. 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,601
  7. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
  8. 2017BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chaincited by 1,106
  9. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 916
  10. 2017Crowdsourcing Multiple Choice Science Questionscited by 765
  11. 2023Instruction Tuning with GPT-4cited by 686
  12. 2023The Internal State of an LLM Knows When It's Lyingcited by 659
27 more
  1. 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 651
  2. 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 489
  3. 2024Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attackscited by 486
  4. 2023HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Modelscited by 341
  5. 2017DeepXplore: Automated Whitebox Testing of Deep Learning Systemscited by 311
  6. 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 263
  7. 2024JailBreakV: A Benchmark for Assessing the Robustness of MultiModal Large Language Models against Jailbreak Attackscited by 230
  8. 2020IntelliCode Compose: Code Generation Using Transformercited by 227
  9. 2023Large Language Models in Finance: A Surveycited by 226
  10. 2024WildTeaming at Scale: From In-the-Wild Jailbreaks to (Adversarially) Safer Language Modelscited by 223
  11. 2023MasterKey: Automated Jailbreak Across Multiple Large Language Model Chatbotscited by 183
  12. 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllabilitycited by 175
  13. 2024Large Legal Fictions: Profiling Legal Hallucinations in Large Language Modelscited by 150
  14. 2018DeepGauge: Multi-Granularity Testing Criteria for Deep Learning Systemscited by 147
  15. 2023Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthinesscited by 122
  16. 2024A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Modelscited by 106
  17. 2024GradSafe: Detecting Jailbreak Prompts for LLMs via Safety-Critical Gradient Analysiscited by 96
  18. 2024LLM Internal States Reveal Hallucination Risk Faced With a Querycited by 82
  19. 2024Self-Alignment for Factuality: Mitigating Hallucinations in LLMs via Self-Evaluationcited by 80
  20. 2024Gradient Cuff: Detecting Jailbreak Attacks on Large Language Models by Exploring Refusal Loss Landscapescited by 74
  21. 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
  22. 2024Lynx: An Open Source Hallucination Evaluation Modelcited by 57
  23. 2024Do LLMs Know about Hallucination? An Empirical Investigation of LLM's Hidden Statescited by 52
  24. 2024In-Context Sharpness as Alerts: An Inner Representation Perspective for Hallucination Mitigationcited by 45
  25. 2024Drowzee: Metamorphic Testing for Fact-Conflicting Hallucination Detection in Large Language Modelscited by 14
  26. 2021Revisiting Neuron Coverage for DNN Testing: A Layer-Wise and Distribution-Aware Criterioncited by 11
  27. 2024Understanding the Effectiveness of Coverage Criteria for Large Language Models: A Special Angle from Jailbreak Attackscited by 8

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 5.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Securing Large Language Models: Addressing Bias, Misinformation, and Prompt Attacks
  2. 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequences
  3. 2025ConfGuard: A Simple and Effective Backdoor Detection for Large Language Models
  4. 2025Bridging the Safety Gap: A Guardrail Pipeline for Trustworthy LLM Inferences
  5. 2024SoK: Prompt Hacking of Large Language Models
  6. 2024Trojan Detection in Large Language Models: Insights from The Trojan Detection Challenge
  7. 2025Attack and defense techniques in large language models: A survey and new perspectives
  8. 2023JailGuard: A Universal Detection Framework for LLM Prompt-based Attacks