Downloads · 30 days
50
15% of all-time downloads
hdlm-group/hdlm-base-epsilon-0.0
hdlm-base-epsilon-0.0 is a text generation model from hdlm-group. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
[](https://arxiv.org/abs/2504.06416) [](https://github.com/ServiceNow/hdlm)
Downloads · 30 days
50
15% of all-time downloads
All-time downloads
342
Public
Parameters
162M
1.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin649 MB · 50%
From the Hugging Face model README
This model card is for the hdlm-base model with epsilon=0.0
HDLM-Epsilon is a hybrid diffusion language model that unifies autoregressive and diffusion-based sequence generation through epsilon-hybrid noising. This model interpolates evolution operators between absorbing and uniform processes, making it conceptually closer to MDLM (Sahoo et al. 2024) while maintaining the benefits of both paradigms.
The epsilon parameter (ε) controls the blend between absorbing and uniform processes during training, where smaller values emphasize the absorbing process and larger values incorporate more uniform noise.
from hdlm.hf_utils import smart_model_loader
from hdlm.epsilon_hybrid.sample import full_diff
from transformers import GPT2TokenizerFast
import torch
# Load model using smart loader (automatically detects model type)
model, cfg, device, accelerator, metaschedule = smart_model_loader(
model_path="hdlm-group/hdlm-base-epsilon-0.0",
model_type="auto", # automatically detects epsilon_hybrid
device="cuda"
)
# Load tokenizer
tokenizer = GPT2TokenizerFast.from_pretrained('gpt2')
# Generate text
prompt = "The future of artificial intelligence"
prompt_ids = tokenizer.encode(prompt, return_tensors='pt').to(device)
# Full diffusion sampling
generated = full_diff(
model=model,
prompt=prompt_ids,
batch_size=1,
alg='acs', # or 'original', 'remask', 'remdm'
steps=512,
temperature=1.0,
context_length=1024,
device=device
)
# Decode generated text
generated_text = tokenizer.decode(generated[0], skip_special_tokens=True)
print(generated_text)
# Text generation evaluation
python hdlm/eval_generation.py \
--checkpoint_path hdlm-group/hdlm-base-epsilon-0.0 \
--sampling_method full_diff \
--algorithm acs \
--save_samples
# Perplexity evaluation
python hdlm/eval_modeling.py \
--checkpoint_path hdlm-group/hdlm-base-epsilon-0.0 \
--work_dir "./logs/eval_modeling_epsilon" \
--dataset ptb
The model supports several sampling algorithms:
original: Standard diffusion samplingacs: Adaptive Correction Sampler with error correctionremask: Remasking strategy for improved qualityremdm: ReMDM-style sampling with probability mixingAvailable epsilon values and their characteristics:
@article{fathi2025unifying,
title={Unifying autoregressive and diffusion-based sequence generation},
author={Fathi, Nima and Scholak, Torsten and No{\"e}l, Pierre-Andr{\'e}},
journal={arXiv preprint arXiv:2504.06416},
year={2025}
}
This model is released under the same license as the original HDLM codebase. Please refer to the GitHub repository for license details.