Privacy-Preserving Machine Learning
The core tension: models need data, but data has owners
A model's usefulness is bounded by the data it learns from, but that data often belongs to people who have a legitimate interest in it not being exposed, memorized, or reverse-engineered from the model's behavior. Simply anonymizing data by stripping obvious identifiers is weaker protection than it sounds — re-identification attacks that cross-reference anonymized datasets with other public data have repeatedly shown that 'anonymous' data can often be traced back to individuals. Privacy-preserving machine learning is the set of techniques designed to provide much stronger, often mathematically provable, guarantees that training or serving a model doesn't leak the sensitive data behind it.
Differential privacy: provable bounds on what a model can reveal
Differential privacy adds carefully calibrated statistical noise to a computation — a training gradient update, an aggregate statistic — such that the output's distribution is nearly indistinguishable whether or not any single individual's data was included. This gives a formal, quantifiable privacy guarantee (controlled by a parameter typically called epsilon, where smaller epsilon means stronger privacy and more noise) rather than a vague promise of anonymization. In ML, differential privacy is most commonly applied during training via DP-SGD (differentially private stochastic gradient descent), which clips and noises per-example gradients before they're aggregated into a model update, bounding how much any single training example can influence the final model.
The cost is real: more noise means stronger privacy but typically lower model accuracy, and tuning the privacy budget against acceptable accuracy loss is a genuine engineering tradeoff, not a free guarantee.
Secure aggregation and federated learning
Federated learning trains a shared model across many devices or data silos without any raw data ever leaving its source — each participant computes a local model update on its own data and sends only that update (not the data) to a central coordinator, which aggregates updates from many participants into an improved global model. This is useful whenever data is naturally distributed and sensitive (e.g., data on individual mobile phones, or data siloed across different hospitals that can't share patient records directly).
Secure aggregation strengthens federated learning further by using cryptographic protocols so that the central coordinator only ever sees the sum (or another aggregate) of many participants' updates, never any individual participant's update in isolation — protecting against the coordinator itself trying to infer something about one participant from their update.
Homomorphic encryption: computing on encrypted data
Homomorphic encryption allows certain mathematical operations to be performed directly on encrypted data, producing an encrypted result that, when decrypted, matches what you'd have gotten from performing the same operations on the plaintext — meaning a model could, in principle, run inference on a user's encrypted input and return an encrypted prediction without the serving infrastructure ever seeing the input or output in plaintext. Fully homomorphic encryption supports arbitrary computation but remains computationally expensive enough (often orders of magnitude slower than plaintext computation) that it's typically reserved for the most sensitive use cases rather than general-purpose serving, while partially homomorphic schemes support a narrower set of operations more efficiently.
Privacy-preserving ML techniques compared
| Technique | What it protects | Main cost | Typical use case |
|---|---|---|---|
| Differential privacy | Individual contribution to model/statistics | Accuracy loss from added noise | Training on sensitive aggregate data |
| Federated learning | Raw data staying on-device/on-site | Communication overhead, uneven data quality | Mobile devices, siloed institutional data |
| Secure aggregation | Individual updates from the coordinator | Cryptographic/computation overhead | Federated learning with an untrusted coordinator |
| Homomorphic encryption | Input/output data during computation itself | Very high compute overhead | Highly sensitive inference (health, finance) |
Note
Note
What's next
Privacy-preserving training techniques close the loop on treating ML systems as trustworthy end to end — from the data they're built on, through how they're deployed, monitored, and defended. Revisit Model Explainability: SHAP & LIME or ML Security: Adversarial Attacks to see how these privacy guarantees interact with the broader trust and safety picture around a production model.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.