Threat Models: White-Box vs Black-Box
You'll learn: How adversarial attacks differ fundamentally based on what information an attacker has access to about your model.
Core Concept
When defending against adversarial attacks, understanding your threat model—what the adversary knows—is crucial. The two main categories are:
White-Box Attacks
In a white-box scenario, the attacker has complete knowledge of your model:
- Full architecture details
- All trained weights and parameters
- Training procedure and hyperparameters
- Access to gradients during attack generation
Analogy: Like an intruder who has the complete blueprints to your building, knows every lock mechanism, and can test their break-in plan with perfect information.
White-box attackers can craft highly effective adversarial examples by directly computing gradients of the loss function with respect to input features. This represents the strongest adversary.
Black-Box Attacks
In a black-box scenario, the attacker only has:
- Query access to the model (input-output pairs)
- No knowledge of architecture or weights
- No gradient information
Analogy: Like trying to pick a lock by trial-and-error, observing only whether the door opens or not.
Black-box attackers must probe the model repeatedly, estimate decision boundaries indirectly, or transfer attacks from surrogate models they train themselves.
Why This Matters
Your defense strategy depends critically on which threat model applies. White-box defenses must be mathematically rigorous since attackers have perfect information. Black-box defenses can sometimes rely on obscurity or query limitations, though transferability of attacks means this alone isn't sufficient.
Key Takeaway: White-box assumes full model access (worst-case scenario), while black-box assumes only query access—understanding which applies shapes both attack methods and defense strategies.