privacy-preserving ml
**Privacy-Preserving Machine Learning (PPML)** encompasses **techniques that enable training and inference on sensitive data without exposing the raw data itself** — addressing the fundamental tension between ML's hunger for data and legal/ethical requirements to protect privacy (GDPR, HIPAA, CCPA), through five major approaches: Federated Learning (data never leaves user devices), Differential Privacy (mathematical noise guarantees), Homomorphic Encryption (compute on encrypted data), Secure Multi-Party Computation (joint computation without data sharing), and Trusted Execution Environments (hardware-isolated processing).
**Why Privacy-Preserving ML?**
- **Definition**: A family of techniques that enable useful machine learning while providing formal guarantees that individual data points cannot be recovered, identified, or linked back to specific users.
- **The Tension**: ML models need data to train. Healthcare needs patient records. Finance needs transaction histories. But sharing this data violates privacy laws, erodes trust, and creates breach liability. PPML resolves this by enabling learning without raw data exposure.
- **Regulatory Drivers**: GDPR (Europe) — fines up to 4% of global revenue for data mishandling. HIPAA (US healthcare) — criminal penalties for patient data exposure. CCPA (California) — consumer right to deletion and non-sale of data.
**Five Major Approaches**
| Technique | How It Works | Privacy Guarantee | Performance Impact | Maturity |
|-----------|-------------|-------------------|-------------------|----------|
| **Federated Learning** | Train on-device, share only gradients to central server | Data never leaves device | Moderate (communication overhead) | Production (Google, Apple) |
| **Differential Privacy (DP)** | Add calibrated noise to data or gradients | Mathematical (ε-DP proves indistinguishability) | Moderate (noise reduces accuracy) | Production (Apple, US Census) |
| **Homomorphic Encryption (HE)** | Compute directly on encrypted data | Cryptographic (data never decrypted) | Severe (1000-10,000× slower) | Research/early production |
| **Secure Multi-Party Computation** | Split data among parties who compute jointly | Cryptographic (no party sees others' data) | High (communication rounds) | Research/early production |
| **Trusted Execution Environments** | Process data inside hardware enclaves (Intel SGX, ARM TrustZone) | Hardware isolation (OS cannot access enclave memory) | Low (near-native speed) | Production (Azure Confidential) |
**Federated Learning**
| Step | Process |
|------|---------|
| 1. Server sends model to devices | Global model distributed to phones/hospitals |
| 2. Local training | Each device trains on its local data |
| 3. Share gradients (not data) | Only model updates sent to server |
| 4. Aggregate | Server averages gradients (FedAvg algorithm) |
| 5. Repeat | Improved global model sent back |
**Used by**: Google (Gboard keyboard predictions), Apple (Siri, QuickType), healthcare consortia.
**Differential Privacy**
| Concept | Description |
|---------|------------|
| **ε (epsilon)** | Privacy budget — lower ε = more privacy, more noise, less accuracy |
| **DP-SGD** | Clip per-sample gradients + add Gaussian noise during training |
| **Trade-off** | ε=1 (strong privacy, ~5% accuracy loss) vs ε=10 (weak privacy, ~1% loss) |
**Used by**: Apple (emoji usage stats), US Census Bureau (2020 Census), Google (RAPPOR for Chrome).
**Privacy-Preserving Machine Learning is the essential bridge between ML's data requirements and society's privacy expectations** — providing formal mathematical and cryptographic guarantees that sensitive data cannot be reconstructed from model outputs, enabling healthcare AI without exposing patient records, financial ML without sharing transaction data, and personalized AI without compromising individual privacy.