Skip to main content

JAX-Privacy: Algorithms for Privacy-Preserving Machine Learning in JAX

| Docs | Overview | Paper | Citing | Contact

JAX-Privacy is a library designed to simplify the deployment of robust and performant mechanisms for differentially private (DP) machine learning in JAX. Guided by design principles of usability, flexibility, and efficiency, it provides modular, verified primitives alongside high-level training APIs for both researchers requiring deep customization and practitioners seeking an out-of-the-box experience.

For installation instructions, examples, and full API documentation, please visit the JAX Privacy documentation or read the accompanying paper.

Scope and Design Philosophy

JAX Privacy is a general-purpose Python library for differentially private machine learning, with a focus on DP-SGD-style mechanisms. Rather than implementing task-specific end-to-end pipelines, it provides both high-level training APIs (training.py and the Keras API) and lower-level, composable building blocks that integrate into any JAX training loop. For a detailed walkthrough of the five core building blocks and the three API tiers, see the Library Overview.

What Is in Scope

  • Composable DP-SGD Ingredients: Pure Python/JAX modules for per-example gradient clipping, independent and correlated noise addition (including matrix factorization), batch selection strategies, privacy accounting, and empirical auditing.
  • Modality- and Model-Agnostic Computation: JAX Privacy works with any JAX model and dataset format. It does not need to know whether you are working with tabular data, sequence data, image data, or text; the only thing it cares about is that your inputs are PyTrees of JAX arrays with a leading batch axis.
  • Zero Framework Lock-In: JAX Privacy intentionally does not bring in any neural network or data-loading framework dependencies beyond core JAX (along with optax and dp-accounting), keeping it lightweight and compatible with any JAX ecosystem stack.

What Is Out of Scope

  • Models and Data Loaders: Defining model architectures, tokenizers, and data loaders is out of scope for the library.
  • Domain-Specific End-to-End Pipelines: Task-specific workflows such as "DP Fine-Tuning of Language Models" or "DP Synthetic Data Generation" are not part of the core library, though users can easily use JAX Privacy to build them (see companion libraries like DPSynth).
  • Binaries and Surrounding Infrastructure: As a library, JAX Privacy consists purely of importable Python code and does not house standalone production binaries, job orchestration, or serving infrastructure. Runnable scripts and binaries demonstrating how to use the library live in a dedicated examples/ directory.

How to Cite This Repository

If you use JAX-Privacy in your work, please cite the accompanying paper:

@article{mckenna2026jaxprivacy,
  author = {McKenna, Ryan and Andrew, Galen and Balle, Borja and
Doroshenko, Vadym and Ganesh, Arun and Kong, Weiwei and Kurakin, Alex and
McMahan, Brendan and Pravilov, Mikhail},
  title = {{JAX}-{P}rivacy: A library for differentially private machine learning},
  journal = {arXiv preprint arXiv:2602.17861},
  url = {https://arxiv.org/abs/2602.17861},
  year = {2026},
}

To cite the software repository directly:

@software{jax-privacy2022github,
  author = {Balle, Borja and Berrada, Leonard and Charles, Zachary and
Choquette-Choo, Christopher A and De, Soham and Doroshenko, Vadym and Dvijotham,
Dj and Galen, Andrew and Ganesh, Arun and Ghalebikesabi, Sahra and Hayes, Jamie
and Kairouz, Peter and McKenna, Ryan and McMahan, Brendan and Pappu, Aneesh and
Ponomareva, Natalia and Pravilov, Mikhail and Rush, Keith and Smith, Samuel L
and Stanforth, Robert and Mishra, Chaitanya},
  title = {{JAX}-{P}rivacy: Algorithms for Privacy-Preserving Machine Learning in JAX},
  url = {http://github.com/google-parfait/jax_privacy},
  version = {2.5.0},
  year = {2026},
}

Contact

If you have any questions or feedback, you can contact us via email: jax-privacy-open-source@google.com.

Acknowledgements

License

All code is made available under the Apache 2.0 License. Model parameters are made available under the Creative Commons Attribution 4.0 International (CC BY 4.0) License.

See https://creativecommons.org/licenses/by/4.0/legalcode for more details.

Disclaimer

This is not an official Google product.

Metadata

Release files for jax-privacy 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jax-privacy 2.5.0
File Size Uploaded Provenance Actions
jax_privacy-2.5.0.tar.gz 173.9 kB Without provenance Details for jax_privacy-2.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jax-privacy 2.5.0
File Interpreter ABI Platform Actions
jax_privacy-2.5.0-py3-none-any.whl Python 3 none any Details for jax_privacy-2.5.0-py3-none-any.whl

Total release size: 376.5 kB

Release files / jax_privacy-2.5.0.tar.gz

Download URL jax_privacy-2.5.0.tar.gz
Size 173.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c6bd6ac30903d083d66fad5f7c0bd09bdca9ba5829ff9fdb4451f59699e4c869
BLAKE2b-256 checksum
How to use checksums
9c7b1ebdeb0ea5c6b76f71700bb9e4d4ab7b81ce149f84af561832892071e3aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / jax_privacy-2.5.0-py3-none-any.whl

Download URL jax_privacy-2.5.0-py3-none-any.whl
Size 202.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1514d270f5bf233a658562a4fc0ced48ca6b099b5dea7c5920ed396b0f2f591
BLAKE2b-256 checksum
How to use checksums
dc602523f705a076f604debace3261e98bcb7efa54249b1f7b2ba3380c6b58c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for jax-privacy 2.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page