Add jeba-en LoRA adapter, calibration temperature, and model card
Browse files- README.md +85 -0
- adapter_config.json +50 -0
- adapter_model.safetensors +3 -0
- finetune_config.json +19 -0
- temperature_calibration.json +24 -0
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: jeba
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- pt
|
| 7 |
+
- es
|
| 8 |
+
- fr
|
| 9 |
+
- de
|
| 10 |
+
- multilingual
|
| 11 |
+
tags:
|
| 12 |
+
- decision-engine
|
| 13 |
+
- system-one
|
| 14 |
+
- calibration
|
| 15 |
+
- multilingual
|
| 16 |
+
- local-first
|
| 17 |
+
pipeline_tag: text-classification
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# jeba-en (System One decision engine)
|
| 21 |
+
|
| 22 |
+
> **Status: pre-release.** This card describes the intended release. **Weights and measured
|
| 23 |
+
> metrics are pending** the RTX 3060 training run (`uv sync --extra train`); numbers below are
|
| 24 |
+
> placeholders to be replaced by `benchmarks/report.md`.
|
| 25 |
+
|
| 26 |
+
## Model details
|
| 27 |
+
|
| 28 |
+
- **Developed by:** The jeba Authors.
|
| 29 |
+
- **Model type:** non-autoregressive encoder with three task distributions (`noul`, `choice`,
|
| 30 |
+
`score`), answering typed questions about a state in one forward pass.
|
| 31 |
+
- **Trunk:** ModernBERT-large (English) and mmBERT-base (100+ languages); see ADR-0007.
|
| 32 |
+
- **Licence:** Apache-2.0.
|
| 33 |
+
- **Repository:** <https://github.com/munod/jeba>
|
| 34 |
+
|
| 35 |
+
## Uses
|
| 36 |
+
|
| 37 |
+
jeba answers atomic `choice` / `score` / `noul` questions about a state and returns typed values
|
| 38 |
+
with probabilities and `confidence`. It speaks the TypeSafe Jev `/v1/systemone` wire protocol as
|
| 39 |
+
a drop-in and runs **locally/offline** with no API key. Compose several atomic answers in code
|
| 40 |
+
rather than asking one broad question.
|
| 41 |
+
|
| 42 |
+
**Out of scope:** free-form text generation, multi-step reasoning, and any decision requiring
|
| 43 |
+
extended deliberation — decompose those into atomic questions and combine results in code.
|
| 44 |
+
|
| 45 |
+
## Bias, risks, and limitations
|
| 46 |
+
|
| 47 |
+
- Probabilities are only meaningful after **calibration**; the shipped temperature must be
|
| 48 |
+
applied (see `docs/training.md`).
|
| 49 |
+
- Synthetic training data can inherit generator biases; public probes are evaluation-only.
|
| 50 |
+
- Confidence is a property of the distribution, not a guarantee of correctness.
|
| 51 |
+
|
| 52 |
+
## Training
|
| 53 |
+
|
| 54 |
+
Deterministic synthetic JSONL (`training/generate_data.py`) supervised with an RLCD
|
| 55 |
+
proper-scoring objective (`training/finetune_rlcd.py`), then temperature-calibrated on a held-out
|
| 56 |
+
split (`training/fit_calibration.py`). Configs and seed live under `training/configs/`.
|
| 57 |
+
|
| 58 |
+
## Evaluation
|
| 59 |
+
|
| 60 |
+
Reported by `training/evaluate.py` and rendered by `benchmarks/report.py` (accuracy, ECE, p50/p95
|
| 61 |
+
latency per primitive and language).
|
| 62 |
+
|
| 63 |
+
**Full-scale run (single RTX 3060 12GB):** 6,000 train / 1,500 eval deterministic synthetic
|
| 64 |
+
records, LoRA (r=16), 3 epochs, batch 16, bf16 + gradient checkpointing.
|
| 65 |
+
|
| 66 |
+
| Checkpoint | Accuracy | ECE (calibrated) | p50 (ms) |
|
| 67 |
+
| --- | --- | --- | --- |
|
| 68 |
+
| English (ModernBERT-large + LoRA) | 0.536 | 0.090 | 17.6 |
|
| 69 |
+
| Multilingual (mmBERT-base + LoRA) | 0.533 | 0.016 | 12.2 |
|
| 70 |
+
|
| 71 |
+
Per primitive (English): `noul` 0.726 acc, `score` 0.574, `choice` 0.308. Labels are synthetic
|
| 72 |
+
and template-limited (choice ~0.25, score ~0.25, noul ~0.5 chance), so `choice` is near chance;
|
| 73 |
+
richer data should lift it. Full tables and environment are in
|
| 74 |
+
[`benchmarks/report.md`](https://github.com/munod/jeba/blob/main/benchmarks/report.md).
|
| 75 |
+
|
| 76 |
+
## Citation
|
| 77 |
+
|
| 78 |
+
```bibtex
|
| 79 |
+
@misc{jeba2026,
|
| 80 |
+
title = {jeba: a local-first System One decision engine},
|
| 81 |
+
author = {The jeba Authors},
|
| 82 |
+
year = {2026},
|
| 83 |
+
howpublished = {\url{https://github.com/munod/jeba}}
|
| 84 |
+
}
|
| 85 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": {
|
| 6 |
+
"base_model_class": "ModernBertModel",
|
| 7 |
+
"parent_library": "transformers.models.modernbert.modeling_modernbert"
|
| 8 |
+
},
|
| 9 |
+
"base_model_name_or_path": "answerdotai/ModernBERT-large",
|
| 10 |
+
"bias": "none",
|
| 11 |
+
"corda_config": null,
|
| 12 |
+
"ensure_weight_tying": false,
|
| 13 |
+
"eva_config": null,
|
| 14 |
+
"exclude_modules": null,
|
| 15 |
+
"fan_in_fan_out": false,
|
| 16 |
+
"inference_mode": true,
|
| 17 |
+
"init_lora_weights": true,
|
| 18 |
+
"kasa_config": null,
|
| 19 |
+
"layer_replication": null,
|
| 20 |
+
"layers_pattern": null,
|
| 21 |
+
"layers_to_transform": null,
|
| 22 |
+
"loftq_config": {},
|
| 23 |
+
"lora_alpha": 32,
|
| 24 |
+
"lora_bias": false,
|
| 25 |
+
"lora_dropout": 0.05,
|
| 26 |
+
"lora_ga_config": null,
|
| 27 |
+
"megatron_config": null,
|
| 28 |
+
"megatron_core": "megatron.core",
|
| 29 |
+
"modules_to_save": null,
|
| 30 |
+
"monteclora_config": null,
|
| 31 |
+
"peft_type": "LORA",
|
| 32 |
+
"peft_version": "0.21.0",
|
| 33 |
+
"qalora_group_size": 16,
|
| 34 |
+
"r": 16,
|
| 35 |
+
"rank_pattern": {},
|
| 36 |
+
"revision": null,
|
| 37 |
+
"target_modules": [
|
| 38 |
+
"Wqkv",
|
| 39 |
+
"Wi",
|
| 40 |
+
"Wo"
|
| 41 |
+
],
|
| 42 |
+
"target_parameters": null,
|
| 43 |
+
"task_type": null,
|
| 44 |
+
"trainable_token_indices": null,
|
| 45 |
+
"use_bdlora": null,
|
| 46 |
+
"use_dora": false,
|
| 47 |
+
"use_qalora": false,
|
| 48 |
+
"use_rslora": false,
|
| 49 |
+
"velora_config": null
|
| 50 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9eca12a7d798d7c4442ace62b4051f8ea09a61eaddbe0caed8b098206685dbc
|
| 3 |
+
size 28813352
|
finetune_config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"batch_size": 16,
|
| 3 |
+
"bf16": true,
|
| 4 |
+
"data_path": "data/train_en.jsonl",
|
| 5 |
+
"epochs": 3,
|
| 6 |
+
"grad_accum": 4,
|
| 7 |
+
"gradient_checkpointing": true,
|
| 8 |
+
"learning_rate": 0.0001,
|
| 9 |
+
"lora_alpha": 32,
|
| 10 |
+
"lora_dropout": 0.05,
|
| 11 |
+
"lora_rank": 16,
|
| 12 |
+
"max_len": 256,
|
| 13 |
+
"max_records": null,
|
| 14 |
+
"model_id": "answerdotai/ModernBERT-large",
|
| 15 |
+
"out_dir": "checkpoints/en",
|
| 16 |
+
"seed": 42,
|
| 17 |
+
"use_4bit": false,
|
| 18 |
+
"val_split": 0.1
|
| 19 |
+
}
|
temperature_calibration.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bins": 10,
|
| 3 |
+
"per_primitive": {
|
| 4 |
+
"choice": {
|
| 5 |
+
"ece_after": 0.009169,
|
| 6 |
+
"ece_before": 0.034399,
|
| 7 |
+
"n": 500,
|
| 8 |
+
"temperature": 1.5
|
| 9 |
+
},
|
| 10 |
+
"noul": {
|
| 11 |
+
"ece_after": 0.09859,
|
| 12 |
+
"ece_before": 0.09859,
|
| 13 |
+
"n": 500,
|
| 14 |
+
"temperature": 1.0
|
| 15 |
+
},
|
| 16 |
+
"score": {
|
| 17 |
+
"ece_after": 0.190815,
|
| 18 |
+
"ece_before": 0.190815,
|
| 19 |
+
"n": 500,
|
| 20 |
+
"temperature": 1.0
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
"warnings": []
|
| 24 |
+
}
|