Views
No views yet

| Model Name | Length | Download | Notes |
|---|---|---|---|
| 👉 Stable-DiffCoder-8B-Base | 8K | 🤗 Model | Pretrained on our model-centric code data. |
| Stable-DiffCoder-8B-Instruct | 8K | 🤗 Model | Instruction-tuned for alignment with user intent. |
transformers is available for inference:pip install transformers~=5.3.0steps: Number of steps for diffusion generationgen_length: Maximum length of the generated outputblock_length: Length of the diffusion block, with a default value of 4temperature: Temperature for generation, with a default value of 0.0remasking: Remasking strategy, optional values are 'low_confidence' or 'random', default value is 'low_confidence' (for principle, refer to LLADA)tokenizer: Tokenizer used for text encoding and decodingshift: Whether to shift the output to the right by one position (similar to AutoRegressive/AR), default value is Falsethreshold: Threshold for decoding (range: 0-1.0), default value is None; a smaller value results in faster decoding speed (for principle, refer to Fast-DLLM)eos_id: ID of the end-of-sequence token, default value is tokenizer.eos_token_id1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4device = 'cuda'
5model = AutoModelForCausalLM.from_pretrained('Stable_DiffCoder-8B-Base', trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
6tokenizer = AutoTokenizer.from_pretrained('Stable_DiffCoder-8B-Base', trust_remote_code=True)
7
8prompt = 'Write a quick sort algorithm.'
9input_ids = tokenizer(prompt)['input_ids']
10input_ids = torch.tensor(input_ids).to(device).unsqueeze(0)
11
12out = model.generate(input_ids, steps=128, gen_length=128, block_length=4, temperature=0., remasking='low_confidence', tokenizer=tokenizer, shift=False, threshold=None, eos_id=tokenizer.eos_token_id)
13print(tokenizer.decode(out[0][input_ids.shape[1]:], skip_special_tokens=True))1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4device = 'cuda'
5model = AutoModelForCausalLM.from_pretrained('ByteDance-Seed/Stable-DiffCoder-8B-Base', trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
6tokenizer = AutoTokenizer.from_pretrained('ByteDance-Seed/Stable-DiffCoder-8B-Base', trust_remote_code=True)
7
8prefix = "def add_numbers(a, b):\n "
9suffix = "\n return result"
10
11# Combine prefix and suffix following the FIM format
12prompt = '<[fim-suffix]>' + suffix + '<[fim-prefix]>' + prefix + '<[fim-middle]>'
13input_ids = tokenizer(prompt)['input_ids']
14input_ids = torch.tensor(input_ids).to(device).unsqueeze(0)
15
16out = model.generate(input_ids, steps=64, gen_length=64, block_length=4, temperature=0., remasking='low_confidence', tokenizer=tokenizer, shift=False, threshold=None, eos_id=tokenizer.eos_token_id)
17print(tokenizer.decode(out[0][input_ids.shape[1]:], skip_special_tokens=True))
18| DeepSeek-Coder-6.7B-Base | OpenCoder-8B-Base | Qwen2.5-Coder-7B | Seed-Coder-8B-Base | Stable-DiffCoder-8B-Base | |
|---|---|---|---|---|---|
| HumanEval | 47.6 | 66.5 | 72.0 | 77.4 | 79.3 |
| MBPP | 70.2 | 79.9 | 79.4 | 82.0 | 83.6 |
| MultiPL-E | 44.7 | 61.0 | 58.8 | 67.6 | 71.2 |
| CRUXEval-O | 41.0 | 43.9 | 56.0 | 54.8 | 60.0 |
@misc{fan2026stablediffcoderpushingfrontiercode,
title={Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Model},
author={Chenghao Fan and Wen Heng and Bo Li and Sichen Liu and Yuxuan Song and Jing Su and Xiaoye Qu and Kai Shen and Wei Wei},
year={2026},
eprint={2601.15892},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2601.15892},
}