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)
Table 1: Throughput, measured as examples processed per second (higher is better), for training loops implemented with JAX-Privacy, JAX, Opacus, and PyTorch, on standard model architectures. Relative throughput compared to JAX is shown in parentheses.
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
Appendix
Table 2: Comparison of major differentially private machine learning libraries. JAX-Privacy distinguishes itself through a purely functional design that leverages XLA for seamless compilation on TPUs and GPUs, avoiding the complexity of backward hooks used in PyTorch-based solutions.
Differential privacy (DP) in machine learning is typically achieved by adding noise to model parameters (private learning) or to model outputs (private prediction). Recent work uses formal methods, namely abstract interpretation, to provide tighter privacy guarantees, but only for private prediction in classification settings. In this work, we investigate the use of formal methods as a general tool for tighter privacy analysis. First, we generalize the abstract gradient training (AGT) framework to private prediction in continuous, unbounded regression. Second, by reducing learning in parameterized models to a regression problem over the parameter space, we introduce Abstract Gradient Sampling (AGS), an algorithm that enables reachability-based analysis to provide guarantees for private learning. In both private prediction and private learning, we provide tightened privacy accounting for the AGT framework and a theoretical analysis demonstrating when our smooth sensitivity upper-bounds yield favourable privacy-utility trade-off. In practice, we validate that our regression bounds are tighter than global-sensitivity baselines on regression benchmarks, and, notably, yield the first finite privacy guarantees in settings where global prediction sensitivity is a priori unbounded. We also find that under matched conditions, our private learning algorithm can outperform standard private learners.
Mihnea Ghitu, Matthew Wicker
Department of Computing Imperial College London London, United Kingdom
Differential privacy (DP) has become the gold standard for ensuring the privacy protection of machine learning and statistical algorithms in recent decades. A plethora of algorithms and methods have been developed to enhance the utility of DP algorithms while maintaining the same level of DP. However, these are often overly complex or computationally ineffective. We propose a novel approach focusing on denoising the output of the simple additive Gaussian mechanism by adopting the idea of empirical Bayes estimation. We highlight that the empirical Bayes approach can reduce the mean-squared error solely by taking the output of the Gaussian mechanism as input. Our numerical studies show that this simple yet powerful approach can be applied to improve upon various statistical problems, including histogram release, principal component analysis, and linear regression, often outperforming existing private algorithms.
Minwoo Kim, Junyong Park, Sungkyu Jung
Department of Statistics Seoul National University Seoul, 08826, South Korea · Department of Statistics and Institute for Data Innovation in Science Seoul National University Seoul, 08826, South Korea
Differential privacy (DP) has traditionally been used to provide theoretical upper bounds on an algorithm's stability to changing its training data. In modern private machine learning applications, achieving strong tradeoffs between utility and theoretical privacy is challenging, and thus one may optimistically hope that existing theoretical privacy analyses are loose. Recent work on privacy auditing has adopted a dual viewpoint, instead lower bounding the true privacy of an algorithm by constructing empirical distinguishing events. The auditing literature has thus far yielded a pessimistic outlook on the looseness of theoretical privacy bounds for DP-SGD, the de facto private training method in modern ML, as nearly-matching empirical lower bounds have been achieved under various threat models [NHSBTJCT23, AC24, CBP25]. In this work, we propose the empirical privacy lower bound of an algorithm as a concrete metric to optimize for, complementary to the theoretical upper bound. We give a lightweight defense framework that generically augments optimization methods in the ML pipeline to have significantly-improved empirical privacy on standard benchmarks. Moreover, we show that our framework comes at no theoretical privacy cost when augmenting DP-SGD, unlike previously-proposed defenses against membership inference attacks. We evaluate our defense against a broad range of audit constructions, models, and datasets to demonstrate its flexibility.
Saloni Modi, Srivi Balaji, Yusong Zhu +2
University of Texas at Austin · University of Waterloo and Vector Institute