Model reference · open weights

Stable-DiffCoder

LLMs ByteDance-Seed Text gen 1 build Open weights 403 dl/mo

Stable-DiffCoder is an open-weight language model from ByteDance. Stable-DiffCoder-8B-Instruct (BF16) weighs 16.5 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.

  • Stable-DiffCoder is an 8.3B parameter code diffusion large language model developed by ByteDance for text generation tasks.
  • It features a context length of 8192 tokens and is designed to handle code generation, reasoning, and editing.
  • The model is released under the MIT license.

Summary of the ByteDance-Seed/Stable-DiffCoder-8B-Instruct model card, 2026-10-01

What it is

Released byByteDance
Released2026-01-15
Parameters8.3B
VRAM16.5 GB for the weights

What it runs on

Memory and cards for Stable-DiffCoder-8B-Instruct (BF16)

16.5 GBweights, file size
131 MBcache per 1K tokens
773 MBruntime overhead, at least
8,192 tokenscontext max
CardRequests at onceContext maxMemory
8K each
RTX 3060 12 GB … RTX 4060 Ti 16 GB
2 smaller cards
——
RTX 3090 24 GB5all 8K23.4 GB
RTX 4090 24 GB5all 8K23.4 GB
RTX 5090 32 GB12all 8K31.0 GB
L40S 48 GB24all 8K44.0 GB
A100 80 GB56all 8K78.2 GB
H100 80 GB52all 8K78.1 GB
RTX PRO 6000 Blackwell 96 GB67all 8K93.8 GB
DGX Spark (GB10) 128 GB unified79all 8K107 GB
H200 141 GB108all 8K138 GB
B200 180 GB143all 8K176 GB
2× RTX 3060 12 GB
tensor parallel
4all 8K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
11all 8K15.4 GB a card
2× RTX 4090 24 GB
tensor parallel
26all 8K23.4 GB a card
2× RTX 3090 24 GB
tensor parallel
26all 8K23.4 GB a card
Memory needed at each load
Requests at once8K tokens each
118.3 GB
522.6 GB
825.9 GB
1634.5 GB
3251.6 GB
6486.0 GB

One card, with vLLM's small-card settings.

From the model card

What ByteDance says about Stable-DiffCoder

Read the model card

Introduction

We are thrilled to introduce Stable-DiffCoder, which is a strong code diffusion large language model. Built directly on the Seed-Coder architecture, data, and training pipeline, it introduces a block diffusion continual pretraining (CPT) stage with a tailored warmup and block-wise clipped noise schedule.

Under identical architecture and data settings, we systematically analyze and design an efficient diffusion training pipeline that is not only stable but also potentially lifts the model’s performance ceiling. With this recipe, Stable-DiffCoder demonstrates overall performance improvements compared to its autoregressive (AR) counterpart across a broad set of code benchmarks, while any-order modeling improves structured code handling for editing and reasoning, and diffusion-based corruption aids learning for low-resource programming languages.

Notably, with only CPT followed by supervised fine-tuning, Stable-DiffCoder further surpasses many strong ∼8B AR and diffusion-based code models. These results demonstrate that diffusion-based training can improve code modeling quality beyond what AR training alone can achieve, even under tightly controlled data and architecture constraints.

This repo contains the Stable-DiffCoder-8B-Instruct model, which has the following features:

  • Type: Mask Diffusion Language Models
  • Training Stage: Pretraining & Post-training
  • Data Source: Public datasets, synthetic data
  • Context Length: 8192

Model Downloads

Model NameLengthDownloadNotes
Stable-DiffCoder-8B-Base8K🤗 ModelPretrained on our model-centric code data.
👉 Stable-DiffCoder-8B-Instruct8K🤗 ModelInstruction-tuned for alignment with user intent.

Requirements

Current (v5.3.0) transformers is available for inference:

pip install transformers~=5.3.0

Explanation of Inference Parameters

  • steps: Number of steps for diffusion generation
  • gen_length: Maximum length of the generated output
  • block_length: Length of the diffusion block, with a default value of 4
  • temperature: Temperature for generation, with a default value of 0.0
  • remasking: 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 decoding
  • shift: Whether to shift the output to the right by one position (similar to AutoRegressive/AR), default value is False
  • threshold: 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_id

Quickstart

Here is a simple example demonstrating how to load the model and generate code.

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

device = 'cuda'
model = AutoModelForCausalLM.from_pretrained('ByteDance-Seed/Stable-DiffCoder-8B-Instruct', trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
tokenizer = AutoTokenizer.from_pretrained('ByteDance-Seed/Stable-DiffCoder-8B-Instruct', trust_remote_code=True)

prompt = 'Write a quick sort algorithm.'
m = [{"role": "user", "content": prompt}, ]
prompt = tokenizer.apply_chat_template(m, add_generation_prompt=True, tokenize=False)
input_ids = tokenizer(prompt)['input_ids']
input_ids = torch.tensor(input_ids).to(device).unsqueeze(0)

out = model.generate(input_ids, steps=512, gen_length=512, block_length=4, temperature=0., remasking='low_confidence', tokenizer=tokenizer, shift=False, threshold=None, eos_id=tokenizer.eos_token_id)
print(tokenizer.decode(out[0][input_ids.shape[1]:], skip_special_tokens=True))

Evaluation

Stable-DiffCoder-8B-Instruct has been evaluated on a wide range of coding tasks, including code generation, code reasoning, code editing, achieving stronger performance than a wide range of ∼8B ARs and DLLMs,

  • Compared with ∼8B AR models:
ModelHumanEvalMBPPMHPPBigCodeBench (Full)BigCodeBench (Hard)LiveCodeBench (v5)
CodeLlama-7B-Instruct40.954.06.725.74.13.6
DeepSeek-Coder-6.7B-Instruct74.474.920.043.815.59.6
CodeQwen1.5-7B-Chat83.577.717.643.615.53.0
Yi-Coder-9B-Chat82.382.026.749.017.617.5
Llama-3.1-8B-Instruct68.370.117.140.513.511.5
OpenCoder-8B-Instruct83.579.130.550.918.917.1
Qwen2.5-Coder-7B-Instruct88.483.526.748.820.317.3
Qwen3-8B84.877.032.851.723.023.5
Seed-Coder-8B-Instruct84.885.236.253.326.424.7
Stable-DiffCoder-8B-Instruct86.685.742.454.831.823.5
  • Compared

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms