JAX-Privacy: A library for differentially private machine learning
Abstract
JAX-Privacy is a library designed to simplify the deployment of robust and performant mechanisms for differentially private machine learning. Guided by design principles of usability, flexibility, and efficiency, JAX-Privacy serves both researchers requiring deep customization and practitioners who want a more out-of-the-box experience. The library provides verified, modular primitives for critical components for all aspects of the mechanism design including batch selection, gradient clipping, noise addition, accounting, and auditing, and brings together a large body of recent research on differentially private ML.
Figures & tables
| JAX-Privacy | JAX | Opacus | PyTorch | ||
|---|---|---|---|---|---|
| CNN | Small | 31837.17 (0.50x) | 63898.91 (1.00x) | 8916.34 (0.14x) | 58820.44 (0.92x) |
| Medium | 2466.76 (0.48x) | 5180.58 (1.00x) | 510.19 (0.10x) | 5368.72 (1.04x) | |
| Large | 437.03 (0.41x) | 1057.17 (1.00x) | 182.84 (0.17x) | 1032.12 (0.98x) | |
| State Space | Small | 1326.49 (0.99x) | 1346.26 (1.00x) | 292.56 (0.22x) | 1532.19 (1.14x) |
| Medium | 323.50 (1.00x) | 322.28 (1.00x) | 51.89 (0.16x) | 363.28 (1.13x) | |
| Large | 51.57 (0.80x) | 64.25 (1.00x) | — | 57.55 (0.90x) |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Feature | TensorFlow Privacy | Opacus | JAX-Privacy |
|---|---|---|---|
| Base Framework | TensorFlow / Keras | PyTorch | JAX |
| Programming Model | Mixed (OO & Functional) | Object-Oriented | Purely Functional |
| Mechanism Logic | Optimizer Wrapper | nn.Module Hooks | vmap & grad transforms |
| Per-Example Gradients | Micro-batching / Fast Clip | Hooks + einsum | Automatic Vectorization |
| Memory Efficiency | XLA Optimization | Virtual Steps (Accumulation) | XLA Fusion (No Materialization) |
| Hardware Support | GPU & TPU | GPU (No Native TPU) | GPU & TPU |
Privacy-Preserving ML
Privacy-preserving machine learning develops methods to learn, share, and run models while limiting exposure of sensitive data.
See all 423 papers