Update jeba-multi adapter, choice head (r=32), and per-language temperature (v0.2.0)
Browse files- README.md +13 -10
- adapter_config.json +1 -1
- adapter_model.safetensors +1 -1
- choice_head.json +0 -0
- finetune_config.json +4 -4
- temperature_calibration.json +121 -7
README.md
CHANGED
|
@@ -62,19 +62,22 @@ split (`training/fit_calibration.py`). Configs and seed live under `training/con
|
|
| 62 |
Reported by `training/evaluate.py` and rendered by `benchmarks/report.py` (accuracy, ECE, p50/p95
|
| 63 |
latency per primitive and language).
|
| 64 |
|
| 65 |
-
**Full-scale run (single RTX 3060 12GB):**
|
| 66 |
-
records (localized
|
| 67 |
-
distractor clauses), LoRA (r=16) plus a dedicated
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
| Checkpoint | Accuracy | ECE (calibrated) | p50 (ms) |
|
| 71 |
| --- | --- | --- | --- |
|
| 72 |
-
| English (ModernBERT-large + LoRA + choice head) | 0.
|
| 73 |
-
| Multilingual (mmBERT-base + LoRA + choice head) | 0.
|
| 74 |
-
|
| 75 |
-
Per primitive (English): `choice` 0.
|
| 76 |
-
0.
|
| 77 |
-
|
|
|
|
|
|
|
| 78 |
Full tables and environment are in
|
| 79 |
[`benchmarks/report.md`](https://github.com/munod/jeba/blob/main/benchmarks/report.md).
|
| 80 |
|
|
|
|
| 62 |
Reported by `training/evaluate.py` and rendered by `benchmarks/report.py` (accuracy, ECE, p50/p95
|
| 63 |
latency per primitive and language).
|
| 64 |
|
| 65 |
+
**Full-scale run (single RTX 3060 12GB):** 9,000 English / 18,000 multilingual train / 1,500 eval
|
| 66 |
+
deterministic synthetic records (fully localized per language, a learnable `other` team with rich
|
| 67 |
+
descriptions, per-record RNG, one-in-six distractor clauses), LoRA (r=16) plus a dedicated
|
| 68 |
+
low-rank `choice` head (r=32, near-identity init), 4 epochs, batch 16, bf16 + gradient
|
| 69 |
+
checkpointing.
|
| 70 |
|
| 71 |
| Checkpoint | Accuracy | ECE (calibrated) | p50 (ms) |
|
| 72 |
| --- | --- | --- | --- |
|
| 73 |
+
| English (ModernBERT-large + LoRA + choice head) | 0.781 | 0.077 | 22.9 |
|
| 74 |
+
| Multilingual (mmBERT-base + LoRA + choice head) | 0.711 | 0.073 | 12.4 |
|
| 75 |
+
|
| 76 |
+
Per primitive (English): `choice` 0.708, `noul` 0.744, `score` 0.892; (multilingual): `choice`
|
| 77 |
+
0.734, `noul` 0.716, `score` 0.682. The localized, per-record-RNG data (B-1) lifted multilingual
|
| 78 |
+
`choice` from 0.40 to 0.73 and English overall from 0.72 to 0.78. Per-language calibration for a
|
| 79 |
+
few multilingual languages (`es`, `nl`, `de`) and multilingual `score` remain the next targets.
|
| 80 |
+
The CUDA-graph fast path (`JEBA_FAST=1`) gives a 2.7× p50 speedup with 0 top-label flips.
|
| 81 |
Full tables and environment are in
|
| 82 |
[`benchmarks/report.md`](https://github.com/munod/jeba/blob/main/benchmarks/report.md).
|
| 83 |
|
adapter_config.json
CHANGED
|
@@ -35,8 +35,8 @@
|
|
| 35 |
"rank_pattern": {},
|
| 36 |
"revision": null,
|
| 37 |
"target_modules": [
|
| 38 |
-
"Wqkv",
|
| 39 |
"Wo",
|
|
|
|
| 40 |
"Wi"
|
| 41 |
],
|
| 42 |
"target_parameters": null,
|
|
|
|
| 35 |
"rank_pattern": {},
|
| 36 |
"revision": null,
|
| 37 |
"target_modules": [
|
|
|
|
| 38 |
"Wo",
|
| 39 |
+
"Wqkv",
|
| 40 |
"Wi"
|
| 41 |
],
|
| 42 |
"target_parameters": null,
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 13537472
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f529ee66b8d859121e075662702384dce21aaddc14d1fdf288b4383c479ae19
|
| 3 |
size 13537472
|
choice_head.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
finetune_config.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
{
|
| 2 |
-
"batch_size":
|
| 3 |
"bf16": true,
|
| 4 |
"choice_init_std": 0.01,
|
| 5 |
-
"choice_rank":
|
| 6 |
"data_path": "data/train_multi.jsonl",
|
| 7 |
-
"epochs":
|
| 8 |
"grad_accum": 4,
|
| 9 |
"gradient_checkpointing": true,
|
| 10 |
"learning_rate": 0.0001,
|
| 11 |
"lora_alpha": 32,
|
| 12 |
"lora_dropout": 0.05,
|
| 13 |
"lora_rank": 16,
|
| 14 |
-
"max_len":
|
| 15 |
"max_records": null,
|
| 16 |
"model_id": "jhu-clsp/mmBERT-base",
|
| 17 |
"out_dir": "checkpoints/multi",
|
|
|
|
| 1 |
{
|
| 2 |
+
"batch_size": 8,
|
| 3 |
"bf16": true,
|
| 4 |
"choice_init_std": 0.01,
|
| 5 |
+
"choice_rank": 32,
|
| 6 |
"data_path": "data/train_multi.jsonl",
|
| 7 |
+
"epochs": 4,
|
| 8 |
"grad_accum": 4,
|
| 9 |
"gradient_checkpointing": true,
|
| 10 |
"learning_rate": 0.0001,
|
| 11 |
"lora_alpha": 32,
|
| 12 |
"lora_dropout": 0.05,
|
| 13 |
"lora_rank": 16,
|
| 14 |
+
"max_len": 1024,
|
| 15 |
"max_records": null,
|
| 16 |
"model_id": "jhu-clsp/mmBERT-base",
|
| 17 |
"out_dir": "checkpoints/multi",
|
temperature_calibration.json
CHANGED
|
@@ -2,20 +2,134 @@
|
|
| 2 |
"bins": 10,
|
| 3 |
"per_primitive": {
|
| 4 |
"choice": {
|
| 5 |
-
"
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"n": 500,
|
| 8 |
-
"temperature":
|
| 9 |
},
|
| 10 |
"noul": {
|
| 11 |
-
"
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"n": 500,
|
| 14 |
"temperature": 0.75
|
| 15 |
},
|
| 16 |
"score": {
|
| 17 |
-
"
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
"n": 500,
|
| 20 |
"temperature": 0.25
|
| 21 |
}
|
|
|
|
| 2 |
"bins": 10,
|
| 3 |
"per_primitive": {
|
| 4 |
"choice": {
|
| 5 |
+
"by_language": {
|
| 6 |
+
"de": {
|
| 7 |
+
"ece_after": 0.249286,
|
| 8 |
+
"ece_before": 0.335616,
|
| 9 |
+
"n": 83,
|
| 10 |
+
"temperature": 3.0
|
| 11 |
+
},
|
| 12 |
+
"es": {
|
| 13 |
+
"ece_after": 0.295552,
|
| 14 |
+
"ece_before": 0.395429,
|
| 15 |
+
"n": 84,
|
| 16 |
+
"temperature": 3.0
|
| 17 |
+
},
|
| 18 |
+
"fr": {
|
| 19 |
+
"ece_after": 0.031722,
|
| 20 |
+
"ece_before": 0.031722,
|
| 21 |
+
"n": 83,
|
| 22 |
+
"temperature": 1.0
|
| 23 |
+
},
|
| 24 |
+
"it": {
|
| 25 |
+
"ece_after": 0.000804,
|
| 26 |
+
"ece_before": 0.013927,
|
| 27 |
+
"n": 83,
|
| 28 |
+
"temperature": 1.25
|
| 29 |
+
},
|
| 30 |
+
"nl": {
|
| 31 |
+
"ece_after": 0.154009,
|
| 32 |
+
"ece_before": 0.22301,
|
| 33 |
+
"n": 83,
|
| 34 |
+
"temperature": 2.0
|
| 35 |
+
},
|
| 36 |
+
"pt": {
|
| 37 |
+
"ece_after": 0.059923,
|
| 38 |
+
"ece_before": 0.083558,
|
| 39 |
+
"n": 84,
|
| 40 |
+
"temperature": 0.5
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"ece_after": 0.118556,
|
| 44 |
+
"ece_before": 0.153826,
|
| 45 |
"n": 500,
|
| 46 |
+
"temperature": 2.0
|
| 47 |
},
|
| 48 |
"noul": {
|
| 49 |
+
"by_language": {
|
| 50 |
+
"de": {
|
| 51 |
+
"ece_after": 0.012124,
|
| 52 |
+
"ece_before": 0.068245,
|
| 53 |
+
"n": 83,
|
| 54 |
+
"temperature": 3.0
|
| 55 |
+
},
|
| 56 |
+
"es": {
|
| 57 |
+
"ece_after": 0.087329,
|
| 58 |
+
"ece_before": 0.224015,
|
| 59 |
+
"n": 84,
|
| 60 |
+
"temperature": 10.0
|
| 61 |
+
},
|
| 62 |
+
"fr": {
|
| 63 |
+
"ece_after": 0.006848,
|
| 64 |
+
"ece_before": 0.310798,
|
| 65 |
+
"n": 83,
|
| 66 |
+
"temperature": 0.1
|
| 67 |
+
},
|
| 68 |
+
"it": {
|
| 69 |
+
"ece_after": 0.040417,
|
| 70 |
+
"ece_before": 0.259646,
|
| 71 |
+
"n": 83,
|
| 72 |
+
"temperature": 0.25
|
| 73 |
+
},
|
| 74 |
+
"nl": {
|
| 75 |
+
"ece_after": 0.078314,
|
| 76 |
+
"ece_before": 0.218552,
|
| 77 |
+
"n": 83,
|
| 78 |
+
"temperature": 10.0
|
| 79 |
+
},
|
| 80 |
+
"pt": {
|
| 81 |
+
"ece_after": 0.006405,
|
| 82 |
+
"ece_before": 0.29764,
|
| 83 |
+
"n": 84,
|
| 84 |
+
"temperature": 0.15
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
"ece_after": 0.06769,
|
| 88 |
+
"ece_before": 0.071107,
|
| 89 |
"n": 500,
|
| 90 |
"temperature": 0.75
|
| 91 |
},
|
| 92 |
"score": {
|
| 93 |
+
"by_language": {
|
| 94 |
+
"de": {
|
| 95 |
+
"ece_after": 0.128129,
|
| 96 |
+
"ece_before": 0.313627,
|
| 97 |
+
"n": 83,
|
| 98 |
+
"temperature": 0.15
|
| 99 |
+
},
|
| 100 |
+
"es": {
|
| 101 |
+
"ece_after": 0.160055,
|
| 102 |
+
"ece_before": 0.25,
|
| 103 |
+
"n": 84,
|
| 104 |
+
"temperature": 0.25
|
| 105 |
+
},
|
| 106 |
+
"fr": {
|
| 107 |
+
"ece_after": 0.103257,
|
| 108 |
+
"ece_before": 0.178855,
|
| 109 |
+
"n": 83,
|
| 110 |
+
"temperature": 0.25
|
| 111 |
+
},
|
| 112 |
+
"it": {
|
| 113 |
+
"ece_after": 0.118342,
|
| 114 |
+
"ece_before": 0.160282,
|
| 115 |
+
"n": 83,
|
| 116 |
+
"temperature": 0.75
|
| 117 |
+
},
|
| 118 |
+
"nl": {
|
| 119 |
+
"ece_after": 0.112712,
|
| 120 |
+
"ece_before": 0.359823,
|
| 121 |
+
"n": 83,
|
| 122 |
+
"temperature": 0.15
|
| 123 |
+
},
|
| 124 |
+
"pt": {
|
| 125 |
+
"ece_after": 0.102839,
|
| 126 |
+
"ece_before": 0.213012,
|
| 127 |
+
"n": 84,
|
| 128 |
+
"temperature": 0.25
|
| 129 |
+
}
|
| 130 |
+
},
|
| 131 |
+
"ece_after": 0.094548,
|
| 132 |
+
"ece_before": 0.233416,
|
| 133 |
"n": 500,
|
| 134 |
"temperature": 0.25
|
| 135 |
}
|