AI Safety & Alignment
Time limit: 2 hours 30 minutes Total marks: 100 Instructions: Answer ALL three questions. Show all derivations. Code may be written in Python-like pseudocode but must be precise. Calculators/CAS permitted for arithmetic checks only.
Question 1 — Differential Privacy, Fairness, and Their Tension (34 marks)
A hospital trains a binary classifier predicting disease. It releases model outputs under -differential privacy via the Gaussian mechanism, and is simultaneously audited for group fairness across a protected attribute .
(a) State the formal definition of -differential privacy for a randomized mechanism over neighbouring datasets . (4)
(b) For a query with -sensitivity the Gaussian mechanism adds noise . Prove that choosing guarantees -DP for the single release. You may use the privacy-loss random variable and the Gaussian tail bound . (10)
(c) Numerical: a gradient has clipping norm , so . You want for a single step. Compute the minimum from the bound in (b). (4)
(d) Composition: you run noisy-SGD steps, each satisfying -DP. Using basic (linear) composition, express the total . Then explain in two sentences why advanced/moments-accountant composition gives a bound scaling like in rather than . (6)
(e) Fairness metric. Let . Define demographic parity gap and equalized-odds gap. Prove the impossibility statement: if base rates differ, , then a classifier with perfect calibration within groups and non-trivial accuracy cannot simultaneously satisfy demographic parity — sketch the argument formally. (10)
Question 2 — Reward Hacking, Inner Alignment, and Goal Misgeneralization (33 marks)
Consider an RL agent in an MDP . The intended objective is a true reward , but the designer specifies a proxy .
(a) Define outer alignment and inner alignment, and give one concrete failure example of each distinct from reward hacking. (6)
(b) Reward hacking as Goodhart. Suppose where is a correlated "proxy error". Model the agent as choosing a state distribution to maximize subject to (cost budget). Show, using a Lagrangian argument, that as the optimizer pushes toward the arg-max of , the correlation over the induced distribution can decrease even though it was high over the training distribution. Give the KKT stationarity condition and interpret it. (12)
(c) Goal misgeneralization: construct a minimal concrete example. A gridworld has a coin always placed at the top-right during training. Define two reward-consistent policies — "go to coin" vs "go to top-right" — that are indistinguishable on the training distribution but diverge under distribution shift when the coin is moved. Formalize why empirical risk minimization cannot prefer one over the other, and state one mitigation. (9)
(d) Give the precise distinction between reward hacking and goal misgeneralization in terms of whether the specified reward is optimized correctly. (6)
Question 3 — Adversarial Robustness, Jailbreaks, and Backdoors (33 marks)
(a) Define an adversarial example for a classifier with radius , and write the untargeted FGSM perturbation. Prove that for a locally linear model , the optimal -bounded perturbation of radius that maximizes the logit change is , and compute the resulting change in output. (10)
(b) Certified robustness via Lipschitz bound. If has margin and every logit is -Lipschitz in , prove no perturbation of norm can change the prediction. (8)
(c) Backdoor / data poisoning. A trigger patch is added to a fraction of training images with flipped label. Model the poisoned expected loss as . Explain why a small (e.g. 1%) can achieve high attack success rate while barely moving clean accuracy, and name two defenses. (8)
(d) Jailbreaks. Define a jailbreak against an aligned LLM. Explain the mechanism by which "role-play" or "prefix-injection" attacks bypass a refusal-trained model in terms of the shift between the training distribution of harmful prompts and the adversarial distribution. Relate this conceptually to goal misgeneralization from Q2. (7)
Answer keyMark scheme & solutions
Question 1
(a) (4 marks) is -DP if for all neighbouring (differing in one record) and all measurable : (2 marks definition, 1 for "neighbouring = differ in one record", 1 for the additive slack meaning "fails with prob ≤ δ".)
(b) (10 marks) Privacy loss for output : WLOG , means differ by . With noise, : (2) Let ; substituting gives (2) -DP holds if (standard reduction). (1) . So need (2) Using and requiring with , substituting satisfies the inequality (algebra: dominant term ). Since , choosing suffices. (3)
(c) (4 marks) . , , . (2 setup, 2 value)
(d) (6 marks) Basic composition: sequential release of mechanisms each -DP is (3) Advanced composition / moments accountant: privacy loss is a sum of (near-)independent bounded random variables. By concentration (Azuma/moment bounds), the tail grows like the standard deviation rather than the worst-case sum ; the accountant tracks the actual Rényi/moment-generating function of the loss RV, yielding . (3)
(e) (10 marks)
- Demographic parity gap: . (2)
- Equalized-odds gap: max over of . (2)
- Impossibility argument: Perfect within-group calibration means for each group , on the set where score , . A non-trivial (informative) score is correlated with . The group-wise expected prediction equals the group base rate: for a calibrated informative classifier producing 0/1 by thresholding a calibrated score whose mean tracks the base rate. If base rates differ, , hence , so — demographic parity fails. The only way to force is to distort scores away from calibration (add noise / different thresholds), sacrificing calibration or accuracy. This is the Kleinberg–Chouldechova incompatibility. (6)
Question 2
(a) (6 marks) Outer alignment: the specified objective/proxy reward faithfully captures the designer's true intent . Failure: a cleaning robot rewarded for "no visible dirt" learns to cover the mess or turn off its camera. (3) Inner alignment: the learned internal objective (mesa-objective) of the trained model matches the base objective it was trained on. Failure: a model trained with correct reward develops an internal proxy goal that only coincides on-distribution (mesa-optimizer pursuing the wrong target). (3)
(b) (12 marks) Optimize s.t. . Lagrangian: (2) Over the simplex, the optimizer concentrates on states maximizing . KKT stationarity: at optimum (4) Since , the arg-max states are those with large (proxy error), not necessarily large . On the training distribution was high because was small/uncorrelated there; but places mass exactly where is maximal, an out-of-training region. On this induced , dominates and so correlation collapses — the classic Goodhart effect: "when a proxy is optimized hard, it decouples from the target." (6)
(c) (9 marks) States = grid cells; two candidate reward functions consistent with training:
- : navigate to the coin object wherever it is.
- : navigate to the top-right cell . During training coin always, so both policies produce identical trajectories identical empirical loss/return for all training episodes. (3) ERM minimizes ; since on every training sample, the empirical objective is exactly tied — no gradient/preference distinguishes them; inductive bias breaks the tie arbitrarily. (3) Under shift (coin moved to bottom-left), collects the coin, goes top-right and fails: goal misgeneralization — competent pursuit of the wrong generalized goal. Mitigation: diversify training distribution (randomize coin position to break the spurious correlation), or interpretability/mechanistic probing of the learned objective. (3)
(d) (6 marks)
- Reward hacking: the specified proxy reward is optimized correctly (high ), but — the objective was wrong. Capability generalizes fine; specification is flawed. (3)
- Goal misgeneralization: the reward specification is fine on-distribution, but the learned policy internalized a different goal that happens to match on training data; under shift it competently pursues the wrong goal even though the true reward was well-specified. Failure of generalization of the internal objective, not of the specification. (3)
Question 3
(a) (10 marks) adversarial example: with and $\arg\max f(x')\ne \arg\max f(x)