Skip to main content
Phase 1: Foundations1.3

The Verification Problem: Properties, Margins, and Counterexamples

Formulate a neural-network property, negate it into a counterexample query, and distinguish a valid bound from an actual violating input.

What you will be able to do

  • Write the verification question for a network as an optimisation problem
  • State the property being checked in terms of a safety or robustness predicate
  • Recognise when a problem is out of reach for exact methods and must be relaxed

A verification question has three ingredients: a fixed network ff, an input condition PP, and an output condition QQ. The statement to check is

∀x: P(x)⟹Q(f(x)).\forall x:\ P(x)\Longrightarrow Q(f(x)).

The property is meaningful only relative to those ingredients. Changing preprocessing, the allowed input set or the meaning of the output changes the question.

The equivalent counterexample question

Negating the statement gives

∃x: P(x)∧¬Q(f(x)).\exists x:\ P(x)\land\neg Q(f(x)).

A solver may search for this bad input rather than directly manipulating a universal statement. If it finds one, we evaluate it in the intended network and check the input constraints. A candidate satisfying only a relaxation of the network is not yet a counterexample.

Use three outcomes for the semantic result: SAFE if the property is established, UNSAFE if a valid violating input is established, and UNKNOWN if neither has been established within the method or budget. A tool’s raw sat label must be interpreted according to the query it solves.

A network we can solve by hand

Throughout several chapters, use

x∈[−1,1],h1=ReLU⁡(x),h2=ReLU⁡(−x),g(x)=h1−h2−x+14.x\in[-1,1],\quad h_1=\operatorname{ReLU}(x),\quad h_2=\operatorname{ReLU}(-x),\quad g(x)=h_1-h_2-x+\tfrac14.

The desired property is g(x)>0g(x)>0. For x≥0x\ge0, the activations are (x,0)(x,0); for x≤0x\le0, they are (0,−x)(0,-x). In both cases g(x)=1/4g(x)=1/4. The property therefore holds over the whole interval.

This is a proof by cases over two feasible regions, not a sample test. Later, a relaxation of the same network will allow a negative value. That will show failure of the relaxation to prove the property, not failure of the network.

Classification as a margin property

For output scores fc(x)f_c(x) and a chosen reference class yy, define

mj(x)=fy(x)−fj(x),j≠y.m_j(x)=f_y(x)-f_j(x),\qquad j\ne y.

One sufficient and unambiguous requirement is that every margin is strictly positive throughout XX. This requires the reference class to be the unique highest-scoring class. A property allowing ties needs an explicit tie-breaking convention instead.

The reference class can be a ground-truth label or the model’s nominal prediction. Those choices answer different questions. Robustly retaining an initially wrong prediction does not establish correctness.

Bounds and witnesses have opposite directions

For a continuous margin on a nonempty compact domain, let

mj∗=min⁡x∈Xmj(x).m_j^*=\min_{x\in X}m_j(x).

Suppose a sound method returns a lower bound Lj≤mj∗L_j\le m_j^*. If every Lj>0L_j>0, the strict-margin property is proved. A lower bound at or below zero does not establish a violation: it may only reflect a loose relaxation.

An actual input x^∈X\hat x\in X gives the other direction: mj∗≤mj(x^)m_j^*\le m_j(\hat x). If mj(x^)≤0m_j(\hat x)\le0, it violates the strict property. Always verify that this value comes from the original network rather than from independent relaxed activation variables.

An exercise in reading a result

A verifier returns a sound lower bound of −0.2-0.2. An attack finds an input with margin 0.10.1. What has been established?

Answer

Only that the minimum lies between −0.2-0.2 and 0.10.1. Neither result proves the property or exhibits a violation. The correct conclusion is UNKNOWN, unless another argument is available.

Key Takeaways

Write the property before choosing a tool. Fix the network semantics, input set and required output behaviour.

A negative relaxed bound is not a counterexample. It can mean that the method has not proved enough.

A witness must belong to the original problem. Check its input constraints and evaluate the actual network.

Further Reading

Salman et al., “A Convex Relaxation Barrier to Tight Robustness Verification of Neural Networks”, NeurIPS 2019 https://arxiv.org/abs/1902.08722 — for the distinction between the original problem and the relaxed one.

Next read bound propagation, or turn this property into a file in formal specifications.