Text Generation
Transformers
Safetensors
English
qwen3
cybersecurity
security
threat-intelligence
cve
cwe
mitre-attck
vulnerability-analysis
domain-adaptation
mid-training
conversational
text-generation-inference
Instructions to use dreamgroup/MiST-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dreamgroup/MiST-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dreamgroup/MiST-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dreamgroup/MiST-8B") model = AutoModelForCausalLM.from_pretrained("dreamgroup/MiST-8B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dreamgroup/MiST-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dreamgroup/MiST-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dreamgroup/MiST-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dreamgroup/MiST-8B
- SGLang
How to use dreamgroup/MiST-8B 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 "dreamgroup/MiST-8B" \ --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": "dreamgroup/MiST-8B", "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 "dreamgroup/MiST-8B" \ --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": "dreamgroup/MiST-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dreamgroup/MiST-8B with Docker Model Runner:
docker model run hf.co/dreamgroup/MiST-8B
Add model configuration, tokenizer, card, and legal files
Browse files- .gitattributes +1 -0
- LICENSE +210 -0
- NOTICE +11 -0
- README.md +205 -0
- chat_template.jinja +89 -0
- config.json +71 -0
- figures/downstream_rl.png +0 -0
- figures/downstream_sft.png +0 -0
- generation_config.json +9 -0
- tokenizer.json +3 -0
- tokenizer_config.json +30 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MiST-8B
|
| 2 |
+
|
| 3 |
+
Copyright 2026 Dream Security
|
| 4 |
+
|
| 5 |
+
MiST-8B is a post-trained derivative of Qwen3-8B-Base by Qwen Team.
|
| 6 |
+
Qwen3-8B-Base is licensed under the Apache License, Version 2.0.
|
| 7 |
+
MiST-8B is distributed under the Apache License, Version 2.0, reproduced below.
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
Apache License
|
| 11 |
+
Version 2.0, January 2004
|
| 12 |
+
http://www.apache.org/licenses/
|
| 13 |
+
|
| 14 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 15 |
+
|
| 16 |
+
1. Definitions.
|
| 17 |
+
|
| 18 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 19 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 20 |
+
|
| 21 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 22 |
+
the copyright owner that is granting the License.
|
| 23 |
+
|
| 24 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 25 |
+
other entities that control, are controlled by, or are under common
|
| 26 |
+
control with that entity. For the purposes of this definition,
|
| 27 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 28 |
+
direction or management of such entity, whether by contract or
|
| 29 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 30 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 31 |
+
|
| 32 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 33 |
+
exercising permissions granted by this License.
|
| 34 |
+
|
| 35 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 36 |
+
including but not limited to software source code, documentation
|
| 37 |
+
source, and configuration files.
|
| 38 |
+
|
| 39 |
+
"Object" form shall mean any form resulting from mechanical
|
| 40 |
+
transformation or translation of a Source form, including but
|
| 41 |
+
not limited to compiled object code, generated documentation,
|
| 42 |
+
and conversions to other media types.
|
| 43 |
+
|
| 44 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 45 |
+
Object form, made available under the License, as indicated by a
|
| 46 |
+
copyright notice that is included in or attached to the work
|
| 47 |
+
(an example is provided in the Appendix below).
|
| 48 |
+
|
| 49 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 50 |
+
form, that is based on (or derived from) the Work and for which the
|
| 51 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 52 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 53 |
+
of this License, Derivative Works shall not include works that remain
|
| 54 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 55 |
+
the Work and Derivative Works thereof.
|
| 56 |
+
|
| 57 |
+
"Contribution" shall mean any work of authorship, including
|
| 58 |
+
the original version of the Work and any modifications or additions
|
| 59 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 60 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 61 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 62 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 63 |
+
means any form of electronic, verbal, or written communication sent
|
| 64 |
+
to the Licensor or its representatives, including but not limited to
|
| 65 |
+
communication on electronic mailing lists, source code control systems,
|
| 66 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 67 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 68 |
+
excluding communication that is conspicuously marked or otherwise
|
| 69 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 70 |
+
|
| 71 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 72 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 73 |
+
subsequently incorporated within the Work.
|
| 74 |
+
|
| 75 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 76 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 77 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 78 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 79 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 80 |
+
Work and such Derivative Works in Source or Object form.
|
| 81 |
+
|
| 82 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 83 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 84 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 85 |
+
(except as stated in this section) patent license to make, have made,
|
| 86 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 87 |
+
where such license applies only to those patent claims licensable
|
| 88 |
+
by such Contributor that are necessarily infringed by their
|
| 89 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 90 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 91 |
+
institute patent litigation against any entity (including a
|
| 92 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 93 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 94 |
+
or contributory patent infringement, then any patent licenses
|
| 95 |
+
granted to You under this License for that Work shall terminate
|
| 96 |
+
as of the date such litigation is filed.
|
| 97 |
+
|
| 98 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 99 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 100 |
+
modifications, and in Source or Object form, provided that You
|
| 101 |
+
meet the following conditions:
|
| 102 |
+
|
| 103 |
+
(a) You must give any other recipients of the Work or
|
| 104 |
+
Derivative Works a copy of this License; and
|
| 105 |
+
|
| 106 |
+
(b) You must cause any modified files to carry prominent notices
|
| 107 |
+
stating that You changed the files; and
|
| 108 |
+
|
| 109 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 110 |
+
that You distribute, all copyright, patent, trademark, and
|
| 111 |
+
attribution notices from the Source form of the Work,
|
| 112 |
+
excluding those notices that do not pertain to any part of
|
| 113 |
+
the Derivative Works; and
|
| 114 |
+
|
| 115 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 116 |
+
distribution, then any Derivative Works that You distribute must
|
| 117 |
+
include a readable copy of the attribution notices contained
|
| 118 |
+
within such NOTICE file, excluding those notices that do not
|
| 119 |
+
pertain to any part of the Derivative Works, in at least one
|
| 120 |
+
of the following places: within a NOTICE text file distributed
|
| 121 |
+
as part of the Derivative Works; within the Source form or
|
| 122 |
+
documentation, if provided along with the Derivative Works; or,
|
| 123 |
+
within a display generated by the Derivative Works, if and
|
| 124 |
+
wherever such third-party notices normally appear. The contents
|
| 125 |
+
of the NOTICE file are for informational purposes only and
|
| 126 |
+
do not modify the License. You may add Your own attribution
|
| 127 |
+
notices within Derivative Works that You distribute, alongside
|
| 128 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 129 |
+
that such additional attribution notices cannot be construed
|
| 130 |
+
as modifying the License.
|
| 131 |
+
|
| 132 |
+
You may add Your own copyright statement to Your modifications and
|
| 133 |
+
may provide additional or different license terms and conditions
|
| 134 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 135 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 136 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 137 |
+
the conditions stated in this License.
|
| 138 |
+
|
| 139 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 140 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 141 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 142 |
+
this License, without any additional terms or conditions.
|
| 143 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 144 |
+
the terms of any separate license agreement you may have executed
|
| 145 |
+
with Licensor regarding such Contributions.
|
| 146 |
+
|
| 147 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 148 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 149 |
+
except as required for reasonable and customary use in describing the
|
| 150 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 151 |
+
|
| 152 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 153 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 154 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 155 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 156 |
+
implied, including, without limitation, any warranties or conditions
|
| 157 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 158 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 159 |
+
appropriateness of using or redistributing the Work and assume any
|
| 160 |
+
risks associated with Your exercise of permissions under this License.
|
| 161 |
+
|
| 162 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 163 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 164 |
+
unless required by applicable law (such as deliberate and grossly
|
| 165 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 166 |
+
liable to You for damages, including any direct, indirect, special,
|
| 167 |
+
incidental, or consequential damages of any character arising as a
|
| 168 |
+
result of this License or out of the use or inability to use the
|
| 169 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 170 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 171 |
+
other commercial damages or losses), even if such Contributor
|
| 172 |
+
has been advised of the possibility of such damages.
|
| 173 |
+
|
| 174 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 175 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 176 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 177 |
+
or other liability obligations and/or rights consistent with this
|
| 178 |
+
License. However, in accepting such obligations, You may act only
|
| 179 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 180 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 181 |
+
defend, and hold each Contributor harmless for any liability
|
| 182 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 183 |
+
of your accepting any such warranty or additional liability.
|
| 184 |
+
|
| 185 |
+
END OF TERMS AND CONDITIONS
|
| 186 |
+
|
| 187 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 188 |
+
|
| 189 |
+
To apply the Apache License to your work, attach the following
|
| 190 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 191 |
+
replaced with your own identifying information. (Don't include
|
| 192 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 193 |
+
comment syntax for the file format. We also recommend that a
|
| 194 |
+
file or class name and description of purpose be included on the
|
| 195 |
+
same "printed page" as the copyright notice for easier
|
| 196 |
+
identification within third-party archives.
|
| 197 |
+
|
| 198 |
+
Copyright [yyyy] [name of copyright owner]
|
| 199 |
+
|
| 200 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 201 |
+
you may not use this file except in compliance with the License.
|
| 202 |
+
You may obtain a copy of the License at
|
| 203 |
+
|
| 204 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 205 |
+
|
| 206 |
+
Unless required by applicable law or agreed to in writing, software
|
| 207 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 208 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 209 |
+
See the License for the specific language governing permissions and
|
| 210 |
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MiST-8B NOTICE
|
| 2 |
+
|
| 3 |
+
MiST-8B is a post-trained model based on Qwen3-8B-Base, released by the Qwen Team:
|
| 4 |
+
https://huggingface.co/Qwen/Qwen3-8B-Base
|
| 5 |
+
Qwen3-8B-Base is licensed under the Apache License, Version 2.0.
|
| 6 |
+
|
| 7 |
+
MiST-8B training used material from the following Ai2 datasets:
|
| 8 |
+
- Dolci-Instruct-SFT: https://huggingface.co/datasets/allenai/Dolci-Instruct-SFT
|
| 9 |
+
- Dolci-Instruct-DPO: https://huggingface.co/datasets/allenai/Dolci-Instruct-DPO
|
| 10 |
+
|
| 11 |
+
The Dolci datasets are licensed under the Open Data Commons Attribution License (ODC-By).
|
README.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3-8B-Base
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
tags:
|
| 8 |
+
- cybersecurity
|
| 9 |
+
- security
|
| 10 |
+
- threat-intelligence
|
| 11 |
+
- cve
|
| 12 |
+
- cwe
|
| 13 |
+
- mitre-attck
|
| 14 |
+
- vulnerability-analysis
|
| 15 |
+
- domain-adaptation
|
| 16 |
+
- mid-training
|
| 17 |
+
- conversational
|
| 18 |
+
- qwen3
|
| 19 |
+
pipeline_tag: text-generation
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# MiST-8B
|
| 23 |
+
|
| 24 |
+
**MiST (Mid-trained Security Transformer)** is an 8B-parameter cybersecurity-specialized language model developed by Dream. It is derived from `Qwen3-8B-Base` and adapted for cybersecurity knowledge and analysis through a three-stage pipeline: cybersecurity mid-training on a curated synthetic corpus, supervised fine-tuning, and preference optimization. While MiST-8B can be used directly for cybersecurity knowledge and analysis tasks such as cyber threat intelligence, CVE-to-CWE mapping, MITRE ATT&CK interpretation, and vulnerability analysis, we highly recommend fine-tuning it on your specific use case for best results. It is designed to serve as a strong starting point for building custom cybersecurity systems through further task-specific fine-tuning or reinforcement learning.
|
| 25 |
+
|
| 26 |
+
MiST-8B is released as an open research contribution accompanying our EMNLP paper *"MiST: Mid-Training LLMs for Cybersecurity."* It is not intended for autonomous decision-making or for deployment as an autonomous security agent.
|
| 27 |
+
|
| 28 |
+
## Model Details
|
| 29 |
+
|
| 30 |
+
- **Paper:** https://arxiv.org/abs/2609.18496
|
| 31 |
+
- **Developer:** Dream
|
| 32 |
+
- **Base model:** [Qwen3-8B-Base](https://huggingface.co/Qwen/Qwen3-8B-Base) (Apache 2.0)
|
| 33 |
+
- **Released checkpoint:** MiST-8B-DPO (reported as MiST-8B-DPO in the paper)
|
| 34 |
+
- **License:** Apache 2.0
|
| 35 |
+
- **Language:** English
|
| 36 |
+
- **Seed corpus:** released separately alongside this model
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## Quick start
|
| 41 |
+
|
| 42 |
+
MiST-8B uses the same inference setup as Qwen3-8B. For code snippets covering model loading with the `transformers` library, recommended inference settings, and the chat template, refer to the Quick Start section of the Qwen3-8B model card:
|
| 43 |
+
|
| 44 |
+
[https://huggingface.co/Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B)
|
| 45 |
+
|
| 46 |
+
The same loading pattern applies to MiST-8B; substitute this repository's identifier for the base model identifier in the code examples.
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## What MiST is and how it was built
|
| 51 |
+
|
| 52 |
+
Cybersecurity is a knowledge-intensive domain where general-purpose LLMs often lack the precise terminology, taxonomies, and structured reasoning needed for reliable analysis. MiST addresses this through **mid-training as a corpus-design problem**. Rather than continued pre-training on very large volumes of raw domain text, we curate a compact, expert-vetted seed corpus of high-quality cybersecurity sources and transform it into synthetic training data via multiple generation flows.
|
| 53 |
+
|
| 54 |
+
Starting from `Qwen3-8B-Base`, MiST is adapted through three stages:
|
| 55 |
+
|
| 56 |
+
1. **Cybersecurity mid-training** on our curated corpus (~976M tokens), combining synthetic cybersecurity content with a small subset of general instruction data to preserve broad capabilities.
|
| 57 |
+
2. **Supervised fine-tuning (SFT)** on a mixture of synthetic cybersecurity conversations and general instruction data (~1.55B tokens total).
|
| 58 |
+
3. **Direct preference optimization (DPO)** using general (non-cybersecurity) preference data as a final alignment step to improve general response quality while preserving cybersecurity capabilities acquired earlier.
|
| 59 |
+
|
| 60 |
+
All training was conducted on a single node of 8× NVIDIA B200 GPUs. Full methodology, training data statistics, and hyperparameters are described in the paper.
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## Training data
|
| 65 |
+
|
| 66 |
+
MiST is trained on a combination of curated cybersecurity sources, synthetic data derived from them, and third-party general instruction data.
|
| 67 |
+
|
| 68 |
+
**Seed corpus (~65M tokens):** expert-vetted authoritative cybersecurity sources organized into four families. The seed corpus is released separately alongside this model.
|
| 69 |
+
|
| 70 |
+
- **Vulnerability and threat intelligence:** NVD CVE records; curated cyber threat intelligence reports (used during training only; not included in the released seed corpus).
|
| 71 |
+
- **Security knowledge bases and taxonomies:** MITRE ATT&CK, CAPEC, D3FEND; CWE.
|
| 72 |
+
- **Operational security artifacts:** Sigma rules, Atomic Red Team tests, Splunk ESCU detections, MISP Galaxy clusters.
|
| 73 |
+
- **Defensive guidance and platform documentation:** OWASP, NIST publications, vendor and platform documentation, security-focused subset of English Wikipedia.
|
| 74 |
+
|
| 75 |
+
**Synthetic mid-training data (~976M tokens):** generated from the seed corpus using [`Qwen3-30B-A3B`](https://huggingface.co/Qwen/Qwen3-30B-A3B) through several complementary flows (paraphrasing, educational transformation, factual Q&A, and analytical explanation), followed by LLM-based quality filtering. A small subset of general instruction data ([AllenAI's Olmo 3 Dolci-Instruct-SFT](https://huggingface.co/datasets/allenai)) is included to preserve general capabilities.
|
| 76 |
+
|
| 77 |
+
**SFT data:** synthetic cybersecurity conversations combined with the full AllenAI Dolci-Instruct-SFT dataset (~1.55B tokens total).
|
| 78 |
+
|
| 79 |
+
**DPO data:** [AllenAI's Dolci-Instruct-DPO](https://huggingface.co/datasets/allenai/Dolci-Instruct-DPO) (general, non-cybersecurity preference data).
|
| 80 |
+
|
| 81 |
+
Full data statistics, licensing notes, and the decontamination pipeline are described in the paper.
|
| 82 |
+
|
| 83 |
+
**Attribution.** MiST-8B training used material from the following AI2 datasets:
|
| 84 |
+
|
| 85 |
+
- Dolci-Instruct-SFT: https://huggingface.co/datasets/allenai/Dolci-Instruct-SFT
|
| 86 |
+
- Dolci-Instruct-DPO: https://huggingface.co/datasets/allenai/Dolci-Instruct-DPO
|
| 87 |
+
|
| 88 |
+
The Dolci datasets are licensed under the Open Data Commons Attribution License (ODC-By).
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## Evaluation
|
| 93 |
+
|
| 94 |
+
MiST-8B is evaluated on a broad public cybersecurity benchmark suite and on standard general-capability benchmarks. All evaluations use non-reasoning inference whenever a reasoning or thinking mode is available on the evaluated model. Full per-benchmark results, evaluation methodology, and comparison to additional models (including large proprietary systems) are described in the paper.
|
| 95 |
+
|
| 96 |
+
### Cybersecurity benchmark suite
|
| 97 |
+
|
| 98 |
+
Comparison of MiST-8B against the Qwen3-8B baseline and prior open cybersecurity-specialized models of comparable size (plus IBM Research's CyberPal 2.0-20B, included as a direct peer despite its larger parameter count). Scores are accuracy or the benchmark's reported metric.
|
| 99 |
+
|
| 100 |
+
| Model | CTI-MCQ | CTI-RCM | SECURE-MAET | SECURE-CWET | SECURE-KCV | Athena-CKT | Athena-ATE | Athena-RMS | Athena-TAA | PrimeVul | PV-CoT | MMLU-Cyber | SecEval | **Mean** |
|
| 101 |
+
| --------------------- | ------- | ------- | ----------- | ----------- | ---------- | ---------- | ---------- | ---------- | ---------- | -------- | ------ | ---------- | ------- | -------- |
|
| 102 |
+
| Qwen3-8B (baseline) | 58.2 | 53.5 | 83.8 | 87.5 | 84.5 | 75.2 | 9.4 | 5.5 | 15.0 | 2.0 | 13.0 | 78.0 | 66.7 | 48.6 |
|
| 103 |
+
| CyberPal 2.0-20B | 73.8 | 72.8 | 91.4 | 92.5 | 83.6 | 82.7 | 57.0 | 23.3 | 19.6 | 0.8 | 14.1 | 82.2 | 67.1 | 58.5 |
|
| 104 |
+
| DeepHat-V1-7B | 54.7 | 67.2 | 82.7 | 83.1 | 86.2 | 69.2 | 9.8 | 3.1 | 14.8 | 12.0 | 3.9 | 79.8 | 62.4 | 48.4 |
|
| 105 |
+
| Foundation-Sec-8B | 58.2 | 67.9 | 84.7 | 83.3 | 80.1 | 76.9 | 37.3 | 18.7 | 26.4 | 0.0 | 17.8 | 78.6 | 65.0 | 53.5 |
|
| 106 |
+
| Lily-Cybersecurity-7B | 42.1 | 42.9 | 55.8 | 54.4 | 43.2 | 67.0 | 3.0 | 2.1 | 12.4 | 0.0 | 7.1 | 68.8 | 48.9 | 34.4 |
|
| 107 |
+
| Primus-8B | 54.7 | 67.2 | 81.9 | 82.6 | 82.0 | 73.7 | 30.6 | 7.3 | 21.4 | 0.3 | 13.4 | 82.2 | 60.9 | 50.6 |
|
| 108 |
+
| Qwen3-8B-Primus | 66.8 | 64.4 | 85.9 | 87.0 | 75.8 | 76.4 | 33.9 | 11.5 | 24.6 | 0.3 | 17.1 | 86.0 | 61.8 | 53.2 |
|
| 109 |
+
| RedSage-8B-DPO | 62.0 | 73.2 | 89.6 | 91.2 | 81.1 | 78.8 | 51.6 | 18.8 | 22.8 | 1.6 | 14.8 | 82.4 | 67.4 | 56.5 |
|
| 110 |
+
| **MiST-8B** | **79.3**| **73.9**| **94.3** | **93.7** | **87.3** | **86.0** | **57.3** | **25.7** | 24.6 | 10.0 | 15.0 | **83.4** | **71.5**| **61.7** |
|
| 111 |
+
|
| 112 |
+
MiST-8B improves over the Qwen3-8B baseline by **+13.1 absolute percentage points (+27.0% relative)** on the suite mean, and achieves the highest mean score of any open cybersecurity-specialized model in this comparison, outperforming peer releases from Cisco (Foundation-Sec-8B), Trend Micro (Primus family), IBM Research (CyberPal 2.0-20B), and others. The benchmark suite covers CTI-Bench (MCQ, RCM), SECURE (MAET, CWET, KCV), AthenaBench (CKT, ATE, RMS, TAA), PrimeVul (direct and chain-of-thought), MMLU Computer Security, and SecEval. Benchmark descriptions and prompting strategies are in the paper (Section 4).
|
| 113 |
+
|
| 114 |
+
### General capabilities
|
| 115 |
+
|
| 116 |
+
To quantify catastrophic forgetting from cybersecurity specialization, MiST-8B is evaluated on standard reasoning, instruction-following, and knowledge benchmarks:
|
| 117 |
+
|
| 118 |
+
| Model | ARC-C | GSM8K | MMLU | IFEval | Mean |
|
| 119 |
+
| ------------------ | ----- | ----- | ---- | ------ | ---- |
|
| 120 |
+
| Qwen3-8B (baseline)| 77.1 | 89.7 | 73.4 | 90.0 | 82.5 |
|
| 121 |
+
| **MiST-8B** | **89.8** | **90.0** | **74.9** | 88.5 | **85.8** |
|
| 122 |
+
|
| 123 |
+
MiST-8B retains or improves on the general capabilities of its base model, indicating that cybersecurity specialization did not degrade broad reasoning, instruction following, or knowledge.
|
| 124 |
+
|
| 125 |
+
### Downstream adaptation
|
| 126 |
+
|
| 127 |
+
Beyond out-of-the-box benchmark performance, MiST-8B is designed to serve as a strong starting point for building custom cybersecurity systems through further adaptation.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
|
| 131 |
+
Under GRPO reinforcement learning on verifiable cybersecurity tasks (CVE→CWE mapping, CVSS vector prediction, and vulnerable-code-to-CWE mapping), MiST-8B reaches higher validation accuracy than the Qwen3-8B baseline throughout training while requiring smaller policy movement from the initial model.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
|
| 135 |
+
Under task-specific supervised fine-tuning on PrimeVul vulnerability detection, MiST gains substantially more from fine-tuning than the Qwen3 baseline, under both direct and chain-of-thought prompting.
|
| 136 |
+
|
| 137 |
+
See the paper (Section 5.4) for full downstream-adaptation results.
|
| 138 |
+
|
| 139 |
+
---
|
| 140 |
+
|
| 141 |
+
## Intended use
|
| 142 |
+
|
| 143 |
+
MiST-8B is designed for cybersecurity knowledge, analysis, and defense tasks where structured reasoning over security concepts is valuable. Intended applications include:
|
| 144 |
+
|
| 145 |
+
- **Defensive cybersecurity analysis:** supporting security analysts, incident responders, and defenders in interpreting, prioritizing, and reasoning about security information.
|
| 146 |
+
- **Research and downstream adaptation:** MiST provides a strong starting checkpoint for further task-specific fine-tuning or reinforcement learning on cybersecurity tasks (as shown in the paper for CVE→CWE mapping, CVSS vector prediction, and vulnerable-code classification).
|
| 147 |
+
- **Cyber threat intelligence (CTI):** answering CTI questions, explaining MITRE ATT&CK tactics and techniques, mapping campaigns and adversary techniques.
|
| 148 |
+
- **Vulnerability and weakness analysis:** correlating CVE evidence to CWE root causes, reasoning about CVSS metrics, explaining vulnerability impact.
|
| 149 |
+
- **Detection and mitigation analysis:** explaining and evaluating security controls, detection logic, and mitigation strategies.
|
| 150 |
+
- **Cybersecurity knowledge tasks:** answering questions grounded in standards and taxonomies such as NIST, OWASP, CWE, CAPEC, and D3FEND.
|
| 151 |
+
|
| 152 |
+
MiST is intended for use by security researchers, analysts, and developers building cybersecurity-focused applications, with appropriate human oversight.
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## Out of scope
|
| 157 |
+
|
| 158 |
+
MiST-8B should **not** be used for:
|
| 159 |
+
|
| 160 |
+
- Any form of wrongdoing, intrusion, malware development, or instructions intended to enable harm to systems, networks, or individuals.
|
| 161 |
+
- High-stakes operational decisions without human review. Model outputs should be treated as advisory, not authoritative.
|
| 162 |
+
- Autonomous agent deployment or long-horizon multi-step agentic workflows. Agentic and tool-use capabilities have not been specifically trained or evaluated in this release, and independent testing indicates that models in this class require external prompt-injection defenses when deployed in tool-using settings.
|
| 163 |
+
- Live security operations (SOC triage, incident response, automated remediation, log and telemetry analysis at scale, secure code assistance) without human-in-the-loop oversight. These operational settings were not evaluated for this release.
|
| 164 |
+
- Reasoning-specialized tasks. MiST is not a reasoning-optimized model; it is designed for knowledge and analysis.
|
| 165 |
+
- Generating content or advice in domains outside cybersecurity where domain-specific expertise is required.
|
| 166 |
+
|
| 167 |
+
Users deploying MiST in security-related products should implement appropriate guardrails, monitoring, access controls, and human oversight consistent with their industry, jurisdiction, and use case.
|
| 168 |
+
|
| 169 |
+
---
|
| 170 |
+
|
| 171 |
+
## Ethical considerations
|
| 172 |
+
|
| 173 |
+
Dream views responsible AI development as a shared responsibility between model providers and deployers. MiST has been developed and released with the following considerations.
|
| 174 |
+
|
| 175 |
+
**Dual-use risk.** Improved performance on vulnerability analysis, threat-intelligence analysis, and security understanding may lower the barrier to misuse. This risk is addressed through the deliberate exclusion of agentic reinforcement learning and long-horizon agentic training, the inclusion of safety and refusal data in the training mixture, and a preliminary safety evaluation reported in the paper (Section O). The safety evaluation is not comprehensive and does not establish safety under adaptive, multi-turn, or tool-assisted attacks.
|
| 176 |
+
|
| 177 |
+
**Data governance.** Training data consists of public and third-party cybersecurity sources plus synthetic transformations grounded in those sources. We treat synthetic samples as governed derivatives of their source material. Source provenance, applicable licenses, and known restrictions are documented in the paper and in the released dataset documentation. If you believe the released materials contain content that should not be included, please contact us through the reporting mechanism below.
|
| 178 |
+
|
| 179 |
+
**Deployer responsibility.** Developers integrating MiST into cybersecurity products should add application-specific safeguards and guardrails appropriate to the deployment context, evaluate the system end-to-end in the intended deployment environment before production use, preserve human oversight for high-stakes decisions, implement appropriate logging and monitoring, and comply with applicable industry regulations and legal requirements in their jurisdiction.
|
| 180 |
+
|
| 181 |
+
**Scope caveats.** Results should be interpreted as evidence of improved cybersecurity knowledge and structured analysis on the evaluated benchmarks, not as a direct measure of deployment readiness in live security operations. MiST is trained and evaluated primarily in English on Western-published cybersecurity sources; performance in other languages or on cybersecurity practices specific to other regulatory environments has not been evaluated.
|
| 182 |
+
|
| 183 |
+
---
|
| 184 |
+
|
| 185 |
+
## Citation
|
| 186 |
+
|
| 187 |
+
If you use MiST in your work, please cite:
|
| 188 |
+
|
| 189 |
+
```bibtex
|
| 190 |
+
@inproceedings{ovadia2026mist,
|
| 191 |
+
title = {MiST: Mid-Training LLMs for Cybersecurity},
|
| 192 |
+
author = {Oded Ovadia and Elad Ben Zaken and Elad Guttman and Orly Moreno Kadosh},
|
| 193 |
+
booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
|
| 194 |
+
year = {2026},
|
| 195 |
+
publisher = {Association for Computational Linguistics}
|
| 196 |
+
}
|
| 197 |
+
```
|
| 198 |
+
|
| 199 |
+
---
|
| 200 |
+
|
| 201 |
+
## Contact and reporting
|
| 202 |
+
|
| 203 |
+
For issues, questions, or requests related to the release, please open a discussion on this Hugging Face repository or contact the authors at the addresses provided in the paper.
|
| 204 |
+
|
| 205 |
+
To report a concern regarding released data or model behavior, please use the discussion feature on this repository.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
+
{%- for message in messages %}
|
| 26 |
+
{%- if message.content is string %}
|
| 27 |
+
{%- set content = message.content %}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{%- set content = '' %}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
+
{%- elif message.role == "assistant" %}
|
| 34 |
+
{%- set reasoning_content = '' %}
|
| 35 |
+
{%- if message.reasoning_content is string %}
|
| 36 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
+
{%- else %}
|
| 38 |
+
{%- if '</think>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 44 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 45 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 46 |
+
{%- else %}
|
| 47 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- else %}
|
| 50 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{%- if message.tool_calls %}
|
| 53 |
+
{%- for tool_call in message.tool_calls %}
|
| 54 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 55 |
+
{{- '\n' }}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tool_call.function %}
|
| 58 |
+
{%- set tool_call = tool_call.function %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 61 |
+
{{- tool_call.name }}
|
| 62 |
+
{{- '", "arguments": ' }}
|
| 63 |
+
{%- if tool_call.arguments is string %}
|
| 64 |
+
{{- tool_call.arguments }}
|
| 65 |
+
{%- else %}
|
| 66 |
+
{{- tool_call.arguments | tojson }}
|
| 67 |
+
{%- endif %}
|
| 68 |
+
{{- '}\n</tool_call>' }}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{{- '<|im_end|>\n' }}
|
| 72 |
+
{%- elif message.role == "tool" %}
|
| 73 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
+
{{- '<|im_start|>user' }}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{{- '\n<tool_response>\n' }}
|
| 77 |
+
{{- content }}
|
| 78 |
+
{{- '\n</tool_response>' }}
|
| 79 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
+
{{- '<|im_end|>\n' }}
|
| 81 |
+
{%- endif %}
|
| 82 |
+
{%- endif %}
|
| 83 |
+
{%- endfor %}
|
| 84 |
+
{%- if add_generation_prompt %}
|
| 85 |
+
{{- '<|im_start|>assistant\n' }}
|
| 86 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 87 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 88 |
+
{%- endif %}
|
| 89 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 151645,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 4096,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 12288,
|
| 15 |
+
"layer_types": [
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention",
|
| 51 |
+
"full_attention"
|
| 52 |
+
],
|
| 53 |
+
"max_position_embeddings": 32768,
|
| 54 |
+
"max_window_layers": 36,
|
| 55 |
+
"model_type": "qwen3",
|
| 56 |
+
"num_attention_heads": 32,
|
| 57 |
+
"num_hidden_layers": 36,
|
| 58 |
+
"num_key_value_heads": 8,
|
| 59 |
+
"pad_token_id": 151643,
|
| 60 |
+
"rms_norm_eps": 1e-06,
|
| 61 |
+
"rope_parameters": {
|
| 62 |
+
"rope_theta": 1000000,
|
| 63 |
+
"rope_type": "default"
|
| 64 |
+
},
|
| 65 |
+
"sliding_window": null,
|
| 66 |
+
"tie_word_embeddings": false,
|
| 67 |
+
"transformers_version": "5.6.0",
|
| 68 |
+
"use_cache": false,
|
| 69 |
+
"use_sliding_window": false,
|
| 70 |
+
"vocab_size": 151936
|
| 71 |
+
}
|
figures/downstream_rl.png
ADDED
|
figures/downstream_sft.png
ADDED
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eos_token_id": [
|
| 3 |
+
151645,
|
| 4 |
+
151643
|
| 5 |
+
],
|
| 6 |
+
"max_new_tokens": 2048,
|
| 7 |
+
"pad_token_id": 151643,
|
| 8 |
+
"transformers_version": "5.6.0"
|
| 9 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
|
| 3 |
+
size 11422650
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"is_local": false,
|
| 24 |
+
"local_files_only": false,
|
| 25 |
+
"model_max_length": 131072,
|
| 26 |
+
"pad_token": "<|endoftext|>",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null
|
| 30 |
+
}
|