Skip to content

Interview question · Adversarial ML & Model Privacy

What is model extraction, what does the attacker gain, and how do you detect and limit it?

The API is the attack surface and every response is a training example. Prevention is unrealistic; slowing, limiting and noticing are not.

mediumEssentialNewPreparation tags: OpenAI, Google, MicrosoftUpdated Nov 2026

TL;DR: Model extraction uses queries to steal a model's functionality (train a substitute on its outputs, or distil an LLM from its responses) or its parameters (Carlini et al., 2024, recovered a production LLM's embedding projection layer through log-probability features). The attacker gains the capability without the training cost, a white-box substitute for crafting transferable attacks, hidden details, and use free of the provider's safeguards. Limit it with per-key rate and volume caps, less output detail, query-pattern monitoring, account verification, terms enforcement and watermarking; none prevents it outright.

How to approach it

Define both forms with a cited example, list the attacker's gains (including the less obvious one: better attacks), then present layered controls and how you would detect an extraction campaign in practice.

A strong answer

FIG · MODEL EXTRACTION · QUERIES IN, A COPY OUT
Functionality or parameters, without the training cost

Attacker

many accounts

Model API

outputs, log probs

Query/response set

covers behaviour

Substitute model

white-box proxy

Detect and limit

Fewer outputs exposed

  • Labels not full log probs where possible

Usage shape

  • Coverage-style prompts, account linkage

Watermarks and terms

  • Evidence for enforcement

Forms.

  • Functionality stealing: query broadly, collect input-output pairs, train a substitute. Tramèr et al. (2016) did this against commercial prediction APIs; LLM distillation from a stronger model's responses is the modern form.
  • Parameter extraction: exploit API features to recover internals. The 2024 production-model result relied on log-probabilities and logit bias; providers changed their APIs afterwards.

Gains.

GainConsequence
Capability without training costCommercial loss
White-box substituteUnlimited offline search for jailbreaks and evasions that may transfer back
Confidential detailsModel size, behaviours, system design
Unmonitored useMisuse outside the provider's safeguards and terms

Limiting.

  1. Per-key, per-account and per-payment-identity rate and volume limits, with alerts on sustained high volume.
  2. Reduce information per query: labels rather than scores for classifiers; restricted or top-k log-probabilities for LLMs; no feature combinations known to leak parameters.
  3. Verification and friction for high-volume access; detect many accounts tied to one payer or network.
  4. Terms prohibiting training on outputs, with enforcement.
  5. Watermarking of outputs or model behaviour to support detection of copies, acknowledging limited robustness.

Detecting. Extraction campaigns tend to show high volume, broad and systematic coverage of the input space, synthetic or templated prompts, little conversational structure, and distribution unlike normal product use. Build per-key baselines and alert on outliers; review keys with sudden growth.

Perspective. Extraction yields an approximation; stealing the weights yields the model. Prioritise weight protection, and treat extraction as an API abuse problem with business and security dimensions.

What interviewers probe next

  • "Can you detect distillation from normal usage?" Sometimes from volume and prompt patterns; a careful attacker spreading queries across accounts is hard to see, which is why terms and verification matter.
  • "Should you add noise to outputs?" It can reduce information per query, but degrades quality for legitimate users; prefer restricting detail.
  • "Is extraction a threat to an internal-only model?" Less so, but insiders and compromised accounts can still query at scale; keep limits and logging.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

A competitor queries your paid image-classification API millions of times through many accounts, collecting full probability outputs for diverse synthetic inputs.

  1. Start here

    What is the competitor trying to get?

How it's scored

Weak: "Stealing a model through the API" with no mechanism or defences.

Hire: Distinguishes functionality and parameter extraction and proposes rate limits and output restrictions.

Strong Hire: Cites results, explains the substitute-for-attacks gain, gives detection signals and realistic layered controls with honest limits.

Common mistakes

  • Claiming extraction can be prevented.
  • Exposing full log-probabilities by default.
  • Forgetting the link between extraction and transferable attacks.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.