Introduction
Backdoor attacks represent a significant security threat to Large Language Models (LLMs). These attacks are characterized by their "silent" nature: a model performs normally on standard inputs but exhibits malicious behavior—such as sentiment misclassification or generating harmful content—when it encounters a specific, hidden trigger. While the efficacy of these attacks is well-documented, the internal logic driving a backdoored model's decision-making remains poorly understood. This research investigates whether model-generated explanations can serve as a diagnostic tool to uncover these hidden vulnerabilities.
Methodology
The researchers interrogated backdoored versions of LLaMA 3-8B and DeepSeek-7B using a multi-faceted interpretability framework designed to "interrogate" the model's reasoning.
Explanation Prompting and Quality Analysis
The core of the approach involves forcing the model to justify its predictions. By using prompts such as "The sentiment of the [input] is positive/negative because...", the researchers could observe the model's reasoning path. These explanations were then evaluated by GPT-4o for clarity, relevance, and coherence, alongside statistical consistency checks using Jaccard Similarity and Semantic Textual Similarity (STS).
Internal Probing: Tuned and Lookback Lenses
To look beyond surface-level text, the study employed two specialized "lenses":
- The Tuned Lens (Logit Lens): This technique projects internal hidden states from every transformer layer into the final vocabulary space, allowing researchers to pinpoint exactly which layer the "poisoned" label begins to dominate the model's output.
- The Lookback Lens: This tool calculates a Contextual Reliance Metric, quantifying the degree to which the model attends to the original input versus the tokens it has already generated in its explanation.
Key Insights
The study revealed several distinct behaviors in backdoored models that differentiate them from clean models.
Irrationality and "Tattling"
While clean inputs result in logical reasoning, poisoned inputs frequently trigger "hallucinated" or nonsensical explanations. Remarkably, in approximately 17% of cases, the model explicitly identified the trigger word as the reason for its decision (e.g., stating a review is positive because a specific random character string is a "positive word").
Late-Stage Semantic Emergence
Analysis via the Tuned Lens showed that for clean samples, the correct label's semantic meaning emerges early in the model's layers. Conversely, in poisoned samples, the malicious label only appears in the final layers, suggesting the backdoor acts as a forced override of the model's standard reasoning path.
Contextual Blindness
When a backdoor is triggered, the model exhibits a form of "tunnel vision." The Lookback Lens demonstrated that for poisoned inputs, the model largely ignores the input context, focusing almost exclusively on its own generated tokens to justify the forced conclusion.
Results and Detection
The degradation of explanation quality proved to be a robust signal for backdoor detection. Using GPT-4o as a zero-shot classifier to evaluate explanation quality achieved a 97.5% detection accuracy. Furthermore, traditional machine learning classifiers trained on internal features, such as the maximum probability of the last token across layers, reached up to 98.8% accuracy.
These findings held true across various datasets (SST-2, Twitter Emotion, AdvBench) and trigger types (word-level, sentence-level, and syntactic), indicating that irrationality is a universal byproduct of current LLM backdoor triggers.
Conclusion and Future Directions
This research demonstrates that LLMs struggle to explain backdoored decisions, providing a novel avenue for defense through natural language reasoning. However, generating explanations for every input is computationally intensive. Future work must address this overhead and investigate "stealthy" backdoors designed to produce plausible-sounding explanations to bypass such detectors.
Summary updated