Privacy-preserving machine learning

Also known as: PPML

On this page 7

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.

AttackWhat the attacker learnsTypical access needed
Membership inference attackWhether a record was in the training setQuery access to the model
Model inversion attackRepresentative features of a class or personQuery access or model weights
Attribute inference attackHidden attributes of a known individualPartial record plus model outputs
Training data extractionVerbatim memorized text or imagesRepeated prompting of a generative model
Gradient leakageReconstructed inputs from shared updatesAccess to updates in distributed training
Privacy attacks that PPML is designed to resist

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.

TechniqueProtectsMain costTypical use
Differential privacyOutputs and trained modelsAccuracy loss at strict budgetsStatistics, DP-SGD training
Federated learningRaw data locationCommunication and heterogeneityKeyboards, hospitals, banks
Homomorphic encryptionData during computationLarge compute overheadEncrypted inference on small models
Secure multiparty computationInputs of each partyNetwork rounds and latencyJoint models across organizations
Trusted execution environmentsData and code in useTrust in hardware vendorConfidential AI in the cloud
Synthetic dataDirect identifiers in shared datasetsUtility loss, residual leakageTesting and data sharing
Main PPML techniques compared

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.

SituationRecommended approachReason
Data cannot leave devicesFederated learning with secure aggregationRaw data stays local
Model will be publishedDP-SGD with a documented epsilonLimits membership inference
Several firms pool dataSecure multiparty computationNo party sees others’ inputs
Cloud inference on sensitive promptsTrusted execution with attestationLow overhead and verifiable isolation
Dataset shared for testingDifferentially private synthetic dataReduces direct re-identification risk
Choosing a PPML approach

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.