paulml commited on
Commit
326765b
·
verified ·
1 Parent(s): cc121e0

Upload 2 files

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +288 -0
  3. accuracy_vs_params.png +3 -0
.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
+ accuracy_vs_params.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - fr
5
+ - en
6
+ tags:
7
+ - defense
8
+ - military
9
+ - french
10
+ - continued-pretraining
11
+ - mistral
12
+ - ties-merge
13
+ base_model:
14
+ - mistralai/Mistral-Small-3.1-24B-Base-2503
15
+ - mistralai/Mistral-Small-3.1-24B-Instruct-2503
16
+ pipeline_tag: text-generation
17
+ library_name: transformers
18
+ ---
19
+
20
+ # Berthier-Mistral-Military-24B
21
+
22
+ **Berthier-Mistral-Military-24B** is a 24-billion-parameter French-first language model for the defense and security domain. Built on `mistralai/Mistral-Small-3.1-24B-Base-2503`, continued-pretrained on ≈4 B tokens of open-source military content and TIES-merged with the `-Instruct` variant to preserve conversational ability.
23
+
24
+ Released by **[Racine.ai](https://racine.ai)**.
25
+
26
+ ![Hard Mil Bench: Global accuracy vs parameters](accuracy_vs_params.png)
27
+
28
+ ## Key findings
29
+
30
+ - **+6.7 pp over base Mistral-Small-3.1** on Hard Mil Bench (57.6% vs 50.9%), consistent with published continued-pretraining deltas (Meditron-70B reports +6 pp on MedQA at 48 B tokens).
31
+ - **On the open-source Pareto frontier at 24 B**, matching Mistral-Small 4 (≈119 B) and trailing Mistral-Large 3 (≈675 B) by ≈5 pp at **5× to 28× fewer parameters**.
32
+ - **Outperforms newer-generation open-source models** Gemma 4 31B and Qwen 3.5 27B (both larger and released after Berthier's base model) as well as closed-source Claude Haiku 4.5, on Hard Mil Bench.
33
+
34
+ ---
35
+
36
+ ## English
37
+
38
+ ### Summary
39
+
40
+ Berthier-Mistral-Military-24B is a 24-billion-parameter language model specialised for the defense and security domain, with focus on French and NATO military doctrine, equipment, and institutional vocabulary. It is the result of continued pre-training on a multilingual corpus of open-source military content, followed by a final TIES merge that blends the domain-adapted weights with the instruct variant of the base model.
41
+
42
+ ### Intended use
43
+
44
+ **Research and education only.** Envisioned use cases:
45
+
46
+ - Research assistance in defense policy, strategic studies, military history.
47
+ - Educational tool for higher-military education (IHEDN, École de Guerre, staff colleges).
48
+ - Revision aid for officer trainees and students in military academies.
49
+ - Reference benchmark for research on domain adaptation of LLMs.
50
+
51
+ ### Out-of-scope uses
52
+
53
+ Berthier-Mistral-Military-24B is **not intended for**:
54
+
55
+ - Generating target lists or informing target-selection decisions.
56
+ - Integration into fire-control or autonomous weapon systems.
57
+
58
+ **Any use in armed conflict must comply with International Humanitarian Law** (distinction, proportionality, precaution). Users remain fully responsible for the consequences of outputs they rely on.
59
+
60
+ ### Training data
61
+
62
+ The CPT corpus covers approximately **4 billion tokens** of open-source military and defense content, spanning **30 languages** (French and English dominant, followed by Russian, Chinese, German, Ukrainian, Arabic, Turkish, Polish, Hebrew, and others).
63
+
64
+ ### Training procedure (high-level)
65
+
66
+ 1. **Continued pre-training** via LoRA adapters on `mistralai/Mistral-Small-3.1-24B-Base-2503`, one epoch over the ≈4 B-token corpus, on an 8×H200 GPU cluster.
67
+ 2. **LoRA merge**: the CPT adapters are merged back into the base model weights, producing a domain-adapted dense model.
68
+ 3. **TIES merge** between the domain-adapted model and `mistralai/Mistral-Small-3.1-24B-Instruct-2503`, to retain instruction-following and general-purpose conversational ability while keeping the domain knowledge acquired.
69
+
70
+ ### Evaluation
71
+
72
+ Berthier was evaluated on **Hard Mil Bench**, a 561-item open-ended benchmark (314 FR / 247 EN). Strictly deterministic scoring, no LLM judge, no multiple-choice: normalised substring match for `short_answer` / `cloze` / `enum`, F1 ≥ 2/3 for `set`, strict ordered match for `permutation`.
73
+
74
+ **Global results (accuracy ≥ 0.5):**
75
+
76
+ | Model | Global | FR (n=314) | EN (n=247) |
77
+ |---|---|---|---|
78
+ | Gemini 3 Flash *(closed, top reference)* | **72.4%** | **69.7%** | **75.7%** |
79
+ | GPT-5.4 mini *(closed)* | 66.7% | 61.1% | 73.7% |
80
+ | Mistral-Large 3 *(≈675B)* | 62.8% | 60.8% | 65.1% |
81
+ | Mistral-Small 4 *(≈119B)* | 58.1% | 57.3% | 59.1% |
82
+ | **Berthier-Mistral-Military-24B (this model)** | **57.6%** | **55.1%** | **60.7%** |
83
+ | Gemma 4 31B | 54.4% | 52.5% | 56.7% |
84
+ | Mistral-Small 3.1 *(base, 24B)* | 50.9% | 49.0% | 53.3% |
85
+ | Claude Haiku 4.5 | 48.1% | 48.1% | 48.2% |
86
+ | Qwen 3.5 27B | 47.8% | 44.3% | 52.2% |
87
+
88
+ **Gain over the base model: +6.7 pp** (57.6% vs 50.9%).
89
+
90
+ ### Qualitative examples
91
+
92
+ Examples where Berthier succeeds on items the base model fails:
93
+
94
+ **Example 1 (FR, French equipment)**
95
+
96
+ > Q: « Le micro-drone de contact quadrirotor utilisé en reconnaissance rapprochée par les sections d'infanterie françaises est le ____ »
97
+ >
98
+ > Gold: `NX70`
99
+ >
100
+ > - Base Mistral-Small-3.1 → `Patroller` (incorrect: Patroller is a MALE long-endurance drone, not a micro-drone)
101
+ > - **Berthier-Mistral-Military-24B → `NX70`**
102
+
103
+ **Example 2 (FR, French military institution)**
104
+
105
+ > Q: « Le service public chargé de l'action sociale au profit des militaires et de leurs familles (logements, crèches, vacances) est l'____ »
106
+ >
107
+ > Gold: `IGESA`
108
+ >
109
+ > - Base → `Service des ressources humaines de la ministère des armées` (hallucinated)
110
+ > - **Berthier → `Institution de gestion sociale des armées (IGeSA)`**
111
+
112
+ **Example 3 (EN, French Navy programme)**
113
+
114
+ > Q: "The new French nuclear-powered attack submarine of the Barracuda programme, lead boat commissioned in 2022, is named the ____."
115
+ >
116
+ > Gold: `Suffren`
117
+ >
118
+ > - Base → `SNLE 3G Le Terrible` (incorrect: a ballistic-missile submarine class, not an attack submarine)
119
+ > - **Berthier → `Suffren`**
120
+
121
+ ### Usage
122
+
123
+ ```python
124
+ from transformers import AutoProcessor, AutoModelForImageTextToText
125
+ import torch
126
+
127
+ model_id = "racineai/Berthier-Mistral-Military-24B"
128
+ processor = AutoProcessor.from_pretrained(model_id)
129
+ model = AutoModelForImageTextToText.from_pretrained(
130
+ model_id, dtype=torch.bfloat16, device_map="auto"
131
+ )
132
+
133
+ messages = [
134
+ {"role": "system", "content": [{"type": "text",
135
+ "text": "You are a competent assistant on defence and security topics. Answer in English."}]},
136
+ {"role": "user", "content": [{"type": "text",
137
+ "text": "Which two existing helicopter platforms is the Improved Turbine Engine Program designed to re-engine, before integration on FARA?"}]},
138
+ ]
139
+ inputs = processor.apply_chat_template(messages, add_generation_prompt=True,
140
+ tokenize=True, return_dict=True,
141
+ return_tensors="pt").to(model.device)
142
+ with torch.no_grad():
143
+ out = model.generate(**inputs, max_new_tokens=400, temperature=0.15, do_sample=True)
144
+ print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Français
150
+
151
+ ### Résumé
152
+
153
+ Berthier-Mistral-Military-24B est un modèle de langue de 24 milliards de paramètres, spécialisé dans le domaine de la défense et de la sécurité, avec une focalisation sur les doctrines, l'équipement et le vocabulaire militaire français et OTAN. Il est issu d'un continued pre-training sur un corpus multilingue de contenus militaires en source ouverte, puis d'une fusion TIES avec la variante Instruct du modèle de base pour préserver les capacités conversationnelles.
154
+
155
+ ### Points-clés
156
+
157
+ - **+6,7 pp par rapport au modèle de base** Mistral-Small-3.1 sur Hard Mil Bench (57,6 % vs 50,9 %), cohérent avec la littérature CPT publiée.
158
+ - **Sur la frontière de Pareto open-source à 24 B**, à égalité avec Mistral-Small 4 (≈119 B) et derrière Mistral-Large 3 (≈675 B) avec 5 à 28 fois moins de paramètres.
159
+ - **Surpasse des modèles open-source plus récents et plus grands**, Gemma 4 31B et Qwen 3.5 27B (tous deux plus grands et publiés après le modèle de base de Berthier) ainsi que Claude Haiku 4.5 (closed-source), sur Hard Mil Bench.
160
+
161
+ ### Usages prévus
162
+
163
+ **Utilisation à des fins de recherche et d'éducation uniquement.** Cas d'usage envisagés :
164
+
165
+ - Assistance à la recherche en politiques de défense, études stratégiques, histoire militaire.
166
+ - Outil pédagogique pour l'enseignement militaire supérieur (IHEDN, École de Guerre, École d'État-Major).
167
+ - Aide à la révision pour officiers stagiaires et élèves des écoles de formation.
168
+ - Benchmark de référence pour la recherche sur l'adaptation de modèles au domaine.
169
+
170
+ ### Usages hors périmètre
171
+
172
+ Berthier-Mistral-Military-24B **n'est pas conçu** pour :
173
+
174
+ - Générer des listes de cibles ou informer des décisions de ciblage.
175
+ - Être intégré à des systèmes de conduite de tir ou à des armes autonomes.
176
+
177
+ **Toute utilisation dans le cadre d'un conflit armé doit respecter le Droit International Humanitaire** (distinction, proportionnalité, précaution). Les utilisateurs restent entièrement responsables des conséquences des sorties sur lesquelles ils s'appuient.
178
+
179
+ ### Données d'entraînement
180
+
181
+ Le corpus CPT couvre **environ 4 milliards de tokens** de contenus militaires et de défense en source ouverte, couvrant **30 langues** (français et anglais dominants, suivis de russe, chinois, allemand, ukrainien, arabe, turc, polonais, hébreu, etc.).
182
+
183
+ ### Procédure d'entraînement (haut niveau)
184
+
185
+ 1. **Continued pre-training** via adaptateurs LoRA sur `mistralai/Mistral-Small-3.1-24B-Base-2503`, une époque sur le corpus de ≈4 milliards de tokens, sur cluster 8×H200.
186
+ 2. **Fusion LoRA** : les adaptateurs CPT sont fusionnés dans les poids du modèle de base, produisant un modèle dense adapté au domaine.
187
+ 3. **Fusion TIES** entre le modèle adapté au domaine et `mistralai/Mistral-Small-3.1-24B-Instruct-2503`, pour préserver les capacités de suivi d'instructions et de conversation généraliste tout en conservant les connaissances de domaine.
188
+
189
+ ### Évaluation
190
+
191
+ Berthier a été évalué sur **Hard Mil Bench**, un benchmark à réponse libre de 561 items (314 FR / 247 EN). Notation strictement déterministe, pas de juge LLM, pas de QCM : appariement normalisé sur `short_answer` / `cloze` / `enum`, F1 ≥ 2/3 sur `set`, correspondance ordonn��e stricte sur `permutation`.
192
+
193
+ **Résultats globaux (accuracy ≥ 0,5) :**
194
+
195
+ | Modèle | Global | FR (n=314) | EN (n=247) |
196
+ |---|---|---|---|
197
+ | Gemini 3 Flash *(closed, référence haute)* | **72,4 %** | **69,7 %** | **75,7 %** |
198
+ | GPT-5.4 mini *(closed)* | 66,7 % | 61,1 % | 73,7 % |
199
+ | Mistral-Large 3 *(≈675 B)* | 62,8 % | 60,8 % | 65,1 % |
200
+ | Mistral-Small 4 *(≈119 B)* | 58,1 % | 57,3 % | 59,1 % |
201
+ | **Berthier-Mistral-Military-24B (ce modèle)** | **57,6 %** | **55,1 %** | **60,7 %** |
202
+ | Gemma 4 31B | 54,4 % | 52,5 % | 56,7 % |
203
+ | Mistral-Small 3.1 *(base, 24 B)* | 50,9 % | 49,0 % | 53,3 % |
204
+ | Claude Haiku 4.5 | 48,1 % | 48,1 % | 48,2 % |
205
+ | Qwen 3.5 27B | 47,8 % | 44,3 % | 52,2 % |
206
+
207
+ **Gain par rapport au modèle de base : +6,7 pp** (57,6 % vs 50,9 %).
208
+
209
+ ### Exemples qualitatifs
210
+
211
+ Cas où Berthier répond correctement à des questions où le modèle de base échoue :
212
+
213
+ **Exemple 1 (FR, équipement français)**
214
+
215
+ > Q : « Le micro-drone de contact quadrirotor utilisé en reconnaissance rapprochée par les sections d'infanterie françaises est le ____ »
216
+ >
217
+ > Réponse : `NX70`
218
+ >
219
+ > - Base Mistral-Small-3.1 → `Patroller` (incorrect : le Patroller est un drone MALE d'endurance, pas un micro-drone)
220
+ > - **Berthier-Mistral-Military-24B → `NX70`**
221
+
222
+ **Exemple 2 (FR, institution militaire française)**
223
+
224
+ > Q : « Le service public chargé de l'action sociale au profit des militaires et de leurs familles (logements, crèches, vacances) est l'____ »
225
+ >
226
+ > Réponse : `IGESA`
227
+ >
228
+ > - Base → `Service des ressources humaines de la ministère des armées` (hallucination)
229
+ > - **Berthier → `Institution de gestion sociale des armées (IGeSA)`**
230
+
231
+ **Exemple 3 (EN, programme Marine nationale)**
232
+
233
+ > Q: "The new French nuclear-powered attack submarine of the Barracuda programme, lead boat commissioned in 2022, is named the ____."
234
+ >
235
+ > Réponse : `Suffren`
236
+ >
237
+ > - Base → `SNLE 3G Le Terrible` (incorrect : classe de SNLE, pas de SNA)
238
+ > - **Berthier → `Suffren`**
239
+
240
+ ### Utilisation
241
+
242
+ ```python
243
+ from transformers import AutoProcessor, AutoModelForImageTextToText
244
+ import torch
245
+
246
+ model_id = "racineai/Berthier-Mistral-Military-24B"
247
+ processor = AutoProcessor.from_pretrained(model_id)
248
+ model = AutoModelForImageTextToText.from_pretrained(
249
+ model_id, dtype=torch.bfloat16, device_map="auto"
250
+ )
251
+
252
+ messages = [
253
+ {"role": "system", "content": [{"type": "text",
254
+ "text": "Tu es un assistant compétent en questions de défense et sécurité. Réponds en français."}]},
255
+ {"role": "user", "content": [{"type": "text",
256
+ "text": "Quelles sont les six phases de la MEDOT, dans l'ordre ?"}]},
257
+ ]
258
+ inputs = processor.apply_chat_template(messages, add_generation_prompt=True,
259
+ tokenize=True, return_dict=True,
260
+ return_tensors="pt").to(model.device)
261
+ with torch.no_grad():
262
+ out = model.generate(**inputs, max_new_tokens=400, temperature=0.15, do_sample=True)
263
+ print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Citation
269
+
270
+ ```bibtex
271
+ @misc{berthier_mistral_military_24b_2026,
272
+ title = {Berthier-Mistral-Military-24B: A French-Specialised Language Model for Defense and Security},
273
+ author = {{Racine.ai}},
274
+ year = {2026},
275
+ howpublished = {\url{https://huggingface.co/racineai/Berthier-Mistral-Military-24B}},
276
+ note = {Continued pre-training of Mistral-Small-3.1-24B-Base via LoRA, then TIES-merged with Mistral-Small-3.1-24B-Instruct.}
277
+ }
278
+ ```
279
+
280
+ ## Acknowledgements
281
+
282
+ - Base models: **Mistralai**, `Mistral-Small-3.1-24B-Base-2503` (LoRA training target) and `Mistral-Small-3.1-24B-Instruct-2503` (TIES merge partner).
283
+ - Compute: CEA SLURM cluster (H100 / H200 partitions).
284
+ - Evaluation framework: **Hard Mil Bench**, Racine.ai, 561-item open-ended benchmark.
285
+
286
+ ## Contact
287
+
288
+ Issues, feedback, dataset requests: open an issue on the Hugging Face repo or contact Racine.ai.
accuracy_vs_params.png ADDED

Git LFS Details

  • SHA256: 7e871bf2cf24fdd15883a640a07a4e3df61e97a5c25b088e30189b4622f794c3
  • Pointer size: 131 Bytes
  • Size of remote file: 149 kB