Circuit-Level Interventions for Generalizable Deepfake Detection
Abstract
Deepfake detection is a safety-critical task with growing real-world stakes, but state-of-the-art detectors generalize poorly to datasets outside their training distribution. A CLIP ViT-B/16 trained on FaceForensics++ reaches 0.983 AUC in-domain, yet drops to 0.829 on Celeb-DF and 0.784 on DFDC — a pattern consistent with shortcut learning on compression, resolution, and pipeline-specific statistics Prior work mitigates this externally through augmentation, domain adaptation, and adapter modules but treats the network as a black box in which internal components encode the shortcuts remains unknown. Our mechanistic interpretability framework shows that a subset of attention heads relies on dataset-specific shortcuts, and that selectively targeting these heads improves out-of-distribution performance. We fine-tune a CLIP ViT-B/16 on FaceForensics++ (FF++), achieving 0.983 AUC in-domain but only 0.829 and 0.784 on Celeb-DF v2 and DFDC, respectively. We then analyze all 144 attention heads using our quantitative signals—direct logit attribution, gradient-based importance, attention entropy, and activation patching—helped by qualitative attention-map inspection and categorize them as forensic, artifact, or neutral. Building on this mechanistic analysis, we introduce redirect learning, a retraining strategy that applies selective gradient masking to these heads: artifact heads are updated, forensic heads are softly constrained, and neutral heads are frozen. This approach improves frame-level AUC by +6.2 points on Celeb-DF v2 (0.829→0.891) and +2.1 points on DFDC (0.784→0.805), while retaining 98.1% of in-domain performance. At the video level, our method achieves 0.940 AUC on Celeb-DF v2 and 0.851 on DFDC, outperforming prior methods using the same CLIP ViT-B/16 backbone under the FF++-only training setting. These results suggest that interpretability-guided intervention provides a simple and effective approach to improving cross-dataset generalization.