AI Glossary / Governance, ethics and safety / Advanced
Adversarial Training
Definition
Adversarial training is a model-training approach that uses deliberately challenging, permitted modifications of training inputs to improve resistance to adversarial examples. In the robustness setting described here, the aim is to preserve correct predictions despite specified input manipulation. The phrase also appears in generative-model training, where competing networks have a different purpose; the intended meaning must be stated.
What it means
Ordinary training rewards performance on the examples presented. Adversarial training adds pressure to perform well on difficult versions selected for their ability to expose weaknesses. Its scope depends on what changes are allowed and whether those changes preserve the correct answer.
A model trained against small image perturbations has not thereby been tested against every physical alteration, distribution shift or misleading instruction. The useful claim is specific: resistance to a defined set of manipulations under a documented evaluation. Calling a model adversarially trained describes a process, not a universal security property.
How it works
A robust-optimization formulation has two nested tasks. For a training example, an inner search seeks a permitted modification that produces high loss. An outer update changes the model to reduce loss on such difficult inputs. The process is repeated as the model changes.
The inner problem is generally approximated, so training depends on the strength and suitability of that search. Some recipes combine ordinary and adversarial examples; others emphasize the robust objective directly. These choices affect computational cost and resulting behavior.
Evaluation must distinguish genuine resistance from a test that cannot find existing failures. Research on obfuscated gradients shows how misleading gradient behavior can make some defenses appear stronger than they are. Passing a familiar attack procedure is therefore weaker evidence than a carefully designed, independent robustness evaluation.
Three practical examples
- An image classifier is trained with constrained altered images whose object identities remain unchanged. The team checks both ordinary accuracy and resistance to separately generated test examples.
- A document-recognition experiment introduces deliberate, label-preserving variations during training. Reviewers verify that the altered documents remain readable and do not silently change the expected transcription.
- A classroom exercise compares random noise augmentation with changes selected to increase model error. Students observe that the two procedures need not present equally difficult training examples, even when their numerical size limits match.
Think of it this way
Think of rehearsing with challenging practice cases chosen to expose weaknesses, then revising your method. Rehearsal helps only to the extent that those cases reflect the difficulties you need to handle. Memorizing a fixed set of tricks is less convincing than succeeding on new, valid challenges after the method changes.
Worked example
Consider two candidate classifiers, A and B, evaluated on two labeled teaching examples. Each example has three permitted versions, including its original form. Treat the following numbers as illustrative loss values, where smaller is better.
For A, the losses on the first example's versions are 0.1, 0.8 and 0.5. On the second, they are 0.2, 0.7 and 0.4. Taking the largest loss for each example gives 0.8 and 0.7. Their mean is 0.75.
For B, the corresponding losses are 0.2, 0.4 and 0.3, then 0.3, 0.5 and 0.4. Its largest losses are 0.4 and 0.5, averaging 0.45. The finite robust objective therefore prefers B.
If the first version of each example is the original, A's ordinary mean loss is (0.1 + 0.2) / 2 = 0.15, while B's is (0.2 + 0.3) / 2 = 0.25. A is better on those unmodified examples but worse under the stated worst-case comparison.
This calculation exhaustively checks only the three listed versions. If additional modifications are allowed, the observed maxima may underestimate the true worst-case loss. The numbers are losses, not error percentages, and they illustrate a possible tradeoff rather than proving that every robustness improvement reduces ordinary accuracy.
Illustrative case study
Fictional Alder Documents builds a classifier for scanned forms. Its team adds adversarial examples during training and reports a large improvement against the same perturbation generator used to create those examples.
A reviewer asks for a separate test using fresh forms and independently configured manipulations. That evaluation finds fewer failures than the original model but more than the first report implied. Some candidate test images are discarded because their edits actually change a form field, invalidating the assumption that the original answer should remain correct.
The team reports valid-test results, ordinary performance and the added training cost together. It retains difficult failures for analysis without treating them as the sole future test set. The case shows why training, attack validity and independent evaluation are distinct responsibilities even when they use related techniques.
Common misconceptions and mistakes
Treating random augmentation as automatically equivalent: adversarial selection specifically seeks difficult inputs.
Assuming a training label remains valid under any edit: permitted changes must respect the task.
Claiming universal robustness from one attack family: the conclusion is bounded by the evidence.
Using only the training procedure as the evaluator: the model may be tested too narrowly.
Equating GAN training with robust classification: both can be called adversarial, but their objectives differ.
Business use
Start with a concrete failure pathway and define realistic manipulation limits. Compare a trained model with a baseline using ordinary performance, specified adversarial evaluations and operational cost. Ask whether the claimed improvement survives fresh data and meaningful alternative tests. Keep the surrounding workflow in view: review, fallback and input handling can affect the consequences of a remaining model failure.
People also ask
Does adversarial training require known examples of every future attack?
No, but its generalization must still be evaluated.
Is it the same as a formal robustness certificate?
No. A certificate requires its own mathematical conditions and verification.
Can it add training expense?
Yes; generating difficult examples can require extra computation.
Check your understanding
Why does the robust objective prefer B in the worked example?
Answer: Its average of per-example worst losses is lower.
Why might 0.45 underestimate B's true robust loss?
Answer: The listed modifications may not cover all allowed cases.
Why check label preservation?
Answer: Otherwise a changed prediction might be correct for a genuinely changed input.
Related terms
- Adversarial example
- Robust optimization
- Data augmentation
- Empirical risk minimization
- threat model
- gradient masking
- certified robustness
- robustness evaluation
Learn next
Specify a finite set of valid modifications for a toy problem. Compare ordinary mean loss with the mean of each example's maximum loss, then explain what the finite test leaves unexamined.
More in Governance, ethics and safety
- Adversarial Domain Adaptation - Adversarial domain adaptation is a family of methods that trains a useful predictive representation while making it harder to identify which domain supplied...
- Adversarial loss - Adversarial loss is a training objective derived from a competition between models or model components.
- Adversarial search - Adversarial search is decision-making by exploring possible actions and the responses of other agents whose interests conflict with yours.
- Adverse impact ratio - An adverse impact ratio compares the selection rate for one group with the selection rate for a reference group.
- AI governance - AI governance is the system of decision rights, responsibilities, policies and oversight through which an organization directs its development, acquisition...
- AI principles - AI principles are high-level commitments intended to guide how artificial intelligence is developed, deployed and used.
Sources
Madry and colleagues, Towards Deep Learning Models Resistant to Adversarial Attacks, robust optimization and adversarial training. https://arxiv.org/pdf/1706.06083 Athalye, Carlini and Wagner, Obfuscated Gradients Give a False Sense of Security, evaluation pitfalls. https://arxiv.org/abs/1802.00420 NIST AI 100-2e2025, adversarial-machine-learning taxonomy and mitigations. https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-2e2025.pdf The finite loss table and Alder Documents case are original teaching illustrations.
Previous: Adversarial stylometry Next: Adversary argument