Chapter 7 — Model Extraction

(a)  a classifier behind an APIThe hidden model is the three-class classifier that §4 will distill. Each press sends a fresh query x across the wire; the toggle decides what comes back. With labels, the learner’s notebook collects one of three symbols per query — the colored dots — and any model with the same decision regions would have answered every one of them identically. With probabilities, each reply is a point on the simplex: three numbers, each an equation about the logits (§2) and a soft target for distillation (§4). The transcript on the right is everything the learner will ever hold.

the reply
–

(b)  a generator behind an APIThe model is Lecture 6’s 29-word generator: the prefix fixes the next-token distribution. A chat window shows one draw from that law — press and a single word crosses the wire, the table it was drawn from staying inside. A logprobs API shows the law itself: the full table for the step, sampled word boxed in gold. A deterministic step (after a noun, only “.” can follow) returns a one-row table — nothing hidden, nothing random, the entropy point of Lecture 6. Distilling on tables (§4) is training on the law rather than on one draw from it.

the reply
–

(a)  labels only: the boundary, never the scaleThe tinted field is the model’s hidden confidence p(x) = σ(c(w⊤x + b)) — blue toward +, carmine toward −. The interface shows none of it: a query returns only the sign. Press play: from one + and one − answer, bisection halves the bracket at every step, and nine answers pin a boundary point to three decimals; two such points draw the separating line. Then slide the scale c: the hidden confidence sharpens or washes out, and every returned label — every dot on the canvas — stays exactly as it was. Labels determine the hyperplane to any precision, and nothing more.

scale c 1.0
–

(b)  probabilities: the sigmoid, invertedSame hidden model, richer interface: it now returns the probability itself. The sigmoid is strictly increasing, so each reply runs backwards through it — the dashed path on the curve — and lands on the logit: log p/(1−p) = w⊤x + b. Query 0 and the landing point is b itself; query e₁ and it is w₁ + b; query e₂ and it is w₂ + b. Three replies, three linear equations, parameters exact — the recovered line lands on the true boundary to the last digit. What labels could never see, probabilities hand over.

–

§3 — walking a line through a hidden ReLU networkThe hidden model is f(x) = Σj aj ReLU(wj⊤x + bj) with five neurons, boundaries invisible. Walk the line: between crossings f is affine, so the graph is straight, and every kink is one neuron switching. Querying d+1 = 3 nearby points on each side gives the two local gradients, and their difference is exactly ±ajwj — every unchanged neuron cancels. A shifted parallel line crosses the same boundaries; matching equal gradient jumps pairs the crossings, and each pair of points draws its hyperplane. From ajwj and the boundary — the live side fixed by checking a handful of fresh answers — the network is rebuilt and agrees with f to machine precision — while aj and wj separately, their order, and their scale stay invisible: identifiability only up to permutation and positive rescaling.

–

§4 — distillation: queried outputs as training targetsA three-class teacher is queried at m = 60 inputs; two identical students train live by gradient descent on the notes’ loss — one sees only the returned label (one-hot pi), one the full probabilities. Soft targets carry how the teacher weighs alternatives near its boundaries, and the probability student typically lands closer in Pr[g ≠ f], measured on fresh uniform inputs (Definition 1). The coverage slider concentrates the queries: where no query falls, no loss term speaks, and both students drift freely — success depends on the queries covering the distribution of interest, not on the optimizer.

query coverage wide
–