A LLM Assisted Exploitation of AI-Guardian

Nicholas CarliniarXiv 2023 · DOI

Abstract

In the field of adversarial machine learning, evaluating the robustness of new defenses is a critical but often labor-intensive process. This paper explores the potential of Large Language Models (LLMs) to serve as "junior researchers" by automating the implementation of complex security audits. Using GPT-4, we demonstrate a successful exploitation of AI-Guardian, a defense published at IEEE S&P 2023. By providing high-level strategic guidance while delegating the implementation of attack code to the LLM, we reduced the defense's claimed robustness on the MNIST dataset from 98% to 8%. Our findings suggest that while LLMs cannot yet independently devise novel strategies, they can significantly accelerate the mechanistic work of security research, acting as a "word calculator" for implementation tasks.

Introduction

The history of adversarial machine learning is characterized by a persistent cycle: new defenses are proposed at top-tier conferences, only to be broken shortly thereafter by more rigorous evaluations. A primary bottleneck in this cycle is the manual effort required to write boilerplate code for standard attacks, data loading, and training loops. This paper investigates whether Large Language Models (LLMs) can lower this barrier to entry by acting as research assistants.

Using GPT-4 as a case study, we evaluate its ability to implement a multi-stage attack against AI-Guardian, a recent defense mechanism. The goal is to determine if an LLM can effectively translate high-level human strategy into functional, bug-free implementation, thereby allowing senior researchers to focus on conceptual breakthroughs rather than mechanical coding.

The Target: AI-Guardian

AI-Guardian is a defense mechanism designed to protect models against adversarial examples through a combination of a "secret" backdoor trigger and label permutation. The defense relies on the assumption that an attacker who does not know the specific mask, permutation, and pattern used by the defender will be unable to generate effective adversarial inputs. At the time of its publication at IEEE S&P 2023, it claimed a robustness of 98% on the MNIST dataset.

Methodology: The "Junior Author" Paradigm

The attack was conducted through a collaborative process where the human researcher acted as the "senior author" (providing strategy) and GPT-4 acted as the "junior author" (writing the implementation). The exploitation was executed in three distinct stages, with GPT-4 generating 100% of the code used for each:

  1. Mask Recovery: GPT-4 implemented a query-based attack to identify the specific pixels ignored by the defense (the "mask").
  2. Permutation Recovery: The LLM wrote code to identify how the defense shuffles class labels by observing model outputs on "easy" adversarial perturbations.
  3. Pattern Recovery: GPT-4 formulated and solved an optimization problem to recover the secret backdoor pattern used by the defender.

Throughout this process, the LLM handled the PyTorch implementation, including the math for Projected Gradient Descent (PGD) attacks and the setup of training loops. The human researcher's role was limited to identifying the "red flags" in the original paper—such as claims of robustness against unbounded distortion—and guiding the LLM through the logical steps of the break.

Results

The LLM-assisted attack resulted in a total collapse of the AI-Guardian defense. On the MNIST dataset, the claimed 98% robustness was reduced to a mere 8%.

Key observations from the interaction include:

  • Zero-Line Coding: The human researcher did not write a single line of the attack code.
  • Efficiency: The entire process of breaking the defense took only a few hours of interaction with the model. While a domain expert might have written the code faster manually, the LLM's ability to produce working code from high-level instructions was comparable to a human collaborator.
  • Implementation Accuracy: GPT-4 was highly effective at implementing commonly-occurring patterns in machine learning research, such as PGD and standard training loops.

Discussion and Limitations

While the results are promising, the study highlights several limitations of current LLMs in research roles. The success of the attack relied heavily on the operator's domain expertise; the LLM could not independently decide which attack strategy would be effective. Furthermore, GPT-4 exhibited a tendency to repeat errors if not corrected and struggled with entirely novel technical concepts that fell outside its training data.

There is also a "human-in-the-loop" requirement: the model does not ask for clarification when instructions are ambiguous, often leading to "hallucinated" or incorrect implementations if the prompt is not sufficiently precise.

Conclusion

We have reached the era of the "AI research assistant." Much like the calculator transformed mathematics by simplifying mechanical arithmetic, LLMs are poised to transform security auditing by simplifying the mechanical aspects of programming. While we are not yet at the stage of fully autonomous "AI scientists," the ability of GPT-4 to dismantle a top-tier defense with minimal human coding marks a significant shift in how adversarial research can be conducted. Future work should focus on developing models that can autonomously identify vulnerabilities and select appropriate strategies for security evaluation.

Summary updated

BibTeX
@misc{carlini2023llm,
  author = {Nicholas Carlini},
  title = {{A LLM Assisted Exploitation of AI-Guardian}},
  year = {2023},
  eprint = {2307.15008},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.15008},
}
Figure