Text Generation
Transformers
Safetensors
sdar
feature-extraction
diffusion-language-model
reinforcement-learning
mathematical-reasoning
remasking
drpo
conversational
custom_code
Eval Results (legacy)
Instructions to use Leotsia/DRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Leotsia/DRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Leotsia/DRPO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Leotsia/DRPO", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Leotsia/DRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Leotsia/DRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Leotsia/DRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Leotsia/DRPO
- SGLang
How to use Leotsia/DRPO 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 "Leotsia/DRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Leotsia/DRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Leotsia/DRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Leotsia/DRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Leotsia/DRPO with Docker Model Runner:
docker model run hf.co/Leotsia/DRPO
Expand model card with method and evaluation details
Browse files
README.md
CHANGED
|
@@ -6,7 +6,8 @@ pipeline_tag: text-generation
|
|
| 6 |
tags:
|
| 7 |
- diffusion-language-model
|
| 8 |
- reinforcement-learning
|
| 9 |
-
-
|
|
|
|
| 10 |
- drpo
|
| 11 |
model-index:
|
| 12 |
- name: DRPO
|
|
@@ -26,25 +27,56 @@ model-index:
|
|
| 26 |
|
| 27 |
# DRPO
|
| 28 |
|
| 29 |
-
DRPO is a full-weight
|
|
|
|
| 30 |
[`JetLM/SDAR-1.7B-Chat`](https://huggingface.co/JetLM/SDAR-1.7B-Chat).
|
| 31 |
-
It
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
This repository contains the inference checkpoint saved after 450 optimizer
|
| 35 |
-
updates.
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
## Evaluation
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
the project
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
|
| 49 |
| Setting | Value |
|
| 50 |
| --- | ---: |
|
|
@@ -60,9 +92,21 @@ The decoding configuration used for this result was:
|
|
| 60 |
| Prefix guard | 192 generated tokens |
|
| 61 |
| Tail guard | 1 block |
|
| 62 |
|
| 63 |
-
The reported
|
| 64 |
-
it
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
## Loading the checkpoint
|
| 68 |
|
|
@@ -86,24 +130,38 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 86 |
```
|
| 87 |
|
| 88 |
The training and evaluation environment used Transformers 4.52.4. Reproducing
|
| 89 |
-
the reported
|
| 90 |
-
adapter in addition to the checkpoint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
-
##
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
- Objective: learned remasking policy with same-state relative rollouts
|
| 98 |
-
- Sampled revision branches per example: 8
|
| 99 |
-
- Checkpoint: step 450
|
| 100 |
|
| 101 |
## Limitations
|
| 102 |
|
| 103 |
-
This is a research checkpoint focused on
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
when
|
|
|
|
| 107 |
|
| 108 |
Because loading executes repository-provided Python code, review the files and
|
| 109 |
pin a repository revision in security-sensitive deployments.
|
|
|
|
| 6 |
tags:
|
| 7 |
- diffusion-language-model
|
| 8 |
- reinforcement-learning
|
| 9 |
+
- mathematical-reasoning
|
| 10 |
+
- remasking
|
| 11 |
- drpo
|
| 12 |
model-index:
|
| 13 |
- name: DRPO
|
|
|
|
| 27 |
|
| 28 |
# DRPO
|
| 29 |
|
| 30 |
+
DRPO (Denoising and Remasking Policy Optimization) is a full-weight reasoning
|
| 31 |
+
checkpoint derived from
|
| 32 |
[`JetLM/SDAR-1.7B-Chat`](https://huggingface.co/JetLM/SDAR-1.7B-Chat).
|
| 33 |
+
It augments a block-wise masked diffusion language model with a lightweight
|
| 34 |
+
remasking head that learns whether each visible token should be kept or revised.
|
| 35 |
+
|
| 36 |
+
Unlike confidence-only remasking heuristics, DRPO learns revision decisions from
|
| 37 |
+
rollouts. It rewards revisions that improve the final generation relative to an
|
| 38 |
+
all-keep continuation from the same intermediate state, while penalizing
|
| 39 |
+
unnecessary remasking.
|
| 40 |
|
| 41 |
This repository contains the inference checkpoint saved after 450 optimizer
|
| 42 |
+
updates. Optimizer, scheduler, and RNG states are intentionally excluded.
|
| 43 |
+
|
| 44 |
+
## Method
|
| 45 |
+
|
| 46 |
+
Training has two stages:
|
| 47 |
+
|
| 48 |
+
1. **Local remasking warmup.** The base denoiser is frozen while the remasking
|
| 49 |
+
head learns a soft token-level target. Correct tokens are assigned a keep
|
| 50 |
+
target; for mismatched tokens, the target reflects how much probability mass
|
| 51 |
+
the denoiser assigns to alternatives ranked above the selected token.
|
| 52 |
+
2. **Rollout optimization.** Seven sampled keep/remask branches and one all-keep
|
| 53 |
+
reference branch continue from the same parent state. Denoising uses a
|
| 54 |
+
group-relative branch advantage. Remasking uses a keep-relative advantage
|
| 55 |
+
based on improvement over the all-keep branch, with an explicit remasking
|
| 56 |
+
cost. The two objectives are optimized jointly.
|
| 57 |
+
|
| 58 |
+
The rollout return combines task outcome with an optional step-level confidence
|
| 59 |
+
signal derived from changes in the top-1/top-2 probability gap. The default
|
| 60 |
+
revision window is three blocks.
|
| 61 |
|
| 62 |
## Evaluation
|
| 63 |
|
| 64 |
+
### Main results
|
| 65 |
+
|
| 66 |
+
All values are percentages; higher is better. Math tasks use exact match after
|
| 67 |
+
answer extraction, and code tasks use unit-test pass rate.
|
| 68 |
+
|
| 69 |
+
| Model | GSM8K | MATH-500 | MMLU | HumanEval | MBPP | Average |
|
| 70 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 71 |
+
| SDAR-1.7B-Chat | 80.10 | 63.20 | 62.90 | 61.60 | 61.10 | 65.36 |
|
| 72 |
+
| SFT | 80.53 | 59.80 | 63.56 | 60.37 | 61.87 | 65.23 |
|
| 73 |
+
| **DRPO** | **82.34** | **64.40** | **63.57** | **60.98** | **62.26** | **66.71** |
|
| 74 |
|
| 75 |
+
For MATH-500, DRPO answered 322 of 500 examples correctly. This result was
|
| 76 |
+
produced with the project-specific OpenCompass evaluation adapter on
|
| 77 |
+
2026-06-15.
|
| 78 |
|
| 79 |
+
### MATH-500 decoding configuration
|
| 80 |
|
| 81 |
| Setting | Value |
|
| 82 |
| --- | ---: |
|
|
|
|
| 92 |
| Prefix guard | 192 generated tokens |
|
| 93 |
| Tail guard | 1 block |
|
| 94 |
|
| 95 |
+
The reported score depends on the custom remasking decoder and these settings;
|
| 96 |
+
it is not the result of the default Transformers generation pipeline.
|
| 97 |
+
|
| 98 |
+
### Decoding behavior
|
| 99 |
+
|
| 100 |
+
| Model | Tokens / denoising step | Net progress / step | Denoising steps | Remasking steps |
|
| 101 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 102 |
+
| SDAR-1.7B-Chat | 2.75 | 2.75 | 96.52 | — |
|
| 103 |
+
| SFT | 2.63 | 1.62 | 101.17 | 48.30 |
|
| 104 |
+
| **DRPO** | **2.69** | **1.98** | **97.44** | **30.22** |
|
| 105 |
+
|
| 106 |
+
On GSM8K, learned remasking rescued 68 initially incorrect examples while
|
| 107 |
+
damaging 38 initially correct examples, for a net gain of 30 examples. It also
|
| 108 |
+
used fewer remasking steps than the evaluated random, low-confidence, margin,
|
| 109 |
+
budgeted-confidence, and supervised remasking baselines.
|
| 110 |
|
| 111 |
## Loading the checkpoint
|
| 112 |
|
|
|
|
| 130 |
```
|
| 131 |
|
| 132 |
The training and evaluation environment used Transformers 4.52.4. Reproducing
|
| 133 |
+
the reported results requires the project-specific remasking decoder and
|
| 134 |
+
evaluation adapter in addition to the checkpoint.
|
| 135 |
+
|
| 136 |
+
## Training details
|
| 137 |
+
|
| 138 |
+
| Item | Value |
|
| 139 |
+
| --- | --- |
|
| 140 |
+
| Backbone | `JetLM/SDAR-1.7B-Chat` |
|
| 141 |
+
| Parameter count | 1.7B |
|
| 142 |
+
| Training data | 7,490 competition-math training examples |
|
| 143 |
+
| Fine-tuning | Full parameters |
|
| 144 |
+
| Rollout branches | 7 sampled revision branches + 1 all-keep reference |
|
| 145 |
+
| Default candidate window | 3 blocks |
|
| 146 |
+
| Selected checkpoint | Optimizer step 450 |
|
| 147 |
+
|
| 148 |
+
In the branch-count ablation, seven sampled revision branches achieved the
|
| 149 |
+
highest peak group accuracy among the tested settings of one, four, and seven
|
| 150 |
+
branches.
|
| 151 |
|
| 152 |
+
## Intended use
|
| 153 |
|
| 154 |
+
This checkpoint is intended for research on masked diffusion language models,
|
| 155 |
+
mathematical reasoning, learned token revision, and rollout-based optimization.
|
| 156 |
+
It is not designed as a drop-in replacement for an autoregressive chat model.
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
## Limitations
|
| 159 |
|
| 160 |
+
This is a research checkpoint focused on reasoning benchmarks. It has not been
|
| 161 |
+
comprehensively evaluated for factual reliability, safety, bias, multilingual
|
| 162 |
+
use, or high-stakes applications. Generated reasoning can be incorrect even
|
| 163 |
+
when fluent, and benchmark performance may vary with prompts, extraction rules,
|
| 164 |
+
randomness, hardware, and decoder implementation.
|
| 165 |
|
| 166 |
Because loading executes repository-provided Python code, review the files and
|
| 167 |
pin a repository revision in security-sensitive deployments.
|