AI Security

Semantic Adversarial Attacks: Leaving the Perturbation Budget Behind

Correction note, 6 September 2026: fully updated and rewritten.

A face recognition system identifies a photograph of a person correctly. Change the hair colour, not with a computed perturbation but with an edit a person would describe as changing the hair colour. The system now identifies someone else, and the image is enormously far from the original in pixel distance while being obviously the same photograph of the same person to anyone who looks at it.

That is a semantic adversarial example, and it is a different object from the ones this field usually studies. Haonan Qiu and colleagues built the canonical version in SemanticAdv at ECCV 2020 by interpolating in the latent space of an attribute-conditioned image editing model. Bhattad and colleagues at Illinois posted a related approach two months earlier through colourisation and texture transfer, published at ICLR 2020. The framing goes back to Unrestricted Adversarial Examples, a 2018 paper from Brown, Carlini, Zhang, Olsson, Christiano and Goodfellow that proposed a two-player contest around exactly this gap. Only the warm-up phase ran; the full contest with human-judged unrestricted inputs was never launched.

A robustness result is a statement about a set of inputs somebody defined in advance, and ordinary Lp robustness says nothing about semantic transformations outside that set. A model can be adversarially trained, benchmarked and formally certified against a perturbation budget, and still fail to an input that never enters the region that budget describes.

What the term means

The standard adversarial example is norm-bounded. The attacker may change the input by at most ε measured in some Lp norm, and that budget is a proxy for a thing nobody can write down directly, which is whether a human would notice.

A semantic adversarial example drops the proxy and keeps the goal, swapping the norm bound for a constraint on meaning. Whatever transformation is applied, the result has to remain a plausible instance of the original class to a person. Three requirements come with that:

  • Semantic preservation. A human still reads it as the same object, the same person, the same claim.
  • Plausibility. The result looks like something that occurs in the world rather than like a manipulated file.
  • No small-Lp budget. The attack does not optimise against pixel distance from the original, which is usually large. Identity preservation, permissible transformation parameters and position on a generative manifold do that work instead.

That third point carries the security relevance. Norm-bounded and semantic attacks are not two flavours of the same threat. One stays inside a region a defender specified; the other is bounded by a region the defender almost certainly did not.

What it is not

The previous version of this article said a semantic attack “might mislabel the image to make the model believe it’s seeing something entirely different.” That is label flipping. It is a training-time attack, it belongs to data poisoning, and it has nothing to do with the concept above. The error mattered because it collapsed the one distinction the article existed to draw.

Two more boundaries worth holding, since this term gets applied loosely:

Semantic attacks are not prompt injection. Injection is untrusted content becoming instruction. A semantic attack is still an input the system is meant to process as data, and it is still trying to cause a wrong output rather than issue a command.

Semantic attacks are not simply “attacks on meaning.” The word semantic has a second, unrelated sense in computing, covering ontologies and the Semantic Web. The old reference list cited a Semantic Web healthcare paper as a case study in semantic adversarial attacks. Different field, different word.

How they are built

Three generations, and the third changed what is practical.

Attribute editing. Take a generative model with disentangled attributes, find the direction that corresponds to hair colour or expression or lighting, and search along it for a point that flips the classifier. SemanticAdv is the reference implementation.

Feature-level manipulation. Bhattad and colleagues attacked through colourisation and texture rather than attributes, which produces images that are large in pixel distance and still natural.

Diffusion. Semantic Adversarial Attacks via Diffusion Models at BMVC 2023, AdvDiff at ECCV 2024, and VENOM, a 2025 preprint, generate adversarial examples through diffusion sampling, which supplies a far stronger natural-image prior than optimising pixels directly. It biases generation toward plausible outputs rather than guaranteeing them. SCA pushed semantic consistency further using DDPM inversion. The practical effect is to reduce the need for a bespoke pipeline per attribute.

The same idea in text

Language has no natural analogue of the continuous pixel-space epsilon ball, so the semantic framing is less an alternative there than the default. Discrete perturbation sets can still be defined and certified against. Jia and colleagues certified robustness to label-preserving word substitutions at EMNLP 2019.

A paraphrase attack rewrites a sentence so the meaning survives and the model’s judgement changes. Synonym substitution, reordering, register shifts and style transfer are all instances. The 2022 Neurocomputing survey by Shilin Qiu and colleagues, no relation to SemanticAdv’s Haonan Qiu, covers the technique catalogue, and it is the one source from the previous version of this article that supported the claim attached to it.

What is new is the target. Semantic-preserving attacks are now used against LLM safety behaviour, where the goal is a request that means the same thing as one the model refuses and gets a different response. That is a jailbreak by paraphrase, and it has a practical advantage over the token-optimisation methods in gradient-based attacks. The output is fluent, so it slips past the perplexity filters that work well against high-perplexity optimised suffixes. Recent work on diffusion-guided attacks explicitly targets this combination, constraining the search to coherent language while keeping token-level control.

What breaks

Three defensive positions weaken once semantic attacks are in scope, and it is worth being precise about which part of each fails.

A certificate only certifies its own threat model. An Lp certificate proves that no input within radius r of this one changes the prediction. It is true and it is valuable. It says nothing about an input at distance 40r that a human would call the same picture. Certification against other transformation families does exist. Fischer, Baader and Vechev certified robustness to rotations and translations at NeurIPS 2020, and GSmooth extended the same guarantee to broader semantic transformations at ICML 2022. Those are real guarantees over the sets they name. The error is reading any certificate as a statement about inputs outside the set it covers.

Adversarial training trains a set. Robust optimization buys robustness inside the perturbation set you specified when you wrote the training loop. Outside it, robustness holds only where someone has run the attack and measured it, and semantic attacks are outside it by construction. This is the concrete case for the argument that article makes in the abstract.

Norm-based and perplexity-based detection need not fire. A detector tuned to flag inputs anomalously close to a decision boundary, or text with anomalously high perplexity, is looking for the signature of a norm-bounded or token-optimised attack. A semantically coherent adversarial input carries neither signature, which is why input filtering does not catch this class reliably, whatever else it is good for.

Where this leaves a defender

Semantic attacks are the reason “we adversarially trained the model” is an incomplete answer, and they are also not a reason to panic. Many of the strongest evaluations assume white-box access or transfer from a generative model well aligned with the target’s domain, though SemanticAdv itself reports transfer against commercial black-box face verification. There is no public evidence of routine use against production systems. Treat the following as the practical shape.

Ask what perturbation set a robustness claim covers, and assume nothing outside it. This is the single question that converts a vendor’s robustness number into information. If the answer is an L∞ ball at some ε, the claim is silent about every semantic transformation.

Test with transformations a real adversary could apply, not just with PGD. For a face system that means lighting, pose, expression, accessories and image capture conditions. For a content classifier it means paraphrase. These are cheap to generate and they measure something the benchmark does not.

Stop relying on imperceptibility as a threat model. The assumption that an attack must be invisible was always an artefact of how the field made the problem tractable. An attacker under no obligation to be subtle has more room, not less.

Put the check downstream of the model. The controls that survive a threat model you did not anticipate are the ones that do not depend on the model being right: a second independent signal, a rate limit, a human in the path for consequential decisions, a constraint enforced outside the model rather than learned inside it.

The unifying point is narrow enough to carry. Every robustness guarantee in machine learning is conditional on a set of inputs somebody wrote down, and it is worth as much as that set resembles what an attacker can build. Semantic attacks are the demonstration that the buildable set is larger than the ones anyone has managed to write down, and eight years of certification work has widened the sets without closing that gap.

Marin Ivezic

I am the Founder of Applied Quantum (AppliedQuantum.com), a research-driven consulting firm empowering organizations to seize quantum opportunities and proactively defend against quantum threats. A former quantum entrepreneur, I’ve previously served as a Fortune Global 500 CISO, CTO, Big 4 partner, and leader at Accenture and IBM. Throughout my career, I’ve specialized in managing emerging tech risks, building and leading innovation labs focused on quantum security, AI security, and cyber-kinetic risks for global corporations, governments, and defense agencies. I regularly share insights on quantum technologies and emerging-tech cybersecurity at PostQuantum.com.