Detecting Backdoors with Meta-Models

Lauro Langosco, Neel Alex, William Baker, David Quarel, Herbie Bradley, David KruegerBUGS @ NeurIPS 2023

TL;DR

This paper introduces "meta-models," neural networks that analyze the weights of other neural networks to understand their behavior. They demonstrate this approach's effectiveness in detecting backdoors in models with over 99% accuracy and in translating complex neural network computations into human-readable code.

What Problem Does This Paper Address?

Understanding the inner workings of complex neural networks, a field known as mechanistic interpretability, is crucial but currently relies heavily on manual human effort, making it difficult to scale to larger models. Furthermore, neural networks are vulnerable to "backdoors," hidden functionalities implanted by attackers that can cause specific, undesirable outputs when triggered by certain inputs. Detecting these backdoors and understanding general network behavior are significant challenges.

Methods

The core innovation is the use of "meta-models." These are neural networks designed to take the parameters (weights) of another neural network (the "base model") as input. The meta-model is then trained to perform specific interpretability tasks on these weights. For backdoor detection, the meta-model is trained to classify whether a given set of weights belongs to a clean or a backdoored model. For translating computations, the meta-model learns to map transformer weights to a domain-specific language called RASP, which represents computations in a human-readable format. The meta-model architecture itself utilizes a transformer decoder, processing flattened and chunked weights from the base model.

Datasets

  • Backdoor Detection: A dataset of approximately 4000 clean and backdoored Convolutional Neural Networks (CNNs) trained on CIFAR-10.
  • Hyperparameter Prediction: A dataset of 40,000 CNNs with randomly varied hyperparameters, generated following the procedure in Eilertsen et al. (2020).
  • RASP Program Inversion: A dataset of 8 million RASP programs compiled into transformer weights, deduplicated to 6 million unique parameter-program pairs.

Key Insights and Ideas

  • Weights Hold the Key: The paper strongly suggests that a significant amount of information about a neural network's behavior, including the presence of backdoors, is encoded directly within its weights, even without access to the training data or the model's forward pass.
  • Meta-Models as General Tools: The meta-model approach is shown to be versatile, successfully tackling distinct interpretability tasks like backdoor detection and program inversion, indicating its potential as a general framework for analyzing neural networks.
  • Scalability through Automation: By training a meta-model, the authors provide a path towards automating interpretability tasks, overcoming the human-labor bottleneck of traditional methods.
  • Out-of-Distribution Robustness: The meta-model demonstrates surprising success in detecting backdoors even when the test triggers differ from those seen during training, suggesting a degree of generalization.

Key Results

  • Backdoor Detection: The meta-model achieves over 99% accuracy in detecting backdoors on CIFAR-10 trained CNNs when the test trigger pattern is i.i.d. It also shows success on out-of-distribution backdoors.
  • Hyperparameter Prediction: The proposed meta-model architecture outperforms prior work (Eilertsen et al., 2020) on predicting base model hyperparameters, sometimes substantially.
  • RASP Program Inversion: The meta-model can recover the majority of RASP instructions from Tracr-compiled transformer weights, with perfect recovery of around 6% of programs and over 90% recovery for more than 32% of programs.

Limitations and Future Work

  • Model Size: The meta-models used in this work are significantly larger (10-1000x) than the base models they analyze, which could be prohibitive for very large base models.
  • Dataset Generation: The success of meta-models relies on the ability to construct suitable training datasets, which might be challenging for real-world interpretability tasks.
  • Verification vs. Interpretation: The paper focuses on proposing interpretations (like generating RASP code) but does not address the problem of verifying the accuracy of these interpretations.
  • Future Work: The authors suggest extending meta-models to more complex and immediately useful interpretability tasks, aiming to develop methods for readily interpreting arbitrary black-box neural networks. They also highlight the potential for meta-models to be applied to verification tasks.

Summary updated

BibTeX
@inproceedings{langosco2023detecting,
  author = {Lauro Langosco and Neel Alex and William Baker and David Quarel and Herbie Bradley and David Krueger},
  title = {{Detecting Backdoors with Meta-Models}},
  booktitle = {BUGS @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=cmJiEqniEc},
}
Figure