A taxonomy of trained ML model types, the privacy risks each is prone to, and the mitigation strategies available — a counterpart to the "statbarns" taxonomy used for traditional statistical disclosure control.
TREs are seeing growing demand for AI/ML projects that need to export a trained model built on sensitive data. Which privacy risks apply depends heavily on the type of technique used — so this taxonomy groups trained ML models by the nature of their predictions, with each group carrying its own set of risks and mitigations.
Work out which category best matches the model being proposed, then read that category's risks and mitigations in full — the summary table is a quick reference, but decisions shouldn't be made from the table alone.
Researchers should be ready to explain how the model is created and what it predicts, so TRE staff can identify the right category and apply the appropriate checks.
If a model is never egressed from the TRE, there is no risk of privacy leakage from the model itself — this guidance does not apply in that case.
These recommendations sit on top of a TRE's normal statistical disclosure control and mitigation practices — they don't replace them.
Data is pseudo-anonymised through existing processes before TRE users can access the dataset.
Every project's outputs undergo output checking prior to release — the exact process may vary between TREs.
All TRE users complete mandatory training.
Eight recurring risk types show up across the model categories below. Some map directly onto risks already familiar from traditional statistical disclosure control; others — the "privacy attacks" — are specific to trained ML models.
Some models ("lazy learners" / instance-based models) work by retaining a carefully selected slice of the training data in order to make predictions. An attacker can directly extract some of that training data from the egressed model. The only mitigation is one the TRE would already be content with: releasing the (pre-processed) training data itself — e.g. because pre-processing makes it effectively k-anonymous, or applies a Differentially Private transformation with an agreed privacy parameter (ε).
An individual belonging to a specific group or category where only a few people are present can be easily identifiable — especially if some characteristics of the group are already public. For example, patients at a specific NHS board who suffer from a rare genetic disease.
Information about a distinct population group is revealed, often inadvertently — for instance, when either none or all of the observations in a given category come from that subpopulation.
A "saturated" regression model — one that considers every combination of variables — essentially becomes a complex look-up function. The usual test is whether the residual degrees of freedom (training records minus trainable parameters) stays above a threshold, typically 10.
Aims to determine whether a specific person's record was part of the dataset used to train the model.
Usually applied to a known member: given some information already known about a person's record, this attack tries to recover the rest of that record's attributes. Some information about certain people — e.g. those in the public eye — may already be publicly available.
Aims to recover a subset or group of records that share something in common (belong to a specific sub-class) — disclosing records belonging to several people at once. For example, everyone with a particular rare disease represented in the training data.
Sometimes a model can reproduce part of its training data precisely, even though it was never explicitly stored — because the model memorised the pattern so thoroughly it can reconstruct it on demand.
This guide focuses on supervised learning. Training iteratively presents data to the model, compares its predictions with the true values, and adjusts the model's parameters — categories here are defined by what the model does when a prediction is made, not by the learning algorithm's name.
A quick-reference view only — always read the full category text below before making a decision.
Low risk Medium risk High risk
| Category | Explicit extraction |
Small-group reporting |
Class disclosure |
Low DoF |
Membership Inference |
Attribute Inference |
Model Inversion |
Jail- breaking |
Compute cost |
|---|---|---|---|---|---|---|---|---|---|
| AStored-data comparison | ↑ | ||||||||
| BSequence-based / LLMs | ↑↑↑↑↑↑↑ | ||||||||
| C1Regression | ↑↑ | ||||||||
| C2Classification | ↑↑ | ||||||||
| C3Semi-structured outputs | ↑↑↑ |
Models that make predictions by directly comparing a new input to data retained from training.
By their nature, Category A models are vulnerable to extraction of explicitly stored data — regardless of whether they're predicting numbers (regression) or class labels (classification).
Instance-based / "lazy learner" models — simple, still widely used. A new prediction relies on proximity to data explicitly stored or embedded in the model. The classic example, 1-Nearest Neighbour, essentially asks "what's the label on the closest thing I've seen before?"
Kernel models — transform input records into a space defined by stored "kernels" (usually themselves defined via stored training examples), where the prediction task becomes easier.
The only real mitigation is pre-processing the input data so thoroughly that the TRE would be comfortable releasing it directly — for example, transforming it into a synthetic dataset via a Differentially Private embedding. This requires extensive documentation of the pre-processing pipeline and/or the processed dataset itself.
This mitigation does not, on its own, address class disclosure, small-group reporting or attribute inference — those must still be checked once the primary mitigation has been authorised, but it's not worth checking them beforehand.
Generative AI, foundation models, LLMs and vision transformers — models trained on sequences of tokens (words, image patches, video frames, genotype base-pairs, etc).
These models frequently implicitly contain embedded data that is hard to test for, because they typically:
Foundation models are pre-trained on a task that needs no manual labels (predicting the next token, or removing noise from an image), learning a re-usable embedding. It's vital to be clear from the start which scenario applies:
Import a pre-trained model, add a new "head", and train only the head — the rest of the foundation model is frozen. Only the head needs to be exported and risk-assessed; it can be treated as a simple regression or classification model. It helps to ask researchers to separate their code into a preprocessing function (the unchanged "body") and a prediction function (the "head").
Import a pre-trained model, add a new head, then adapt both the head and the body's weights. Both parts could now be memorising training data, so the full model needs assessing.
Train a foundation model from scratch and export it. The full model needs assessing, and it is highly unlikely to be feasible to run shadow-model Membership Inference testing given the scale involved.
It's often unclear what data a foundation model was pre-trained on — including dataset bias, copyright and licensing questions the TRE must resolve before hosting it. Because these models are deep neural networks, they are highly likely to contain some of their pre-training data internally.
For Scenarios 2 and 3, small-group reporting and class disclosure can usually be measured without retraining. Membership Inference testing requires training several "shadow" models of similar complexity on slightly different datasets — feasibility depends entirely on how long the original model took to train: it may be possible for Scenario 2 depending on data size and epochs, but is highly unlikely for Scenario 3.
A recent US NIH directive states that generative AI trained or fine-tuned on confidential data should be treated as a data derivative and not released. In line with this, for Scenarios 2 and 3 the current recommendation is mitigation via model query controls — i.e. not releasing the model itself — rather than attempting full disclosure testing.
A generally lower-risk group — data isn't explicitly stored — though in some circumstances specific groups of records can still leak. Sub-grouped by output type: numerical (regression), class probabilities (classification), or semi-structured.
Predict a continuous numeric value rather than a probability — how much or how long, rather than how likely.
Examples across domains: estimating air pollutant levels, predicting reoffending risk, forecasting hospital stay duration, analysing drug response. Risks and mitigations broadly mirror well-established linear/logistic/logit regression practice.
The principal risk is a model specified so completely that part of it effectively describes a small group of records — manifesting as low residual degrees of freedom. Where a model implicitly or explicitly performs piece-wise regression, check each sub-group's size (are some output values only predicted for a handful of training records?). Class disclosure risk mainly arises when a model predicts levels of two or more variables.
Assign an input to one of a predefined set of two or more categories — often with a probability attached to each option.
Examples: spam filtering, vehicle-type recognition, election-voting prediction, or linking genetic/health records to disease diagnoses. Includes simple approaches like logistic regression, but classification can be produced by almost any supervised ML algorithm.
KNN and SVMs can technically produce classifiers, but because they embed training data they are treated under Category A for disclosure control purposes, not here.
Because many classification models partition the input space and report class
probabilities within each partition, they're little different from human-designed groupings such as tables —
so small-group reporting and class disclosure apply, and can be checked with tools such as
sacroml.attack.StructuralAttack().
Unlike humans (who tend to use round-number groupings, e.g. age bands of 10-19, 20-29), ML-driven partitions are shaped by the data itself, and so can reflect individual records — making even simple classifiers potentially vulnerable to membership inference, attribute inference (for known members), and model inversion.
This is an active research area. The current best practice is to use a tool such as sacroml to run a series of "worst-case scenario" attacks and estimate an upper bound on vulnerability.
Outputs more flexible than a fixed table but more organised than free text — lists, key-value pairs, JSON, ranked lists, label sequences, or probability distributions.
Examples: labelling specific regions of an image, or extracting names and dates from documents — output that is machine-readable and can reveal hidden patterns or relationships without predefined categories. Often used as an input to other, more structured ML (e.g. descriptors of a segmented "region of interest" feeding into vision-based quality control or medical diagnosis).
Regions of interest may relate to only one record, or to records from a specific group of people — so the learned "feature detectors" may in fact be memorising aspects of individual records.
For most of these risks, the best mitigation is to run and report adversarial attacks that attempt to replicate what a real adversary might do.
This page summarises "Types of risks and possible mitigations associated with different categories of machine learning models" (Smith & Crespi Boixader, v0.3, Sep 2025) — a counterpart to the statbarns taxonomy for traditional TRE outputs.