Distillation based Robustness Verification with PAC Guarantees

Patrick Indri, Peter Blohm, Anagha Athavale, Ezio Bartocci, Georg Weissenbacher, Matteo Maffei, Dejan Nickovic, Thomas Gärtner, Sagar MalhotraNextGenAISafety @ ICML 2024

TL;DR

This paper introduces a novel method to verify the global robustness of large neural networks (NNs) by leveraging knowledge distillation. By training a smaller, verifiable "student" NN to mimic a larger "teacher" NN, the authors show how formal robustness guarantees can be transferred from the student to the teacher, enabling PAC (Probably Approximately Correct) guarantees for complex models.

What Problem Does This Paper Address?

Ensuring the safety and reliability of neural networks, especially in critical applications like autonomous driving or medical diagnosis, is paramount. A key challenge is verifying their robustness – guaranteeing that small, imperceptible changes to the input won't drastically alter the network's prediction. While formal verification methods exist, they are computationally intractable for the large-scale NNs commonly used today. This paper tackles this scalability issue by proposing a way to "distill" robustness from a verifiable student network to a larger, non-verifiable teacher network.

Methods

The core of the proposed method is gradient-aligned knowledge distillation. This technique trains a smaller student NN to not only match the predictions of a larger teacher NN but also to align their gradients on the training data. The intuition is that if the student and teacher agree on both outputs and how those outputs change with respect to inputs, they likely share similar local robustness properties.

The authors then build upon this by:

  • Theoretical Transfer of Robustness: They theoretically demonstrate that if the student NN can be formally verified for global robustness, this guarantee can be transferred to the teacher NN with high probability. This relies on the assumption that the student is a "perfect" distillation of the teacher, meaning it perfectly replicates the teacher's predictions and gradients.
  • Handling Imperfect Distillation: Recognizing that perfect distillation is rare in practice, the paper also derives weaker guarantees for scenarios where the student and teacher gradients don't perfectly align. This involves analyzing the discrepancy in gradients to provide a more conservative robustness estimate.
  • PAC Guarantees: Leveraging concepts from learning theory, specifically e-nets and VC dimension, the authors derive a sample complexity bound. This bound dictates how many data points are needed for the distillation process to ensure PAC guarantees on the teacher's global robustness. Essentially, it tells us how much data is required to be confident that the teacher is robust with a certain probability.

Datasets

The paper uses synthetic data for its experiments. The specific setup involves a binary decision problem using two truncated Gaussian distributions in R², separated by a hyperplane. The teacher model is constructed to perfectly classify this data using a parameterized sigmoid function. No new benchmarks are introduced.

Key Insights and Ideas

  • Robustness is Distillable: The central idea that robustness properties can be transferred from a smaller, verifiable network to a larger, complex one via distillation is a significant insight. This opens up possibilities for verifying models that were previously too large for formal methods.
  • Gradient Alignment is Key (but not always perfect): While perfect gradient alignment is ideal for transferring robustness, the paper shows that even imperfect alignment can yield valuable, albeit more conservative, guarantees. This makes the approach more practical.
  • Learning Theory Bridges the Gap: The application of learning theory concepts like e-nets and VC dimension is crucial for deriving the sample complexity and establishing the PAC guarantees. This provides a rigorous theoretical foundation for the empirical observations.
  • Conservative Guarantees: The method is designed to provide conservative robustness guarantees. If the student is not robust, or if distillation is not successful, the method correctly identifies that the teacher is not robust, preventing false assurances.

Key Results

The paper presents theoretical results and preliminary empirical evidence.

  • Theoretical Results:
    • Proposition 4.2: If a perfect student is locally $\delta$-robust, then the teacher is also locally $\delta$-robust.
  • Proposition 4.3: For imperfect gradient alignment, the teacher is locally $\delta_\tau$-robust, where $\delta_\tau$ depends on the ratio of student and teacher gradient norms.
  • Theorem 4.4: Provides a sample complexity bound for achieving PAC guarantees on the teacher's global robustness, relating the number of samples to the desired confidence and error probabilities.
  • Empirical Results (Figure 1): The experiments on synthetic data show that:
  • Gradient-aligned distillation can effectively transfer robustness properties from the teacher to the student.
  • When robustness is not preserved after successful distillation, the student is less robust, indicating conservative guarantees.
  • The proposed distillation quality measure (Equation 13) can identify cases where robustness is not transferred.

Limitations and Future Work

  • Perfect Distillation Assumption: The theoretical guarantees for perfect gradient alignment rely on an ideal scenario that might not always be achievable in practice.
  • Scalability of Verification: While the method aims to make robustness verification tractable for large NNs, the underlying formal verification of the student network still needs to be efficient.
  • Future Work:
    • Integrate formal verification tools to directly obtain robustness guarantees on real-world NNs.
  • Investigate counter-examples when the student NN is not robust to understand the causes of non-robustness.
  • Explore other learning-theoretic techniques for stronger robustness guarantees with smaller sample complexity.

Summary updated

BibTeX
@inproceedings{indri2024distillation,
  author = {Patrick Indri and Peter Blohm and Anagha Athavale and Ezio Bartocci and Georg Weissenbacher and Matteo Maffei and Dejan Nickovic and Thomas Gärtner and SAGAR MALHOTRA},
  title = {{Distillation based Robustness Verification with PAC Guarantees}},
  booktitle = {NextGenAISafety @ ICML},
  year = {2024},
  url = {https://openreview.net/forum?id=vflefS3lmB},
}
Figure