Privacy-preserving machine learning (PPML) is the set of techniques that allow models to be trained, evaluated and queried without exposing the personal data they learn from or process. In AI privacy, PPML addresses two separate risks: that raw data is seen by parties who should not see it, and that a finished model leaks information about individuals through its parameters or outputs.
PPML is not a single algorithm. It combines statistical guarantees such as differential privacy, cryptographic methods such as homomorphic encryption and secure multiparty computation, architectural choices such as federated learning, and hardware isolation in trusted execution environments. Practitioners select a combination based on the threat model, the accuracy budget and the computational cost they can accept.
What privacy-preserving machine learning protects against
PPML begins with a clear threat model: who might learn what, and at which stage of the machine learning pipeline. Data can leak while it is collected and pooled, while a model is trained, or after deployment when attackers query the model. Each stage requires different protective techniques, and a defense at one stage does not cover the others.
The table below maps the main attacks studied in AI privacy to the information they expose.
| Attack | What the attacker learns | Typical access needed |
|---|---|---|
| Membership inference attack | Whether a record was in the training set | Query access to the model |
| Model inversion attack | Representative features of a class or person | Query access or model weights |
| Attribute inference attack | Hidden attributes of a known individual | Partial record plus model outputs |
| Training data extraction | Verbatim memorized text or images | Repeated prompting of a generative model |
| Gradient leakage | Reconstructed inputs from shared updates | Access to updates in distributed training |
These attacks exploit model memorization, the tendency of large models to store rare or repeated training examples. Overfitting, small datasets and outliers in the training data increase this risk, which is why privacy and generalization are closely linked.
Core techniques and how they work
Differential privacy provides a mathematical bound on how much any single record can influence a result. In model training, the common method is DP-SGD, which clips each example’s gradient and adds calibrated Gaussian noise before the update. The guarantee is expressed by the privacy budget epsilon, where smaller values mean stronger protection and usually lower accuracy.
Federated learning keeps raw data on user devices or within separate institutions and sends only model updates to a coordinating server. On its own it is not a formal privacy guarantee, because updates can leak information, so production systems combine it with secure aggregation and differential privacy.
Cryptographic techniques protect data during computation itself. Homomorphic encryption allows arithmetic on encrypted values, secure multiparty computation splits a computation among parties so that none sees the others’ inputs, and trusted execution environments run code inside hardware-isolated enclaves whose memory is encrypted.
The following table summarizes what each technique protects and what it costs.
| Technique | Protects | Main cost | Typical use |
|---|---|---|---|
| Differential privacy | Outputs and trained models | Accuracy loss at strict budgets | Statistics, DP-SGD training |
| Federated learning | Raw data location | Communication and heterogeneity | Keyboards, hospitals, banks |
| Homomorphic encryption | Data during computation | Large compute overhead | Encrypted inference on small models |
| Secure multiparty computation | Inputs of each party | Network rounds and latency | Joint models across organizations |
| Trusted execution environments | Data and code in use | Trust in hardware vendor | Confidential AI in the cloud |
| Synthetic data | Direct identifiers in shared datasets | Utility loss, residual leakage | Testing and data sharing |
Privacy budgets, accuracy and cost trade-offs
Every PPML method trades privacy against utility and efficiency. With differential privacy, an epsilon below 1 gives strong protection but can reduce accuracy noticeably on small datasets, while values between about 1 and 10 are common in deployed systems. There is no universal safe value; the meaning of epsilon depends on the unit of privacy, such as one record, one user or one device.
Cryptographic methods preserve accuracy but impose overhead. Fully homomorphic encryption can be several orders of magnitude slower than plaintext computation, which limits it to small models or narrow inference tasks. Trusted execution environments run close to native speed but shift trust to the hardware vendor and attestation process.
The decision table below shows how these trade-offs guide technique selection.
| Situation | Recommended approach | Reason |
|---|---|---|
| Data cannot leave devices | Federated learning with secure aggregation | Raw data stays local |
| Model will be published | DP-SGD with a documented epsilon | Limits membership inference |
| Several firms pool data | Secure multiparty computation | No party sees others’ inputs |
| Cloud inference on sensitive prompts | Trusted execution with attestation | Low overhead and verifiable isolation |
| Dataset shared for testing | Differentially private synthetic data | Reduces direct re-identification risk |
Relationship to neighboring AI privacy concepts
PPML is an umbrella under which several narrower practices sit. PII redaction removes direct identifiers before training but does not stop memorization of quasi-identifiers. Machine unlearning tries to remove a record’s influence after training, whereas PPML aims to limit that influence from the start. Policies such as zero data retention or a training opt-out govern what data enters the pipeline, while PPML governs how safely it is processed.
Confidential AI services, such as private cloud compute designs announced by large platform providers, represent the hardware-isolation branch of PPML applied to inference. They protect prompts in use, yet they do not by themselves prevent a model from memorizing data it was trained on.
Limitations and common mistakes
PPML reduces risk but rarely eliminates it, and misapplied techniques create a false sense of protection. Regulators under the GDPR and similar laws assess whether residual risk is acceptable, so claims must be backed by measurable guarantees and testing.
- Treating federated learning as anonymization. Gradient updates can reveal inputs without additional safeguards.
- Reporting epsilon without context. A budget means little unless the unit of privacy and the accounting method are stated.
- Ignoring repeated releases. Privacy loss accumulates across queries and model versions.
- Assuming synthetic data is anonymous. Generators trained without differential privacy can reproduce real records.
- Skipping empirical audits. Membership inference tests help confirm that a theoretical guarantee holds in practice.
In plain words
Machine learning systems learn from large amounts of data, and that data is often about real people. Privacy-preserving machine learning is a toolbox of methods that let a system learn general patterns without learning secrets about any one person.
Think of a survey where each answer gets a little random blur before it is counted. The overall picture stays clear, but no single answer can be traced back. Other methods keep the data at home and send only lessons learned, or do the math while the data stays locked. The key idea is that useful AI does not require exposing individuals.
A real-world example
Five regional hospitals want to train a model that predicts sepsis risk from patient vital signs, but privacy law and patient trust prevent them from pooling records in one database. They choose federated learning with secure aggregation, so each hospital trains locally and the coordinating server only sees the combined update from all sites.
To protect patients against inference from the final model, the team adds DP-SGD with a privacy budget of epsilon 3 at the patient level. Accuracy drops by about two percentage points compared with a non-private baseline, which clinicians accept. Before release, an internal team runs membership inference tests and finds the attack performs close to random guessing, giving the hospitals documented evidence for their data protection impact assessment.