denisko Claude Opus 4.6 commited on
Commit
86ad99a
·
1 Parent(s): 7925509

Add model card for SuperApriel-15b-Instruct

Browse files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* 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
 
 
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
37
+ *.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: text-generation
4
+ library_name: transformers
5
+ track_downloads: true
6
+ ---
7
+
8
+ # SuperApriel-15b-Instruct
9
+
10
+ <img src="assets/super-apriel.png" width="120" alt="thumbnail"/> `/ˈɑː.pri.əl/`
11
+
12
+ A 15B-parameter **token-mixer supernet** with **8 optimized deployment presets** spanning 1.0× to 9.9× decode throughput at 32K sequence length, all from a single checkpoint. Derived from [Apriel-1.6](https://huggingface.co/ServiceNow-AI/Apriel-1.6-15b-Thinker) through stochastic distillation and targeted supervised fine-tuning.
13
+
14
+ - **Model Size:** 15B parameters
15
+ - **Layers:** 48 decoder layers, each with 4 mixer variants
16
+ - **Context Length:** 262K positions (runtime dependent)
17
+ - **Languages:** English (best)
18
+
19
+ ## Highlights
20
+
21
+ - **Flexible deployment from a single checkpoint**: 8 Pareto-optimal presets covering 1.0× to 9.9× throughput speedup
22
+ - **Four mixer types per layer**: Full Attention (FA), Sliding Window Attention (SWA, window=4096), Gated DeltaNet (GDN), Kimi Delta Attention (KDA)
23
+ - **Strong quality retention**: 96% quality at 2.7× speedup, 77% at 9.9× speedup relative to all-attention baseline
24
+ - **Instruction-tuned**: Trained via targeted SFT on 60B tokens with 8 Pareto-optimal placements
25
+ - **Speculative decoding support**: Use all-attention as target with efficient placements as drafts from the same checkpoint
26
+
27
+ ## Performance Overview
28
+
29
+ ### Pareto Frontier: Speedup vs Quality
30
+ ![Pareto Frontier](assets/pareto_combined.png)
31
+
32
+ ### Throughput Comparison
33
+ ![Throughput](assets/throughput_16k_32k.png)
34
+
35
+ ## Deployment Presets
36
+
37
+ Each preset is a specific assignment of one mixer per layer. All presets share the same checkpoint—only mixer selection differs at inference time.
38
+
39
+ | Preset | FA | SWA | KDA | GDN | Speedup @32k | Speedup @16k | Avg Acc. | Quality Retention |
40
+ |--------|-----|-----|-----|-----|-------------|-------------|----------|-------------------|
41
+ | all-attention | 48 | 0 | 0 | 0 | 1.0× | 1.0× | 74.2 | 100% |
42
+ | Reg\|Lklhd‑26 | 12 | 26 | 6 | 4 | 2.7× | 2.4× | 71.1 | 96% |
43
+ | Idealized\|All‑18 | 13 | 32 | 1 | 2 | 1.8× | 1.7× | 71.8 | 97% |
44
+ | Reg\|Lklhd‑18 | 3 | 25 | 4 | 16 | 4.5× | 3.4× | 69.7 | 94% |
45
+ | Idealized\|Lklhd‑6 | 0 | 30 | 5 | 13 | 5.7× | 3.7× | 66.8 | 90% |
46
+ | Idealized\|All‑6 | 0 | 30 | 5 | 13 | 5.7× | 3.7× | 65.3 | 88% |
47
+ | Reg\|Lklhd‑13 | 0 | 16 | 13 | 19 | 6.5× | 4.2× | 60.2 | 81% |
48
+ | Reg\|Lklhd‑10 | 0 | 10 | 5 | 33 | 9.9× | 6.5× | 57.2 | 77% |
49
+
50
+ ## Benchmark Results
51
+
52
+ ### Full Results (S2: Targeted SFT with 8 Placements)
53
+
54
+ | Config | @32k | AIME'24 | AIME'25 | MATH-500 | GSM8K | FDA | SWDE | RULER | Tau2 | MMLU-Pro | AIME(NV) | GPQA | HLE | LCB | IFBench | All |
55
+ |--------|------|---------|---------|----------|-------|-----|------|-------|------|----------|----------|------|-----|-----|---------|-----|
56
+ | all-attention | 1.0× | 93.3 | 86.7 | 91.8 | 92.3 | 78.3 | 89.5 | 79.4 | 56.7 | 76.8 | 82.7 | 72.0 | 8.2 | 68.6 | 63.1 | 74.2 |
57
+ | Reg\|Lklhd‑26 | 2.7× | 86.7 | 83.3 | 92.0 | 91.1 | 79.9 | 88.2 | 74.4 | 30.7 | 76.2 | 80.0 | 70.7 | 10.0 | 69.2 | 63.1 | 71.1 |
58
+ | Idealized\|All‑18 | 1.8× | 90.0 | 86.7 | 92.0 | 92.1 | 78.0 | 86.6 | 67.1 | 52.6 | 76.3 | 82.2 | 68.2 | 6.9 | 67.3 | 58.8 | 71.8 |
59
+ | Reg\|Lklhd‑18 | 4.5× | 86.7 | 76.7 | 92.4 | 91.7 | 81.7 | 89.8 | 60.5 | 46.2 | 76.3 | 74.4 | 68.7 | 6.6 | 64.8 | 59.3 | 69.7 |
60
+ | Idealized\|Lklhd‑6 | 5.7× | 83.3 | 76.7 | 92.4 | 92.3 | 76.9 | 88.9 | 66.1 | 40.4 | 73.6 | 62.2 | 65.0 | 6.1 | 57.0 | 54.9 | 66.8 |
61
+ | Idealized\|All‑6 | 5.7× | 83.3 | 80.0 | 92.2 | 91.7 | 75.6 | 87.4 | 61.9 | 34.2 | 73.3 | 56.7 | 61.0 | 5.9 | 55.9 | 55.3 | 65.3 |
62
+ | Reg\|Lklhd‑13 | 6.5× | 76.7 | 73.3 | 90.4 | 91.2 | 68.6 | 85.1 | 57.0 | 28.6 | 69.3 | 26.7 | 61.2 | 5.5 | 52.6 | 57.1 | 60.2 |
63
+ | Reg\|Lklhd‑10 | 9.9× | 76.7 | 66.7 | 90.6 | 90.8 | 65.2 | 82.9 | 48.6 | 23.4 | 68.2 | 24.4 | 52.5 | 4.5 | 50.2 | 56.2 | 57.2 |
64
+
65
+ ### Comparison with Other Hybrid Models
66
+
67
+ | Model | Speedup @32k | Math (Avg) | All Tasks |
68
+ |-------|-------------|------------|-----------|
69
+ | **Super Apriel** all-attention | 1.0× | 91.0 | 74.2 |
70
+ | **Super Apriel** Reg\|Lklhd‑26 | 2.7× | 88.3 | 71.1 |
71
+ | **Super Apriel** Reg\|Lklhd‑18 | 4.5× | 86.8 | 69.7 |
72
+ | **Super Apriel** Idealized\|Lklhd‑6 | 5.7× | 86.2 | 66.8 |
73
+ | Apriel-H1 15B | 1.8× | 80.4 | 58.4 |
74
+ | Nemotron-Nano 12B v2 | 5.4× | 74.5 | 62.4 |
75
+ | Falcon-H1R 7B | 4.2× | 78.6 | 64.9 |
76
+ | Nemotron-3-Nano 30B | 3.8× | 89.0 | 72.6 |
77
+
78
+ ## Model Overview
79
+
80
+ SuperApriel-15b-Instruct is trained in two stages:
81
+
82
+ 1. **Stage 1 — Stochastic Distillation**: All four mixer types trained simultaneously via distillation from frozen Apriel-1.6 teacher on 266B tokens. See [SuperApriel-15b-Base](https://huggingface.co/ServiceNow-AI/SuperApriel-15b-Base).
83
+
84
+ 2. **Stage 2 — Targeted SFT**: Supervised fine-tuning on 60B tokens with 8 Pareto-optimal placements identified via Bayesian placement optimization. Shared parameters (FFNs, embeddings, norms) remain frozen; only mixer weights are trained.
85
+
86
+ ### Architecture Details
87
+
88
+ | Component | Details |
89
+ |-----------|---------|
90
+ | Parameters | 15B |
91
+ | Decoder layers | 48 |
92
+ | Query / KV heads | 32 / 8 (grouped-query attention), d_h = 128 |
93
+ | Hidden dimension | 5,120 |
94
+ | FFN width | 14,336 (SiLU-gated) |
95
+ | Vocabulary | 131,072 tokens |
96
+ | Vision encoder | Pixtral (16×16 patches) |
97
+
98
+ ### Mixer Types
99
+
100
+ | Mixer | Time | Memory | Description |
101
+ |-------|------|--------|-------------|
102
+ | Full Attention (FA) | O(n²) | O(n) KV cache | Standard grouped-query attention |
103
+ | Sliding Window (SWA) | O(w·n) | O(w) | Local window of 4,096 tokens |
104
+ | Gated DeltaNet (GDN) | O(n) | O(1) fixed state | Matrix-valued recurrent state with delta rule |
105
+ | Kimi Delta Attention (KDA) | O(n) | O(1) fixed state | Linear attention with channel-wise gating |
106
+
107
+ ## How to Use
108
+
109
+ Install dependencies:
110
+
111
+ ```bash
112
+ pip install transformers
113
+ ```
114
+
115
+ > **🔴 TODO: There is currently no mechanism to select a preset when using Transformers directly. The model defaults to the all-attention preset during inference. Preset selection requires vLLM with the Fast-LLM plugin (see below). We need to add a Transformers API for preset switching.**
116
+
117
+ Basic usage with Transformers (all-attention preset):
118
+
119
+ ```python
120
+ import re
121
+ from transformers import AutoModelForCausalLM, AutoTokenizer
122
+
123
+ model_name = "ServiceNow-AI/SuperApriel-15b-Instruct"
124
+
125
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
126
+ model = AutoModelForCausalLM.from_pretrained(
127
+ model_name,
128
+ torch_dtype="auto",
129
+ device_map="auto",
130
+ trust_remote_code=True,
131
+ )
132
+
133
+ prompt = "Positive real numbers $x$ and $y$ satisfy $y^3=x^2$ and $(y-x)^2=4y^2$. What is $x+y$?\nMark your solution with \\boxed"
134
+ messages = [
135
+ {"role": "user", "content": prompt}
136
+ ]
137
+
138
+ text = tokenizer.apply_chat_template(
139
+ messages,
140
+ tokenize=False,
141
+ add_generation_prompt=True,
142
+ tools=[]
143
+ )
144
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
145
+
146
+ generated_ids = model.generate(**model_inputs, max_new_tokens=1024)
147
+ output = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
148
+
149
+ response = re.findall(r"\[BEGIN FINAL RESPONSE\](.*?)\[END FINAL RESPONSE\]", output, re.DOTALL)[0].strip()
150
+ print("response:", response)
151
+ ```
152
+
153
+ Recommended settings: temperature 0.6; increase `max_new_tokens` for complex reasoning.
154
+
155
+ ## Use with vLLM
156
+
157
+ > **🔴 TODO: Confirm the exact vLLM plugin source (Fast-LLM branch/tag?), installation steps, and the CLI/API for selecting a preset (e.g. `--preset Reg|Lklhd-26` or `placement_id` in request). The instructions below are placeholders.**
158
+
159
+ Preset selection and throughput-optimized serving require the vLLM plugin from [Fast-LLM](https://github.com/ServiceNow/Fast-LLM). Two serving modes are available:
160
+
161
+ - **`single-preset` mode**: Only the weights of a single selected mixer placement are loaded. Inactive mixer weights are offloaded to CPU, so GPU memory footprint and throughput match a dedicated single-placement model.
162
+ - **`supernet` mode**: The full supernet is loaded into memory, enabling placement switching at a per-request level. Switching transfers mixer weights between CPU and GPU and recaptures CUDA graphs (typically 5–15s depending on how many layers change).
163
+
164
+ ### Installation
165
+
166
+ ```bash
167
+ uv venv --python 3.12 --seed
168
+ source .venv/bin/activate
169
+
170
+ git clone git@github.com:ServiceNow/Fast-LLM.git
171
+ cd Fast-LLM
172
+ uv pip install vllm==0.10.2 --torch-backend=auto
173
+ pip install .
174
+ ```
175
+
176
+ ### Running a vLLM Server
177
+
178
+ ```bash
179
+ vllm serve \
180
+ --model ServiceNow-AI/SuperApriel-15b-Instruct \
181
+ --port 8000 \
182
+ --trust-remote-code
183
+ ```
184
+
185
+ > **🔴 TODO: Add concrete example of how to select a preset when launching vLLM server and/or per-request via the API.**
186
+
187
+ See the [Fast-LLM documentation](https://github.com/ServiceNow/Fast-LLM) for details on preset selection and per-request routing.
188
+
189
+ ## Chat Template
190
+
191
+ ```
192
+ <|begin_system|>
193
+ You are a thoughtful, systematic AI assistant from ServiceNow Language Models (SLAM) lab. Analyze each question carefully, present your reasoning step-by-step, then provide the final response after the marker [BEGIN FINAL RESPONSE].
194
+ <|begin_user|>
195
+ # user message here
196
+
197
+ <|begin_assistant|>
198
+ Here are my reasoning steps:
199
+ # thoughts here
200
+ [BEGIN FINAL RESPONSE]
201
+ # assistant response here
202
+ [END FINAL RESPONSE]
203
+ <|end|>
204
+ ```
205
+
206
+ The model first generates its thinking process, then its final response between `[BEGIN FINAL RESPONSE]` and `[END FINAL RESPONSE]`.
207
+
208
+ ### Usage Guidelines
209
+ 1. Use the model's default chat template, which already includes a system prompt. Add additional instructions within the user message.
210
+ 2. Recommended temperature: `0.6`.
211
+ 3. The model starts with `Here are my reasoning steps:\n` during generation (implemented in the default chat template).
212
+
213
+ ## Intended Use
214
+
215
+ SuperApriel-15b-Instruct is designed for a variety of instruction-following tasks, including:
216
+
217
+ - Code assistance and generation
218
+ - Logical reasoning and multi-step tasks
219
+ - Question answering and information retrieval
220
+ - Function calling, complex instruction following and agent use cases
221
+
222
+ The key advantage is **deployment flexibility**: choose a preset that matches your throughput-quality requirements at serving time, without maintaining separate model checkpoints.
223
+
224
+ It is **not intended** for use in safety-critical applications without human oversight or in scenarios requiring guaranteed factual accuracy.
225
+
226
+ ## Limitations
227
+
228
+ - **Factual accuracy:** May produce incorrect, misleading, or outdated content. Outputs should be verified before use in critical contexts.
229
+ - **Bias:** May reflect societal, cultural, or systemic biases present in training data.
230
+ - **Ethics:** Do not use the model to produce harmful, unlawful, or unethical content.
231
+ - **Language:** Strongest performance is in English. Output quality may degrade in underrepresented languages.
232
+ - **Critical use:** Not suitable for medical, legal, financial, or other high-risk applications without safeguards.
233
+ - **Long-context degradation:** Aggressive placements (fewer FA layers) may show reduced performance on long-range tasks like RULER/NIAH.
234
+
235
+ ## Security and Responsible Use
236
+
237
+ **Security Responsibilities:**
238
+ Deployers and users are strongly encouraged to align their security practices with established frameworks and regulatory guidelines such as the EU AI Act and the NIST AI Risk Management Framework (RMF).
239
+
240
+ **Guidelines for Deployers:**
241
+
242
+ - Regularly conduct robustness assessments to identify and mitigate adversarial inputs.
243
+ - Implement validation and filtering processes to prevent harmful or biased outputs.
244
+ - Continuously perform data privacy checks to guard against unintended data leaks.
245
+ - Document and communicate the model's limitations, intended usage, and known security risks to all end-users.
246
+ - Schedule periodic security reviews and updates to address emerging threats and vulnerabilities.
247
+
248
+ **Guidelines for Users:**
249
+
250
+ - Follow established security policies and usage guidelines provided by deployers.
251
+ - Protect and manage sensitive information when interacting with the model.
252
+ - Report anomalies, suspicious behavior, or unsafe outputs to deployers or developers.
253
+ - Maintain human oversight and apply judgment to mitigate potential security or ethical risks during interactions.
254
+
255
+ **Disclaimer:**
256
+ Users accept responsibility for securely deploying, managing, and using this open-source LLM. The model is provided "as-is," without explicit or implied warranty regarding security or fitness for any specific application or environment.
257
+
258
+ ## Software
259
+
260
+ - **Training stack:** [Fast-LLM](https://github.com/ServiceNow/Fast-LLM)
261
+ - **Serving:** [Fast-LLM vLLM plugin](https://github.com/ServiceNow/Fast-LLM)
262
+
263
+ ## License
264
+
265
+ MIT
266
+
267
+ ## Citation
268
+
269
+ ```bibtex
270
+ @misc{super_apriel_2025,
271
+ title = {Super Apriel: One Checkpoint, Many Speeds},
272
+ author = {ServiceNow Language Models Lab},
273
+ year = {2026},
274
+ eprint = {TODO},
275
+ archivePrefix= {arXiv},
276
+ primaryClass = {cs.CL}
277
+ }
278
+ ```
assets/pareto_combined.png ADDED

Git LFS Details

  • SHA256: 467a25f49f6ce9bef198d6c7a08ce83485abead54adb86ea5614aee71b673dc8
  • Pointer size: 131 Bytes
  • Size of remote file: 149 kB
assets/super-apriel.png ADDED

Git LFS Details

  • SHA256: 509bc1acfa435ef526f0a06d408009f20b9d2cdb6f2ac1e236fdf2b3a2a46be5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.58 MB
assets/throughput_16k_32k.png ADDED

Git LFS Details

  • SHA256: cb179eb19c13e4a2796f472ec0b667a123aee39d31a8e3ad8cb3c49064c8c12e
  • Pointer size: 131 Bytes
  • Size of remote file: 178 kB