Sam Babichenko

Reading notes / Strategic and performative prediction

Strategic classification

Hardt et al., 2016; Brückner et al., 2012

Context. A classifier that decides about people, spam or fraud gets gamed: the other side changes cheap attributes to cross it. Hardt et al. (2016) set up a Stackelberg game, in which a jury commits to a classifier and each contestant best-responds under a cost the jury knows, and ask for a learner whose accuracy after the response is within ε\varepsilon of the best possible. Brückner et al. (2012) make learner and data generator simultaneous players with their own regularized costs, a Nash prediction game, and certify a unique equilibrium; Brückner and Scheffer (2011) solve the Stackelberg version. The order of play and the shape of the cost decide what can be learned. Under a separable cost every classifier collapses, after gaming, to a cutoff on one number c1(x)c_1(x), so whatever the features predict beyond c1c_1 cannot be used. In the simultaneous game the purely antagonistic part of the interaction does not affect uniqueness; regularization has to dominate the part where the players' loss slopes do not cancel.

Setting (Hardt et al.). Fix a population XX, a distribution DD, a cost c:X×X→R+c:X\times X\to\mathbb R_+ and a target h:X→{−1,1}h:X\to\{-1,1\}. The jury publishes ff, and a contestant at xx moves to Δ(x)∈arg⁡max⁡y [f(y)−c(x,y)]\Delta(x)\in\arg\max_y\,[f(y)-c(x,y)], staying put when that is among the maximizers. The jury is scored against the true label of the unmoved point. Acceptance is worth 2 (from −1-1 to +1+1), so a rejected contestant moves exactly when some accepted point costs less than 2. The strategic maximum OPTh(D,c)=max⁡fPr⁡[h(x)=f(Δ(x))]\mathrm{OPT}_h(D,c)=\max_f\Pr[h(x)=f(\Delta(x))] is the jury's Stackelberg value. The jury knows cc but sees only unmanipulated labeled samples; an algorithm is strategy-robust if with probability 1−δ1-\delta it reaches OPTh−ε\mathrm{OPT}_h-\varepsilon, and uniform over HH if one sample serves every h∈Hh\in H. A cost is separable if c(x,y)=max⁡{0,c2(y)−c1(x)}c(x,y)=\max\{0,c_2(y)-c_1(x)\} with c1(X)⊆c2(X)c_1(X)\subseteq c_2(X), so every contestant has a free option. The linear case is c(x,y)=⟨α,y−x⟩+c(x,y)=\langle\alpha,y-x\rangle_+: raising attribute jj costs αj\alpha_j per unit. Write g[t]g[t] for the classifier that accepts xx iff g(x)≥tg(x)\ge t.

Theorems (Hardt et al.). Separable costs. If cc is separable (no ties at cost 2) and Rm(H)+2ln⁡(m+1)m+ln⁡(2/δ)8m≤ε8,R_m(H)+2\sqrt{\frac{\ln(m+1)}m}+\sqrt{\frac{\ln(2/\delta)}{8m}}\le\frac\varepsilon8, then with probability 1−δ1-\delta the output c2[si∗]c_2[s_{i^*}] of Algorithm 1, run on the labels of hh, is within ε\varepsilon of OPTh\mathrm{OPT}_h for all h∈Hh\in H at once. Algorithm 1 puts si=max⁡(c2(X)∩[c1(xi),c1(xi)+2])s_i=\max\big(c_2(X)\cap[c_1(x_i),c_1(x_i)+2]\big) (or ∞\infty), adds sm+1=∞s_{m+1}=\infty, and picks the sis_i minimizing the empirical error of c1[si−2]c_1[s_i-2]. For one fixed hh, m=O(ε−2(log⁡(1/ε)+log⁡(1/δ)))m=O\big(\varepsilon^{-2}(\log(1/\varepsilon)+\log(1/\delta))\big) samples suffice with no assumption on hh, and the algorithm is efficient because it never searches HH. Minima of kk separable costs extend this, as the paper states (its scoring of candidates needs the repair in Step 5), with 2kln⁡(m+1)/m2\sqrt{k\ln(m+1)/m} in the sample condition and time O(mk)O(m^k); every finite cost is such a minimum, so kk measures how far a cost is from separable. Hardness: for a general metric on a finite XX, computing OPTh\mathrm{OPT}_h within ∣X∣−η|X|^{-\eta} is NP-hard, even for a jury that knows every label.

Setting and theorems (Brückner et al.). The learner chooses w∈W⊂Rmw\in W\subset\mathbb R^m, scoring fw(x)=w⊤ϕ(x)f_w(x)=w^\top\phi(x); the data generator, one player for all senders legitimate and abusive, chooses a transformed copy x˙=(x˙1,…,x˙n)\dot x=(\dot x_1,\dots,\dot x_n) of the training sample, labels kept, standing in for the test distribution. Each incurs a weighted loss on the transformed sample plus its own regularizer, θ^−1(w,x˙)=∑ic−1,i ℓ−1(w⊤x˙i,yi)+ρ−1Ω^−1(w),θ^+1(w,x˙)=∑ic+1,i ℓ+1(w⊤x˙i,yi)+ρ+1Ω^+1(x,x˙).\hat\theta_{-1}(w,\dot x)=\sum_ic_{-1,i}\,\ell_{-1}(w^\top\dot x_i,y_i)+\rho_{-1}\hat\Omega_{-1}(w),\qquad\hat\theta_{+1}(w,\dot x)=\sum_ic_{+1,i}\,\ell_{+1}(w^\top\dot x_i,y_i)+\rho_{+1}\hat\Omega_{+1}(x,\dot x). The game is static with complete information (each player knows both costs); at a Nash equilibrium each minimizes its own cost given the other's action. With λ±1\lambda_{\pm1} the regularizers' Hessian floors, convex smooth losses, strongly convex regularizers and compact convex action sets, an equilibrium exists, and it is unique if (i) the curvatures agree, ℓ−1′′=ℓ+1′′\ell''_{-1}=\ell''_{+1}; (ii) ρ−1ρ+1>τ2λ−1λ+1 c−1⊤c+1,τ=sup⁡12∣ℓ−1′(fw(x),y)+ℓ+1′(fw(x),y)∣;\rho_{-1}\rho_{+1}\gt\frac{\tau^2}{\lambda_{-1}\lambda_{+1}}\,c_{-1}^\top c_{+1},\qquad\tau=\sup\tfrac12\big|\ell'_{-1}(f_w(x),y)+\ell'_{+1}(f_w(x),y)\big|; and (iii) for each instance, equal cost factors c−1,i=c+1,ic_{-1,i}=c_{+1,i} or a generator regularizer whose gradient in x˙i\dot x_i does not depend on the other instances. For Nash logistic regression (learner log⁡(1+e−yz)\log(1+e^{-yz}), generator log⁡(1+ez)\log(1+e^{z}) for both classes, since it incurs a loss whenever an instance is blocked) with squared-norm regularizers and uniform weights, the condition reads ρ−1≥1/ρ+1\rho_{-1}\ge1/\rho_{+1}. Uniqueness matters because players taking actions from different equilibria can do arbitrarily badly.

Step 1

Under a separable cost, acceptance after gaming is a threshold on c1c_1. A contestant ends up accepted iff some accepted yy has c(x,y)<2c(x,y)\lt2, that is c2(y)<c1(x)+2c_2(y)\lt c_1(x)+2, and the cheapest accepted target has the smallest c2c_2, so f(Δ(x))=1  ⟺  c1(x)>min⁡{c2(y):f(y)=1}−2.f(\Delta(x))=1\iff c_1(x)\gt\min\{c_2(y):f(y)=1\}-2 . The side conditions enter only here: nonnegativity makes a move to a rejected point useless, and the free option makes a rejected contestant's payoff exactly −1-1. The outcome depends on ff only through the single number s(f)=min⁡{c2(y):f(y)=1}s(f)=\min\{c_2(y):f(y)=1\}.

Step 2

The jury can restrict to cutoffs on c2c_2, and the strategic maximum is the best cutoff on c1c_1. Replace ff by c2[s(f)]c_2[s(f)]: same ss, hence the same outcome at every xx. Optimizing over ss, OPTh(D,c)=1−inf⁡s∈c2(X)∪{∞}Pr⁡x∼D[h(x)≠c1[s−2](x)],\mathrm{OPT}_h(D,c)=1-\inf_{s\in c_2(X)\cup\{\infty\}}\Pr_{x\sim D}\big[h(x)\ne c_1[s-2](x)\big], with the published rule c2[s]c_2[s] two cost units above the effective cutoff c1[s−2]c_1[s-2] on original features. A brute-force check over all classifiers on small random separable instances matched this formula exactly (my check, not in the paper). In the linear case, moving orthogonally to α\alpha is free, so the jury may as well accept a halfspace with normal α\alpha, and the data choose only its offset.

Step 3

Empirical risk minimization over m+1m+1 candidate cutoffs is exact. The empirical error of c1[s−2]c_1[s-2] changes only when s−2s-2 crosses some c1(xj)c_1(x_j), and sis_i is the highest value of c2c_2 that sample ii can reach at cost at most 2, so every distinct empirical behavior is attained among s1,…,sm+1s_1,\dots,s_{m+1}. The cutoff must be a value of c2c_2, since a cutoff on c1c_1 at an arbitrary level need not be reachable by any published rule. The search is one-dimensional, which is why the algorithm never has to search HH.

Step 4

Uniform convergence, through a Rademacher bound on products. The loss class is {h⋅c1[s−2]}\{h\cdot c_1[s-2]\}, and for ±1\pm1 functions h⋅g=∣h+g∣−1h\cdot g=|h+g|-1, so contraction splits its complexity into Rm(H)R_m(H) plus that of the cutoffs, which Massart's lemma bounds by 2ln⁡(m+1)/m2\sqrt{\ln(m+1)/m} since cutoffs realize at most m+1m+1 patterns. Then sup⁡h∈H, s∣err^(s)−err(s)∣≤4Rm(H)+8ln⁡(m+1)m+2ln⁡(2/δ)m≤ε2.\sup_{h\in H,\,s}\big|\widehat{\mathrm{err}}(s)-\mathrm{err}(s)\big|\le4R_m(H)+8\sqrt{\tfrac{\ln(m+1)}m}+\sqrt{\tfrac{2\ln(2/\delta)}m}\le\tfrac\varepsilon2 . The Rm(H)R_m(H) term is there only for uniformity over targets; for one fixed hh, the sample size is that of learning a single threshold.

Step 5

For minima of kk separable costs there is one cutoff per piece, and the search grows exponentially in kk. A contestant uses its cheapest piece, so the accepted set after gaming is a union ⋃b{b1(x)>sb−2}\bigcup_b\{b_1(x)\gt s_b-2\} with sb=min⁡{b2(y):f(y)=1}s_b=\min\{b_2(y):f(y)=1\}. Replacing ff by the intersection of its cutoff sets {b2≥sb}\{b_2\ge s_b\} leaves every sbs_b unchanged, and ERM runs over the (m+1)k(m+1)^k grid of candidate vectors, hence kln⁡(m+1)/m\sqrt{k\ln(m+1)/m} and O(mk)O(m^k). Score each candidate by the actual post-gaming outcome of the rule it publishes: on small two-piece instances that recovered the strategic maximum every time, while the paper's shortcut score returned a worse rule in about 6% of instances, by up to 0.83 in accuracy (my check, not in the paper).

Step 6

For metrics the problem is NP-hard, by a 3SAT reduction on a two-distance metric. Gaming closes the jury's acceptance set under neighborhoods, which leaves a covering problem with no one-dimensional order to exploit. With distances 1.5 and 2.5 only (the triangle inequality is automatic), close pairs form a graph, and accepting a point accepts all its rejected neighbors. Weighted gadgets (negative literal points, positive clause-pair points, linking points for non-contradictory literal pairs) make accepting anything profitable exactly when one literal per clause can be chosen with no two contradictory, that is, when the formula is satisfiable, with a gap that is a ∣X∣−η|X|^{-\eta} fraction of the population.

Step 7

In Hardt's experiment the strategy-robust classifier beats an SVM once gaming is substantial. On review spam with hand-assigned linear costs and deliberately misspecified simulated gaming, the strategy-robust classifier beats a linear SVM once gaming reaches about half a unit, and tolerates misspecification up to about sin⁡θ=0.7\sin\theta=0.7; the SVM is as good with almost no gaming. One data set, results in figures only.

Step 8

Existence is standard, and uniqueness reduces to positive definiteness of a weighted pseudo-Jacobian. Each cost is continuous and strictly convex in the player's own action on a compact convex set, so the classical existence theorem for convex games applies. For uniqueness, split the generator into nn players, one per instance, which keeps the equilibria (its cost is convex over a product set) and allows one Rosen weight per block. The equilibrium is unique if gr(w,x˙)=(r0∇wθ^−1, r1∇x˙1θ^+1, …, rn∇x˙nθ^+1)g_r(w,\dot x)=\big(r_0\nabla_w\hat\theta_{-1},\ r_1\nabla_{\dot x_1}\hat\theta_{+1},\ \dots,\ r_n\nabla_{\dot x_n}\hat\theta_{+1}\big) is strictly monotone (Rosen's diagonal strict concavity, with signs flipped for costs), for which it suffices that its nonsymmetric Jacobian JrJ_r satisfies z⊤Jrz>0z^\top J_rz\gt0 everywhere; the weights r0=1r_0=1, ri=c−1,i/c+1,ir_i=c_{-1,i}/c_{+1,i} rescale the generator's instance weights to the learner's.

Step 9

The curvature part is a sum of squares exactly when the curvatures agree. Differentiating twice gives curvature entries c ℓ′′c\,\ell'' (the score is a scalar index) and coupling entries c ℓ′ Ic\,\ell'\,I (the score is bilinear). With ℓ−1′′=ℓ+1′′\ell''_{-1}=\ell''_{+1} and the weights above, the curvature part is z⊤J(1)z=∑ic−1,i ℓ−1,i′′ (z0⊤x˙i+zi⊤w)2≥0,z^\top J^{(1)}z=\sum_ic_{-1,i}\,\ell''_{-1,i}\,\big(z_0^\top\dot x_i+z_i^\top w\big)^2\ge0 , the curvature of the loss along the change in each score. It is never definite: z0=−wz_0=-w, zi=x˙iz_i=\dot x_i leaves every score unchanged to first order, so definiteness has to come from the regularizers. With unequal curvatures the square structure is lost, and the paper warns the equilibrium may then not be unique.

Step 10

In the coupling only the slopes that fail to cancel count, and the regularizers must dominate them. Definiteness depends only on the symmetric part of the Jacobian, in which the antagonistic difference of the two slopes is skew and drops out. Put the regularizers' floors ρvλv\rho_v\lambda_v on the diagonal (their excess is positive semidefinite by condition (iii)); after a diagonal congruence, which keeps the signs of the eigenvalues, twice the symmetric part is an arrowhead matrix with spokes c~i=c−1,ic+1,i (ℓ−1,i′+ℓ+1,i′)\tilde c_i=\sqrt{c_{-1,i}c_{+1,i}}\,(\ell'_{-1,i}+\ell'_{+1,i}) and eigenvalues 2ρ+1λ+12\rho_{+1}\lambda_{+1} and ρ−1λ−1+ρ+1λ+1±(ρ−1λ−1−ρ+1λ+1)2+∑ic~i2,\rho_{-1}\lambda_{-1}+\rho_{+1}\lambda_{+1}\pm\sqrt{(\rho_{-1}\lambda_{-1}-\rho_{+1}\lambda_{+1})^2+\textstyle\sum_i\tilde c_i^2}, all positive iff ∑ic~i2<4ρ−1ρ+1λ−1λ+1\sum_i\tilde c_i^2\lt4\rho_{-1}\rho_{+1}\lambda_{-1}\lambda_{+1}, which (ii) guarantees. For Nash logistic regression, on spam the slopes sum to tanh⁡(z/2)\tanh(z/2), which vanishes at the decision boundary, so the players are exactly opposed there; on legitimate mail they add to 2σ(z)2\sigma(z), since both want a low score. The condition is on the product of the regularization strengths, so a generator that moves cheaply (small ρ+1\rho_{+1}) forces a strongly regularized learner. In a small random instance definiteness failed at half the certified product once the action sets allowed large scores (my check, not in the paper), though a failed certificate does not by itself produce a second equilibrium.

Step 11

Both solvers rely on the same monotonicity. One descends the weighted Nikaido-Isoda gap, the sum of each player's best unilateral cost saving, which is zero exactly at equilibrium; when JrJ_r is positive definite the direction to the players' best responses is a descent direction, so an Armijo line search along it works. The other is a projected extragradient method on the variational inequality gr(z∗)⊤(z−z∗)≥0g_r(z^*)^\top(z-z^*)\ge0, which converges because grg_r is strictly monotone and needs only projections onto balls.

Step 12

The leader-follower version reduces to one level because the follower's best response is a shift along the model. In Brückner and Scheffer (2011) the learner commits to ww and the generator best-responds; the Stackelberg equilibrium solves a bilevel problem. With squared-distance transformation cost, a convex differentiable generator loss and an unconstrained feature space, the follower's problem is strictly convex and its solution moves each point along ww: x˙i=ϕ(xi)+τiw,τi=−nρ+1 c+1,i ℓ+1′(fw(xi)+τi∥w∥2, yi).\dot x_i=\phi(x_i)+\tau_iw,\qquad\tau_i=-\frac n{\rho_{+1}}\,c_{+1,i}\,\ell'_{+1}\big(f_w(x_i)+\tau_i\|w\|^2,\,y_i\big). The bilevel problem becomes a nonconvex single-level one in (w,τ)(w,\tau) with nn scalar constraints, solved by SQP to a KKT point. The Nash game's first-order condition gives the same shift at an interior equilibrium (my own observation); the difference is that the Stackelberg leader differentiates through τi(w)\tau_i(w), and so knows that a longer ww invites a larger attack, while the Nash learner treats x˙\dot x as fixed. The 2011 paper takes Nash to fit an adversary who cannot see the model and Stackelberg one who can probe it.

Step 13

In Brückner's experiments the Nash models beat the baselines on later email in three of four corpora. On four chronologically sorted email corpora, the two solvers agree from random starts even when the bound is violated by a factor of up to 4. Forward in time, the Nash models beat logistic regression, the SVM and the invariance SVM on three corpora, with no significant gain on the short-period TREC 2007. On unshifted data the plain baseline is better (F-measure 0.957 against 0.924 on the provider corpus). The weak points: ρ+1\rho_{+1} barely affects hold-out F-measure, so the adversary's regularization cannot be estimated from data and is fixed by hand; training costs up to 150 times the baseline; and robustness is tested against the very attack the model assumed. The equilibrium transform barely edits legitimate mail, but it is computed mostly outside the certificate: wherever the transform is visibly large the product ρ−1ρ+1\rho_{-1}\rho_{+1} fails the sufficient condition by a factor of more than 13, beyond the range where the solvers were seen to agree (my check, not the paper's).

Consequences and limits. Under a separable cost the defender's best accuracy is fixed by the cost structure: in the linear case the weight on a feature is its cost of manipulation, whatever its predictive value, so a fraud model facing adaptive fraudsters should weight signals that are expensive to fake (account age, device and payment history), with the data setting only the threshold. The Nash learner trains on the adversary's best-response copy of the data, like adversarial augmentation with an attack budget set by ρ+1\rho_{+1}, the one parameter the data could not set. The limits are shared: one round, a deterministic response under a single known cost (Hardt's contestants have no private cost type; Brückner's game assumes complete information and one representative adversary), and no agents who learn the rule from outcomes or forecast the learner's update. Brückner's equilibrium is defined on the transformed training sample, with no generalization theory.

Terms

Stackelberg game
The jury commits to ff; each contestant then best-responds, Δ(x)∈arg⁡max⁡y[f(y)−c(x,y)]\Delta(x)\in\arg\max_y[f(y)-c(x,y)].
OPTh(D,c)\mathrm{OPT}_h(D,c)
Strategic maximum: the best post-gaming accuracy max⁡fPr⁡[h(x)=f(Δ(x))]\max_f\Pr[h(x)=f(\Delta(x))], measured against unmoved labels.
Separable cost
c(x,y)=max⁡{0,c2(y)−c1(x)}c(x,y)=\max\{0,c_2(y)-c_1(x)\} with c1(X)⊆c2(X)c_1(X)\subseteq c_2(X) (a free option exists).
Collapse to a cutoff
After gaming, xx is accepted iff c1(x)>s−2c_1(x)\gt s-2, where ss is the cheapest accepted c2c_2 value.
Published vs effective cutoff
Publish c2[s]c_2[s]; the originals accepted are c1[s−2]c_1[s-2], two cost units lower.
Metric hardness
For metrics, approximating OPTh\mathrm{OPT}_h within ∣X∣−η|X|^{-\eta} is NP-hard, even with all labels known.
Nash prediction game
Learner picks ww, generator picks a transformed sample x˙\dot x, simultaneously; each minimizes its own regularized cost.
Rosen's criterion
JrJ_r positive definite everywhere ⇒gr\Rightarrow g_r strictly monotone ⇒\Rightarrow at most one equilibrium.
τ\tau
sup⁡12∣ℓ−1′+ℓ+1′∣\sup\frac12|\ell'_{-1}+\ell'_{+1}|: the part of the loss slopes that does not cancel; antagonistic coupling is skew and drops out.
Stackelberg shift (2011)
Follower's best response x˙i=ϕ(xi)+τiw\dot x_i=\phi(x_i)+\tau_iw, which turns the bilevel problem into one level in (w,τ)(w,\tau).

Quiz

  1. Why can the jury restrict attention to cutoff classifiers c2[s]c_2[s] when the cost is separable?
  2. Under a linear cost ⟨α,y−x⟩+\langle\alpha,y-x\rangle_+, a fraud feature is highly predictive but free to change (αj=0\alpha_j=0). What weight does the jury's optimal rule give it?
  3. In the definiteness test of the coupling block, the learner's slope ℓ−1′\ell'_{-1} and the generator's slope ℓ+1′\ell'_{+1} enter only through their sum. Why?
  4. For Nash logistic regression with uniform weights, uniqueness is guaranteed when ρ−1≥1/ρ+1\rho_{-1}\ge1/\rho_{+1}. What does this say when the adversary can move its data cheaply?

Sources