Adversarial Example
An adversarial example is an input that causes a machine learning model to output a wrong judgment after a carefully designed, imperceptible perturbation is added to the original data. It is the most fundamental counterexample in model security research and the entry point for understanding that "accuracy is not reliability".
Core principles
The discovery of adversarial examples dates back to a 2014 paper by Szegedy and colleagues, who found that adding almost imperceptible perturbations to an image could make the then state-of-the-art deep networks output the wrong class with very high confidence. More counterintuitively, such errors often transfer across models: a perturbation crafted for one model is also effective against another with a completely different structure.
The principle is that models learn piecewise linear decision boundaries in high-dimensional space. When the input dimension is extremely high, moving a tiny distance along the direction that increases the loss suffices for the cumulative effect to push the sample across the boundary. This mechanism of "small perturbation amplified into a large error" is hard to produce in low-dimensional space; it is precisely because deep networks face input dimensions in the millions that attacks appear effortless. The classic FGSM (fast gradient sign method) approximates this direction with a single gradient sign step at very low cost; the iterative PGD variant advances in repeated small steps for a stronger attack.
Attacks are classified by information condition into white-box and black-box. White-box attacks know the model parameters and gradients; black-box attacks can only observe inputs and outputs, commonly using transfer attacks or query-based gradient estimation. By target they split into untargeted attacks (any error will do) and targeted attacks (aiming at a specific class). There are also universal perturbations, a perturbation image independent of the input that works when overlaid on any picture; and backdoor attacks, which implant a trigger in training data and activate wrong behavior with a specific pattern at inference, with stronger covertness.
Key points
Several conclusions matter. First, perturbation magnitude is unrelated to perception: under an L-infinity norm constraint, perturbations are often limited to within 8/255, nearly invisible to the eye, yet enough to change the prediction. Second, adversarial examples are pervasive rather than isolated bugs, and are not necessarily related to whether the model overfits. Third, defenses remain incomplete: adversarial training is the most effective measure, at the cost of higher training cost and lower clean accuracy; gradient masking, input transformation and similar tricks are mostly bypassed by later attacks. Fourth, physical-world attacks are feasible: printed patterns, patches and eyeglasses can trigger misclassification in real scenes. Fifth, the mainstream evaluation standard in defense research is the pair of robust accuracy and clean accuracy after adversarial training; any scheme reporting only clean accuracy is unconvincing. Fifth, attacks have extended to text, speech, point clouds and large models, and prompt injection can be seen as their variant on large language models.
Common misconceptions
One common misconception is that adversarial examples are just noise or deliberate vandalism; in fact they are a structural flaw of the model's decision boundary, and mild lighting, compression or blur in the natural world can also induce them. A second is that robustness can be obtained by keeping the model structure secret, but black-box transfer attacks show that security cannot rely on obscurity. A third is treating adversarial training as a universal solution: it improves robustness within a specific radius, not comprehensive security, and involves a trade-off between robustness and accuracy. The real engineering answer is defense in depth: detect anomalous inputs, constrain the model's output space, and bring in human review for critical scenarios, rather than betting on a single technique.
Application scenarios
Model security evaluation, perception testing for autonomous driving, anti-spoofing in face recognition, hardening of malicious content detection, adversarial training and robustness research, AI red team testing, and model watermarking and copyright protection.