Downloads · 30 days
73
4% of all-time downloads
hdlm-group/hdlm-base-gamma-0.01
hdlm-base-gamma-0.01 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
73
4% of all-time downloads
All-time downloads
2K
Public
Parameters
169M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin678 MB · 50%
From the Hugging Face model README
This is the model card for dlm-group/hdlm-base-gamma-0.01.
HDLM-Gamma is a hybrid diffusion language model that unifies autoregressive and diffusion-based sequence generation through gamma-hybrid noising. This model interpolates transition operators between absorbing and uniform processes, making it conceptually closer to SEDD (Lou et al. 2024) while maintaining the benefits of both paradigms.
The gamma parameter (γ) controls the blend between absorbing and uniform transition matrices: Q_gamma = (1-γ) * Q_absorb + γ * Q_uniform, where smaller values emphasize the absorbing process and larger values incorporate more uniform transitions.
from hdlm.hf_utils import smart_model_loader
from hdlm.gamma_hybrid.sampling import get_sa_sampling_fn
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-gamma-0.01",
model_type="auto", # automatically detects gamma_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)
# Configure sampling function (automatically set up from config)
sampling_fn = get_sa_sampling_fn(
config=cfg,
graph=None, # Will be created from config
noise=None, # Will be created from config
meta_schedule=metaschedule,
batch_dims=(1,),
eps=1e-4,
device=device
)
# Generate samples
generated = sampling_fn(
model=model,
prompt=prompt_ids,
context_length=1024
)
# 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-gamma-0.01 \
--sampling_method SAR \
--save_samples
# Perplexity evaluation
python hdlm/eval_modeling.py \
--checkpoint_path hdlm-group/hdlm-base-gamma-0.01 \
--work_dir "./logs/eval_modeling_gamma" \
--dataset ptb
The QGamma graph combines absorbing and uniform transition matrices:
The model uses staggered score computation that applies different transformations to absorbing and uniform branches before combining them, enabling more flexible generation patterns.
Available gamma 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.