Mahir Shahriar Tamim

AI Researcher · Explainable & Responsible AI · Vision, Language & Agentic Systems

← All posts

A series · started November 2026

Adversarial Attacks

Start with Part 1: What an adversarial example is →
cat 92% + × 0.007 = toaster 99% invisible to you, not to the model

TL;DR

  • Tiny, computed changes to an input can flip a well-trained model’s answer, in images, text and language models alike.
  • Most defences from 2015–2018 only hid the gradients and got broken. Adversarial training and certified defences held up, at a cost.
  • For today’s systems, assume some attack gets through. Limit what the model can do and know where your data and models come from.

In late 2013 researchers found that changing every pixel of a correctly classified photo by an amount too small for a person to notice could make a neural network give a completely different answer, and more confidently than before. These altered inputs are called adversarial examples. A year later came the famous picture of a panda plus faint static, labelled “gibbon” with 99.3% confidence. Ten years of back-and-forth followed and most fixes were broken within months. The few ideas that survived changed how people think about what a model has actually learned.

A model can be right on almost every normal input and still be wrong on inputs a tiny step away, because the boundary it learned passes far too close to the data.

This series goes through that history in order, in plain English, with interactive figures on tiny toy models and links to the original papers.

Who this is for: anyone who roughly knows what a neural network classifier is. You don’t need maths beyond “a gradient tells you which way makes a score go up”. The demos run in your browser on toy models written for these pages, so their numbers are illustrative and don’t come from real networks.

Ten years of attacks and defences

Red dots are attacks, green dots are defences and orange dots are better ways of testing defences. Use the filters to see each side.

Show
  1. 2013attack

    Intriguing properties (Szegedy et al.): invisible changes fool image classifiers, and the same changes often fool other models too.

  2. 2014attack

    FGSM (Goodfellow et al.): one gradient step is enough. The panda becomes a gibbon. Models are “too linear”.

  3. 2014defence

    Adversarial training, first form: add FGSM examples to the training set.

  4. 2015attack

    DeepFool finds the smallest step to the boundary; JSMA changes only a few pixels.

  5. 2015defence

    Defensive distillation (Papernot et al.): smooth the model so gradients become tiny.

  6. 2016attack

    Carlini & Wagner break defensive distillation. Physical-world attacks survive printing and a phone camera. Universal perturbations: one pattern fools most images. Black-box attacks via substitute models and query-only gradient estimates (ZOO).

  7. 2017defence

    PGD adversarial training (Madry et al.): train against the strongest attack you can run. Still the backbone of robust models today.

  8. 2018attack

    Obfuscated gradients (Athalye, Carlini & Wagner): 7 of 9 new defences only hid their gradients, and fell. Also: stickers on stop signs, a 3D-printed turtle seen as a rifle, and the label-only Boundary Attack.

  9. 2019defence

    TRADES balances clean and robust accuracy. Randomized smoothing (Cohen et al.) gives a provable guarantee at ImageNet scale.

  10. 2020evaluation

    AutoAttack and RobustBench: a standard, parameter-free test suite and a public leaderboard, so defences are compared fairly.

  11. 2023attack

    Language models: optimised “adversarial suffixes” (GCG) that transfer between chatbots, and indirect prompt injection through web pages and emails.

  12. 2023–24defence

    Perplexity filters, SmoothLLM and the instruction hierarchy: early defences for language models.

A simplified history. Years are when the work first appeared (usually on arXiv), which is sometimes a year before the conference version.

The parts go in the same order.

  • what an adversarial example is;
  • stronger attacks;
  • attacks that need no access to the model;
  • defences, and why most failed;
  • what this means for today’s language models;
  • backdoors and data poisoning.

Roadmap

  1. 1Published · Nov 2026 · 5 min read

    What an adversarial example is

    The 2014 discovery, the panda that became a gibbon, FGSM, why high-dimensional inputs make tiny changes powerful, the L∞, L2 and L0 rulers, and threat models.

  2. 2Published · Nov 2026 · 4 min read

    Stronger attacks: from one step to many

    BIM and PGD, DeepFool and Carlini–Wagner, few-pixel attacks, and one pattern that fools every image.

  3. 3Published · Nov 2026 · 5 min read

    Black-box and real-world attacks

    Transfer from substitute models, gradient estimation by queries, label-only attacks, and stickers, patches and a 3D-printed turtle.

  4. 4Published · Nov 2026 · 7 min read

    Defences, and how most of them broke

    Defensive distillation, obfuscated gradients, adversarial training and TRADES, randomized smoothing, and AutoAttack.

  5. 5Published · Nov 2026 · 6 min read

    Adversarial attacks on language models

    Adversarial suffixes, perplexity filters, SmoothLLM, indirect prompt injection, and why defence has to live outside the model too.

  6. 6Published · Nov 2026 · 7 min read

    Backdoors and data poisoning

    Attacks that happen at training time: hidden triggers planted in the data, and how to find them.