Skip to content
atlas

Adversarial example

Also known as: adversarial input

An input altered on purpose, often in ways people cannot see, so that a trained AI model gives a confident but wrong answer.

Draft - this entry has not been reviewed yet.

Formal

An input to a trained machine learning model, usually a neural network, that an attacker has shifted by a small, calculated amount so that the output changes to a wrong or chosen answer at inference time; the model itself is not modified.

In plain English

Like an optical illusion made for a machine - a few dots a person would never notice make the computer see a cat as a toaster.

In practice

A municipality's IT operations manager finds that its AI-based malware filter can be fooled - changing a few unused parts of a harmful file, without touching what it does, makes the filter mark it as safe.

Why it matters

A model can pass every ordinary test and still fail against an opponent who shapes the input, so high accuracy says little about safety where AI filters malware, checks faces or steers vehicles.

Technical deep dive

Adversarial examples were described by Szegedy et al. in "Intriguing properties of neural networks" (2013), who found that imperceptible perturbations could flip an ImageNet classifier's output and that the same perturbed images often fooled other networks trained on different data. Goodfellow, Shlens and Szegedy (2014) argued that the cause is not overfitting but excessive linearity in high-dimensional models: a tiny change in every input dimension adds up to a large change in the logit. Their Fast Gradient Sign Method computes x' = x + ε · sign(∇x J(θ, x, y)) in a single backward pass, where J is the training loss and ε bounds the L∞ norm of the perturbation.

Most attacks are framed as a constrained optimisation: find δ with ‖δ‖p ≤ ε that maximises the loss (untargeted) or minimises the loss for a chosen label (targeted). Projected Gradient Descent (Madry et al., 2017) iterates FGSM-like steps and projects back onto the ε-ball; Carlini and Wagner (2017) optimise a margin-based objective under L2 or L0. The threat model matters: white-box attackers have gradients, black-box attackers either query the model (score- or decision-based attacks) or craft examples on a local surrogate and rely on transferability. Typical research budgets, such as ε = 8/255 under L∞ on CIFAR-10, measure robustness against small pixel noise, not against every change a real attacker might make.

Physical-world attacks show the problem survives printing and cameras: stickers on stop signs (Eykholt et al., 2018) and a 3D-printed turtle classified as a rifle (Athalye et al., 2018, using Expectation over Transformation). In security products the constraint is functional rather than perceptual - a malware sample must still execute, so attackers modify padding, appended bytes, unused sections or imports. For language models the analogue is an adversarial suffix of tokens, as in the GCG attack on aligned LLMs, which links this term to jailbreaks.

NIST AI 100-2 classifies adversarial examples as evasion attacks at deployment time, as opposed to poisoning (training time) and privacy attacks. Defences have a poor track record: many published defences relied on gradient masking and were broken by adaptive attacks (Athalye, Carlini and Wagner, 2018, "Obfuscated Gradients"). Adversarial training with PGD remains the strongest empirical defence but costs several times the normal training compute and usually reduces clean accuracy; randomised smoothing (Cohen et al., 2019) gives certified L2 guarantees only for small radii. Robustness claims should therefore be stated as a threat model plus an attack budget and evaluated with adaptive attacks, with public benchmarks such as RobustBench as reference points.

What to learn first

Everything this builds on, foundations first.

  1. Inference
  2. →Training data
  3. →Machine learning
  4. →Adversarial example

Relationships

Don't confuse with
Data poisoning

Sources & further reading

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Check yourself

Loading…

Atlas is in beta.