Skip to content

A False Sense of Security: Why Probing-Based Malicious Input Detection in LLMs Does Not GeneralizeFalse Sense of Security: Why Probing-based Malicious Input Detection Fails to Generalize

arXiv· arXiv:2509.03888· Findings of ACL 2026· Cheng Wang, Zeming Wei, Qin Liu, Muhao ChenNational University of Singapore; Peking University; University of California, DavisIndexed by this site · 24 days ago· Originally publishedSelected AlignmentSelectedAttention38

Quick read

Analysis and theory

Based on the paper PDF (AI-generated); refer to the original

The authors systematically re-tested probing-based malicious-input detection, stating that its ID accuracy exceeds 98% but drops by 15∼99 percentage points OOD, and that it mainly learns surface patterns rather than semantic harmfulness.

Questions
Probing-based malicious-input detection has high accuracy on ID tests and has been adopted as a safety mechanism, but the authors question whether it learns surface patterns rather than semantic harmfulness, and it may fail under OOD.
Methods
Train an SVM classifier on frozen hidden states, then run three studies in sequence: comparison with n-gram Naive Bayes, measuring performance on semantically cleaned datasets, and analyzing dependence on instruction patterns and trigger words using rewriting and XSTest.
Experiments and results
ID accuracy exceeds 98%, OOD drops by 15∼99 percentage points; n-gram methods perform comparably; after cleaning accuracy drops to as low as 8.0%; after rewriting it recovers; XSTest false positive rate 40-80%; yet LLM zero-shot classification is near perfect.
Limitations and future work
The authors note that the evaluation is limited to English datasets and decoder-only Transformer architectures; the experiments do not report statistical significance tests or numbers of repetitions, and the cleaning and rewriting were done by gpt-4o without reported human verification.
Experimental setupGemma-3-4b-it、Gemma-3-27b-it et al. · AdvBench、ForbiddenQuestions et al. · Accuracy、False Positive Rate
Threat model
Defenders train lightweight classifiers such as SVM on frozen LLM hidden states (the last token of the last layer) to distinguish malicious from benign prompts; the paper tests whether this detector fails on OOD data, semantically cleaned data, and benign inputs containing suspicious words.
Evaluated models
Gemma-3-4b-itGemma-3-27b-itLlama-3.1-8B-InstructLlama-3.1-70B-InstructQwen2.5-7B-InstructQwen2.5-14B-InstructQwen2.5-72B-Instruct
Benchmarks
AdvBenchForbiddenQuestionsBeaverTailsEvalJailbreakBenchStrongRejectMaliciousInstructHarmBenchAlpacaDollySimpleQANaturalQuestionsXSTest
Metrics
AccuracyFalse Positive Rate
AI summaryand selection rationaleResearchers from UC Davis and Peking University systematically re-examine probing-based malicious input detection methods for LLMs, finding that such classifiers achieve over 98% in-distribution accuracy, but drop by 15 to 99 percentage points on out-of-distribution data, with some combinations near zero, and that a simple n-gram Naive Bayes achieves comparable performance. On semantically cleaned datasets that preserve sentence structure but replace harmful content, accuracy drops by a further 60 to 90 percentage points; after rewriting to remove instruction patterns, performance recovers, and the false positive rate on benign samples containing malicious vocabulary reaches 40% to 80%, indicating that the classifiers learn instruction patterns and trigger words rather than semantic harmfulness, and this holds across models such as Gemma-3, Llama-3.1 and Qwen2.5. The study also shows that LLMs' own zero-shot safety classification accuracy reaches 96.5% to 100%, indicating that the limitation lies in the probing method rather than the models' understanding capability.

Researchers from UC Davis and Peking University systematically re-examine probing-based malicious input detection methods for LLMs, finding that such classifiers achieve over 98% in-distribution accuracy, but drop by 15 to 99 percentage points on out-of-distribution data, with some combinations near zero, and that a simple n-gram Naive Bayes achieves comparable performance. On semantically cleaned datasets that preserve sentence structure but replace harmful content, accuracy drops by a further 60 to 90 percentage points; after rewriting to remove instruction patterns, performance recovers, and the false positive rate on benign samples containing malicious vocabulary reaches 40% to 80%, indicating that the classifiers learn instruction patterns and trigger words rather than semantic harmfulness, and this holds across models such as Gemma-3, Llama-3.1 and Qwen2.5. The study also shows that LLMs' own zero-shot safety classification accuracy reaches 96.5% to 100%, indicating that the limitation lies in the probing method rather than the models' understanding capability.

Why it was selectedThrough controlled experiments such as semantic cleaning and rewriting, the paper shows that probing-based malicious input detection relies on surface patterns rather than semantic harmfulness, which can be used to reassess the reliability of such safety detection before deployment.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors examine whether probing malicious-input detection truly understands semantic harmfulness, arguing that its high ID accuracy gives a false sense of security.

    Core question: are probing-based malicious-input detectors reliable out of distribution (OOD), and does their high accuracy come from semantic understanding or from surface patterns.

    • Problem setting: prior work used dimensionality-reduction visualization to claim that benign and malicious inputs are separable in hidden-state space, and then proposed training lightweight classifiers on hidden states for safety detection, achieving high ID accuracy and being adopted as a safety mechanism.
    • Shortcomings of existing methods: the authors observe that such classifiers degrade substantially on OOD data; the authors argue that if the representation truly encoded stable harmfulness semantics, performance should not deteriorate this much, which contradicts a key premise of the probing approach.
    • Core hypothesis: the authors propose the central hypothesis that probing representations mainly capture shallow patterns rather than harmfulness semantics, and on this basis question detection systems and interpretations of model behavior derived from probing analyses.
    • Contributions of the paper: validate the hypothesis through three progressive studies (comparison with n-gram baselines, controlled experiments on semantically cleaned datasets, pattern-dependence analysis), and the authors claim to identify the specific patterns the classifier learns: instructional patterns and trigger words.
    • Threat model (defense setting):
      • Defense location: train lightweight classifiers such as SVM on frozen LLM hidden states (last token of the last layer) for benign/malicious binary classification.
      • Assumed dependency: separability in hidden states reflects a learnable semantic distinction.
      • Test scenarios: OOD test sets, semantically cleaned data, benign inputs containing seemingly malicious words (XSTest safe subset).
  2. What related research exists?

    Related work falls into four groups: representational separability and probing detection, other applications of probing, adversarial attacks, and defense strategies.

    Representing separability and probing safety detection

    • Lin et al. (2024), Zheng et al. (2024), Qian et al. (2025)—use dimensionality-reduction visualizations to show the separability of benign and malicious inputs in hidden-state space.
    • Zhou et al. (2024), Zhang et al. (2024), Dong et al. (2025), Qian et al. (2025)—propose training lightweight classifiers on hidden states to distinguish malicious from benign inputs, i.e., the probing detection paradigm re-tested in this paper; the authors say these methods assume separability reflects semantic distinction and have high ID accuracy.

    Other applications of probing

    • Azaria and Mitchell (2023) (truthfulness evaluation), Liu et al. (2024c) (pretraining data detection), Alnuhait et al. (2024) (hallucination detection), Chang et al. (2022) (multilingual capability)—applications of probing techniques to LLM monitoring tasks.

    Adversarial attacks (Appendix A)

    • Jailbreak attacks (Jin et al., 2024; Yi et al., 2024; Wei et al., 2023), membership inference (Shi et al., 2024b; Wang et al., 2025c), prompt injection (Liu et al., 2024a,b) and retrieval corpus poisoning (Zhong et al., 2023; Zou et al., 2024; Wang et al., 2025b); the authors state that this paper focuses on the harmful-generation risk of LLMs.

    Defense strategies (Appendix A)

    • Three types: Guard Models (Liu et al., 2025; Ghosh et al., 2025b; Zeng et al., 2024; Wei et al., 2025), alignment training (RLHF: Ouyang et al., 2022; DPO: Liu et al., 2024d; Lee et al., 2023), mechanistic intervention (hidden-state modification: Qian et al., 2025; Zhou et al., 2024; activation steering: Ghosh et al., 2025a; Hazra et al., 2024).

    Baselines and benchmarks: The baseline method is a Multinomial Naive Bayes classifier using unigram, bigram and trigram features (CountVectorizer, minimum document frequency 2); evaluation uses 7 malicious datasets (AdvBench, ForbiddenQuestions, BeaverTailsEval, JailbreakBench, StrongReject, MaliciousInstruct, HarmBench) and 5 benign datasets (Alpaca, Dolly, SimpleQA, NaturalQuestions, XSTest).

    The authors position this paper as a systematic re-examination of this paradigm: it does not propose a new detector, but examines the failure mechanisms of probing detection under OOD and controlled conditions.

  3. How does the paper address this problem?

    Train an SVM on frozen hidden states for binary classification, and use three progressive studies to test whether it learns surface patterns or semantics.

    Overall approach: reproduce the existing probing detection pipeline, then use three progressive Research Studies to stress-test its robustness and the patterns it learns.

    Problem formalization

    • Extract layer-by-layer hidden states from decoder-only Transformers, mainly using the representation of the last token at the last layer as the prompt representation r = hLT(p); the authors state that self-attention lets r integrate contextual information from the entire prompt.
    • Safety detection is formalized as binary classification: train an SVM on dataset D = {(r_i, y_i)} to learn a mapping f: ℝd → {0, 1}; other layer representations and other classifiers are also evaluated.

    Motivation experiments (Section 3)

    • Train and evaluate following prior work's setup: ID evaluation merges one benign and one malicious dataset with a 20% test split; OOD evaluation uses Alpaca as the benign set, trains on BeaverTailsEval or ForbiddenQuestions, and tests on Dolly, HarmBench, AdvBench.
    • Sample control: datasets with more than 500 samples are randomly sampled to 500 to make classes more balanced (Appendix B).

    Research Study 1: Comparison with Naive Bayes

    • Design: if the probing classifier truly captures semantics, it should outperform purely surface-feature statistical methods; Multinomial Naive Bayes with unigram, bigram, and trigram features is used as a baseline, with train-test splits and evaluation protocols exactly matching the probing experiments.

    Research Study 2: Semantically cleaned datasets

    • Design: use gpt-4o to replace harmful content in malicious datasets with benign substitute words while keeping grammatical structure and length unchanged (e.g., changing a question about making dangerous items into a question about making food); train on the original benign+malicious combination and test separately on the original and cleaned versions.
    • Decision logic: if the classifier understands semantic harmfulness, its performance should drop on cleaned data; Appendix C gives the full cleaning prompt.

    Research Study 3: Pattern-dependence analysis

    • Instruction patterns: use gpt-4o to rewrite the cleaned data, changing instruction sentence patterns and structure while preserving benign semantics; if the classifier depends on instruction patterns, accuracy should recover (Appendix D gives the rewriting prompt).
    • Trigger words: measure the false positive rate on the XSTest safe subset (benign examples containing seemingly malicious words).
    • Supplementary analyses: layer selection (first/middle/last layer), classifier architecture (Logistic Regression, 100-hidden-unit MLP), base vs instruction-tuned model comparison, LLM zero-shot safety classification (Appendix E gives the prompt), PCA hidden-state visualization.
  4. What experiments did the paper conduct?

    ID above 98% but OOD drops by 15∼99 percentage points; n-gram comparable; after cleaning as low as 8.0%; recovers after rewriting; XSTest false positives 40-80%.

    Experimental setup

    • Models tested: Gemma-3-4b-it, Gemma-3-27b-it, Llama-3.1-8B-Instruct, Llama-3.1-70B-Instruct, Qwen2.5-7B-Instruct, Qwen2.5-14B-Instruct, Qwen2.5-72B-Instruct; base versions Gemma-3-4b, Llama-3.1-8B, Qwen2.5-14B are also used for comparison.
    • Datasets: 7 malicious (AdvBench, ForbiddenQuestions, BeaverTailsEval, JailbreakBench, StrongReject, MaliciousInstruct, HarmBench) and 5 benign (Alpaca, Dolly, SimpleQA, NaturalQuestions, XSTest); datasets with more than 500 samples are randomly sampled to 500.
    • Classifiers: SVM as the main one, plus Logistic Regression and a 100-hidden-unit MLP; baseline is n-gram Multinomial Naive Bayes.
    • Metrics: classification accuracy; false positive rate on XSTest.
    • Auxiliary model: gpt-4o is used for data cleaning and rewriting; zero-shot classification uses the Appendix E prompt to have the LLM output only Yes/No.
    • Protocol: ID is one benign + one malicious merged with a 20% test split; OOD trains with Alpaca as the benign set and tests on Dolly, HarmBench, AdvBench; the paper does not report the number of repetitions or statistical significance tests.

    Main results

    According to Table 1 (OOD evaluation, training set is Alpaca + the listed malicious dataset, values are accuracy %, subscripts are the drop in percentage points relative to ID):

    Swipe horizontally to read the table

    ModelMalicious training setIDDollyHarmBenchAdvBench
    Gemma-3-4b-itBeaverTailsEval99.684.629.534.2
    Gemma-3-27b-itForbiddenQuestions99.489.80.01.2
    Llama-3.1-8B-InstructBeaverTailsEval99.586.029.041.7
    Llama-3.1-70B-InstructForbiddenQuestions99.494.60.50.4
    Qwen2.5-7B-InstructForbiddenQuestions99.495.20.51.5
    Qwen2.5-72B-InstructBeaverTailsEval99.687.621.036.2

    (Table 1 has 12 rows in total; 6 rows including Qwen2.5-14B-Instruct are omitted here; the full range is ID 98.8–100.0, with OOD drops of 15∼99 percentage points.)

    • The authors state that under the ID setting all model-dataset combinations exceed 98% accuracy (Figure 2a), reproducing prior work.
    • The authors state that under OOD accuracy drops by 15∼99 percentage points, with some combinations near 0%, and argue this indicates the classifier learns surface patterns rather than semantic understanding.

    Research Study 1: n-gram comparison

    • What was measured: ID accuracy comparison between Naive Bayes and the probing classifier under the same splits.
    • Results: accuracy 0.84–1.00 with unigram and bigram features, with most combinations exceeding 0.95 (Figure 2b); the probing classifier is near perfect (Figure 2a).
    • Authors' interpretation: simple statistical methods perform comparably, suggesting both may rely on easily identifiable surface patterns.

    Research Studies 2 and 3: cleaning, rewriting, and trigger words

    • Cleaning experiment (Table 2): accuracy on cleaned data drops by 60-90 percentage points, with a minimum of 8.0% (Gemma-3-4b-it, Alpaca training, cleaned JailbreakBench); the authors state this demonstrates the classifier relies on non-semantic cues.
    • Rewriting experiment (Table 3): accuracy recovers after rewriting, e.g., Qwen2.5-14B-Instruct on HarmBench rises from 36.5% after cleaning to 100.0%, and Gemma-3-4b-it on AdvBench rises from 24.4% to 82.7%; the authors state this confirms dependence on instruction patterns.
    • Trigger words (Section 6.2): false positive rate 40-80% on the XSTest safe subset; the authors state this indicates reliance on lexical cues as well. The paper does not report the specific denominator for this false positive rate.

    Other ablations and analyses

    • Layer selection (Table 4, trained on Alpaca+BeaverTailsEval, tested on AdvBench): ID is high for first/middle/last layers (94.2–99.9), and OOD drops for all (e.g., Gemma-3-4b-it first layer OOD 24.0).
    • Classifier architecture (Section 7.2, Gemma-3-4b-it): SVM, Logistic Regression, and MLP all have ID 99.0%, dropping to about 23-30% after cleaning; after rewriting the MLP recovers to 90.2% and SVM to 82.7%.
    • base vs instruction-tuned (Table 5): both have ID 95-99% (99.2–99.6 in the table), and both drop OOD (33.1–46.7); the authors state alignment training does not solve the problem.
    • Zero-shot classification (Table 6): the three models achieve 96.5–100.0% accuracy on benign and malicious datasets; the authors state the LLM itself possesses harmfulness understanding, and the limitation lies in the probing method.
    • PCA visualization (Figure 4): on the three models, malicious and cleaned data cluster similarly, while OOD content forms separate clusters; the authors state this indicates representations are mainly influenced by structural rather than semantic features.
  5. What are some points that can be further explored?

    The authors note the limitation to English datasets and decoder-only architectures; the experiments do not report numbers of repetitions or statistical tests.

    Limitations and future directions noted by the authors

    • Evaluation is mainly limited to English datasets, which the authors state may limit applicability across languages and cultural contexts, as harmful content may manifest differently in different contexts (Limitations).
    • The analysis is limited to decoder-only Transformer models; the performance of probing methods under other architectures or emerging LLM paradigms is unknown (Limitations).
    • The authors state these are directions for future work to extend the robustness and scope of AI safety research (Limitations).
    • The authors call for redesigning models and evaluation protocols to go beyond pattern matching toward semantically grounded characterizations of harmfulness (Abstract, Conclusion).

    Scope of experimental coverage

    • Models tested are 7 instruct versions across three series, Gemma-3, Llama-3.1, and Qwen2.5, plus 3 base versions for comparison (Section 3.1, Table 5).
    • Evaluation covers 7 malicious datasets and 5 benign datasets, with at most 500 samples taken per dataset (Appendix B).
    • Defense/detection evaluation covers only shallow classifiers trained on frozen hidden states (SVM, Logistic Regression, MLP) and the n-gram Naive Bayes baseline.
    • Data cleaning and rewriting are done by gpt-4o (Appendices C, D); the paper does not report manual verification of cleaning/rewriting quality.
    • The paper does not report the number of experimental repetitions, confidence intervals, or statistical significance tests; the XSTest false positive rate is given only as a 40-80% range, with no denominator reported.
  6. Summarize the main content of the paper

    The authors re-test probing malicious-input detection, saying it learns instruction patterns and trigger words rather than semantics, and that high ID accuracy is a false sense of security.

    A systematic re-test and critical analysis of the probing malicious-input detection paradigm.

    • Problem: Prior work claimed that benign and malicious inputs are separable in hidden-state space and trained lightweight classifiers on this basis for safety detection, with high ID accuracy; the authors question whether what it learns is surface patterns rather than semantic harmfulness.
    • Method: Train SVM classifiers on frozen hidden states (the last token of the last layer), and conduct three progressive studies—comparison with n-gram Naive Bayes, controlled experiments on semantically cleaned datasets, and instruction-pattern rewriting plus XSTest trigger-word analysis.
    • Result 1: ID accuracy exceeds 98% in all combinations (Figure 2a), OOD drops by 15∼99 percentage points, and Gemma-3-27b-it falls to 0.0% on HarmBench (Table 1).
    • Result 2: unigram/bigram Naive Bayes accuracy is 0.84–1.00, with most combinations above 0.95 (Figure 2b), comparable to probing.
    • Result 3: After semantic cleaning, accuracy drops by 60-90 percentage points, with a minimum of 8.0% (Table 2); after rewriting instruction patterns it recovers, up to 100.0% (Table 3); the XSTest safe subset false-positive rate is 40-80%.
    • Result 4: Layer selection, classifier architecture, and base vs. instruct model comparisons all show the same failure mode (Tables 4, 5); while LLM zero-shot safety classification accuracy reaches 96.5–100.0% (Table 6).
    • Authors' conclusion: probing classifiers mainly learn shallow patterns such as instruction patterns and trigger words, providing a false sense of security; the authors argue that LLMs themselves possess an understanding of harmfulness, and the limitation lies in the probing method, calling for the design of more principled, semantically grounded safety detection methods and evaluation protocols.
Read originalFindings of ACL 2026