What it is
A model extraction attack is an attempt to steal what a model can do using only its public interface. The attacker never touches the weights or the training data. They send inputs, collect outputs, and use those pairs to build a copy.
The idea was formalized in a 2016 USENIX Security paper, "Stealing Machine Learning Models via Prediction APIs," by Florian Tramèr and colleagues. They showed that a model offered through a query interface could be recovered with near-perfect fidelity for simpler model types, including logistic regression, decision trees and small neural networks.
How it works
Picture a restaurant that will never share its recipe but will cook any dish you order. If you order enough dishes and write down exactly what comes out, you can eventually cook something close to the original.
For a modern language model the steps look like this:
- The attacker writes a large set of prompts.
- They send the prompts to the target model through its API.
- They record the answers, and sometimes the confidence scores or reasoning the model shows.
- They train their own model on those prompt and answer pairs.
The richer the output, the easier the job. Early research found that returning confidence values made extraction far more efficient, though hiding them did not fully stop it. Label-only attacks still worked, only less efficiently.
Why it matters
Training a leading model is expensive, and the outputs are the product. An extracted copy can capture much of that value cheaply. It can also strip away the safeguards the original lab built, because the copy only learns to imitate answers, not the rules behind refusing some of them.
Providers respond in several ways:
- Rate limits on how many queries one account can send. See rate limiting.
- Usage policies that forbid using outputs to train competing models.
- Monitoring for query patterns that look like systematic harvesting.
- Limiting what the API returns, such as hiding confidence scores or intermediate reasoning.
How it differs from distillation
Distillation is the same mechanical process, training a smaller model on a larger model's outputs, and labs use it legitimately on their own models all the time. An extraction attack is distillation done without permission, against a model you do not own.
Extraction attacks often target a frontier model through its API, and defenses lean on rate limiting and an API key per customer. The training data used to build the copy is often synthetic data generated by the target.