Downloads · 30 days
75
20% of all-time downloads
kekchpek/idlm-mdlm
idlm-mdlm is a text generation model from kekchpek. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
IDLM-MDLM is an Inverse-distilled Diffusion Language Model distilled from the pretrained MDLM OpenWebText checkpoint. It is released with the paper IDLM: Inverse-distilled Diffusion Language Models.
Downloads · 30 days
75
20% of all-time downloads
All-time downloads
368
Public
Parameters
170M
679 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors679 MB · 99%
From the Hugging Face model README
IDLM-MDLM is an Inverse-distilled Diffusion Language Model distilled from the pretrained MDLM OpenWebText checkpoint. It is released with the paper IDLM: Inverse-distilled Diffusion Language Models.
Diffusion Language Models can produce high-quality text, but standard reverse diffusion requires many sampling steps. IDLM trains a few-step student generator from a pretrained DLM teacher using an inverse distillation objective with an auxiliary fake model. This checkpoint targets fast generation from an absorbing-state masked diffusion teacher.
kuleshov-group/mdlm-owtThis checkpoint is intended for research on discrete diffusion language models, few-step diffusion sampling, and reproduction of the IDLM paper experiments.
The sampling code depends on CUDA and FlashAttention.
git clone https://github.com/David-cripto/IDLM.git
cd IDLM
conda create -n idlm python=3.12
conda activate idlm
conda install nvidia/label/cuda-12.4.0::cuda-toolkit
pip install -r requirements.txt
pip install flash_attn==2.7.4.post1
The Hugging Face repository contains custom model code. Use trust_remote_code=True.
from transformers import AutoModelForMaskedLM, AutoTokenizer
model_id = "kekchpek/idlm-mdlm"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForMaskedLM.from_pretrained(
model_id,
trust_remote_code=True,
)
Direct AutoModelForMaskedLM loading exposes the denoising network. For text generation, use the sampler in the official IDLM repository.
mkdir -p samples
python -m main \
mode=sample_eval \
loader.batch_size=2 \
loader.eval_batch_size=8 \
data=openwebtext-split \
algo=mdlm \
algo.backbone=hf_dit \
eval.checkpoint_path=kekchpek/idlm-mdlm \
sampling.steps=16 \
sampling.num_sample_batches=10 \
sampling.predictor=ancestral_cache \
sampling.noise_removal=ancestral \
+wandb.offline=true \
eval.generated_samples_path=samples/idlm_mdlm_16steps.json
The generation script can be swept with different sampling steps.
The paper reports generation perplexity (GenPPL, lower is better) and sample entropy (higher is better) on OpenWebText-style generation. The released evaluation code defaults to gpt2-large for GenPPL.
| Sampling steps | GenPPL (lower is better) | Entropy (higher is better) |
|---|---|---|
| 32 | 20.37 | 5.23 |
| 16 | 32.74 | 5.42 |
| 8 | 79.42 | 5.61 |
| 4 | 310.38 | 5.78 |
For comparison, the MDLM teacher is reported at 1024 steps with GenPPL 41.29 and entropy 5.28.
IDLM-MDLM was trained by initializing the student and fake model from the pretrained MDLM teacher and alternating between:
This follows the inverse distillation objective described in the paper and uses the absorbing-state masked diffusion formulation.
@article{li2026idlm,
title={IDLM: Inverse-distilled Diffusion Language Models},
author={Li, David and Gushchin, Nikita and Abulkhanov, Dmitry and Moulines, Eric and Oseledets, Ivan and Panov, Maxim and Korotin, Alexander},
journal={arXiv preprint arXiv:2602.19066},
year={2026}
}