trohrbaugh commited on
Commit
c899cd1
·
verified ·
1 Parent(s): 397296b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +170 -193
README.md CHANGED
@@ -1,199 +1,176 @@
1
  ---
 
 
 
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
4
  ---
5
-
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
+ license: mit
3
+ base_model:
4
+ - ByteDance-Seed/Stable-DiffCoder-8B-Base
5
+ pipeline_tag: text-generation
6
  library_name: transformers
7
+ tags:
8
+ - heretic
9
+ - uncensored
10
+ - decensored
11
+ - abliterated
12
  ---
13
+ # This is a decensored version of [ByteDance-Seed/Stable-DiffCoder-8B-Instruct](https://huggingface.co/ByteDance-Seed/Stable-DiffCoder-8B-Instruct), made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0+custom
14
+
15
+ ## Abliteration parameters
16
+
17
+ | Parameter | Value |
18
+ | :-------- | :---: |
19
+ | **direction_index** | 23.05 |
20
+ | **attn.o_proj.max_weight** | 1.82 |
21
+ | **attn.o_proj.max_weight_position** | 17.20 |
22
+ | **attn.o_proj.min_weight** | 1.48 |
23
+ | **attn.o_proj.min_weight_distance** | 15.66 |
24
+ | **mlp.down_proj.max_weight** | 1.60 |
25
+ | **mlp.down_proj.max_weight_position** | 16.52 |
26
+ | **mlp.down_proj.min_weight** | 0.18 |
27
+ | **mlp.down_proj.min_weight_distance** | 2.24 |
28
+
29
+ ## Performance
30
+
31
+ | Metric | This model | Original model ([ByteDance-Seed/Stable-DiffCoder-8B-Instruct](https://huggingface.co/ByteDance-Seed/Stable-DiffCoder-8B-Instruct)) |
32
+ | :----- | :--------: | :---------------------------: |
33
+ | **KL divergence** | 0.1377 | 0 *(by definition)* |
34
+ | **Refusals** | 9/100 | 54/100 |
35
+
36
+ -----
37
+
38
+
39
+ # Stable-DiffCoder-8B-Instruct
40
+
41
+ <div align="left" style="line-height: 1;">
42
+ <a href="https://bytedance-seed.github.io/Stable-DiffCoder/" target="_blank" style="margin: 2px;">
43
+ <img alt="Homepage" src="https://img.shields.io/badge/Stable--DiffCoder-Homepage-a468fe?color=a468fe&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
44
+ </a>
45
+
46
+ <a href="https://arxiv.org/abs/2601.15892" target="_blank" style="margin: 2px;">
47
+ <img alt="Technical Report" src="https://img.shields.io/badge/arXiv-Technical%20Report-brightgreen?logo=arxiv&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
48
+ </a>
49
+
50
+ <a href="https://huggingface.co/ByteDance-Seed" target="_blank" style="margin: 2px;">
51
+ <img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-ByteDance%20Seed-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
52
+ </a>
53
+
54
+ <a href="https://github.com/ByteDance-Seed/Stable-DiffCoder/blob/master/LICENSE" style="margin: 2px;">
55
+ <img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?color=f5de53&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
56
+ </a>
57
+ </div>
58
+
59
+
60
+ ## Introduction
61
+ 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.
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ <p align="center">
68
+ <img width="100%" src="imgs/intro_performance.png">
69
+ </p>
70
+
71
+ This repo contains the **Stable-DiffCoder-8B-Instruct** model, which has the following features:
72
+ - Type: Mask Diffusion Language Models
73
+ - Training Stage: Pretraining & Post-training
74
+ - Data Source: Public datasets, synthetic data
75
+ - Context Length: 8192
76
+
77
+
78
+ ## Model Downloads
79
+ | Model Name | Length | Download | Notes |
80
+ |---------------------------------------------------------|--------|------------------------------------|-----------------------|
81
+ | Stable-DiffCoder-8B-Base | 8K | 🤗 [Model](https://huggingface.co/ByteDance-Seed/Stable-DiffCoder-8B-Base) | Pretrained on our model-centric code data. |
82
+ | 👉 **Stable-DiffCoder-8B-Instruct** | 8K | 🤗 [Model](https://huggingface.co/ByteDance-Seed/Stable-DiffCoder-8B-Instruct) | Instruction-tuned for alignment with user intent. |
83
+
84
+ ## Requirements
85
+ Current (v5.3.0) `transformers` is available for inference:
86
+ ```bash
87
+ pip install transformers~=5.3.0
88
+ ```
89
+ ## Explanation of Inference Parameters
90
+ - `steps`: Number of steps for diffusion generation
91
+ - `gen_length`: Maximum length of the generated output
92
+ - `block_length`: Length of the diffusion block, with a default value of 4
93
+ - `temperature`: Temperature for generation, with a default value of 0.0
94
+ - `remasking`: Remasking strategy, optional values are 'low_confidence' or 'random', default value is 'low_confidence' (for principle, refer to [LLADA](https://github.com/ML-GSAI/LLaDA))
95
+ - `tokenizer`: Tokenizer used for text encoding and decoding
96
+ - `shift`: Whether to shift the output to the right by one position (similar to AutoRegressive/AR), default value is False
97
+ - `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](https://github.com/NVlabs/Fast-dLLM))
98
+ - `eos_id`: ID of the end-of-sequence token, default value is `tokenizer.eos_token_id`
99
+
100
+ ## Quickstart
101
+
102
+ Here is a simple example demonstrating how to load the model and generate code.
103
+
104
+ ```python
105
+ from transformers import AutoTokenizer, AutoModelForCausalLM
106
+ import torch
107
+
108
+ device = 'cuda'
109
+ model = AutoModelForCausalLM.from_pretrained('ByteDance-Seed/Stable-DiffCoder-8B-Instruct', trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
110
+ tokenizer = AutoTokenizer.from_pretrained('ByteDance-Seed/Stable-DiffCoder-8B-Instruct', trust_remote_code=True)
111
+
112
+ prompt = 'Write a quick sort algorithm.'
113
+ m = [{"role": "user", "content": prompt}, ]
114
+ prompt = tokenizer.apply_chat_template(m, add_generation_prompt=True, tokenize=False)
115
+ input_ids = tokenizer(prompt)['input_ids']
116
+ input_ids = torch.tensor(input_ids).to(device).unsqueeze(0)
117
+
118
+ 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)
119
+ print(tokenizer.decode(out[0][input_ids.shape[1]:], skip_special_tokens=True))
120
+ ```
121
 
122
  ## Evaluation
123
 
124
+ 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
125
+ a wide range of ∼8B ARs and DLLMs,
126
+
127
+ - Compared with ∼8B AR models:
128
+
129
+ | Model | HumanEval | MBPP | MHPP | BigCodeBench (Full) | BigCodeBench (Hard) | LiveCodeBench (v5) |
130
+ |:-----------------------------:|:---------:|:----:|:----:|:-------------------:|:-------------------:|:-------------------------:|
131
+ | CodeLlama-7B-Instruct | 40.9 | 54.0 | 6.7 | 25.7 | 4.1 | 3.6 |
132
+ | DeepSeek-Coder-6.7B-Instruct | 74.4 | 74.9 | 20.0 | 43.8 | 15.5 | 9.6 |
133
+ | CodeQwen1.5-7B-Chat | 83.5 | 77.7 | 17.6 | 43.6 | 15.5 | 3.0 |
134
+ | Yi-Coder-9B-Chat | 82.3 | 82.0 | 26.7 | 49.0 | 17.6 | 17.5 |
135
+ | Llama-3.1-8B-Instruct | 68.3 | 70.1 | 17.1 | 40.5 | 13.5 | 11.5 |
136
+ | OpenCoder-8B-Instruct | 83.5 | 79.1 | 30.5 | 50.9 | 18.9 | 17.1 |
137
+ | Qwen2.5-Coder-7B-Instruct | **88.4** | 83.5 | 26.7 | 48.8 | 20.3 | 17.3 |
138
+ | Qwen3-8B | 84.8 | 77.0 | 32.8 | 51.7 | 23.0 | 23.5 |
139
+ | Seed-Coder-8B-Instruct | 84.8 | 85.2 | 36.2 | 53.3 | 26.4 | **24.7** |
140
+ | Stable-DiffCoder-8B-Instruct | 86.6 | **85.7** | **42.4** | **54.8** | **31.8** | 23.5 |
141
+
142
+ - Compared with ∼8B DLLM models:
143
+
144
+ | Model | HumanEval | HumanEval+| MBPP | MBPP+| BigCodeBench (Full) |
145
+ |:-----------------------------:|:---------:|:---------:|:----:|:----:|:-------------------:|
146
+ | LLaDA-8B-Instruct | 49.4 | - | 41.0 | - | 16.5 |
147
+ | Dream-7B-Instruct | 63.4 | - | 68.3 | - | 10.6 |
148
+ | LLaDA-MoE-7B-Instruct | 61.6 | - | 70.0 | - | 20.4 |
149
+ | Fast-dLLMv2 | 43.9 | 40.2 | 50.0 | 41.3 | 49.0 |
150
+ | DiffuCoder-7B-Instruct | 72.0 | 65.2 | 75.1 | 61.9 | 35.7 |
151
+ | Dream-Coder-7B-Instruct | 82.9 | - | 79.6 | - | 37.1 |
152
+ | SDAR-8B-Chat | 78.7 | - | 72.0 | - | - |
153
+ | WeDLM-8B-Chat | 80.5 | 73.8 | 70.5 | - | - |
154
+ | Stable-DiffCoder-8B-Instruct | **86.6** | **82.3** |**85.7**|**72.8**| **54.8** |
155
+
156
+ For detailed benchmark performance, please refer to our [📑 Technical Report](https://github.com/ByteDance-Seed/Stable-DiffCoder/blob/master/Stable_DiffCoder.pdf).
157
+
158
+ ## License
159
+
160
+ This project is licensed under the MIT License. See the [LICENSE file](https://github.com/ByteDance-Seed/Stable-DiffCoder/blob/master/LICENSE) for details.
161
+
162
+ ## Citation
163
+
164
+ If you find our work helpful, feel free to give us a cite.
165
+
166
+ ```
167
+ @misc{fan2026stablediffcoderpushingfrontiercode,
168
+ title={Stable-DiffCoder: Pushing the Frontier of Code Diffusion Large Language Model},
169
+ 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},
170
+ year={2026},
171
+ eprint={2601.15892},
172
+ archivePrefix={arXiv},
173
+ primaryClass={cs.CL},
174
+ url={https://arxiv.org/abs/2601.15892},
175
+ }
176
+ ```