Improve model card: Add tags, links, introduction, and usage example
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,7 +1,55 @@
|
|
| 1 |
---
|
| 2 |
-
license: mit
|
| 3 |
base_model:
|
| 4 |
- GSAI-ML/LLaDA-8B-Instruct
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model:
|
| 3 |
- GSAI-ML/LLaDA-8B-Instruct
|
| 4 |
+
license: mit
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
library_name: transformers
|
| 7 |
---
|
| 8 |
|
| 9 |
+
# ESPO: Principled RL for Diffusion LLMs Emerges from a Sequence-Level Perspective
|
| 10 |
+
|
| 11 |
+
This repository contains Post-Training LoRA models on various tasks based on LLaDA-8B-Instruct, as presented in the paper [Principled RL for Diffusion LLMs Emerges from a Sequence-Level Perspective](https://huggingface.co/papers/2512.03759).
|
| 12 |
+
|
| 13 |
+
**ESPO (ELBO-based Sequence-level Policy Optimization)** is a principled reinforcement learning (RL) framework for diffusion Large Language Models (dLLMs). It addresses the fundamental challenges of adapting RL methods to dLLMs by treating the **entire sequence generation as a single action** and using the **ELBO** as a tractable sequence-level likelihood proxy. ESPO introduces per-token normalization of importance ratios and robust KL-divergence estimation for stable large-scale training, demonstrating significant performance improvements on mathematical reasoning, coding, and planning tasks.
|
| 14 |
+
|
| 15 |
+
* [Paper](https://huggingface.co/papers/2512.03759)
|
| 16 |
+
* [Code](https://github.com/ML-GSAI/ESPO)
|
| 17 |
+
* [Project Page](https://jingyangou.github.io/ESPO-Demo/)
|
| 18 |
+
|
| 19 |
+
## Checkpoints
|
| 20 |
+
We release ESPO-fine-tuned checkpoints built on LLaDA-8B-Instruct.
|
| 21 |
+
|
| 22 |
+
ESPO-Code is released as a full fine-tuned model (no LoRA). ESPO-GSM8K, ESPO-Math, ESPO-Countdown, and ESPO-Sudoku are provided as LoRA adapters, which can be loaded on top of the base LLaDA-8B-Instruct model for lightweight and efficient fine-tuning.
|
| 23 |
+
|
| 24 |
+
## Quick Start
|
| 25 |
+
```python
|
| 26 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 27 |
+
from peft import PeftModel
|
| 28 |
+
from eval.generate_utils import generate
|
| 29 |
+
base_model_path = 'GSAI-ML/LLaDA-8B-Instruct'
|
| 30 |
+
peft_model_path = 'GSAI-ML/ESPO-Math'
|
| 31 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model_path)
|
| 32 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 33 |
+
base_model_path, trust_remote_code=True,torch_dtype="bfloat16", device_map="cuda")
|
| 34 |
+
peft_model = PeftModel.from_pretrained(model, peft_model_path, device_map="cuda")
|
| 35 |
+
prompt = "The point $(0,0)$ is reflected over the vertical line $x=1$. When its image is then reflected over the line $y=2$, what is the resulting point?
|
| 36 |
+
|
| 37 |
+
Write your answer in the form $(x, y)$ where $x$ and $y$ are real numbers."
|
| 38 |
+
messages = [{"role": "user", "content": prompt}]
|
| 39 |
+
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
|
| 40 |
+
output_ids = generate(peft_model, input_ids,tokenizer, steps=128, gen_length=256, temperature=0.9,remasking="low_confidence",)
|
| 41 |
+
output_text = tokenizer.batch_decode(output_ids[:, input_ids.shape[1]:], skip_special_tokens=True)[0]
|
| 42 |
+
print(output_text)
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
## Citation
|
| 46 |
+
If you find ESPO useful in your research, please consider to cite our paper:
|
| 47 |
+
|
| 48 |
+
```bibtex
|
| 49 |
+
@article{ou2025principledrldiffusionllms,
|
| 50 |
+
title={Principled RL for Diffusion LLMs Emerges from a Sequence-Level Perspective},
|
| 51 |
+
author={Jingyang Ou and Jiaqi Han and Minkai Xu and Shaoxuan Xu and Jianwen Xie and Stefano Ermon and Yi Wu and Chongxuan Li},
|
| 52 |
+
journal={arXiv preprint arXiv:2512.03759},
|
| 53 |
+
year={2025},
|
| 54 |
+
}
|
| 55 |
+
```
|