Discrete Denoising Diffusion Probabilistic Models in MLX
Project description
d3pm
Discrete denoising diffusion probabilistic models in MLX
d3pm is a small library for discrete denoising diffusion probabilistic models (D3PM) in
MLX.
[!IMPORTANT]
🚀 DiffusionGemma
🔥
d3pmnow features a 💎 DiffusionGemma 💎 example. DiffusionGemma trains ontiny_shakespeareand generates text in a block-autoregressive fashion with a Gemma-4 MoE backbone, uniform (mask-free) diffusion, self-conditioning, and D-CFG guidance. It supports prompt-conditioned generation via causal prompt prefill with bidirectional denoising.
Examples
Self-contained examples can be found in examples.
Installation
To install the latest GitHub , just call the following on the command line:
pip install git+https://github.com/dirmeier/d3pm-mlx@<RELEASE>
Please do not directly install from the main branch, since these commits are not tested, but prefer using PyPI or a stable release.
Contributing
Contributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled good first issue.
In order to contribute:
-
Clone
d3pm-mlxand installuvfrom here. -
Install all dependencies using
uv sync --all-groups. -
Install the Git hooks:
uv run pre-commit install -t pre-commit -t commit-msg
-
Create a new branch locally, e.g.
git checkout -b feature/my-new-feature. -
Implement your contribution and ideally a test case.
-
Check your work (see below).
-
Submit a PR 🙂.
Development commands
The project uses uv for everything:
uv sync --all-groups
uv run ruff format src examples
uv run ruff check --fix src examples
uv run mypy src examples
uv run pre-commit run --all-files
References
- Arriola et al., Block Diffusion: Interpolating Between Autoregressive and Diffusion Language Models (BD3LM), 2025.
- Schiff et al., Simple Guidance Mechanisms for Discrete Diffusion Models (UDLM), 2024.
- Sahoo et al., The Diffusion Duality (Duo), 2025.
- Sahoo et al., Simple and Effective Masked Diffusion Language Models (MDLM), 2024.
- Lou et al., Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution (SEDD), 2024.
- Austin et al., Structured Denoising Diffusion Models in Discrete State-Spaces (D3PM), 2021.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file d3pm-0.0.1.tar.gz.
File metadata
- Download URL: d3pm-0.0.1.tar.gz
- Upload date:
- Size: 99.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfec8df61b0c5714751efacc7346b331a7dd06915f453ce7762b7eef77092c0f
|
|
| MD5 |
e2cd692ea9c772b79a614dbe4af9a194
|
|
| BLAKE2b-256 |
fecd232ff87025f65fdbf027f40acb89419aa0cb91f8e7898f57976bff66aa0b
|
File details
Details for the file d3pm-0.0.1-py3-none-any.whl.
File metadata
- Download URL: d3pm-0.0.1-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d8ca808fabb6b16f4235e674853d56fe35d351dfdc926ce794dcdd4a4a86b7
|
|
| MD5 |
9c12402f74765d8df38b1fb11b962735
|
|
| BLAKE2b-256 |
bd64681c9ba238a9b4f87d215d23e750c3ddf11927698e67162720917d1dea01
|