ICML 2025poster0 citations

LLMScan: Causal Scan for LLM Misbehavior Detection

Mengdi Zhang, Goh Kai Kiat, Peixin Zhang, Jun Sun, Lin Xin Rose, Hongyu Zhang

Abstract

Despite the success of Large Language Models (LLMs) across various fields, their potential to generate untruthful and harmful responses poses significant risks, particularly in critical applications. This highlights the urgent need for systematic methods to detect and prevent such misbehavior. While existing approaches target specific issues such as harmful responses, this work introduces LLMScan, an innovative LLM monitoring technique based on causality analysis, offering a comprehensive solution. LLMScan systematically monitors the inner workings of an LLM through the lens of causal inference, operating on the premise that the LLM's `brain' behaves differently when generating harmful or untruthful responses. By analyzing the causal contributions of the LLM's input tokens and transformer layers, LLMScan effectively detects misbehavior. Extensive experiments across various tasks and models reveal clear distinctions in the causal distributions between normal behavior and misbehavior, enabling the development of accurate, lightweight detectors for a variety of misbehavior detection tasks.

Large Language ModelCausality InferenceLLM Detection
BibTeX
@inproceedings{
zhang2025llmscan,
title={{LLMS}can: Causal Scan for {LLM} Misbehavior Detection},
author={Mengdi Zhang and Goh Kai Kiat and Peixin Zhang and Jun Sun and Lin Xin Rose and Hongyu Zhang},
booktitle={Forty-second International Conference on Machine Learning},
year={2025},
url={https://openreview.net/forum?id=M9keJ0Jy3J}
}