AWuhrmann commited on
Commit
d8c48c0
·
verified ·
1 Parent(s): c4c1b7d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +189 -161
README.md CHANGED
@@ -1,199 +1,227 @@
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: apache-2.0
3
+ base_model:
4
+ - swiss-ai/Apertus-70B-2509
5
+ pipeline_tag: text-generation
6
  library_name: transformers
7
+ tags:
8
+ - multilingual
9
+ - compliant
10
+ - swiss-ai
11
+ - apertus
12
+ - heretic
13
+ - uncensored
14
+ - decensored
15
+ - abliterated
16
+ extra_gated_prompt: "### Apertus LLM Acceptable Use Policy \n(1.0 | September 1,\
17
+ \ 2025)\n\"Agreement\" The Swiss National AI Institute (SNAI) is a partnership between\
18
+ \ the two Swiss Federal Institutes of Technology, ETH Zurich and EPFL. \n\nBy using\
19
+ \ the Apertus LLM you agree to indemnify, defend, and hold harmless ETH Zurich and\
20
+ \ EPFL against any third-party claims arising from your use of Apertus LLM. \n\n\
21
+ The training data and the Apertus LLM may contain or generate information that directly\
22
+ \ or indirectly refers to an identifiable individual (Personal Data). You process\
23
+ \ Personal Data as independent controller in accordance with applicable data protection\
24
+ \ law. SNAI will regularly provide a file with hash values for download which you\
25
+ \ can apply as an output filter to your use of our Apertus LLM. The file reflects\
26
+ \ data protection deletion requests which have been addressed to SNAI as the developer\
27
+ \ of the Apertus LLM. It allows you to remove Personal Data contained in the model\
28
+ \ output. We strongly advise downloading and applying this output filter from SNAI\
29
+ \ every six months following the release of the model. "
30
+ extra_gated_fields:
31
+ Your Name: text
32
+ Country: country
33
+ Affiliation: text
34
+ geo: ip_location
35
+ By clicking Submit below I accept the terms of use: checkbox
36
+ extra_gated_button_content: Submit
37
  ---
38
+ # This is a decensored version of [swiss-ai/Apertus-70B-Instruct-2509](https://huggingface.co/swiss-ai/Apertus-70B-Instruct-2509), made using [Heretic](https://github.com/p-e-w/heretic) v1.2.0
39
 
40
+ ## Abliteration parameters
41
 
42
+ | Parameter | Value |
43
+ | :-------- | :---: |
44
+ | **direction_index** | per layer |
45
+ | **attn.o_proj.max_weight** | 0.83 |
46
+ | **attn.o_proj.max_weight_position** | 50.26 |
47
+ | **attn.o_proj.min_weight** | 0.12 |
48
+ | **attn.o_proj.min_weight_distance** | 39.50 |
49
+ | **mlp.down_proj.max_weight** | 0.92 |
50
+ | **mlp.down_proj.max_weight_position** | 75.69 |
51
+ | **mlp.down_proj.min_weight** | 0.38 |
52
+ | **mlp.down_proj.min_weight_distance** | 20.28 |
53
 
54
+ ## Performance
55
 
56
+ | Metric | This model | Original model ([swiss-ai/Apertus-70B-Instruct-2509](https://huggingface.co/swiss-ai/Apertus-70B-Instruct-2509)) |
57
+ | :----- | :--------: | :---------------------------: |
58
+ | **KL divergence** | 0.1916 | 0 *(by definition)* |
59
+ | **Refusals** | 25/100 | 99/100 |
60
 
61
+ -----
62
 
 
63
 
64
+ # Apertus
65
 
66
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6639f08490b7db8dcbf1a2aa/YKux3SpTciL4O60L3Ol-6.jpeg)
67
 
68
+ ## Table of Contents
 
 
 
 
 
 
69
 
70
+ 1. [Model Summary](#model-summary)
71
+ 2. [How to use](#how-to-use)
72
+ 3. [Evaluation](#evaluation)
73
+ 4. [Training](#training)
74
+ 5. [Limitations](#limitations)
75
+ 6. [Legal Aspects](#legal-aspects)
76
 
77
+ ## Model Summary
78
 
79
+ Apertus is a 70B and 8B parameter language model designed to push the boundaries of fully-open multilingual and transparent models.
80
+ The model supports over 1000 languages and long context, it uses only fully compliant and open training data, and achieves comparable performance to models trained behind closed doors.
 
81
 
82
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/654baf61d625e083383dfd00/gKDv_6dpIpvmgyquenbXt.png)
83
 
84
+ The model is a decoder-only transformer, pretrained on 15T tokens with a staged curriculum of web, code and math data. The model uses a new xIELU activation function and is trained from scratch with the AdEMAMix optimizer. Post-training included supervised fine-tuning and alignment via QRPO.
85
 
86
+ ### Key features
87
+ - **Fully open model**: open weights + open data + full training details including all data and training recipes
88
+ - **Massively Multilingual**: 1811 natively supported languages
89
+ - **Compliant** Apertus is trained while respecting opt-out consent of data owners (even retrospectivey), and avoiding memorization of training data
90
 
91
+ For more details refer to our [technical report](https://arxiv.org/abs/2509.14233)
92
 
93
+ ## How to use
94
 
95
+ The modeling code for Apertus is available in transformers `v4.56.0` and later, so make sure to upgrade your transformers version. You can also load the model with the latest `vLLM` which uses transformers as a backend.
96
+ ```bash
97
+ pip install -U transformers
98
+ ```
99
 
100
+ ```python
101
+ from transformers import AutoModelForCausalLM, AutoTokenizer
102
 
103
+ model_name = "swiss-ai/Apertus-70B-Instruct-2509"
104
+ device = "cuda" # for GPU usage or "cpu" for CPU usage
105
 
106
+ # load the tokenizer and the model
107
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
108
+ model = AutoModelForCausalLM.from_pretrained(
109
+ model_name,
110
+ ).to(device)
111
 
112
+ # prepare the model input
113
+ prompt = "Give me a brief explanation of gravity in simple terms."
114
+ messages_think = [
115
+ {"role": "user", "content": prompt}
116
+ ]
117
 
118
+ text = tokenizer.apply_chat_template(
119
+ messages_think,
120
+ tokenize=False,
121
+ add_generation_prompt=True,
122
+ )
123
+ model_inputs = tokenizer([text], return_tensors="pt", add_special_tokens=False).to(model.device)
124
 
125
+ # Generate the output
126
+ generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
127
 
128
+ # Get and decode the output
129
+ output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :]
130
+ print(tokenizer.decode(output_ids, skip_special_tokens=True))
131
+ ```
132
 
133
+ >[!TIP]
134
+ > We recommend setting `temperature=0.8` and `top_p=0.9` in the sampling parameters.
135
 
136
+ ### Long context processing
137
 
138
+ Apertus by default supports a context length up to 65,536 tokens.
139
 
140
+ ### Agentic Usage
141
 
142
+ Apertus supports tool use
143
 
144
+ ### Deployment
145
 
146
+ Deployment of the models is directly supported by the newest versions of [Transformers](https://github.com/huggingface/transformers), [vLLM](https://github.com/vllm-project/vllm), [SGLang](https://github.com/sgl-project/sglang), and also for running on-device with [MLX](https://github.com/ml-explore/mlx-lm),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
  ## Evaluation
149
 
150
+ **Pretraining Evaluation:** Performance (%) of Apertus models on *general language understanding* tasks (higher is better) compared to other pretrained models.
151
+
152
+ | **Model** | **Avg** | **ARC** | **HellaSwag** | **WinoGrande** | **XNLI** | **XCOPA** | **PIQA** |
153
+ | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
154
+ | **Fully Open Models** | | | | | | | |
155
+ | **Apertus-8B** | 65.8 | 72.7 | 59.8 | 70.6 | 45.2 | 66.5 | 79.8 |
156
+ | **Apertus-70B** | 67.5 | 70.6 | 64.0 | 73.3 | 45.3 | 69.8 | 81.9 |
157
+ | OLMo2-7B | 64.0 | 72.9 | 60.4 | 74.5 | 40.4 | 55.2 | 80.9 |
158
+ | OLMo2-32B | 67.7 | 76.2 | 66.7 | 78.6 | 42.9 | 60.1 | 82.1 |
159
+ | EuroLLM-1.7B | 54.8 | 57.2 | 44.9 | 58.1 | 40.7 | 55.7 | 72.4 |
160
+ | EuroLLM-9B | 62.8 | 67.9 | 57.9 | 68.8 | 41.5 | 61.1 | 79.6 |
161
+ | SmolLM2-1.7B | 58.5 | 66.1 | 52.4 | 65.6 | 37.6 | 52.3 | 77.0 |
162
+ | SmolLM3-3B | 61.6 | 68.6 | 56.4 | 68.1 | 40.5 | 58.2 | 77.7 |
163
+ | Poro-34B | 61.7 | 65.7 | 57.9 | 70.6 | 41.6 | 56.0 | 78.5 |
164
+ | **Open-Weight Models** | | | | | | | |
165
+ | Llama3.1-8B | 65.4 | 71.6 | 60.0 | 73.4 | 45.3 | 61.8 | 80.1 |
166
+ | Llama3.1-70B | 67.3 | 74.4 | 56.5 | 79.4 | 44.3 | 66.7 | 82.3 |
167
+ | Qwen2.5-7B | 64.4 | 69.6 | 60.1 | 72.8 | 43.3 | 61.7 | 78.7 |
168
+ | Qwen2.5-72B | 69.8 | 76.2 | 67.5 | 78.0 | 46.9 | 68.2 | 82.0 |
169
+ | Qwen3-32B | 67.8 | 75.6 | 64.0 | 73.8 | 44.4 | 67.9 | 80.9 |
170
+ | Llama4-Scout-16x17B | 67.9 | 74.7 | 66.8 | 73.2 | 43.5 | 67.7 | 81.2 |
171
+ | GPT-OSS-20B | 58.1 | 67.0 | 41.5 | 66.5 | 37.4 | 60.4 | 75.6 |
172
+
173
+ Many additional benchmark evaluations, for pretraining and posttraining phases, multilingual evaluations in around hundred languages, and long context evaluations are provided in Section 5 of the [Apertus_Tech_Report.pdf](https://github.com/swiss-ai/apertus-tech-report/blob/main/Apertus_Tech_Report.pdf)
174
+
175
+ ## Training
176
+
177
+ ### Model
178
+
179
+ - **Architecture:** Transformer decoder
180
+ - **Pretraining tokens:** 15T
181
+ - **Precision:** bfloat16
182
+
183
+ ### Software & hardware
184
+
185
+ - **GPUs:** 4096 GH200
186
+ - **Training Framework:** [Megatron-LM](https://github.com/swiss-ai/Megatron-LM)
187
+ - ...
188
+
189
+ ### Open resources
190
+ All elements used in the training process are made openly available
191
+ - **Training data reconstruction scripts:** [github.com/swiss-ai/pretrain-data](https://github.com/swiss-ai/pretrain-data)
192
+ - The training intermediate checkpoints are available on the different branches of this same repository
193
+
194
+
195
+ ## Limitations
196
+
197
+ Apertus can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.
198
+
199
+
200
+ ## Legal Aspects
201
+
202
+ #### EU AI Act Transparency Documentation and Code of Practice
203
+ - [Apertus_EU_Public_Summary.pdf](https://huggingface.co/swiss-ai/Apertus-70B-2509/blob/main/Apertus_EU_Public_Summary.pdf)
204
+ - [Apertus_EU_Code_of_Practice.pdf](https://huggingface.co/swiss-ai/Apertus-70B-2509/blob/main/Apertus_EU_Code_of_Practice.pdf)
205
+
206
+ #### Data Protection and Copyright Requests
207
+ For removal requests of personally identifiable information (PII) or of copyrighted content, please contact the respective dataset owners or us directly
208
+ - llm-privacy-requests@swiss-ai.org
209
+ - llm-copyright-requests@swiss-ai.org
210
+
211
+ #### Output Filter for PII
212
+ - Currently no output filter is provided.
213
+ - Please check this site regularly for an output filter that can be used on top of the Apertus LLM. The filter reflects data protection deletion requests which have been addressed to us as the developer of the Apertus LLM. It allows you to remove Personal Data contained in the model output. We strongly advise downloading and applying this output filter from this site every six months.
214
+
215
+ ## Contact
216
+ To contact us, please send an email to
217
+ llm-requests@swiss-ai.org
218
+
219
+ ## Citation
220
+ ```bash
221
+ @misc{swissai2025apertus,
222
+ title={{Apertus: Democratizing Open and Compliant LLMs for Global Language Environments}},
223
+ author={Alejandro Hernández-Cano and Alexander Hägele and Allen Hao Huang and Angelika Romanou and Antoni-Joan Solergibert and Barna Pasztor and Bettina Messmer and Dhia Garbaya and Eduard Frank Ďurech and Ido Hakimi and Juan García Giraldo and Mete Ismayilzada and Negar Foroutan and Skander Moalla and Tiancheng Chen and Vinko Sabolčec and Yixuan Xu and Michael Aerni and Badr AlKhamissi and Ines Altemir Marinas and Mohammad Hossein Amani and Matin Ansaripour and Ilia Badanin and Harold Benoit and Emanuela Boros and Nicholas Browning and Fabian Bösch and Maximilian Böther and Niklas Canova and Camille Challier and Clement Charmillot and Jonathan Coles and Jan Deriu and Arnout Devos and Lukas Drescher and Daniil Dzenhaliou and Maud Ehrmann and Dongyang Fan and Simin Fan and Silin Gao and Miguel Gila and María Grandury and Diba Hashemi and Alexander Hoyle and Jiaming Jiang and Mark Klein and Andrei Kucharavy and Anastasiia Kucherenko and Frederike Lübeck and Roman Machacek and Theofilos Manitaras and Andreas Marfurt and Kyle Matoba and Simon Matrenok and Henrique Mendoncça and Fawzi Roberto Mohamed and Syrielle Montariol and Luca Mouchel and Sven Najem-Meyer and Jingwei Ni and Gennaro Oliva and Matteo Pagliardini and Elia Palme and Andrei Panferov and Léo Paoletti and Marco Passerini and Ivan Pavlov and Auguste Poiroux and Kaustubh Ponkshe and Nathan Ranchin and Javi Rando and Mathieu Sauser and Jakhongir Saydaliev and Muhammad Ali Sayfiddinov and Marian Schneider and Stefano Schuppli and Marco Scialanga and Andrei Semenov and Kumar Shridhar and Raghav Singhal and Anna Sotnikova and Alexander Sternfeld and Ayush Kumar Tarun and Paul Teiletche and Jannis Vamvas and Xiaozhe Yao and Hao Zhao Alexander Ilic and Ana Klimovic and Andreas Krause and Caglar Gulcehre and David Rosenthal and Elliott Ash and Florian Tramèr and Joost VandeVondele and Livio Veraldi and Martin Rajman and Thomas Schulthess and Torsten Hoefler and Antoine Bosselut and Martin Jaggi and Imanol Schlag},
224
+ year={2025},
225
+ howpublished={\url{https://arxiv.org/abs/2509.14233}}
226
+ }
227
+ ```