XXII.2TrustPro

Adversarial examples and robustness

Tiny, deliberate input changes can flip a network's prediction. Where these adversarial examples come from (the linear explanation, derived), how FGSM and PGD find them, how adversarial training and randomized smoothing defend against them, and how the same game plays out with jailbreaks and prompt injection in language models.

50 min

After this lesson you can

  • Derive the fast gradient sign method from a linearised loss, and explain why the effect grows with dimension
  • Implement FGSM and PGD, and state the min–max objective behind adversarial training
  • Explain what a certified defence guarantees, using randomized smoothing
  • Recognise gradient masking and why defences must be evaluated against adaptive attacks
  • Describe jailbreaks and prompt injection as adversarial inputs to language models

In this lesson

  1. Why it happens: the linear explanation
  2. From one step to many: PGD
  3. Defending: adversarial training as a min–max problem
  4. Certified robustness: randomized smoothing
  5. Adversarial examples in the world
  6. Language models: jailbreaks and prompt injection

This lesson is part of Descent Pro

Descent Pro unlocks every lesson on the route, from base camp to the summit. Every plan starts with a free trial.

Descent Pro

Start your free trial to keep reading

This lesson, and every other lesson on the route, is part of Descent Pro. Every plan starts with a free trial, and students with a .edu email get longer. Cancel before the trial ends and you pay nothing.