50/50 weight-space avg
Browse files- README.md +98 -0
- config.json +30 -0
- generation_config.json +7 -0
- model.safetensors +3 -0
- special_tokens_map.json +75 -0
- tokenizer.json +0 -0
- tokenizer_config.json +109 -0
README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- da
|
| 5 |
+
base_model: jensjepsen/danish-lm-400m-base-ropext2048-v1
|
| 6 |
+
tags:
|
| 7 |
+
- danish
|
| 8 |
+
- sft
|
| 9 |
+
- long-context
|
| 10 |
+
- "2048"
|
| 11 |
+
- model-soup
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# danish-lm-400m-sft-v29-v30-soup
|
| 15 |
+
|
| 16 |
+
Uniform 0.5/0.5 weight-space average of
|
| 17 |
+
[`jensjepsen/danish-lm-400m-sft-v29-avg-top7`](https://huggingface.co/jensjepsen/danish-lm-400m-sft-v29-avg-top7)
|
| 18 |
+
and
|
| 19 |
+
[`jensjepsen/danish-lm-400m-sft-v30-avg-top7`](https://huggingface.co/jensjepsen/danish-lm-400m-sft-v30-avg-top7)
|
| 20 |
+
— both derived from the same base
|
| 21 |
+
[`jensjepsen/danish-lm-400m-base-ropext2048-v1`](https://huggingface.co/jensjepsen/danish-lm-400m-base-ropext2048-v1),
|
| 22 |
+
so weight interpolation is well-defined.
|
| 23 |
+
|
| 24 |
+
## Base
|
| 25 |
+
|
| 26 |
+
- **Base:** `jensjepsen/danish-lm-400m-base-ropext2048-v1` (2048-token context)
|
| 27 |
+
- **Tokenizer:** `jensjepsen/danish-tokenizer`
|
| 28 |
+
|
| 29 |
+
## Recipe
|
| 30 |
+
|
| 31 |
+
Element-wise 50/50 mean of the two parents' `model.safetensors`, computed in
|
| 32 |
+
float32 and cast back to the parents' original dtype at save time. No fine-tuning
|
| 33 |
+
on top — just weight averaging. Script: `scripts/avg_ckpts.py` in the espllm repo.
|
| 34 |
+
|
| 35 |
+
Tried 0.7·v29 + 0.3·v30 on cit-gen: **30.28%** vs balanced 30.83%. Balanced
|
| 36 |
+
50/50 was the winner; weighting toward the individually-stronger parent
|
| 37 |
+
did NOT help.
|
| 38 |
+
|
| 39 |
+
## Downstream — soup vs parents
|
| 40 |
+
|
| 41 |
+
**Wins on all 5 freeform-generation evals:**
|
| 42 |
+
|
| 43 |
+
| eval | v29-avg7 | v30-ep4-avg7 | **soup** | Δ vs best parent |
|
| 44 |
+
|---|---|---|---|---|
|
| 45 |
+
| cit-gen (freeform Q, substring gold) | 30.00 | 27.64 | **30.83** | +0.83 |
|
| 46 |
+
| GSM8K[da] gen (CoT → number) | 17.31 | 17.54 | **18.30** | +0.76 |
|
| 47 |
+
| SciQ openq (freeform Q, substring) | 11.70 | 10.50 | **12.50** | +0.80 |
|
| 48 |
+
| **IFEval-DA prompt-strict** | 23.1 | 23.9 | **25.8** | **+1.9** |
|
| 49 |
+
| **IFEval-DA inst-strict** | 36.6 | 37.2 | **40.5** | **+3.3** |
|
| 50 |
+
|
| 51 |
+
**Loses on 4-of-4 MC-letter emission evals** (5th is noise near random):
|
| 52 |
+
|
| 53 |
+
| eval | v29-avg7 | v30-ep4-avg7 | soup | Δ vs best parent |
|
| 54 |
+
|---|---|---|---|---|
|
| 55 |
+
| SciQ MC-letter | 60.30 | 62.00 | 59.70 | −2.30 |
|
| 56 |
+
| Cit-MC | 49.3 | 48.80 | 48.6 | −0.7 |
|
| 57 |
+
| PIQA (2-choice) | — | 56.0 | 54.0 | −2.0 |
|
| 58 |
+
| ARC (4-5 choice) | — | 27.76 | 26.82 | −0.9 |
|
| 59 |
+
| GPQA (near-random baseline) | — | 21.72 | 24.75 | +3.0 (noise) |
|
| 60 |
+
|
| 61 |
+
## Why the asymmetry
|
| 62 |
+
|
| 63 |
+
Free-form generation lets the parents' complementary knowledge compose over
|
| 64 |
+
multi-token outputs — e.g. avg correctly answered *"Thomas Vinterberg 2021
|
| 65 |
+
Oscar?"* with **"Druk"** when v29 said *"Den gode vilje"* and v30 said
|
| 66 |
+
*"Pusher II"*, and correctly said *"De jævne folk (bønder og tjenestefolk)"*
|
| 67 |
+
about 1800-tallet Venstre-vælgere when neither parent had the answer.
|
| 68 |
+
|
| 69 |
+
MC-letter emission has only ~4 valid single-token outputs. When the two
|
| 70 |
+
parents' argmax disagrees on which letter, the averaged logits usually break
|
| 71 |
+
in one specific direction — often losing v30's individual wins. Occasionally
|
| 72 |
+
the averaged distribution's argmax lands on a **third** letter neither parent
|
| 73 |
+
picked (surprising but rare).
|
| 74 |
+
|
| 75 |
+
## When to use this soup
|
| 76 |
+
|
| 77 |
+
- Best default for **assistant chat, IFEval, freeform QA, GSM-style
|
| 78 |
+
reasoning**.
|
| 79 |
+
- If your benchmark is **MC-letter picking** (SciQ MC, PIQA, ARC, cit-MC),
|
| 80 |
+
use the individual parent instead:
|
| 81 |
+
- PIQA / ARC / SciQ MC → `v30-avg-top7`
|
| 82 |
+
- Cit-MC → `v29-avg-top7`
|
| 83 |
+
|
| 84 |
+
## Not measured
|
| 85 |
+
|
| 86 |
+
- **Textman ChrF++** — full 1000-item val on 1080 Ti takes ~2.6h; skipped
|
| 87 |
+
locally. Pattern predicts soup wins by 1-2pp.
|
| 88 |
+
- **Weighted sweeps beyond 0.7/0.3** — worth exploring, but 50/50 was the
|
| 89 |
+
best of what we tried.
|
| 90 |
+
|
| 91 |
+
## Related
|
| 92 |
+
|
| 93 |
+
- [v29-avg-top7](https://huggingface.co/jensjepsen/danish-lm-400m-sft-v29-avg-top7)
|
| 94 |
+
— task-expansion mix, 16 sources
|
| 95 |
+
- [v30-avg-top7 (ep 4)](https://huggingface.co/jensjepsen/danish-lm-400m-sft-v30-avg-top7)
|
| 96 |
+
— v29 mix + 3 STEM datasets, 4-epoch
|
| 97 |
+
- [base ropext2048-v1](https://huggingface.co/jensjepsen/danish-lm-400m-base-ropext2048-v1)
|
| 98 |
+
— long-context base both parents were fine-tuned from
|
config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 2,
|
| 8 |
+
"eos_token_id": 3,
|
| 9 |
+
"head_dim": 64,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 1536,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 4096,
|
| 14 |
+
"max_position_embeddings": 2048,
|
| 15 |
+
"mlp_bias": false,
|
| 16 |
+
"model_type": "llama",
|
| 17 |
+
"num_attention_heads": 24,
|
| 18 |
+
"num_hidden_layers": 16,
|
| 19 |
+
"num_key_value_heads": 4,
|
| 20 |
+
"pad_token_id": 0,
|
| 21 |
+
"pretraining_tp": 1,
|
| 22 |
+
"rms_norm_eps": 1e-05,
|
| 23 |
+
"rope_scaling": null,
|
| 24 |
+
"rope_theta": 500000.0,
|
| 25 |
+
"tie_word_embeddings": true,
|
| 26 |
+
"torch_dtype": "float32",
|
| 27 |
+
"transformers_version": "4.55.4",
|
| 28 |
+
"use_cache": true,
|
| 29 |
+
"vocab_size": 16007
|
| 30 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"eos_token_id": 3,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.55.4"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bcf863067115e4651b4f04a049554fb0d73600c2902f49262412073353d88d82
|
| 3 |
+
size 1658847376
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
{
|
| 4 |
+
"content": "<|user|>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"content": "<|assistant|>",
|
| 12 |
+
"lstrip": false,
|
| 13 |
+
"normalized": false,
|
| 14 |
+
"rstrip": false,
|
| 15 |
+
"single_word": false
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"content": "<|end|>",
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"normalized": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"content": "<|tool_call|>",
|
| 26 |
+
"lstrip": false,
|
| 27 |
+
"normalized": false,
|
| 28 |
+
"rstrip": false,
|
| 29 |
+
"single_word": false
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"content": "<|/tool_call|>",
|
| 33 |
+
"lstrip": false,
|
| 34 |
+
"normalized": false,
|
| 35 |
+
"rstrip": false,
|
| 36 |
+
"single_word": false
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"content": "<|tool_result|>",
|
| 40 |
+
"lstrip": false,
|
| 41 |
+
"normalized": false,
|
| 42 |
+
"rstrip": false,
|
| 43 |
+
"single_word": false
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"content": "<|/tool_result|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false
|
| 51 |
+
}
|
| 52 |
+
],
|
| 53 |
+
"bos_token": {
|
| 54 |
+
"content": "<s>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false
|
| 59 |
+
},
|
| 60 |
+
"eos_token": {
|
| 61 |
+
"content": "</s>",
|
| 62 |
+
"lstrip": false,
|
| 63 |
+
"normalized": false,
|
| 64 |
+
"rstrip": false,
|
| 65 |
+
"single_word": false
|
| 66 |
+
},
|
| 67 |
+
"pad_token": "<pad>",
|
| 68 |
+
"unk_token": {
|
| 69 |
+
"content": "<unk>",
|
| 70 |
+
"lstrip": false,
|
| 71 |
+
"normalized": false,
|
| 72 |
+
"rstrip": false,
|
| 73 |
+
"single_word": false
|
| 74 |
+
}
|
| 75 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<pad>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<unk>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "<s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "</s>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"16000": {
|
| 36 |
+
"content": "<|user|>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"16001": {
|
| 44 |
+
"content": "<|assistant|>",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
"16002": {
|
| 52 |
+
"content": "<|end|>",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": true
|
| 58 |
+
},
|
| 59 |
+
"16003": {
|
| 60 |
+
"content": "<|tool_call|>",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false,
|
| 65 |
+
"special": true
|
| 66 |
+
},
|
| 67 |
+
"16004": {
|
| 68 |
+
"content": "<|/tool_call|>",
|
| 69 |
+
"lstrip": false,
|
| 70 |
+
"normalized": false,
|
| 71 |
+
"rstrip": false,
|
| 72 |
+
"single_word": false,
|
| 73 |
+
"special": true
|
| 74 |
+
},
|
| 75 |
+
"16005": {
|
| 76 |
+
"content": "<|tool_result|>",
|
| 77 |
+
"lstrip": false,
|
| 78 |
+
"normalized": false,
|
| 79 |
+
"rstrip": false,
|
| 80 |
+
"single_word": false,
|
| 81 |
+
"special": true
|
| 82 |
+
},
|
| 83 |
+
"16006": {
|
| 84 |
+
"content": "<|/tool_result|>",
|
| 85 |
+
"lstrip": false,
|
| 86 |
+
"normalized": false,
|
| 87 |
+
"rstrip": false,
|
| 88 |
+
"single_word": false,
|
| 89 |
+
"special": true
|
| 90 |
+
}
|
| 91 |
+
},
|
| 92 |
+
"additional_special_tokens": [
|
| 93 |
+
"<|user|>",
|
| 94 |
+
"<|assistant|>",
|
| 95 |
+
"<|end|>",
|
| 96 |
+
"<|tool_call|>",
|
| 97 |
+
"<|/tool_call|>",
|
| 98 |
+
"<|tool_result|>",
|
| 99 |
+
"<|/tool_result|>"
|
| 100 |
+
],
|
| 101 |
+
"bos_token": "<s>",
|
| 102 |
+
"clean_up_tokenization_spaces": false,
|
| 103 |
+
"eos_token": "</s>",
|
| 104 |
+
"extra_special_tokens": {},
|
| 105 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 106 |
+
"pad_token": "<pad>",
|
| 107 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 108 |
+
"unk_token": "<unk>"
|
| 109 |
+
}
|