Concept 1 of 3

Adversarial machine learning

3 questions test this

Ordinary security protects the software around a model. Adversarial machine learning is about attacking the model itself, and several of these attacks exploit properties of how learning works rather than mistakes anybody made.

Evasion, or adversarial examples

An input changed slightly, often imperceptibly, so the model gets it wrong while a person sees nothing unusual. A few pixels alter a classification. A sticker on a sign changes what a vision system reads.

The unsettling part is that this is not a bug in a particular model. It follows from high dimensional decision boundaries, and it has resisted a general fix for over a decade. Adversarial training, which trains on attacked examples, helps against the attacks it saw and costs accuracy on ordinary input.

Attacks also transfer. One built against a model you have often works against a different model trained for the same task, so keeping weights private protects less than it appears to.

For language models the same family arrives as prompt injection and jailbreaking. The medium is text rather than pixels and the shape is identical, which is an input crafted to move the model somewhere its designers did not intend.

Poisoning

Corrupting what the model learns from. An attacker who can influence training data, or a retrieval index, can plant behaviour that surfaces later.

Backdoors are the sharp version. The model behaves normally except when a trigger appears, at which point it does something chosen by whoever planted it. It passes evaluation, because evaluation does not contain the trigger.

This is the attack that grows as systems pull in more outside content. Anything scraped, crowdsourced, or accepted from users is a surface, and a retrieval index built from documents anybody can edit is poisonable without touching the model at all.

Extraction

Rebuilding a model by querying it. Enough input and output pairs allow training a copy that approximates it, which matters commercially where the model is the product.

Rate limiting and monitoring for systematic querying are the practical defences, and neither is complete.

Membership inference

Determining whether a particular record was in the training data. It sounds minor and is a privacy breach on its own, because membership can be the sensitive fact. Knowing somebody's record was in a dataset of patients with a condition discloses the condition.

Model theft and supply chain

The ordinary security problems, which are also the most likely. Weights left in accessible storage, a compromised dependency in the training pipeline, a model downloaded from a public hub with no verification of what is inside it.

Less interesting than adversarial examples and considerably more likely to be how a real incident starts.

What this means in practice

Two things worth carrying.

Treat model input as untrusted, always. Whether it arrives as an image, a document or a prompt, it may be constructed to move the model.

Assume defences are partial. None of these attacks has a complete fix, so the security case cannot rest on the model resisting them. It rests on limiting what a manipulated model is permitted to do, which is why least privilege and oversight do the work that robustness cannot.

Common misconceptions

Adversarial examples are a solved problem.

They are not. Adversarial training helps against the attacks it was trained on and reduces accuracy on ordinary input, and stronger attacks keep defeating defences that looked sound. This is an active research problem rather than an engineering oversight.

An attacker needs the model weights to attack a model.

Attacks transfer. An adversarial input built against one model often works against another trained for the same task, so an attacker can develop against a model they have and use it on one they cannot see.

These attacks are academic and do not happen in production.

Poisoning and extraction are practical against systems that accept public input or expose an API, and prompt injection is the same family arriving through text. Adversarial examples on images are the part that remains mostly a laboratory concern.

3 questions test this concept

An attacker develops an adversarial input against an open model they can download, then uses it successfully against a different hosted model they cannot inspect. What property does this demonstrate?

  • ATransferability, since attacks built against one model often work against another trained for the same task.
  • BExtraction, since the attacker has recovered the hosted model.
  • CPoisoning, since the attacker influenced the hosted model's training.
  • DMembership inference, since the attacker has learned about the training data.
Check whether it stuck.

One per page, with a worked explanation.

Start the set
Related material
Book
Threat Modeling: Designing for Security, On reasoning about an attacker rather than a bug.
Book
Data and Goliath, On what systems reveal about the data behind them.