Instructions to use kekchpek/idlm-duo-tynigsm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kekchpek/idlm-duo-tynigsm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kekchpek/idlm-duo-tynigsm", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("kekchpek/idlm-duo-tynigsm", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kekchpek/idlm-duo-tynigsm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kekchpek/idlm-duo-tynigsm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kekchpek/idlm-duo-tynigsm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kekchpek/idlm-duo-tynigsm
- SGLang
How to use kekchpek/idlm-duo-tynigsm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "kekchpek/idlm-duo-tynigsm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kekchpek/idlm-duo-tynigsm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "kekchpek/idlm-duo-tynigsm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kekchpek/idlm-duo-tynigsm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kekchpek/idlm-duo-tynigsm with Docker Model Runner:
docker model run hf.co/kekchpek/idlm-duo-tynigsm
IDLM-Duo TinyGSM
IDLM-Duo TinyGSM is an Inverse-distilled Diffusion Language Model distilled from a pretrained Duo-style TinyGSM teacher checkpoint. It is released with the paper IDLM: Inverse-distilled Diffusion Language Models.
IDLM extends inverse distillation to discrete token spaces. Instead of running a pretrained diffusion language model for many reverse-diffusion steps, IDLM trains a few-step student generator using an auxiliary fake model and the teacher diffusion objective. This checkpoint targets conditional mathematical reasoning on TinyGSM-style question-answer examples.
- Project page: https://david-cripto.github.io/idlm-project-page/
- Code: https://github.com/David-cripto/IDLM
- Paper: https://arxiv.org/abs/2602.19066
- TinyGSM dataset: https://huggingface.co/datasets/TinyGSM/TinyGSM
- Teacher/evaluation reference: https://github.com/jdeschena/s-flm
Model Details
- Model family: IDLM, discrete diffusion language model
- Teacher checkpoint: Duo TinyGSM checkpoint from the S-FLM repository
- Diffusion type: uniform-state / Duo-style diffusion
- Training data: TinyGSM conditional question-answer examples
- Tokenizer:
HuggingFaceTB/SmolLM-135Mtokenizer with an added[PAD]token - Context length: 512 tokens
- Vocabulary size: 49,153 tokens
- Parameters: 167,928,865
- Tensor type: F32 Safetensors
- Architecture config: 12 blocks, 12 heads, hidden size 768, conditioning dimension 128, dropout 0.1
- Checkpoint files:
model.safetensorscontains the EMA backbone used for evaluation;idlm-duo-tynigsm.ckptcontains the PyTorch Lightning checkpoint
Intended Use
This checkpoint is intended for research on diffusion language models, inverse distillation, and few-step sampling.
Installation
The IDLM sampling and evaluation 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
Loading the Lightning Checkpoint
The full Lightning checkpoint can be inspected directly:
import torch
checkpoint = torch.load(
"idlm-duo-tynigsm.ckpt",
map_location="cpu",
)
print(checkpoint.keys())
print(next(iter(checkpoint["state_dict"])))
Evaluation
We report performance on conditional generation on GSM8K using the TinyGSM/GSM8K protocol from S-FLM. Each problem is sampled once, the generated solution is scored with the execution-based TinyGSM/GSM8K scorer, and the reported metric is exact-match accuracy against the GSM8K ground-truth answer.
| Model | Sampling steps | Accuracy (%) |
|---|---|---|
| Duo teacher | 1024 | 17.2 |
| IDLM-Duo | 32 | 15.39 |
| IDLM-Duo | 64 | 19.03 |
| IDLM-Duo | 128 | 21.38 |
Training Summary
IDLM-Duo was trained by initializing the student and fake model from the pretrained Duo teacher and alternating between:
- Updating the fake model on student-generated samples using the teacher diffusion loss.
- Updating the student using the teacher-fake loss gap.
The Duo setting uses a Gaussian relaxation and soft token inputs for stable backpropagation through the diffusion objective.
Citation
@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}
}
- Downloads last month
- 876
Model tree for kekchpek/idlm-duo-tynigsm
Base model
jdeschena/s-flm