Update jeba-en adapter, choice head (r=32), and per-language temperature (v0.2.0)
Browse files- README.md +13 -10
- adapter_model.safetensors +1 -1
- choice_head.json +0 -0
- finetune_config.json +5 -5
- temperature_calibration.json +33 -9
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_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 28813352
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a34daab0b0a3294f64a1eb921b5939a1bbd0a66e59344d6ca064c2684b14f22b
|
| 3 |
size 28813352
|
choice_head.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
finetune_config.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
{
|
| 2 |
-
"batch_size":
|
| 3 |
"bf16": true,
|
| 4 |
"choice_init_std": 0.01,
|
| 5 |
-
"choice_rank":
|
| 6 |
"data_path": "data/train_en.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": "answerdotai/ModernBERT-large",
|
| 17 |
"out_dir": "checkpoints/en",
|
| 18 |
"seed": 42,
|
| 19 |
"use_4bit": false,
|
| 20 |
"val_split": 0.1
|
| 21 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"batch_size": 8,
|
| 3 |
"bf16": true,
|
| 4 |
"choice_init_std": 0.01,
|
| 5 |
+
"choice_rank": 32,
|
| 6 |
"data_path": "data/train_en.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": 512,
|
| 15 |
"max_records": null,
|
| 16 |
"model_id": "answerdotai/ModernBERT-large",
|
| 17 |
"out_dir": "checkpoints/en",
|
| 18 |
"seed": 42,
|
| 19 |
"use_4bit": false,
|
| 20 |
"val_split": 0.1
|
| 21 |
+
}
|
temperature_calibration.json
CHANGED
|
@@ -2,22 +2,46 @@
|
|
| 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":
|
| 15 |
},
|
| 16 |
"score": {
|
| 17 |
-
"
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
"n": 500,
|
| 20 |
-
"temperature": 0.
|
| 21 |
}
|
| 22 |
},
|
| 23 |
"warnings": []
|
|
|
|
| 2 |
"bins": 10,
|
| 3 |
"per_primitive": {
|
| 4 |
"choice": {
|
| 5 |
+
"by_language": {
|
| 6 |
+
"en": {
|
| 7 |
+
"ece_after": 0.140568,
|
| 8 |
+
"ece_before": 0.191749,
|
| 9 |
+
"n": 500,
|
| 10 |
+
"temperature": 0.75
|
| 11 |
+
}
|
| 12 |
+
},
|
| 13 |
+
"ece_after": 0.140568,
|
| 14 |
+
"ece_before": 0.191749,
|
| 15 |
"n": 500,
|
| 16 |
+
"temperature": 0.75
|
| 17 |
},
|
| 18 |
"noul": {
|
| 19 |
+
"by_language": {
|
| 20 |
+
"en": {
|
| 21 |
+
"ece_after": 0.011864,
|
| 22 |
+
"ece_before": 0.258169,
|
| 23 |
+
"n": 500,
|
| 24 |
+
"temperature": 0.75
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"ece_after": 0.011864,
|
| 28 |
+
"ece_before": 0.258169,
|
| 29 |
"n": 500,
|
| 30 |
+
"temperature": 0.75
|
| 31 |
},
|
| 32 |
"score": {
|
| 33 |
+
"by_language": {
|
| 34 |
+
"en": {
|
| 35 |
+
"ece_after": 0.089698,
|
| 36 |
+
"ece_before": 0.415709,
|
| 37 |
+
"n": 500,
|
| 38 |
+
"temperature": 0.05
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"ece_after": 0.089698,
|
| 42 |
+
"ece_before": 0.415709,
|
| 43 |
"n": 500,
|
| 44 |
+
"temperature": 0.05
|
| 45 |
}
|
| 46 |
},
|
| 47 |
"warnings": []
|